Remove splashscreen generation from IImageEncoder and add IImageGenerator

This commit is contained in:
David Ullmer
2021-08-17 18:11:38 +02:00
committed by Cody Robibero
parent 0fd4ff4451
commit 3fb3ee074a
10 changed files with 128 additions and 152 deletions

View File

@@ -0,0 +1,13 @@
namespace MediaBrowser.Controller.Drawing
{
/// <summary>
/// Which generated images an <see cref="IImageGenerator"/> supports.
/// </summary>
public enum GeneratedImages
{
/// <summary>
/// The splashscreen.
/// </summary>
Splashscreen
}
}

View File

@@ -74,11 +74,5 @@ namespace MediaBrowser.Controller.Drawing
/// <param name="options">The options to use when creating the collage.</param>
/// <param name="libraryName">Optional. </param>
void CreateImageCollage(ImageCollageOptions options, string? libraryName);
/// <summary>
/// Creates a splashscreen image.
/// </summary>
/// <param name="options">The options to use when creating the splashscreen.</param>
void CreateSplashscreen(SplashscreenOptions options);
}
}

View File

@@ -0,0 +1,17 @@
namespace MediaBrowser.Controller.Drawing
{
public interface IImageGenerator
{
/// <summary>
/// Gets the supported generated images of the image generator.
/// </summary>
/// <returns>The supported images.</returns>
GeneratedImages[] GetSupportedImages();
/// <summary>
/// Generates a splashscreen.
/// </summary>
/// <param name="generationOptions">The options used to generate the splashscreen.</param>
void GenerateSplashscreen(SplashscreenOptions generationOptions);
}
}

View File

@@ -1,5 +1,3 @@
using System.Collections.Generic;
namespace MediaBrowser.Controller.Drawing
{
/// <summary>
@@ -10,30 +8,14 @@ namespace MediaBrowser.Controller.Drawing
/// <summary>
/// Initializes a new instance of the <see cref="SplashscreenOptions"/> class.
/// </summary>
/// <param name="portraitInputPaths">The portrait input paths.</param>
/// <param name="landscapeInputPaths">The landscape input paths.</param>
/// <param name="outputPath">The output path.</param>
/// <param name="width">Optional. The image width.</param>
/// <param name="height">Optional. The image height.</param>
/// <param name="applyFilter">Optional. Apply a darkening filter.</param>
public SplashscreenOptions(IReadOnlyList<string> portraitInputPaths, IReadOnlyList<string> landscapeInputPaths, string outputPath, bool applyFilter = false)
public SplashscreenOptions(string outputPath, bool applyFilter = false)
{
PortraitInputPaths = portraitInputPaths;
LandscapeInputPaths = landscapeInputPaths;
OutputPath = outputPath;
ApplyFilter = applyFilter;
}
/// <summary>
/// Gets or sets the poster input paths.
/// </summary>
public IReadOnlyList<string> PortraitInputPaths { get; set; }
/// <summary>
/// Gets or sets the landscape input paths.
/// </summary>
public IReadOnlyList<string> LandscapeInputPaths { get; set; }
/// <summary>
/// Gets or sets the output path.
/// </summary>