| java.lang.Object com.keypoint.PngEncoder com.keypoint.PngEncoderB
Constructor Summary | |
public | PngEncoderB() | public | PngEncoderB(BufferedImage image) Class constructor specifying BufferedImage to encode, with no alpha channel encoding. | public | PngEncoderB(BufferedImage image, boolean encodeAlpha) Class constructor specifying BufferedImage to encode, and whether to encode alpha. | public | PngEncoderB(BufferedImage image, boolean encodeAlpha, int whichFilter) Class constructor specifying BufferedImage to encode, whether to encode alpha, and filter to use. | public | PngEncoderB(BufferedImage image, boolean encodeAlpha, int whichFilter, int compLevel) |
Method Summary | |
protected boolean | establishStorageInfo() Get and set variables that determine how picture is stored. | public byte[] | pngEncode(boolean encodeAlpha) Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not. | public byte[] | pngEncode() Creates an array of bytes that is the PNG equivalent of the current image. | public void | setImage(BufferedImage image) | protected void | writeHeader() Write a PNG "IHDR" chunk into the pngBytes array. | protected boolean | writeImageData() Write the image data into the pngBytes array.
This will write one or more PNG "IDAT" chunks. | protected void | writePalette(IndexColorModel icm) |
tType | protected int tType(Code) | | |
wRaster | protected WritableRaster wRaster(Code) | | |
PngEncoderB | public PngEncoderB()(Code) | | Class constructor
|
PngEncoderB | public PngEncoderB(BufferedImage image)(Code) | | Class constructor specifying BufferedImage to encode, with no alpha channel encoding.
Parameters: image - A Java BufferedImage object |
PngEncoderB | public PngEncoderB(BufferedImage image, boolean encodeAlpha)(Code) | | Class constructor specifying BufferedImage to encode, and whether to encode alpha.
Parameters: image - A Java BufferedImage object Parameters: encodeAlpha - Encode the alpha channel? false=no; true=yes |
PngEncoderB | public PngEncoderB(BufferedImage image, boolean encodeAlpha, int whichFilter)(Code) | | Class constructor specifying BufferedImage to encode, whether to encode alpha, and filter to use.
Parameters: image - A Java BufferedImage object Parameters: encodeAlpha - Encode the alpha channel? false=no; true=yes Parameters: whichFilter - 0=none, 1=sub, 2=up |
PngEncoderB | public PngEncoderB(BufferedImage image, boolean encodeAlpha, int whichFilter, int compLevel)(Code) | | Class constructor specifying BufferedImage source to encode, whether to encode alpha, filter to use, and compression level
Parameters: image - A Java BufferedImage object Parameters: encodeAlpha - Encode the alpha channel? false=no; true=yes Parameters: whichFilter - 0=none, 1=sub, 2=up Parameters: compLevel - 0..9 |
establishStorageInfo | protected boolean establishStorageInfo()(Code) | | Get and set variables that determine how picture is stored.
Retrieves the writable raster of the buffered image,
as well its transfer type.
Sets number of output bytes per pixel, and, if only
eight-bit bytes, turns off alpha encoding.
true if 1-byte or 4-byte data, false otherwise |
pngEncode | public byte[] pngEncode(boolean encodeAlpha)(Code) | | Creates an array of bytes that is the PNG equivalent of the current image, specifying whether to encode alpha or not.
Parameters: encodeAlpha - boolean false=no alpha, true=encode alpha an array of bytes, or null if there was a problem |
pngEncode | public byte[] pngEncode()(Code) | | Creates an array of bytes that is the PNG equivalent of the current image.
Alpha encoding is determined by its setting in the constructor.
an array of bytes, or null if there was a problem |
setImage | public void setImage(BufferedImage image)(Code) | | Set the BufferedImage to be encoded
Parameters: image - A Java BufferedImage object |
writeHeader | protected void writeHeader()(Code) | | Write a PNG "IHDR" chunk into the pngBytes array.
|
writeImageData | protected boolean writeImageData()(Code) | | Write the image data into the pngBytes array.
This will write one or more PNG "IDAT" chunks. In order
to conserve memory, this method grabs as many rows as will
fit into 32K bytes, or the whole image; whichever is less.
true if no errors; false if error grabbing pixels |
Methods inherited from com.keypoint.PngEncoder | protected void filterSub(byte[] pixels, int startPos, int width)(Code)(Java Doc) protected void filterUp(byte[] pixels, int startPos, int width)(Code)(Java Doc) public int getCompressionLevel()(Code)(Java Doc) public boolean getEncodeAlpha()(Code)(Java Doc) public int getFilter()(Code)(Java Doc) public byte[] pngEncode(boolean encodeAlpha)(Code)(Java Doc) public byte[] pngEncode()(Code)(Java Doc) protected byte[] resizeByteArray(byte[] array, int newLength)(Code)(Java Doc) public void setCompressionLevel(int level)(Code)(Java Doc) public void setEncodeAlpha(boolean encodeAlpha)(Code)(Java Doc) public void setFilter(int whichFilter)(Code)(Java Doc) public void setImage(Image image)(Code)(Java Doc) protected int writeByte(int b, int offset)(Code)(Java Doc) protected int writeBytes(byte[] data, int offset)(Code)(Java Doc) protected int writeBytes(byte[] data, int nBytes, int offset)(Code)(Java Doc) protected void writeEnd()(Code)(Java Doc) protected void writeHeader()(Code)(Java Doc) protected boolean writeImageData()(Code)(Java Doc) protected int writeInt2(int n, int offset)(Code)(Java Doc) protected int writeInt4(int n, int offset)(Code)(Java Doc) protected int writeString(String s, int offset)(Code)(Java Doc)
|
|
|