2020-08-22 19:56:24 +00:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:01:16 +00:00
|
|
|
using System;
|
2019-02-06 20:31:41 +00:00
|
|
|
using System.Collections.Generic;
|
2023-05-30 21:23:02 +00:00
|
|
|
using MediaBrowser.Model.Configuration;
|
2018-12-27 23:27:57 +00:00
|
|
|
using MediaBrowser.Model.Drawing;
|
|
|
|
|
|
|
|
namespace MediaBrowser.Controller.Drawing
|
|
|
|
{
|
|
|
|
public interface IImageEncoder
|
|
|
|
{
|
|
|
|
/// <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; }
|
2019-12-13 19:57:23 +00:00
|
|
|
|
2018-12-27 23:27:57 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the supported output formats.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The supported output formats.</value>
|
2019-02-06 20:31:41 +00:00
|
|
|
IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; }
|
2018-12-27 23:27:57 +00:00
|
|
|
|
|
|
|
/// <summary>
|
2019-12-13 19:57:23 +00:00
|
|
|
/// Gets the display name for the encoder.
|
2018-12-27 23:27:57 +00:00
|
|
|
/// </summary>
|
2019-12-13 19:57:23 +00:00
|
|
|
/// <value>The display name.</value>
|
2018-12-27 23:27:57 +00:00
|
|
|
string Name { get; }
|
|
|
|
|
|
|
|
/// <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 a value indicating whether [supports image encoding].
|
|
|
|
/// </summary>
|
|
|
|
/// <value><c>true</c> if [supports image encoding]; otherwise, <c>false</c>.</value>
|
|
|
|
bool SupportsImageEncoding { get; }
|
|
|
|
|
2019-12-13 19:57:23 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Get the dimensions of an image from the filesystem.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="path">The filepath of the image.</param>
|
|
|
|
/// <returns>The image dimensions.</returns>
|
2019-01-26 12:16:47 +00:00
|
|
|
ImageDimensions GetImageSize(string path);
|
2019-08-11 14:52:37 +00:00
|
|
|
|
2020-03-23 19:05:49 +00:00
|
|
|
/// <summary>
|
2020-05-25 21:50:29 +00:00
|
|
|
/// Gets the blurhash of an image.
|
2020-03-23 19:05:49 +00:00
|
|
|
/// </summary>
|
2020-06-01 15:12:49 +00:00
|
|
|
/// <param name="xComp">Amount of X components of DCT to take.</param>
|
|
|
|
/// <param name="yComp">Amount of Y components of DCT to take.</param>
|
2020-03-23 19:05:49 +00:00
|
|
|
/// <param name="path">The filepath of the image.</param>
|
|
|
|
/// <returns>The blurhash.</returns>
|
2020-06-01 15:12:49 +00:00
|
|
|
string GetImageBlurHash(int xComp, int yComp, string path);
|
2020-03-23 19:05:49 +00:00
|
|
|
|
2019-08-11 14:52:37 +00:00
|
|
|
/// <summary>
|
2019-12-13 19:57:23 +00:00
|
|
|
/// Encode an image.
|
2019-08-11 14:52:37 +00:00
|
|
|
/// </summary>
|
2021-07-25 03:33:58 +00:00
|
|
|
/// <param name="inputPath">Input path of image.</param>
|
|
|
|
/// <param name="dateModified">Date modified.</param>
|
|
|
|
/// <param name="outputPath">Output path of image.</param>
|
|
|
|
/// <param name="autoOrient">Auto-orient image.</param>
|
|
|
|
/// <param name="orientation">Desired orientation of image.</param>
|
|
|
|
/// <param name="quality">Quality of encoded image.</param>
|
|
|
|
/// <param name="options">Image processing options.</param>
|
|
|
|
/// <param name="outputFormat">Image format of output.</param>
|
|
|
|
/// <returns>Path of encoded image.</returns>
|
2019-08-11 14:52:37 +00:00
|
|
|
string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat);
|
|
|
|
|
|
|
|
/// <summary>
|
2019-12-13 19:57:23 +00:00
|
|
|
/// Create an image collage.
|
2019-08-11 14:52:37 +00:00
|
|
|
/// </summary>
|
2019-12-13 19:57:23 +00:00
|
|
|
/// <param name="options">The options to use when creating the collage.</param>
|
2020-08-21 17:53:55 +00:00
|
|
|
/// <param name="libraryName">Optional. </param>
|
|
|
|
void CreateImageCollage(ImageCollageOptions options, string? libraryName);
|
2022-01-10 15:25:46 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new splashscreen image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="posters">The list of poster paths.</param>
|
|
|
|
/// <param name="backdrops">The list of backdrop paths.</param>
|
|
|
|
void CreateSplashscreen(IReadOnlyList<string> posters, IReadOnlyList<string> backdrops);
|
2023-05-30 21:23:02 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Creates a new jpeg trickplay grid image.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="options">The options to use when creating the image. Width and Height are a quantity of tiles in this case, not pixels.</param>
|
|
|
|
/// <param name="quality">The image encode quality.</param>
|
|
|
|
/// <param name="imgWidth">The width of a single trickplay image.</param>
|
|
|
|
/// <param name="imgHeight">Optional height of a single trickplay image, if it is known.</param>
|
|
|
|
/// <returns>Height of single decoded trickplay image.</returns>
|
|
|
|
int CreateTrickplayGrid(ImageCollageOptions options, int quality, int imgWidth, int? imgHeight);
|
2018-12-27 23:27:57 +00:00
|
|
|
}
|
|
|
|
}
|