Table of Contents

Class TgaFormat

Namespace
Egami.Formats.Tga
Assembly
Egami.dll

The TGA (Truevision Targa) format, registered in Default. TGA has no signature, so it is detected last and only when the whole 18-byte header is consistent.

public static class TgaFormat
Inheritance
TgaFormat
Inherited Members

Examples

// Every built-in format, with its name, extensions and MIME types; Raster.Save picks one by extension.
foreach (FormatInfo format in new[] { PngFormat.Info, JpegFormat.Info, GifFormat.Info, BmpFormat.Info, TgaFormat.Info, QoiFormat.Info, PnmFormat.Info })
{
    Console.WriteLine($"{format.Name}: {string.Join(", ", format.Extensions)} ({string.Join(", ", format.MimeTypes)})");
}

// A SignatureMatcher decides from the first SignatureLength bytes whether a file is in the format.
SignatureMatcher isPng = PngFormat.Info.Matches;
bool png = isPng(File.ReadAllBytes("duck.png").AsSpan(0, PngFormat.Info.SignatureLength));

Properties

Info

Gets the format's registration: name, MIME type, extensions, signature check, reader and writer.

public static FormatInfo Info { get; }

Property Value

FormatInfo