IImageEncoder.cs 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma warning disable CS1591
  2. #nullable enable
  3. using System;
  4. using System.Collections.Generic;
  5. using MediaBrowser.Model.Drawing;
  6. namespace MediaBrowser.Controller.Drawing
  7. {
  8. public interface IImageEncoder
  9. {
  10. /// <summary>
  11. /// Gets the supported input formats.
  12. /// </summary>
  13. /// <value>The supported input formats.</value>
  14. IReadOnlyCollection<string> SupportedInputFormats { get; }
  15. /// <summary>
  16. /// Gets the supported output formats.
  17. /// </summary>
  18. /// <value>The supported output formats.</value>
  19. IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; }
  20. /// <summary>
  21. /// Gets the display name for the encoder.
  22. /// </summary>
  23. /// <value>The display name.</value>
  24. string Name { get; }
  25. /// <summary>
  26. /// Gets a value indicating whether [supports image collage creation].
  27. /// </summary>
  28. /// <value><c>true</c> if [supports image collage creation]; otherwise, <c>false</c>.</value>
  29. bool SupportsImageCollageCreation { get; }
  30. /// <summary>
  31. /// Gets a value indicating whether [supports image encoding].
  32. /// </summary>
  33. /// <value><c>true</c> if [supports image encoding]; otherwise, <c>false</c>.</value>
  34. bool SupportsImageEncoding { get; }
  35. /// <summary>
  36. /// Get the dimensions of an image from the filesystem.
  37. /// </summary>
  38. /// <param name="path">The filepath of the image.</param>
  39. /// <returns>The image dimensions.</returns>
  40. ImageDimensions GetImageSize(string path);
  41. /// <summary>
  42. /// Gets the blurhash of an image.
  43. /// </summary>
  44. /// <param name="xComp">Amount of X components of DCT to take.</param>
  45. /// <param name="yComp">Amount of Y components of DCT to take.</param>
  46. /// <param name="path">The filepath of the image.</param>
  47. /// <returns>The blurhash.</returns>
  48. string GetImageBlurHash(int xComp, int yComp, string path);
  49. /// <summary>
  50. /// Encode an image.
  51. /// </summary>
  52. string EncodeImage(string inputPath, DateTime dateModified, string outputPath, bool autoOrient, ImageOrientation? orientation, int quality, ImageProcessingOptions options, ImageFormat outputFormat);
  53. /// <summary>
  54. /// Create an image collage.
  55. /// </summary>
  56. /// <param name="options">The options to use when creating the collage.</param>
  57. /// <param name="libraryName">Optional. </param>
  58. void CreateImageCollage(ImageCollageOptions options, string? libraryName);
  59. }
  60. }