IImageProcessor.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Threading.Tasks;
  5. using MediaBrowser.Controller.Entities;
  6. using MediaBrowser.Model.Drawing;
  7. using MediaBrowser.Model.Entities;
  8. namespace MediaBrowser.Controller.Drawing
  9. {
  10. /// <summary>
  11. /// Interface IImageProcessor
  12. /// </summary>
  13. public interface IImageProcessor
  14. {
  15. /// <summary>
  16. /// Gets the supported input formats.
  17. /// </summary>
  18. /// <value>The supported input formats.</value>
  19. IReadOnlyCollection<string> SupportedInputFormats { get; }
  20. /// <summary>
  21. /// Gets a value indicating whether [supports image collage creation].
  22. /// </summary>
  23. /// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
  24. bool SupportsImageCollageCreation { get; }
  25. /// <summary>
  26. /// Gets the dimensions of the image.
  27. /// </summary>
  28. /// <param name="path">Path to the image file.</param>
  29. /// <returns>ImageDimensions</returns>
  30. ImageDimensions GetImageDimensions(string path);
  31. /// <summary>
  32. /// Gets the dimensions of the image.
  33. /// </summary>
  34. /// <param name="item">The base item.</param>
  35. /// <param name="info">The information.</param>
  36. /// <returns>ImageDimensions</returns>
  37. ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
  38. /// <summary>
  39. /// Gets the image cache tag.
  40. /// </summary>
  41. /// <param name="item">The item.</param>
  42. /// <param name="image">The image.</param>
  43. /// <returns>Guid.</returns>
  44. string GetImageCacheTag(BaseItem item, ItemImageInfo image);
  45. string GetImageCacheTag(BaseItem item, ChapterInfo info);
  46. string GetImageCacheTag(Jellyfin.Data.Entities.User user);
  47. /// <summary>
  48. /// Processes the image.
  49. /// </summary>
  50. /// <param name="options">The options.</param>
  51. /// <param name="toStream">To stream.</param>
  52. /// <returns>Task.</returns>
  53. Task ProcessImage(ImageProcessingOptions options, Stream toStream);
  54. /// <summary>
  55. /// Processes the image.
  56. /// </summary>
  57. /// <param name="options">The options.</param>
  58. /// <returns>Task.</returns>
  59. Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options);
  60. /// <summary>
  61. /// Gets the supported image output formats.
  62. /// </summary>
  63. /// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns>
  64. IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
  65. /// <summary>
  66. /// Creates the image collage.
  67. /// </summary>
  68. /// <param name="options">The options.</param>
  69. void CreateImageCollage(ImageCollageOptions options);
  70. bool SupportsTransparency(string path);
  71. }
  72. }