diff --git a/src/ImageSharp/Formats/IEncoderOptions.cs b/src/ImageSharp/Formats/IEncoderOptions.cs deleted file mode 100644 index 1f8337f0a..000000000 --- a/src/ImageSharp/Formats/IEncoderOptions.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Six Labors. -// Licensed under the Six Labors Split License. - -using SixLabors.ImageSharp.Processing.Processors.Quantization; - -namespace SixLabors.ImageSharp.Formats; - -/// -/// Defines the contract for basic encoder options. -/// -public interface IEncoderOptions -{ - /// - /// Gets a value indicating whether to ignore decoded metadata when encoding. - /// - bool SkipMetadata { get; init; } -} - -/// -/// Defines the contract for encoder options that allow color palette generation via quantization. -/// -public interface IQuantizingEncoderOptions : IEncoderOptions -{ - /// - /// Gets the quantizer used to generate the color palette. - /// - IQuantizer Quantizer { get; init; } - - /// - /// Gets the used for quantization when building color palettes. - /// - IPixelSamplingStrategy PixelSamplingStrategy { get; init; } -} diff --git a/src/ImageSharp/Formats/ImageEncoder.cs b/src/ImageSharp/Formats/ImageEncoder.cs index 074e80395..a0c087e64 100644 --- a/src/ImageSharp/Formats/ImageEncoder.cs +++ b/src/ImageSharp/Formats/ImageEncoder.cs @@ -10,9 +10,11 @@ namespace SixLabors.ImageSharp.Formats; /// /// The base class for all image encoders. /// -public abstract class ImageEncoder : IImageEncoder, IEncoderOptions +public abstract class ImageEncoder : IImageEncoder { - /// + /// + /// Gets a value indicating whether to ignore decoded metadata when encoding. + /// public bool SkipMetadata { get; init; } /// @@ -27,11 +29,15 @@ public abstract class ImageEncoder : IImageEncoder, IEncoderOptions /// /// The base class for all image encoders that allow color palette generation via quantization. /// -public abstract class QuantizingImageEncoder : ImageEncoder, IQuantizingEncoderOptions +public abstract class QuantizingImageEncoder : ImageEncoder { - /// + /// + /// Gets the quantizer used to generate the color palette. + /// public IQuantizer Quantizer { get; init; } = KnownQuantizers.Octree; - /// + /// + /// Gets the used for quantization when building color palettes. + /// public IPixelSamplingStrategy PixelSamplingStrategy { get; init; } = new DefaultPixelSamplingStrategy(); } diff --git a/src/ImageSharp/Formats/Png/PngEncoderCore.cs b/src/ImageSharp/Formats/Png/PngEncoderCore.cs index 9440e51b0..610ea6924 100644 --- a/src/ImageSharp/Formats/Png/PngEncoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngEncoderCore.cs @@ -1280,7 +1280,7 @@ internal sealed class PngEncoderCore : IImageEncoderInternals, IDisposable /// The bits per component. /// The image. private static IndexedImageFrame CreateQuantizedFrame( - IQuantizingEncoderOptions encoder, + QuantizingImageEncoder encoder, PngColorType colorType, byte bitDepth, Image image)