|
PngCs
1.1.4
A C# library for read/write PNG images
|
Simple immutable wrapper for basic image info More...
Public Member Functions | |
| ImageInfo (int cols, int rows, int bitdepth, bool alpha) | |
| Simple constructor: only for RGB/RGBA | |
| ImageInfo (int cols, int rows, int bitdepth, bool alpha, bool grayscale, bool palette) | |
| General Constructor | |
| override String | ToString () |
| General information, for debugging | |
| override int | GetHashCode () |
| override bool | Equals (Object obj) |
Public Attributes | |
| readonly int | Cols |
| Image width, in pixels | |
| readonly int | Rows |
| Image height, in pixels | |
| readonly int | BitDepth |
| Bits per sample (per channel) in the buffer. | |
| readonly int | Channels |
| Number of channels, used in the buffer | |
| readonly int | BitspPixel |
| Bits used for each pixel in the buffer | |
| readonly int | BytesPixel |
| Bytes per pixel, rounded up | |
| readonly int | BytesPerRow |
| Bytes per row, rounded up | |
| readonly int | SamplesPerRow |
| Samples (scalar values) per row | |
| readonly int | SamplesPerRowPacked |
| Number of values in our scanline, which might be packed. | |
| readonly bool | Alpha |
| flag: has alpha channel | |
| readonly bool | Greyscale |
| flag: is grayscale (G/GA) | |
| readonly bool | Indexed |
| flag: has palette | |
| readonly bool | Packed |
| flag: less than one byte per sample (bit depth 1-2-4) | |
Simple immutable wrapper for basic image info
Some parameters are clearly redundant The constructor requires an 'ortogonal' subset http://www.w3.org/TR/PNG/#11IHDR
| Hjg.Pngcs.ImageInfo.ImageInfo | ( | int | cols, |
| int | rows, | ||
| int | bitdepth, | ||
| bool | alpha | ||
| ) |
Simple constructor: only for RGB/RGBA
| Hjg.Pngcs.ImageInfo.ImageInfo | ( | int | cols, |
| int | rows, | ||
| int | bitdepth, | ||
| bool | alpha, | ||
| bool | grayscale, | ||
| bool | palette | ||
| ) |
General Constructor
| cols | Width in pixels |
| rows | Height in pixels |
| bitdepth | Bits per sample per channel |
| alpha | Has alpha channel |
| grayscale | Is grayscale |
| palette | Has palette |
| override String Hjg.Pngcs.ImageInfo.ToString | ( | ) |
General information, for debugging
| override int Hjg.Pngcs.ImageInfo.GetHashCode | ( | ) |
| override bool Hjg.Pngcs.ImageInfo.Equals | ( | Object | obj | ) |
| readonly int Hjg.Pngcs.ImageInfo.Cols |
Image width, in pixels
| readonly int Hjg.Pngcs.ImageInfo.Rows |
Image height, in pixels
| readonly int Hjg.Pngcs.ImageInfo.BitDepth |
Bits per sample (per channel) in the buffer.
This is 8 or 16 for RGB/ARGB images. For grayscale, it's 8 (or 1 2 4 ). For indexed images, number of bits per palette index (1 2 4 8). /remarks>
| readonly int Hjg.Pngcs.ImageInfo.Channels |
Number of channels, used in the buffer
WARNING: This is 3-4 for rgb/rgba, but 1 for palette/gray ! /remarks>
| readonly int Hjg.Pngcs.ImageInfo.BitspPixel |
Bits used for each pixel in the buffer
equals channels * bitDepth
| readonly int Hjg.Pngcs.ImageInfo.BytesPixel |
Bytes per pixel, rounded up
This is mainly for internal use (filter)
| readonly int Hjg.Pngcs.ImageInfo.BytesPerRow |
Bytes per row, rounded up
equals ceil(bitspp*cols/8)
| readonly int Hjg.Pngcs.ImageInfo.SamplesPerRow |
Samples (scalar values) per row
Equals cols * channels
| readonly int Hjg.Pngcs.ImageInfo.SamplesPerRowPacked |
Number of values in our scanline, which might be packed.
Equals samplesPerRow if not packed. Elsewhere, it's lower For internal use, mostly.
| readonly bool Hjg.Pngcs.ImageInfo.Alpha |
flag: has alpha channel
| readonly bool Hjg.Pngcs.ImageInfo.Greyscale |
flag: is grayscale (G/GA)
| readonly bool Hjg.Pngcs.ImageInfo.Indexed |
flag: has palette
| readonly bool Hjg.Pngcs.ImageInfo.Packed |
flag: less than one byte per sample (bit depth 1-2-4)
1.8.2