PngCs
1.1.4
A C# library for read/write PNG images
|
Lightweight wrapper for an image scanline, for read and write More...
Public Types | |
enum | ESampleType { INT, BYTE } |
Public Member Functions | |
ImageLine (ImageInfo imgInfo) | |
ImageLine (ImageInfo imgInfo, ESampleType stype) | |
ImageLine (ImageInfo imgInfo, ESampleType stype, bool unpackedMode) | |
Constructs an ImageLine | |
ImageLine | unpackToNewImageLine () |
ImageLine | packToNewImageLine () |
int[] | GetScanlineInt () |
byte[] | GetScanlineByte () |
bool | IsInt () |
bool | IsByte () |
override String | ToString () |
Properties | |
ImageInfo | ImgInfo [get, set] |
ImageInfo (readonly inmutable) | |
int[] | Scanline [get, set] |
Samples of an image line | |
byte[] | ScanlineB [get, set] |
Same as Scanline, but with one byte per sample. Only one of Scanline and ScanlineB is valid - this depends on SampleType} | |
int | Rown [get, set] |
tracks the current row number (from 0 to rows-1) | |
int | ElementsPerRow [get, set] |
Hown many elements has the scanline array =imgInfo.samplePerRowPacked, if packed, imgInfo.samplePerRow elsewhere | |
int | maxSampleVal [get, set] |
Maximum sample value that this line admits: typically 255; less if bitdepth less than 8, 65535 if 16bits | |
ESampleType | SampleType [get, set] |
Determines if samples are stored in integers or in bytes | |
bool | SamplesUnpacked [get, set] |
True: each scanline element is a sample. False: each scanline element has severals samples packed in a byte | |
FilterType | FilterUsed [get, set] |
informational only ; filled by the reader | |
Lightweight wrapper for an image scanline, for read and write
It can be (usually it is) reused while iterating over the image lines See scanline
field doc, to understand the format. /remarks>
Hjg.Pngcs.ImageLine.ImageLine | ( | ImageInfo | imgInfo | ) |
Hjg.Pngcs.ImageLine.ImageLine | ( | ImageInfo | imgInfo, |
ESampleType | stype | ||
) |
Hjg.Pngcs.ImageLine.ImageLine | ( | ImageInfo | imgInfo, |
ESampleType | stype, | ||
bool | unpackedMode | ||
) |
ImageLine Hjg.Pngcs.ImageLine.unpackToNewImageLine | ( | ) |
ImageLine Hjg.Pngcs.ImageLine.packToNewImageLine | ( | ) |
int [] Hjg.Pngcs.ImageLine.GetScanlineInt | ( | ) |
byte [] Hjg.Pngcs.ImageLine.GetScanlineByte | ( | ) |
bool Hjg.Pngcs.ImageLine.IsInt | ( | ) |
bool Hjg.Pngcs.ImageLine.IsByte | ( | ) |
override String Hjg.Pngcs.ImageLine.ToString | ( | ) |
|
getset |
Samples of an image line
The 'scanline' is an array of integers, corresponds to an image line (row) Except for 'packed' formats (gray/indexed with 1-2-4 bitdepth) each int is a "sample" (one for channel), (0-255 or 0-65535) in the respective PNG sequence sequence : (R G B R G B...) or (R G B A R G B A...) or (g g g ...) or ( i i i ) (palette index)
For bitdepth 1/2/4 ,and if samplesUnpacked=false, each value is a PACKED byte! To get an unpacked copy, see Pack()
and its inverse Unpack()
To convert a indexed line to RGB balues, see ImageLineHelper.PalIdx2RGB() (cant do the reverse)
|
getset |
Same as Scanline, but with one byte per sample. Only one of Scanline and ScanlineB is valid - this depends on SampleType}
|
getset |
tracks the current row number (from 0 to rows-1)
|
getset |
Hown many elements has the scanline array =imgInfo.samplePerRowPacked, if packed, imgInfo.samplePerRow elsewhere
|
getset |
Maximum sample value that this line admits: typically 255; less if bitdepth less than 8, 65535 if 16bits
|
getset |
Determines if samples are stored in integers or in bytes
|
getset |
True: each scanline element is a sample. False: each scanline element has severals samples packed in a byte
|
getset |
informational only ; filled by the reader