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)
Get i-th element of array (for 0 to size-1).
|
static IImageLineFactory<ImageLineInt> |
getFactory()
Helper method, returns a default factory for this object
|
FilterType |
getFilterType() |
ImageInfo |
getImageInfo() |
int[] |
getScanline() |
int |
getSize()
length of array (should correspond to samples)
|
void |
readFromPngRaw(byte[] raw,
int len,
int offset,
int step)
Extract pixels from a raw unlfilterd PNG row.
|
void |
setFilterType(FilterType ft)
This should rarely be used by client code.
|
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 static IImageLineFactory<ImageLineInt> getFactory()
public FilterType getFilterType()
getFilterType
in interface IImageLineArray
public void setFilterType(FilterType ft)
public void readFromPngRaw(byte[] raw, int len, int offset, int step)
IImageLine
readFromPngRaw
in interface IImageLine
public void writeToPngRaw(byte[] raw)
IImageLine
writeToPngRaw
in interface IImageLine
public void endReadFromPngRaw()
endReadFromPngRaw
in interface IImageLine
public int getSize()
IImageLineArray
getSize
in interface IImageLineArray
size
public int getElem(int i)
IImageLineArray
getElem
in interface IImageLineArray
public int[] getScanline()
scanline
public ImageInfo getImageInfo()
getImageInfo
in interface IImageLineArray
Copyright © 2014. All rights reserved.