|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectar.com.hjg.pngj.ImageInfo
public class ImageInfo
Simple immutable wrapper for basic image info.
Some parameters are redundant, but the constructor receives an 'orthogonal' subset.
ref: http://www.w3.org/TR/PNG/#11IHDR
Field Summary | |
---|---|
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) |
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 |
Constructor Summary | |
---|---|
ImageInfo(int cols,
int rows,
int bitdepth,
boolean alpha)
Short constructor: assumes truecolor (RGB/RGBA) |
|
ImageInfo(int cols,
int rows,
int bitdepth,
boolean alpha,
boolean grayscale,
boolean indexed)
Full constructor |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final boolean alpha
public final int bitDepth
public final int bitspPixel
public final int bytesPerRow
public final int bytesPixel
public final int channels
public final int cols
public final boolean greyscale
public final boolean indexed
public final boolean packed
public final int rows
public final int samplesPerRow
Constructor Detail |
---|
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 paletteMethod Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |