2020-08-22 12:56:24 -07:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 13:01:16 -07:00
|
|
|
using System;
|
2019-01-13 12:25:32 -07:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.IO;
|
|
|
|
using System.Threading.Tasks;
|
2020-05-20 10:07:53 -07:00
|
|
|
using Jellyfin.Data.Entities;
|
2018-12-27 16:27:57 -07:00
|
|
|
using MediaBrowser.Controller.Entities;
|
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
/// <summary>
|
2020-06-15 15:37:52 -07:00
|
|
|
/// Interface IImageProcessor.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
|
|
|
public interface IImageProcessor
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the supported input formats.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The supported input formats.</value>
|
2019-02-06 13:31:41 -07:00
|
|
|
IReadOnlyCollection<string> SupportedInputFormats { get; }
|
2018-12-27 16:27:57 -07:00
|
|
|
|
2019-08-11 07:52:37 -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; }
|
|
|
|
|
2019-02-05 11:53:50 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the dimensions of the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">Path to the image file.</param>
|
2020-06-19 03:21:49 -07:00
|
|
|
/// <returns>ImageDimensions.</returns>
|
2019-02-05 11:53:50 -07:00
|
|
|
ImageDimensions GetImageDimensions(string path);
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
/// <summary>
|
2019-02-05 11:53:50 -07:00
|
|
|
/// Gets the dimensions of the image.
|
2018-12-27 16:27:57 -07:00
|
|
|
/// </summary>
|
2019-02-05 11:53:50 -07:00
|
|
|
/// <param name="item">The base item.</param>
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <param name="info">The information.</param>
|
2020-06-19 03:21:49 -07:00
|
|
|
/// <returns>ImageDimensions.</returns>
|
2019-02-05 11:53:50 -07:00
|
|
|
ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
|
2018-12-27 16:27:57 -07:00
|
|
|
|
2020-05-19 05:42:50 -07:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the blurhash of the image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">Path to the image file.</param>
|
2020-06-19 03:21:49 -07:00
|
|
|
/// <returns>BlurHash.</returns>
|
2020-05-20 15:43:19 -07:00
|
|
|
string GetImageBlurHash(string path);
|
2020-05-19 05:42:50 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <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);
|
2020-05-12 19:10:35 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
string GetImageCacheTag(BaseItem item, ChapterInfo info);
|
|
|
|
|
2020-05-20 10:07:53 -07:00
|
|
|
string GetImageCacheTag(User user);
|
2020-05-12 19:10:35 -07:00
|
|
|
|
2018-12-27 16:27:57 -07:00
|
|
|
/// <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 06:46:17 -07:00
|
|
|
Task<(string path, string mimeType, DateTime dateModified)> ProcessImage(ImageProcessingOptions options);
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the supported image output formats.
|
|
|
|
/// </summary>
|
2019-08-11 07:52:37 -07:00
|
|
|
/// <returns><see cref="IReadOnlyCollection{ImageOutput}" />.</returns>
|
2019-02-06 13:31:41 -07:00
|
|
|
IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
|
2018-12-27 16:27:57 -07:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates the image collage.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options.</param>
|
|
|
|
void CreateImageCollage(ImageCollageOptions options);
|
|
|
|
|
|
|
|
bool SupportsTransparency(string path);
|
|
|
|
}
|
|
|
|
}
|