diff --git a/src/ImageSharp/Formats/SpecializedImageDecoder{T}.cs b/src/ImageSharp/Formats/SpecializedImageDecoder{T}.cs index 90442689bc..54a3c42914 100644 --- a/src/ImageSharp/Formats/SpecializedImageDecoder{T}.cs +++ b/src/ImageSharp/Formats/SpecializedImageDecoder{T}.cs @@ -14,6 +14,38 @@ namespace SixLabors.ImageSharp.Formats; public abstract class SpecializedImageDecoder : ImageDecoder, ISpecializedImageDecoder where T : ISpecializedDecoderOptions { + /// + public Image Decode(T options, Stream stream) + where TPixel : unmanaged, IPixel + => WithSeekableStream( + options.GeneralOptions, + stream, + s => this.Decode(options, s, default)); + + /// + public Image Decode(T options, Stream stream) + => WithSeekableStream( + options.GeneralOptions, + stream, + s => this.Decode(options, s, default)); + + /// + public Task> DecodeAsync(T options, Stream stream, CancellationToken cancellationToken) + where TPixel : unmanaged, IPixel + => WithSeekableStreamAsync( + options.GeneralOptions, + stream, + (s, ct) => this.Decode(options, s, ct), + cancellationToken); + + /// + public Task DecodeAsync(T options, Stream stream, CancellationToken cancellationToken) + => WithSeekableStreamAsync( + options.GeneralOptions, + stream, + (s, ct) => this.Decode(options, s, ct), + cancellationToken); + /// /// Decodes the image from the specified stream to an of a specific pixel type. /// @@ -56,36 +88,4 @@ public abstract class SpecializedImageDecoder : ImageDecoder, ISpecializedIma /// The general decoder options. /// The new . protected abstract T CreateDefaultSpecializedOptions(DecoderOptions options); - - /// - public Image Decode(T options, Stream stream) - where TPixel : unmanaged, IPixel - => WithSeekableStream( - options.GeneralOptions, - stream, - s => this.Decode(options, s, default)); - - /// - public Image Decode(T options, Stream stream) - => WithSeekableStream( - options.GeneralOptions, - stream, - s => this.Decode(options, s, default)); - - /// - public Task> DecodeAsync(T options, Stream stream, CancellationToken cancellationToken) - where TPixel : unmanaged, IPixel - => WithSeekableStreamAsync( - options.GeneralOptions, - stream, - (s, ct) => this.Decode(options, s, ct), - cancellationToken); - - /// - public Task DecodeAsync(T options, Stream stream, CancellationToken cancellationToken) - => WithSeekableStreamAsync( - options.GeneralOptions, - stream, - (s, ct) => this.Decode(options, s, ct), - cancellationToken); }