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