Class PnmDetails
Details only Netpbm files have, kept in FormatDetails.
public sealed class PnmDetails : FormatDetails
- Inheritance
-
PnmDetails
- Inherited Members
Examples
// Each reader fills in what the file's header says, in the format's own terms.
using Raster png = Raster.Load("duck.png");
if (png.Metadata.FormatDetails is PngDetails pngDetails)
{
Console.WriteLine($"PNG {pngDetails.ColorType}, {pngDetails.BitDepth}-bit, interlaced: {pngDetails.Interlaced}");
foreach (PngTextSource source in pngDetails.TextSources)
{
Console.WriteLine($"Text from a {source.ChunkType} chunk, compressed: {source.Compressed}");
}
}
using Raster bmp = Raster.Load("duck.bmp");
BmpDetails bmpDetails = (BmpDetails)bmp.Metadata.FormatDetails!;
Console.WriteLine($"BMP {bmpDetails.BitsPerPixel}-bit, {bmpDetails.Compression}, {bmpDetails.HeaderSize}-byte header");
using Raster tga = Raster.Load("duck.tga");
TgaDetails tgaDetails = (TgaDetails)tga.Metadata.FormatDetails!;
Console.WriteLine($"TGA type {tgaDetails.ImageType}, origin {tgaDetails.Origin}, alpha {tgaDetails.AlphaType}");
using Raster qoi = Raster.Load("duck.qoi");
QoiDetails qoiDetails = (QoiDetails)qoi.Metadata.FormatDetails!;
Console.WriteLine($"QOI {qoiDetails.Channels} channels, linear: {qoiDetails.Linear}");
using Raster pgm = Raster.Load("duck.pgm");
PnmDetails pnmDetails = (PnmDetails)pgm.Metadata.FormatDetails!;
Console.WriteLine($"PNM {pnmDetails.Kind}, maxval {pnmDetails.MaxValue}, plain text: {pnmDetails.PlainText}");
Properties
Kind
Gets or sets the variant.
public PnmKind Kind { get; set; }
Property Value
LittleEndian
Gets or sets whether a PFM file's floats were little-endian (a negative scale); null for other variants. The writer always writes little-endian.
public bool? LittleEndian { get; set; }
Property Value
- bool?
MaxValue
Gets or sets the maxval: the sample value that means full intensity (1 for PBM).
public int MaxValue { get; set; }
Property Value
PlainText
Gets or sets whether the samples were stored as text (P1, P2 or P3).
public bool PlainText { get; set; }
Property Value
Scale
Gets or sets a PFM file's scale: the absolute value of its third header field, which some programs use as an exposure factor. null for other variants. The writer always writes 1.
public double? Scale { get; set; }
Property Value
TupleType
Gets or sets the PAM tuple type, such as "RGB_ALPHA", or null for other variants.
public string? TupleType { get; set; }
Property Value
Methods
Copy()
Returns a deep copy.
public override FormatDetails Copy()
Returns
- FormatDetails
The copy.