public class ImageLineInt extends Object implements IImageLine, IImageLineArray
scanline to understand the format.| Modifier and Type | Field and Description |
|---|---|
protected FilterType |
filterType
informational ; only filled by the reader.
|
ImageInfo |
imgInfo |
protected int[] |
scanline
The 'scanline' is an array of integers, corresponds to an image line
(row).
|
protected int |
size
number of elements in the scanline
|
| Constructor and Description |
|---|
ImageLineInt(ImageInfo imgInfo) |
ImageLineInt(ImageInfo imgInfo,
int[] sci) |
| Modifier and Type | Method and Description |
|---|---|
void |
endReadFromPngRaw()
Does nothing in this implementation
|
int |
getElem(int i) |
static IImageLineFactory<ImageLineInt> |
getFactory(ImageInfo iminfo)
Helper method, returns a default factory for this object
|
FilterType |
getFilterType() |
ImageInfo |
getImageInfo() |
int[] |
getScanline() |
int |
getSize() |
void |
readFromPngRaw(byte[] raw,
int len,
int offset,
int step)
Extract pixels from a raw unlfilterd PNG row.
|
void |
setFilterType(FilterType ft) |
String |
toString()
Basic info
|
void |
writeToPngRaw(byte[] raw)
Writes the line to a PNG raw byte array, in the unfiltered PNG format
Notice that the first byte is the filter type, you should write it only
if you know it.
|
public final ImageInfo imgInfo
protected final int[] scanline
Each
For bitdepth=1/2/4 the value is not scaled (hence, eg, if bitdepth=2 the
range will be 0-4)
To convert a indexed line to RGB values, 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)
ImageLineHelper.palette2rgb(ImageLineInt, ar.com.hjg.pngj.chunks.PngChunkPLTE, int[])
(you can't do the reverse)
protected final int size
protected FilterType filterType
public ImageLineInt(ImageInfo imgInfo)
imgInfo - Inmutable ImageInfo, basic parameters of the image we are
reading or writingpublic ImageLineInt(ImageInfo imgInfo, int[] sci)
imgInfo - Inmutable ImageInfo, basic parameters of the image we are
reading or writingsci - prealocated buffer (can be null)public FilterType getFilterType()
getFilterType in interface IImageLineArraypublic void setFilterType(FilterType ft)
public void readFromPngRaw(byte[] raw,
int len,
int offset,
int step)
IImageLinereadFromPngRaw in interface IImageLinepublic void writeToPngRaw(byte[] raw)
IImageLinewriteToPngRaw in interface IImageLinepublic void endReadFromPngRaw()
endReadFromPngRaw in interface IImageLinepublic int getSize()
getSize in interface IImageLineArraysizepublic int getElem(int i)
getElem in interface IImageLineArraypublic int[] getScanline()
scanlinepublic ImageInfo getImageInfo()
getImageInfo in interface IImageLineArraypublic static IImageLineFactory<ImageLineInt> getFactory(ImageInfo iminfo)
iminfo - Copyright © 2013. All rights reserved.