Interface IImageDecoder
Encapsulates properties and methods required for decoding an image from a stream.
Namespace: SixLabors.ImageSharp.Formats
Assembly: SixLabors.ImageSharp.dll
Syntax
public interface IImageDecoder
Methods
| Improve this Doc View SourceDecode(Configuration, Stream)
Decodes the image from the specified stream to an Image.
Declaration
Image Decode(Configuration configuration, Stream stream)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration for the image. |
Stream | stream | The Stream containing image data. |
Returns
Type | Description |
---|---|
Image | The Image. |
Decode<TPixel>(Configuration, Stream)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Declaration
Image<TPixel> Decode<TPixel>(Configuration configuration, Stream stream)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration for the image. |
Stream | stream | The Stream containing image data. |
Returns
Type | Description |
---|---|
Image<TPixel> | The Image<TPixel>. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |
DecodeAsync(Configuration, Stream, CancellationToken)
Decodes the image from the specified stream to an Image.
Declaration
Task<Image> DecodeAsync(Configuration configuration, Stream stream, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration for the image. |
Stream | stream | The Stream containing image data. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Task<Image> | The Image. |
DecodeAsync<TPixel>(Configuration, Stream, CancellationToken)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Declaration
Task<Image<TPixel>> DecodeAsync<TPixel>(Configuration configuration, Stream stream, CancellationToken cancellationToken)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration for the image. |
Stream | stream | The Stream containing image data. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Task<Image<TPixel>> | The Image<TPixel>. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel format. |