From d58da2a7728580f79203cfa502269c31c463775d Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 18 Sep 2013 14:49:06 -0400 Subject: moved image manager to an interface --- MediaBrowser.Controller/Drawing/IImageProcessor.cs | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 MediaBrowser.Controller/Drawing/IImageProcessor.cs (limited to 'MediaBrowser.Controller/Drawing/IImageProcessor.cs') diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs new file mode 100644 index 000000000..55c279b0c --- /dev/null +++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs @@ -0,0 +1,94 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Drawing; +using MediaBrowser.Model.Entities; +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; + +namespace MediaBrowser.Controller.Drawing +{ + /// + /// Interface IImageProcessor + /// + public interface IImageProcessor + { + /// + /// Gets the image enhancers. + /// + /// The image enhancers. + IEnumerable ImageEnhancers { get; } + + /// + /// Gets the size of the image. + /// + /// The path. + /// ImageSize. + ImageSize GetImageSize(string path); + + /// + /// Gets the size of the image. + /// + /// The path. + /// The image date modified. + /// ImageSize. + ImageSize GetImageSize(string path, DateTime imageDateModified); + + /// + /// Adds the parts. + /// + /// The enhancers. + void AddParts(IEnumerable enhancers); + + /// + /// 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. + /// Type of the image. + /// The image path. + /// Guid. + Guid GetImageCacheTag(BaseItem item, ImageType imageType, string imagePath); + + /// + /// Gets the image cache tag. + /// + /// The item. + /// Type of the image. + /// The original image path. + /// The date modified. + /// The image enhancers. + /// Guid. + Guid GetImageCacheTag(BaseItem item, ImageType imageType, string originalImagePath, DateTime dateModified, + IEnumerable imageEnhancers); + + /// + /// Processes the image. + /// + /// The entity. + /// Type of the image. + /// Index of the image. + /// The original image path. + /// if set to true [crop whitespace]. + /// The date modified. + /// To stream. + /// The width. + /// The height. + /// Width of the max. + /// Height of the max. + /// The quality. + /// The enhancers. + /// Task. + Task ProcessImage(BaseItem entity, ImageType imageType, int imageIndex, string originalImagePath, bool cropWhitespace, + DateTime dateModified, Stream toStream, int? width, int? height, int? maxWidth, int? maxHeight, + int? quality, List enhancers); + } +} -- cgit v1.2.3