Class TgaEncoder
Image encoder for writing an image to a stream as a Targa true-vision image.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Formats.Tga
Assembly: SixLabors.ImageSharp.dll
Syntax
public sealed class TgaEncoder : ImageEncoder, IImageEncoder
Properties
| Edit this page View SourceBitsPerPixel
Gets the number of bits per pixel.
Declaration
public TgaBitsPerPixel? BitsPerPixel { get; init; }
Property Value
Type | Description |
---|---|
TgaBitsPerPixel? |
Compression
Gets a value indicating whether no compression or run length compression should be used.
Declaration
public TgaCompression Compression { get; init; }
Property Value
Type | Description |
---|---|
TgaCompression |
Methods
| Edit this page View SourceEncode<TPixel>(Image<TPixel>, Stream, CancellationToken)
Encodes the image to the specified stream from the Image<TPixel>.
Declaration
protected override void Encode<TPixel>(Image<TPixel> image, Stream stream, CancellationToken cancellationToken) where TPixel : unmanaged, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Image<TPixel> | image | The Image<TPixel> to encode from. |
Stream | stream | The Stream to encode the image data to. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
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.