From a86b71899ec52c44ddc6c3018e8cc5e9d7ff4d62 Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Thu, 27 Dec 2018 18:27:57 -0500 Subject: Add GPL modules --- .../Providers/IImageEnhancer.cs | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 MediaBrowser.Controller/Providers/IImageEnhancer.cs (limited to 'MediaBrowser.Controller/Providers/IImageEnhancer.cs') diff --git a/MediaBrowser.Controller/Providers/IImageEnhancer.cs b/MediaBrowser.Controller/Providers/IImageEnhancer.cs new file mode 100644 index 000000000..c8ea25335 --- /dev/null +++ b/MediaBrowser.Controller/Providers/IImageEnhancer.cs @@ -0,0 +1,61 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Model.Drawing; +using MediaBrowser.Model.Entities; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Providers +{ + public interface IImageEnhancer + { + /// + /// Return true only if the given image for the given item will be enhanced by this enhancer. + /// + /// The item. + /// Type of the image. + /// true if this enhancer will enhance the supplied image for the supplied item, false otherwise + bool Supports(BaseItem item, ImageType imageType); + + /// + /// Gets the priority or order in which this enhancer should be run. + /// + /// The priority. + MetadataProviderPriority Priority { get; } + + /// + /// Return a key incorporating all configuration information related to this item + /// + /// The item. + /// Type of the image. + /// Cache key relating to the current state of this item and configuration + string GetConfigurationCacheKey(BaseItem item, ImageType imageType); + + /// + /// Gets the size of the enhanced image. + /// + /// The item. + /// Type of the image. + /// Index of the image. + /// Size of the original image. + /// ImageSize. + ImageSize GetEnhancedImageSize(BaseItem item, ImageType imageType, int imageIndex, ImageSize originalImageSize); + + EnhancedImageInfo GetEnhancedImageInfo(BaseItem item, string inputFile, ImageType imageType, int imageIndex); + + /// + /// Enhances the image async. + /// + /// The item. + /// The input file. + /// The output file. + /// Type of the image. + /// Index of the image. + /// Task{Image}. + /// + Task EnhanceImageAsync(BaseItem item, string inputFile, string outputFile, ImageType imageType, int imageIndex); + } + + public class EnhancedImageInfo + { + public bool RequiresTransparency { get; set; } + } +} \ No newline at end of file -- cgit v1.2.3