IImageProcessor.cs 3.3 KB

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