IImageEncoder.cs 2.6 KB

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