jellyfin/MediaBrowser.Controller/Drawing/IImageProcessor.cs

104 lines
3.6 KiB
C#
Raw Normal View History

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