com.keypoint
Class PngEncoderB
java.lang.Object
|
+--com.keypoint.PngEncoder
|
+--com.keypoint.PngEncoderB
- public class PngEncoderB
- extends PngEncoder
Constructor Summary |
PngEncoderB()
Class constructor |
PngEncoderB(java.awt.image.BufferedImage image)
Class constructor specifying BufferedImage to encode, with no alpha channel encoding. |
PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha)
Class constructor specifying BufferedImage to encode, and whether to encode alpha. |
PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha,
int whichFilter)
Class constructor specifying BufferedImage to encode, whether to encode alpha, and filter to use. |
PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha,
int whichFilter,
int compLevel)
Class constructor specifying BufferedImage source to encode, whether to encode alpha, filter to use, and compression level |
Method Summary |
byte[] |
pngEncode()
Creates an array of bytes that is the PNG equivalent of the current image. |
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. |
void |
setImage(java.awt.image.BufferedImage image)
Set the BufferedImage to be encoded |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
PngEncoderB
public PngEncoderB()
- Class constructor
PngEncoderB
public PngEncoderB(java.awt.image.BufferedImage image)
- Class constructor specifying BufferedImage to encode, with no alpha channel encoding.
- Parameters:
image
- A Java BufferedImage object
PngEncoderB
public PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha)
- Class constructor specifying BufferedImage to encode, and whether to encode alpha.
- Parameters:
image
- A Java BufferedImage objectencodeAlpha
- Encode the alpha channel? false=no; true=yes
PngEncoderB
public PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha,
int whichFilter)
- Class constructor specifying BufferedImage to encode, whether to encode alpha, and filter to use.
- Parameters:
image
- A Java BufferedImage objectencodeAlpha
- Encode the alpha channel? false=no; true=yeswhichFilter
- 0=none, 1=sub, 2=up
PngEncoderB
public PngEncoderB(java.awt.image.BufferedImage image,
boolean encodeAlpha,
int whichFilter,
int compLevel)
- Class constructor specifying BufferedImage source to encode, whether to encode alpha, filter to use, and compression level
- Parameters:
image
- A Java BufferedImage objectencodeAlpha
- Encode the alpha channel? false=no; true=yeswhichFilter
- 0=none, 1=sub, 2=upcompLevel
- 0..9
setImage
public void setImage(java.awt.image.BufferedImage image)
- Set the BufferedImage to be encoded
- Parameters:
BufferedImage
- A Java BufferedImage object
pngEncode
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.
- Overrides:
- pngEncode in class PngEncoder
- Parameters:
encodeAlpha
- boolean false=no alpha, true=encode alpha- Returns:
- an array of bytes, or null if there was a problem
pngEncode
public byte[] pngEncode()
- Creates an array of bytes that is the PNG equivalent of the current image.
Alpha encoding is determined by its setting in the constructor.
- Overrides:
- pngEncode in class PngEncoder
- Returns:
- an array of bytes, or null if there was a problem