2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2019-01-13 19:25:32 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.Threading.Tasks;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Controller.Providers;
|
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Interface IImageProcessor
|
|
|
|
/// </summary>
|
|
|
|
public interface IImageProcessor
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the supported input formats.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The supported input formats.</value>
|
2019-02-06 20:31:41 +00:00
|
|
|
IReadOnlyCollection<string> SupportedInputFormats { get; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the image enhancers.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The image enhancers.</value>
|
|
|
|
IImageEnhancer[] ImageEnhancers { get; }
|
|
|
|
|
2019-02-05 18:53:50 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the dimensions of the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">Path to the image file.</param>
|
|
|
|
/// <returns>ImageDimensions</returns>
|
|
|
|
ImageDimensions GetImageDimensions(string path);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2019-02-05 18:53:50 +00:00
|
|
|
/// Gets the dimensions of the image.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2019-02-05 18:53:50 +00:00
|
|
|
/// <param name="item">The base item.</param>
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <param name="info">The information.</param>
|
2019-02-05 18:53:50 +00:00
|
|
|
/// <returns>ImageDimensions</returns>
|
|
|
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
|
2018-12-27 23:27:57 +00:00
|
|
|
|
2019-02-05 18:53:50 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the dimensions of the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="item">The base item.</param>
|
|
|
|
/// <param name="info">The information.</param>
|
|
|
|
/// <param name="updateItem">Whether or not the item info should be updated.</param>
|
|
|
|
/// <returns>ImageDimensions</returns>
|
|
|
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem);
|
2018-12-27 23:27:57 +00: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>
|
|
|
|
IImageEnhancer[] GetSupportedEnhancers(BaseItem item, ImageType imageType);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the image cache tag.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
/// <param name="image">The image.</param>
|
|
|
|
/// <returns>Guid.</returns>
|
|
|
|
string GetImageCacheTag(BaseItem item, ItemImageInfo image);
|
|
|
|
string GetImageCacheTag(BaseItem item, ChapterInfo info);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the image cache tag.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="item">The item.</param>
|
|
|
|
/// <param name="image">The image.</param>
|
|
|
|
/// <param name="imageEnhancers">The image enhancers.</param>
|
|
|
|
/// <returns>Guid.</returns>
|
|
|
|
string GetImageCacheTag(BaseItem item, ItemImageInfo image, IImageEnhancer[] imageEnhancers);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Processes the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <param name="toStream">To stream.</param>
|
|
|
|
/// <returns>Task.</returns>
|
|
|
|
Task ProcessImage(ImageProcessingOptions options, Stream toStream);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Processes the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
/// <returns>Task.</returns>
|
2019-01-12 13:46:17 +00:00
|
|
|
Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options);
|
2018-12-27 23:27:57 +00: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>
|
|
|
|
Task<string> GetEnhancedImage(BaseItem item, ImageType imageType, int imageIndex);
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the supported image output formats.
|
|
|
|
/// </summary>
|
2019-02-06 20:31:41 +00:00
|
|
|
/// <returns>IReadOnlyCollection{ImageOutput}.</returns>
|
|
|
|
IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates the image collage.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
void CreateImageCollage(ImageCollageOptions options);
|
|
|
|
|
|
|
|
/// <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; }
|
|
|
|
|
|
|
|
IImageEncoder ImageEncoder { get; set; }
|
|
|
|
|
|
|
|
bool SupportsTransparency(string path);
|
|
|
|
}
|
|
|
|
}
|