|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectar.com.hjg.pngj.ImageLine
public class ImageLine
Lightweight wrapper for an image scanline, used for read and write.
This object can be (usually it is) reused while iterating over the image lines.
See scanline
field, to understand the format.
Field Summary | |
---|---|
ImageInfo |
imgInfo
|
int[] |
scanline
The 'scanline' is an array of integers, corresponds to an image line (row). |
Constructor Summary | |
---|---|
ImageLine(ImageInfo imgInfo)
|
Method Summary | |
---|---|
FilterType |
getFilterUsed()
|
int |
getRown()
This row number inside the image (0 is top) |
int[] |
getScanLineCopy(int[] b)
Returns a copy from scanline, in byte array. |
void |
incRown()
Increments row number |
void |
pack(int[] buf,
boolean scale)
Packs scanline (for bitdepth 1-2-4) from array into the scanline If scale==true |
void |
setFilterUsed(FilterType ft)
|
void |
setRown(int n)
Sets row number (0 : Rows-1) |
void |
setScanLine(int[] b)
Sets scanline, making copy from passed array. |
static void |
showLineInfo(ImageLine line)
Prints some statistics - just for debugging |
java.lang.String |
toString()
Basic info |
int[] |
unpack(int[] buf,
boolean scale)
Unpacks scanline (for bitdepth 1-2-4) into a array int[]
You can (OPTIONALLY) pass an preallocated array, that will be filled and returned. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final ImageInfo imgInfo
public final int[] scanline
Except for 'packed' formats (gray/indexed with 1-2-4 bitdepth) each
For bitdepth=1/2/4 , each value is a PACKED byte! To get an unpacked copy, see
To convert a indexed line to RGB balues, see
int
is a "sample" (one for channel), (0-255
or 0-65535) in the corresponding PNG 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)
tf_pack()
and its
inverse tf_unpack()
ImageLineHelper.palIdx2RGB()
(you can't do the reverse)
Constructor Detail |
---|
public ImageLine(ImageInfo imgInfo)
Method Detail |
---|
public FilterType getFilterUsed()
public int getRown()
public int[] getScanLineCopy(int[] b)
You can (OPTIONALLY) pass an preallocated array to use.
You should rarely use this
public void incRown()
public void pack(int[] buf, boolean scale)
If
scale==true
, it scales the value (just a bit shift).
public void setFilterUsed(FilterType ft)
public void setRown(int n)
public void setScanLine(int[] b)
public static void showLineInfo(ImageLine line)
public java.lang.String toString()
toString
in class java.lang.Object
public int[] unpack(int[] buf, boolean scale)
int[]
You can (OPTIONALLY) pass an preallocated array, that will be filled and returned. If null, it will be allocated
If
scale==true
, it scales the value (just a bit shift) towards 0-255.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |