using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Drawing; using MediaBrowser.Model.Entities; namespace MediaBrowser.Controller.Drawing { /// /// Interface IImageProcessor /// public interface IImageProcessor { /// /// Gets the supported input formats. /// /// The supported input formats. IReadOnlyCollection SupportedInputFormats { get; } /// /// Gets the image enhancers. /// /// The image enhancers. IReadOnlyCollection ImageEnhancers { get; set; } /// /// Gets a value indicating whether [supports image collage creation]. /// /// true if [supports image collage creation]; otherwise, false. bool SupportsImageCollageCreation { get; } IImageEncoder ImageEncoder { get; set; } /// /// Gets the dimensions of the image. /// /// Path to the image file. /// ImageDimensions ImageDimensions GetImageDimensions(string path); /// /// Gets the dimensions of the image. /// /// The base item. /// The information. /// ImageDimensions ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info); /// /// Gets the dimensions of the image. /// /// The base item. /// The information. /// Whether or not the item info should be updated. /// ImageDimensions ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem); /// /// Gets the supported enhancers. /// /// The item. /// Type of the image. /// IEnumerable{IImageEnhancer}. IEnumerable GetSupportedEnhancers(BaseItem item, ImageType imageType); /// /// Gets the image cache tag. /// /// The item. /// The image. /// Guid. string GetImageCacheTag(BaseItem item, ItemImageInfo image); string GetImageCacheTag(BaseItem item, ChapterInfo info); /// /// Gets the image cache tag. /// /// The item. /// The image. /// The image enhancers. /// Guid. string GetImageCacheTag(BaseItem item, ItemImageInfo image, IReadOnlyCollection imageEnhancers); /// /// Processes the image. /// /// The options. /// To stream. /// Task. Task ProcessImage(ImageProcessingOptions options, Stream toStream); /// /// Processes the image. /// /// The options. /// Task. Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options); /// /// Gets the enhanced image. /// /// The item. /// Type of the image. /// Index of the image. /// Task{System.String}. Task GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex); /// /// Gets the supported image output formats. /// /// . IReadOnlyCollection GetSupportedImageOutputFormats(); /// /// Creates the image collage. /// /// The options. void CreateImageCollage(ImageCollageOptions options); bool SupportsTransparency(string path); } }