2015-11-09 11:18:37 -07:00
|
|
|
|
using System;
|
|
|
|
|
using MediaBrowser.Controller.Entities;
|
2013-09-18 11:49:06 -07:00
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interface IImageProcessor
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface IImageProcessor
|
|
|
|
|
{
|
2015-04-08 07:38:02 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the supported input formats.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The supported input formats.</value>
|
|
|
|
|
string[] SupportedInputFormats { get; }
|
2015-11-12 12:30:07 -07:00
|
|
|
|
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the image enhancers.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value>The image enhancers.</value>
|
|
|
|
|
IEnumerable<IImageEnhancer> ImageEnhancers { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the size of the image.
|
|
|
|
|
/// </summary>
|
2015-02-28 06:42:47 -07:00
|
|
|
|
/// <param name="info">The information.</param>
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <returns>ImageSize.</returns>
|
2015-02-28 06:42:47 -07:00
|
|
|
|
ImageSize GetImageSize(ItemImageInfo info);
|
2013-09-18 11:49:06 -07:00
|
|
|
|
|
2015-10-16 12:25:19 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the size of the image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="path">The path.</param>
|
|
|
|
|
/// <returns>ImageSize.</returns>
|
|
|
|
|
ImageSize GetImageSize(string path);
|
2015-11-12 12:30:07 -07:00
|
|
|
|
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <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>
|
2013-12-19 14:51:32 -07:00
|
|
|
|
IEnumerable<IImageEnhancer> GetSupportedEnhancers(IHasImages item, ImageType imageType);
|
2013-09-18 11:49:06 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the image cache tag.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2014-02-07 13:30:41 -07:00
|
|
|
|
/// <param name="image">The image.</param>
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <returns>Guid.</returns>
|
2014-05-08 13:09:53 -07:00
|
|
|
|
string GetImageCacheTag(IHasImages item, ItemImageInfo image);
|
2013-09-18 11:49:06 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the image cache tag.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
2014-06-18 08:12:20 -07:00
|
|
|
|
/// <param name="image">The image.</param>
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <param name="imageEnhancers">The image enhancers.</param>
|
|
|
|
|
/// <returns>Guid.</returns>
|
2014-06-18 08:12:20 -07:00
|
|
|
|
string GetImageCacheTag(IHasImages item, ItemImageInfo image, List<IImageEnhancer> imageEnhancers);
|
2013-09-18 11:49:06 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processes the image.
|
|
|
|
|
/// </summary>
|
2013-09-19 08:12:28 -07:00
|
|
|
|
/// <param name="options">The options.</param>
|
2013-09-18 11:49:06 -07:00
|
|
|
|
/// <param name="toStream">To stream.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2013-09-19 08:12:28 -07:00
|
|
|
|
Task ProcessImage(ImageProcessingOptions options, Stream toStream);
|
2015-11-12 12:30:07 -07:00
|
|
|
|
|
2014-07-17 15:21:35 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Processes the image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
|
/// <returns>Task.</returns>
|
2016-07-17 09:59:40 -07:00
|
|
|
|
Task<Tuple<string, string, DateTime>> ProcessImage(ImageProcessingOptions options);
|
2013-09-20 08:42:27 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the enhanced image.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
|
/// <param name="imageType">Type of the image.</param>
|
|
|
|
|
/// <param name="imageIndex">Index of the image.</param>
|
|
|
|
|
/// <returns>Task{System.String}.</returns>
|
2013-12-19 14:51:32 -07:00
|
|
|
|
Task<string> GetEnhancedImage(IHasImages item, ImageType imageType, int imageIndex);
|
2014-11-08 20:18:14 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the supported image output formats.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>ImageOutputFormat[].</returns>
|
2014-11-29 12:51:30 -07:00
|
|
|
|
ImageFormat[] GetSupportedImageOutputFormats();
|
2015-04-08 07:38:02 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates the image collage.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="options">The options.</param>
|
2017-05-19 10:09:37 -07:00
|
|
|
|
void CreateImageCollage(ImageCollageOptions options);
|
2015-10-25 22:29:32 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets a value indicating whether [supports image collage creation].
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
|
|
|
|
|
bool SupportsImageCollageCreation { get; }
|
2017-05-12 11:09:42 -07:00
|
|
|
|
|
|
|
|
|
IImageEncoder ImageEncoder { get; set; }
|
2017-05-17 11:18:18 -07:00
|
|
|
|
|
|
|
|
|
void SaveImageSize(string path, DateTime imageDateModified, ImageSize size);
|
2013-09-18 11:49:06 -07:00
|
|
|
|
}
|
|
|
|
|
}
|