public class ImageInfo extends Object
Some parameters are redundant, but the constructor receives an 'orthogonal' subset.
ref: http://www.w3.org/TR/PNG/#11IHDR
| Modifier and Type | Field and Description |
|---|---|
boolean |
alpha
Flag: true if has alpha channel (RGBA/GA)
|
int |
bitDepth
Bits per sample (per channel) in the buffer (1-2-4-8-16).
|
int |
bitspPixel
Bits used for each pixel in the buffer: channel * bitDepth
|
int |
bytesPerRow
ceil(bitspp*cols/8) - does not include filter
|
int |
bytesPixel
rounded up value: this is only used internally for filter
|
int |
channels
Number of channels, as used internally: 3 for RGB, 4 for RGBA, 2 for GA
(gray with alpha), 1 for grayscale or indexed.
|
int |
cols
Cols= Image width, in pixels.
|
boolean |
greyscale
Flag: true if is grayscale (G/GA)
|
boolean |
indexed
Flag: true if image is indexed, i.e., it has a palette
|
boolean |
packed
Flag: true if image internally uses less than one byte per sample (bit
depth 1-2-4)
|
int |
rows
Rows= Image height, in pixels
|
int |
samplesPerRow
Equals cols * channels
|
int |
samplesPerRowPacked
Amount of "packed samples" : when several samples are stored in a single
byte (bitdepth 1,2 4) they are counted as one "packed sample".
|
public final int cols
public final int rows
public final int bitDepth
public final int channels
public final boolean alpha
public final boolean greyscale
public final boolean indexed
public final boolean packed
public final int bitspPixel
public final int bytesPixel
public final int bytesPerRow
public final int samplesPerRow
public final int samplesPerRowPacked
This equals the number of elements in the scanline array if working with packedMode=true
For internal use, client code should rarely access this.
public ImageInfo(int cols,
int rows,
int bitdepth,
boolean alpha)
public ImageInfo(int cols,
int rows,
int bitdepth,
boolean alpha,
boolean grayscale,
boolean indexed)
cols - Width in pixelsrows - Height in pixelsbitdepth - Bits per sample, in the buffer : 8-16 for RGB true color and
greyscalealpha - Flag: has an alpha channel (RGBA or GA)grayscale - Flag: is gray scale (any bitdepth, with or without alpha)indexed - Flag: has paletteCopyright © 2013. All rights reserved.