TgaEncoder Class
Immutable settings for TGA encoding (Truevision TGA 2.0 true-color and grayscale still images).
public sealed class TgaEncoder : ImageEncoderRemarks
The output is the conservative true-color and grayscale subset: bottom-up rows with the origin at the bottom left, no image identification field, no color map, and a TGA 2.0 footer with no developer or extension area. Gray pixel formats are written as 8-bit grayscale (image type 3 or 11), pixel formats with alpha as 32-bit BGRA with 8 declared alpha bits, and the others as 24-bit BGR (image type 2 or 10). Color-mapped output, 15/16-bit output, right-to-left storage and top-down storage are never written.
The output is lossless for 8-bit pixels, alpha included; 16-bit pixel formats require TgaEncoder.AllowBitDepthReduction.
TGA stores exactly one frame: animated images and images with a poster frame are rejected with an UnsupportedImageFeatureException; use ImageFrame.Save to save one frame explicitly.
TGA stores no metadata this version writes: an ICC profile, EXIF, XMP, an orientation other than ExifOrientation.TopLeft, a resolution and text entries follow ImageEncoder.MetadataHandling (rejected by default).
- Inheritance
ImageEncoderTgaEncoder
Constructors
| Name | Description |
|---|---|
| TgaEncoder() |
TgaEncoder()
public TgaEncoder()No documentation is available.
Properties
| Name | Description |
|---|---|
| AllowBitDepthReduction | Gets a value indicating whether 16-bit pixel formats may be reduced to 8 bits per component (nearest rounding). Defaults to false. |
| Compression | Gets the compression. Defaults to TgaCompression.None. |
| Format | Gets the format produced by this encoder. |
AllowBitDepthReduction
TgaEncoder.csCompression
TgaEncoder.csGets the compression. Defaults to TgaCompression.None.
public TgaCompression Compression { get; init; }