IImageProcessor.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using MediaBrowser.Controller.Entities;
  3. using MediaBrowser.Controller.Providers;
  4. using MediaBrowser.Model.Drawing;
  5. using MediaBrowser.Model.Entities;
  6. using System.Collections.Generic;
  7. using System.IO;
  8. using System.Threading.Tasks;
  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. string[] SupportedInputFormats { get; }
  21. /// <summary>
  22. /// Gets the image enhancers.
  23. /// </summary>
  24. /// <value>The image enhancers.</value>
  25. IEnumerable<IImageEnhancer> ImageEnhancers { get; }
  26. /// <summary>
  27. /// Gets the size of the image.
  28. /// </summary>
  29. /// <param name="info">The information.</param>
  30. /// <returns>ImageSize.</returns>
  31. ImageSize GetImageSize(ItemImageInfo info);
  32. /// <summary>
  33. /// Gets the size of the image.
  34. /// </summary>
  35. /// <param name="path">The path.</param>
  36. /// <returns>ImageSize.</returns>
  37. ImageSize GetImageSize(string path);
  38. /// <summary>
  39. /// Adds the parts.
  40. /// </summary>
  41. /// <param name="enhancers">The enhancers.</param>
  42. void AddParts(IEnumerable<IImageEnhancer> enhancers);
  43. /// <summary>
  44. /// Gets the supported enhancers.
  45. /// </summary>
  46. /// <param name="item">The item.</param>
  47. /// <param name="imageType">Type of the image.</param>
  48. /// <returns>IEnumerable{IImageEnhancer}.</returns>
  49. IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType);
  50. /// <summary>
  51. /// Gets the image cache tag.
  52. /// </summary>
  53. /// <param name="item">The item.</param>
  54. /// <param name="image">The image.</param>
  55. /// <returns>Guid.</returns>
  56. string GetImageCacheTag(IHasImages item, ItemImageInfo image);
  57. /// <summary>
  58. /// Gets the image cache tag.
  59. /// </summary>
  60. /// <param name="item">The item.</param>
  61. /// <param name="image">The image.</param>
  62. /// <param name="imageEnhancers">The image enhancers.</param>
  63. /// <returns>Guid.</returns>
  64. string GetImageCacheTag(IHasImages item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers);
  65. /// <summary>
  66. /// Processes the image.
  67. /// </summary>
  68. /// <param name="options">The options.</param>
  69. /// <param name="toStream">To stream.</param>
  70. /// <returns>Task.</returns>
  71. Task ProcessImage(ImageProcessingOptions options, Stream toStream);
  72. /// <summary>
  73. /// Processes the image.
  74. /// </summary>
  75. /// <param name="options">The options.</param>
  76. /// <returns>Task.</returns>
  77. Task<Tuple<string, string>> ProcessImage(ImageProcessingOptions options);
  78. /// <summary>
  79. /// Gets the enhanced image.
  80. /// </summary>
  81. /// <param name="item">The item.</param>
  82. /// <param name="imageType">Type of the image.</param>
  83. /// <param name="imageIndex">Index of the image.</param>
  84. /// <returns>Task{System.String}.</returns>
  85. Task<string> GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex);
  86. /// <summary>
  87. /// Gets the supported image output formats.
  88. /// </summary>
  89. /// <returns>ImageOutputFormat[].</returns>
  90. ImageFormat[] GetSupportedImageOutputFormats();
  91. /// <summary>
  92. /// Creates the image collage.
  93. /// </summary>
  94. /// <param name="options">The options.</param>
  95. Task CreateImageCollage(ImageCollageOptions options);
  96. /// <summary>
  97. /// Gets a value indicating whether [supports image collage creation].
  98. /// </summary>
  99. /// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
  100. bool SupportsImageCollageCreation { get; }
  101. }
  102. }