Table of Contents

Class PnmFormat

Namespace
Egami.Formats.Pnm
Assembly
Egami.dll

The Netpbm formats PBM, PGM, PPM, PAM and the PFM float map as one format, registered in Default.

public static class PnmFormat
Inheritance
PnmFormat
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 types, extensions, signature, reader and writer.

public static FormatInfo Info { get; }

Property Value

FormatInfo