mirror of https://github.com/SixLabors/ImageSharp
45 changed files with 605 additions and 431 deletions
@ -0,0 +1,73 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Six Labors Split License.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp.Formats; |
|||
|
|||
/// <summary>
|
|||
/// Defines the contract for all image decoders.
|
|||
/// </summary>
|
|||
public interface IImageDecoder |
|||
{ |
|||
/// <summary>
|
|||
/// Reads the raw image information from the specified stream.
|
|||
/// </summary>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="IImageInfo"/> object.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public IImageInfo Identify(DecoderOptions options, Stream stream); |
|||
|
|||
/// <summary>
|
|||
/// Reads the raw image information from the specified stream.
|
|||
/// </summary>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>The <see cref="Task{IImageInfo}"/> object.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Task<IImageInfo> IdentifyAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Image<TPixel> Decode<TPixel>(DecoderOptions options, Stream stream) |
|||
where TPixel : unmanaged, IPixel<TPixel>; |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Image Decode(DecoderOptions options, Stream stream); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Task<Image<TPixel>> DecodeAsync<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken) |
|||
where TPixel : unmanaged, IPixel<TPixel>; |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Task<Image> DecodeAsync(DecoderOptions options, Stream stream, CancellationToken cancellationToken); |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Six Labors Split License.
|
|||
|
|||
namespace SixLabors.ImageSharp.Formats; |
|||
|
|||
/// <summary>
|
|||
/// Encapsulates methods used for detecting the raw image information without fully decoding it.
|
|||
/// </summary>
|
|||
public interface IImageInfoDetector |
|||
{ |
|||
/// <summary>
|
|||
/// Reads the raw image information from the specified stream.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
|
|||
/// </remarks>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>The <see cref="IImageInfo"/> object.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
IImageInfo Identify(DecoderOptions options, Stream stream, CancellationToken cancellationToken); |
|||
} |
|||
@ -0,0 +1,56 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Six Labors Split License.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp.Formats; |
|||
|
|||
/// <summary>
|
|||
/// Defines the contract for an image decoder that supports specialized options.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
public interface ISpecializedImageDecoder<T> : IImageDecoder |
|||
where T : ISpecializedDecoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Image<TPixel> Decode<TPixel>(T options, Stream stream) |
|||
where TPixel : unmanaged, IPixel<TPixel>; |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Image Decode(T options, Stream stream); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Task<Image<TPixel>> DecodeAsync<TPixel>(T options, Stream stream, CancellationToken cancellationToken) |
|||
where TPixel : unmanaged, IPixel<TPixel>; |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public Task<Image> DecodeAsync(T options, Stream stream, CancellationToken cancellationToken); |
|||
} |
|||
@ -1,178 +0,0 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Six Labors Split License.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp.Formats; |
|||
|
|||
/// <summary>
|
|||
/// Extensions methods for <see cref="ImageDecoder"/> and <see cref="SpecializedImageDecoder{T}"/>.
|
|||
/// </summary>
|
|||
public static class ImageDecoderExtensions |
|||
{ |
|||
/// <summary>
|
|||
/// Reads the raw image information from the specified stream.
|
|||
/// </summary>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="IImageInfo"/> object.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static IImageInfo Identify(this ImageDecoder decoder, DecoderOptions options, Stream stream) |
|||
=> Image.WithSeekableStream( |
|||
options, |
|||
stream, |
|||
s => decoder.Identify(options, s, default)); |
|||
|
|||
/// <summary>
|
|||
/// Reads the raw image information from the specified stream.
|
|||
/// </summary>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>The <see cref="Task{IImageInfo}"/> object.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Task<IImageInfo> IdentifyAsync(this ImageDecoder decoder, DecoderOptions options, Stream stream, CancellationToken cancellationToken = default) |
|||
=> Image.WithSeekableStreamAsync( |
|||
options, |
|||
stream, |
|||
(s, ct) => decoder.Identify(options, s, ct), |
|||
cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Image<TPixel> Decode<TPixel>(this ImageDecoder decoder, DecoderOptions options, Stream stream) |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> Image.WithSeekableStream( |
|||
options, |
|||
stream, |
|||
s => decoder.Decode<TPixel>(options, s, default)); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Image Decode(this ImageDecoder decoder, DecoderOptions options, Stream stream) |
|||
=> Image.WithSeekableStream( |
|||
options, |
|||
stream, |
|||
s => decoder.Decode(options, s, default)); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Task<Image<TPixel>> DecodeAsync<TPixel>(this ImageDecoder decoder, DecoderOptions options, Stream stream, CancellationToken cancellationToken = default) |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> Image.WithSeekableStreamAsync( |
|||
options, |
|||
stream, |
|||
(s, ct) => decoder.Decode<TPixel>(options, s, ct), |
|||
cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Task<Image> DecodeAsync(this ImageDecoder decoder, DecoderOptions options, Stream stream, CancellationToken cancellationToken = default) |
|||
=> Image.WithSeekableStreamAsync( |
|||
options, |
|||
stream, |
|||
(s, ct) => decoder.Decode(options, s, ct), |
|||
cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Image<TPixel> Decode<T, TPixel>(this SpecializedImageDecoder<T> decoder, T options, Stream stream) |
|||
where T : ISpecializedDecoderOptions |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> Image.WithSeekableStream( |
|||
options.GeneralOptions, |
|||
stream, |
|||
s => decoder.Decode<TPixel>(options, s, default)); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}"/>.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Image Decode<T>(this SpecializedImageDecoder<T> decoder, T options, Stream stream) |
|||
where T : ISpecializedDecoderOptions |
|||
=> Image.WithSeekableStream( |
|||
options.GeneralOptions, |
|||
stream, |
|||
s => decoder.Decode(options, s, default)); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Task<Image<TPixel>> DecodeAsync<T, TPixel>(this SpecializedImageDecoder<T> decoder, T options, Stream stream, CancellationToken cancellationToken = default) |
|||
where T : ISpecializedDecoderOptions |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> Image.WithSeekableStreamAsync( |
|||
options.GeneralOptions, |
|||
stream, |
|||
(s, ct) => decoder.Decode<TPixel>(options, s, ct), |
|||
cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image"/> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
/// <param name="decoder">The decoder.</param>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream"/> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>A <see cref="Task{Image}"/> representing the asynchronous operation.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
public static Task<Image> DecodeAsync<T>(this SpecializedImageDecoder<T> decoder, T options, Stream stream, CancellationToken cancellationToken = default) |
|||
where T : ISpecializedDecoderOptions |
|||
=> Image.WithSeekableStreamAsync( |
|||
options.GeneralOptions, |
|||
stream, |
|||
(s, ct) => decoder.Decode(options, s, ct), |
|||
cancellationToken); |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Six Labors Split License.
|
|||
|
|||
using SixLabors.ImageSharp.PixelFormats; |
|||
|
|||
namespace SixLabors.ImageSharp.Formats; |
|||
|
|||
/// <summary>
|
|||
/// Acts as a base class for specialized image decoders.
|
|||
/// Specialized decoders allow for additional options to be passed to the decoder.
|
|||
/// Types that inherit this decoder are required to implement cancellable synchronous decoding operations only.
|
|||
/// </summary>
|
|||
/// <typeparam name="T">The type of specialized options.</typeparam>
|
|||
public abstract class SpecializedImageDecoder<T> : ImageDecoder, ISpecializedImageDecoder<T> |
|||
where T : ISpecializedDecoderOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image{TPixel}" /> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
|
|||
/// </remarks>
|
|||
/// <typeparam name="TPixel">The pixel format.</typeparam>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream" /> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}" />.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
protected abstract Image<TPixel> Decode<TPixel>(T options, Stream stream, CancellationToken cancellationToken) |
|||
where TPixel : unmanaged, IPixel<TPixel>; |
|||
|
|||
/// <summary>
|
|||
/// Decodes the image from the specified stream to an <see cref="Image" /> of a specific pixel type.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
|
|||
/// </remarks>
|
|||
/// <param name="options">The specialized decoder options.</param>
|
|||
/// <param name="stream">The <see cref="Stream" /> containing image data.</param>
|
|||
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
|
|||
/// <returns>The <see cref="Image{TPixel}" />.</returns>
|
|||
/// <exception cref="ImageFormatException">Thrown if the encoded image contains errors.</exception>
|
|||
protected abstract Image Decode(T options, Stream stream, CancellationToken cancellationToken); |
|||
|
|||
/// <inheritdoc/>
|
|||
protected override Image<TPixel> Decode<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken) |
|||
=> this.Decode<TPixel>(this.CreateDefaultSpecializedOptions(options), stream, cancellationToken); |
|||
|
|||
/// <inheritdoc/>
|
|||
protected override Image Decode(DecoderOptions options, Stream stream, CancellationToken cancellationToken) |
|||
=> this.Decode(this.CreateDefaultSpecializedOptions(options), stream, cancellationToken); |
|||
|
|||
/// <summary>
|
|||
/// A factory method for creating the default specialized options.
|
|||
/// </summary>
|
|||
/// <param name="options">The general decoder options.</param>
|
|||
/// <returns>The new <typeparamref name="T" />.</returns>
|
|||
protected abstract T CreateDefaultSpecializedOptions(DecoderOptions options); |
|||
|
|||
/// <inheritdoc/>
|
|||
public Image<TPixel> Decode<TPixel>(T options, Stream stream) |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> WithSeekableStream( |
|||
options.GeneralOptions, |
|||
stream, |
|||
s => this.Decode<TPixel>(options, s, default)); |
|||
|
|||
/// <inheritdoc/>
|
|||
public Image Decode(T options, Stream stream) |
|||
=> WithSeekableStream( |
|||
options.GeneralOptions, |
|||
stream, |
|||
s => this.Decode(options, s, default)); |
|||
|
|||
/// <inheritdoc/>
|
|||
public Task<Image<TPixel>> DecodeAsync<TPixel>(T options, Stream stream, CancellationToken cancellationToken) |
|||
where TPixel : unmanaged, IPixel<TPixel> |
|||
=> WithSeekableStreamAsync( |
|||
options.GeneralOptions, |
|||
stream, |
|||
(s, ct) => this.Decode<TPixel>(options, s, ct), |
|||
cancellationToken); |
|||
|
|||
/// <inheritdoc/>
|
|||
public Task<Image> DecodeAsync(T options, Stream stream, CancellationToken cancellationToken) |
|||
=> WithSeekableStreamAsync( |
|||
options.GeneralOptions, |
|||
stream, |
|||
(s, ct) => this.Decode(options, s, ct), |
|||
cancellationToken); |
|||
} |
|||
Loading…
Reference in new issue