Class TgaDecoder
Image decoder for Truevision TGA images.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Formats.Tga
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class TgaDecoder : ImageDecoder, IImageDecoderProperties
| Edit this page View SourceInstance
Gets the shared instance.
Declaration
public static TgaDecoder Instance { get; }Property Value
| Type | Description | 
|---|---|
| TgaDecoder | 
Methods
| Edit this page View SourceDecode(DecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image.
Declaration
protected override Image Decode(DecoderOptions options, Stream stream, CancellationToken cancellationToken)Parameters
| Type | Name | Description | 
|---|---|---|
| DecoderOptions | options | The general decoder options. | 
| Stream | stream | The Stream containing image data. | 
| CancellationToken | cancellationToken | The token to monitor for cancellation requests. | 
Returns
| Type | Description | 
|---|---|
| Image | The Image. | 
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
| Type | Condition | 
|---|---|
| ImageFormatException | Thrown if the encoded image contains errors. | 
Decode<TPixel>(DecoderOptions, Stream, CancellationToken)
Decodes the image from the specified stream to an Image<TPixel> of a specific pixel type.
Declaration
protected override Image<TPixel> Decode<TPixel>(DecoderOptions options, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>Parameters
| Type | Name | Description | 
|---|---|---|
| DecoderOptions | options | The general decoder options. | 
| Stream | stream | The Stream containing image data. | 
| CancellationToken | cancellationToken | The token to monitor for cancellation requests. | 
Returns
| Type | Description | 
|---|---|
| Image<TPixel> | The Image<TPixel>. | 
Type Parameters
| Name | Description | 
|---|---|
| TPixel | The pixel format. | 
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
| Type | Condition | 
|---|---|
| ImageFormatException | Thrown if the encoded image contains errors. | 
Identify(DecoderOptions, Stream, CancellationToken)
Reads the raw image information from the specified stream.
Declaration
protected override ImageInfo Identify(DecoderOptions options, Stream stream, CancellationToken cancellationToken)Parameters
| Type | Name | Description | 
|---|---|---|
| DecoderOptions | options | The general decoder options. | 
| Stream | stream | The Stream containing image data. | 
| CancellationToken | cancellationToken | The token to monitor for cancellation requests. | 
Returns
| Type | Description | 
|---|---|
| ImageInfo | The ImageInfo object. | 
Overrides
Remarks
This method is designed to support the ImageSharp internal infrastructure and is not recommended for direct use.
Exceptions
| Type | Condition | 
|---|---|
| ImageFormatException | Thrown if the encoded image contains errors. |