aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Drawing/IImageProcessor.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-18 14:49:06 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-18 14:49:06 -0400
commitd58da2a7728580f79203cfa502269c31c463775d (patch)
tree839f627fc09c0198cad153c5dc6c246fc6d1f1b8 /MediaBrowser.Controller/Drawing/IImageProcessor.cs
parentbcd3e8e0faa622fc23025903d3b1d926ccfb2f49 (diff)
moved image manager to an interface
Diffstat (limited to 'MediaBrowser.Controller/Drawing/IImageProcessor.cs')
-rw-r--r--MediaBrowser.Controller/Drawing/IImageProcessor.cs94
1 files changed, 94 insertions, 0 deletions
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
+{
+ /// <summary>
+ /// Interface IImageProcessor
+ /// </summary>
+ public interface IImageProcessor
+ {
+ /// <summary>
+ /// Gets the image enhancers.
+ /// </summary>
+ /// <value>The image enhancers.</value>
+ IEnumerable<IImageEnhancer> ImageEnhancers { get; }
+
+ /// <summary>
+ /// Gets the size of the image.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns>ImageSize.</returns>
+ ImageSize GetImageSize(string path);
+
+ /// <summary>
+ /// Gets the size of the image.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <param name="imageDateModified">The image date modified.</param>
+ /// <returns>ImageSize.</returns>
+ ImageSize GetImageSize(string path, DateTime imageDateModified);
+
+ /// <summary>
+ /// Adds the parts.
+ /// </summary>
+ /// <param name="enhancers">The enhancers.</param>
+ void AddParts(IEnumerable<IImageEnhancer> enhancers);
+
+ /// <summary>
+ /// Gets the supported enhancers.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="imageType">Type of the image.</param>
+ /// <returns>IEnumerable{IImageEnhancer}.</returns>
+ IEnumerable<IImageEnhancer> GetSupportedEnhancers(BaseItem item, ImageType imageType);
+
+ /// <summary>
+ /// Gets the image cache tag.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="imageType">Type of the image.</param>
+ /// <param name="imagePath">The image path.</param>
+ /// <returns>Guid.</returns>
+ Guid GetImageCacheTag(BaseItem item, ImageType imageType, string imagePath);
+
+ /// <summary>
+ /// Gets the image cache tag.
+ /// </summary>
+ /// <param name="item">The item.</param>
+ /// <param name="imageType">Type of the image.</param>
+ /// <param name="originalImagePath">The original image path.</param>
+ /// <param name="dateModified">The date modified.</param>
+ /// <param name="imageEnhancers">The image enhancers.</param>
+ /// <returns>Guid.</returns>
+ Guid GetImageCacheTag(BaseItem item, ImageType imageType, string originalImagePath, DateTime dateModified,
+ IEnumerable<IImageEnhancer> imageEnhancers);
+
+ /// <summary>
+ /// Processes the image.
+ /// </summary>
+ /// <param name="entity">The entity.</param>
+ /// <param name="imageType">Type of the image.</param>
+ /// <param name="imageIndex">Index of the image.</param>
+ /// <param name="originalImagePath">The original image path.</param>
+ /// <param name="cropWhitespace">if set to <c>true</c> [crop whitespace].</param>
+ /// <param name="dateModified">The date modified.</param>
+ /// <param name="toStream">To stream.</param>
+ /// <param name="width">The width.</param>
+ /// <param name="height">The height.</param>
+ /// <param name="maxWidth">Width of the max.</param>
+ /// <param name="maxHeight">Height of the max.</param>
+ /// <param name="quality">The quality.</param>
+ /// <param name="enhancers">The enhancers.</param>
+ /// <returns>Task.</returns>
+ 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<IImageEnhancer> enhancers);
+ }
+}