Interface ISpecializedImageDecoder<T>
- Namespace
- SixLabors.ImageSharp.Formats
- Assembly
- SixLabors.ImageSharp.dll
Defines the contract for an image decoder that supports specialized options.
public interface ISpecializedImageDecoder<T> : IImageDecoder where T : ISpecializedDecoderOptions
Type Parameters
T
The type of specialized options.
- Inherited Members
Methods
Decode(T, Stream)
Decodes the image from the specified stream to an Image of a specific pixel type.
Image Decode(T options, Stream stream)
Parameters
Returns
- Image
The Image<TPixel>.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.
DecodeAsync(T, Stream, CancellationToken)
Decodes the image from the specified stream to an Image of a specific pixel type.
Task<Image> DecodeAsync(T options, Stream stream, CancellationToken cancellationToken = default)
Parameters
options
TThe specialized decoder options.
stream
StreamThe Stream containing image data.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<Image>
A Task<TResult> representing the asynchronous operation.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.
DecodeAsync<TPixel>(T, Stream, CancellationToken)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Task<Image<TPixel>> DecodeAsync<TPixel>(T options, Stream stream, CancellationToken cancellationToken = default) where TPixel : unmanaged, IPixel<TPixel>
Parameters
options
TThe specialized decoder options.
stream
StreamThe Stream containing image data.
cancellationToken
CancellationTokenThe token to monitor for cancellation requests.
Returns
- Task<Image<TPixel>>
A Task<TResult> representing the asynchronous operation.
Type Parameters
TPixel
The pixel format.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.
Decode<TPixel>(T, Stream)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Image<TPixel> Decode<TPixel>(T options, Stream stream) where TPixel : unmanaged, IPixel<TPixel>
Parameters
Returns
- Image<TPixel>
The Image<TPixel>.
Type Parameters
TPixel
The pixel format.
Exceptions
- ImageFormatException
Thrown if the encoded image contains errors.