Table of Contents

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

options T

The specialized decoder options.

stream Stream

The Stream containing image data.

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 T

The specialized decoder options.

stream Stream

The Stream containing image data.

cancellationToken CancellationToken

The 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 T

The specialized decoder options.

stream Stream

The Stream containing image data.

cancellationToken CancellationToken

The 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

options T

The specialized decoder options.

stream Stream

The Stream containing image data.

Returns

Image<TPixel>

The Image<TPixel>.

Type Parameters

TPixel

The pixel format.

Exceptions

ImageFormatException

Thrown if the encoded image contains errors.