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 |
|---|---|
| public final boolean | alpha
Flag: true if has alpha channel (RGBA/GA) |
| public final int | bitDepth
Bits per sample (per channel) in the buffer (1-2-4-8-16). |
| public final int | bitspPixel
Bits used for each pixel in the buffer: channel * bitDepth |
| public final int | bytesPerRow
ceil(bitspp*cols/8) |
| public final int | bytesPixel
rounded up value: this is only used internally for filter |
| public final 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. |
| public final int | cols
Cols= Image width, in pixels. |
| public final boolean | greyscale
Flag: true if is grayscale (G/GA) |
| public final boolean | indexed
Flag: true if image is indexed, i.e., it has a palette |
| private static final int | |
| public final boolean | packed
Flag: true if image internally uses less than one byte per sample (bit depth 1-2-4) |
| public final int | rows
Rows= Image height, in pixels |
| public final int | samplesPerRow
Equals cols * channels |
| public final 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". |
| Access | Constructor and Description |
|---|---|
| public | ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha)
Short constructor: assumes truecolor (RGB/RGBA) |
| public | ImageInfo(final int
Width in pixels cols, final int Height in pixels rows, final int Bits per sample, in the buffer : 8-16 for RGB true color and
greyscale bitdepth, final boolean Flag: has an alpha channel (RGBA or GA) alpha, final boolean Flag: is gray scale (any bitdepth, with or without alpha) grayscale, final boolean Flag: has palette indexed)Full constructor |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| public int | |
| public String |
| alpha | back to summary |
|---|---|
| public final boolean alpha Flag: true if has alpha channel (RGBA/GA) | |
| bitDepth | back to summary |
|---|---|
| public final int bitDepth Bits per sample (per channel) in the buffer (1-2-4-8-16). This is 8-16 for RGB/ARGB images, 1-2-4-8 for grayscale. For indexed images, number of bits per palette index (1-2-4-8) | |
| bitspPixel | back to summary |
|---|---|
| public final int bitspPixel Bits used for each pixel in the buffer: channel * bitDepth | |
| bytesPerRow | back to summary |
|---|---|
| public final int bytesPerRow ceil(bitspp*cols/8) | |
| bytesPixel | back to summary |
|---|---|
| public final int bytesPixel rounded up value: this is only used internally for filter | |
| channels | back to summary |
|---|---|
| public final 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. | |
| cols | back to summary |
|---|---|
| public final int cols Cols= Image width, in pixels. | |
| greyscale | back to summary |
|---|---|
| public final boolean greyscale Flag: true if is grayscale (G/GA) | |
| indexed | back to summary |
|---|---|
| public final boolean indexed Flag: true if image is indexed, i.e., it has a palette | |
| MAX_COLS_ROWS_VAL | back to summary |
|---|---|
| private static final int MAX_COLS_ROWS_VAL | |
| packed | back to summary |
|---|---|
| public final boolean packed Flag: true if image internally uses less than one byte per sample (bit depth 1-2-4) | |
| rows | back to summary |
|---|---|
| public final int rows Rows= Image height, in pixels | |
| samplesPerRow | back to summary |
|---|---|
| public final int samplesPerRow Equals cols * channels | |
| samplesPerRowPacked | back to summary |
|---|---|
| public final 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". This is less that samplesPerRow only when bitdepth is 1-2-4 (flag packed = true) This equals the number of elements in the scanline array if working with packedMode=true For internal use, client code should rarely access this. | |
| ImageInfo | back to summary |
|---|---|
| public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha) Short constructor: assumes truecolor (RGB/RGBA) | |
| ImageInfo | back to summary |
|---|---|
| public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha, final boolean grayscale, final boolean indexed) Full constructor
| |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |