2
0

IImageProcessor.cs 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 blurhash of the image.
  33. /// </summary>
  34. /// <param name="path">Path to the image file.</param>
  35. /// <returns>BlurHash</returns>
  36. String GetImageHash(string path);
  37. /// <summary>
  38. /// Gets the dimensions of the image.
  39. /// </summary>
  40. /// <param name="item">The base item.</param>
  41. /// <param name="info">The information.</param>
  42. /// <returns>ImageDimensions</returns>
  43. ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
  44. /// <summary>
  45. /// Gets the image cache tag.
  46. /// </summary>
  47. /// <param name="item">The item.</param>
  48. /// <param name="image">The image.</param>
  49. /// <returns>Guid.</returns>
  50. string GetImageCacheTag(BaseItem item, ItemImageInfo image);
  51. string GetImageCacheTag(BaseItem item, ChapterInfo info);
  52. /// <summary>
  53. /// Processes the image.
  54. /// </summary>
  55. /// <param name="options">The options.</param>
  56. /// <param name="toStream">To stream.</param>
  57. /// <returns>Task.</returns>
  58. Task ProcessImage(ImageProcessingOptions options, Stream toStream);
  59. /// <summary>
  60. /// Processes the image.
  61. /// </summary>
  62. /// <param name="options">The options.</param>
  63. /// <returns>Task.</returns>
  64. Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options);
  65. /// <summary>
  66. /// Gets the supported image output formats.
  67. /// </summary>
  68. /// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns>
  69. IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
  70. /// <summary>
  71. /// Creates the image collage.
  72. /// </summary>
  73. /// <param name="options">The options.</param>
  74. void CreateImageCollage(ImageCollageOptions options);
  75. bool SupportsTransparency(string path);
  76. }
  77. }