mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
Remove splashscreen generation from IImageEncoder and add IImageGenerator
This commit is contained in:
committed by
Cody Robibero
parent
0fd4ff4451
commit
3fb3ee074a
13
MediaBrowser.Controller/Drawing/GeneratedImages.cs
Normal file
13
MediaBrowser.Controller/Drawing/GeneratedImages.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
17
MediaBrowser.Controller/Drawing/IImageGenerator.cs
Normal file
17
MediaBrowser.Controller/Drawing/IImageGenerator.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user