IImageProcessor.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. using Jellyfin.Database.Implementations.Entities;
  6. using MediaBrowser.Controller.Entities;
  7. using MediaBrowser.Model.Drawing;
  8. using MediaBrowser.Model.Dto;
  9. using MediaBrowser.Model.Entities;
  10. namespace MediaBrowser.Controller.Drawing
  11. {
  12. /// <summary>
  13. /// Interface IImageProcessor.
  14. /// </summary>
  15. public interface IImageProcessor
  16. {
  17. /// <summary>
  18. /// Gets the supported input formats.
  19. /// </summary>
  20. /// <value>The supported input formats.</value>
  21. IReadOnlyCollection<string> SupportedInputFormats { get; }
  22. /// <summary>
  23. /// Gets a value indicating whether [supports image collage creation].
  24. /// </summary>
  25. /// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
  26. bool SupportsImageCollageCreation { get; }
  27. /// <summary>
  28. /// Gets the dimensions of the image.
  29. /// </summary>
  30. /// <param name="path">Path to the image file.</param>
  31. /// <returns>ImageDimensions.</returns>
  32. ImageDimensions GetImageDimensions(string path);
  33. /// <summary>
  34. /// Gets the dimensions of the image.
  35. /// </summary>
  36. /// <param name="item">The base item.</param>
  37. /// <param name="info">The information.</param>
  38. /// <returns>ImageDimensions.</returns>
  39. ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
  40. /// <summary>
  41. /// Gets the blurhash of the image.
  42. /// </summary>
  43. /// <param name="path">Path to the image file.</param>
  44. /// <returns>BlurHash.</returns>
  45. string GetImageBlurHash(string path);
  46. /// <summary>
  47. /// Gets the blurhash of the image.
  48. /// </summary>
  49. /// <param name="path">Path to the image file.</param>
  50. /// <param name="imageDimensions">The image dimensions.</param>
  51. /// <returns>BlurHash.</returns>
  52. string GetImageBlurHash(string path, ImageDimensions imageDimensions);
  53. /// <summary>
  54. /// Gets the image cache tag.
  55. /// </summary>
  56. /// <param name="baseItemPath">The items basePath.</param>
  57. /// <param name="imageDateModified">The image last modification date.</param>
  58. /// <returns>Guid.</returns>
  59. string? GetImageCacheTag(string baseItemPath, DateTime imageDateModified);
  60. /// <summary>
  61. /// Gets the image cache tag.
  62. /// </summary>
  63. /// <param name="item">The item.</param>
  64. /// <param name="image">The image.</param>
  65. /// <returns>Guid.</returns>
  66. string? GetImageCacheTag(BaseItemDto item, ChapterInfo image);
  67. /// <summary>
  68. /// Gets the image cache tag.
  69. /// </summary>
  70. /// <param name="item">The item.</param>
  71. /// <param name="image">The image.</param>
  72. /// <returns>Guid.</returns>
  73. string GetImageCacheTag(BaseItem item, ItemImageInfo image);
  74. /// <summary>
  75. /// Gets the image cache tag.
  76. /// </summary>
  77. /// <param name="item">The item.</param>
  78. /// <param name="image">The image.</param>
  79. /// <returns>Guid.</returns>
  80. string GetImageCacheTag(BaseItemDto item, ItemImageInfo image);
  81. string? GetImageCacheTag(BaseItem item, ChapterInfo chapter);
  82. string? GetImageCacheTag(User user);
  83. /// <summary>
  84. /// Processes the image.
  85. /// </summary>
  86. /// <param name="options">The options.</param>
  87. /// <returns>Task.</returns>
  88. Task<(string Path, string? MimeType, DateTime DateModified)> ProcessImage(ImageProcessingOptions options);
  89. /// <summary>
  90. /// Gets the supported image output formats.
  91. /// </summary>
  92. /// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns>
  93. IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
  94. /// <summary>
  95. /// Creates the image collage.
  96. /// </summary>
  97. /// <param name="options">The options.</param>
  98. /// <param name="libraryName">The library name to draw onto the collage.</param>
  99. void CreateImageCollage(ImageCollageOptions options, string? libraryName);
  100. }
  101. }