|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.keypoint.PngEncoder
Field Summary | |
protected int |
bytePos
|
protected int |
bytesPerPixel
|
protected int |
compressionLevel
|
protected java.util.zip.CRC32 |
crc
|
protected long |
crcValue
|
protected int |
dataPos
|
static boolean |
ENCODE_ALPHA
Constant specifying that alpha channel should be encoded. |
protected boolean |
encodeAlpha
|
protected int |
endPos
|
protected int |
filter
|
static int |
FILTER_LAST
|
static int |
FILTER_NONE
Constants for filters |
static int |
FILTER_SUB
|
static int |
FILTER_UP
|
protected int |
hdrPos
|
protected int |
height
|
protected java.awt.Image |
image
|
protected byte[] |
leftBytes
|
protected int |
maxPos
|
static boolean |
NO_ALPHA
Constant specifying that alpha channel should not be encoded. |
protected byte[] |
pngBytes
|
protected byte[] |
priorRow
|
protected int |
width
|
Constructor Summary | |
PngEncoder()
Class constructor |
|
PngEncoder(java.awt.Image image)
Class constructor specifying Image source to encode, with no alpha channel encoding. |
|
PngEncoder(java.awt.Image image,
boolean encodeAlpha)
Class constructor specifying Image source to encode, and whether to encode alpha or not |
|
PngEncoder(java.awt.Image image,
boolean encodeAlpha,
int which_filter)
Class constructor specifying Image source to encode, whether to encode alpha or not, and which filter to use |
|
PngEncoder(java.awt.Image image,
boolean encodeAlpha,
int which_filter,
int comp_level)
Class constructor specifying Image source to encode, whether to encode alpha or not, which filter to use, and compression level. |
Method Summary | |
int |
getCompressionLevel()
Retrieve compression level |
boolean |
getEncodeAlpha()
Retrieve alpha encoding status. |
int |
getFilter()
Retrieve filtering scheme |
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. |
protected byte[] |
resizeByteArray(byte[] array,
int newLength)
Increase or decrease the length of a byte array. |
void |
setCompressionLevel(int level)
Set the compression level to use |
void |
setEncodeAlpha(boolean encodeAlpha)
Set the alpha encoding on or off. |
void |
setFilter(int which_filter)
Set the filter to use |
void |
setImage(java.awt.Image image)
Set the image to be encoded |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final boolean ENCODE_ALPHA
public static final boolean NO_ALPHA
public static final int FILTER_NONE
public static final int FILTER_SUB
public static final int FILTER_UP
public static final int FILTER_LAST
protected byte[] pngBytes
protected byte[] priorRow
protected byte[] leftBytes
protected java.awt.Image image
protected int width
protected int height
protected int bytePos
protected int maxPos
protected int hdrPos
protected int dataPos
protected int endPos
protected java.util.zip.CRC32 crc
protected long crcValue
protected boolean encodeAlpha
protected int filter
protected int bytesPerPixel
protected int compressionLevel
Constructor Detail |
public PngEncoder()
public PngEncoder(java.awt.Image image)
image
- A Java Image object which uses the DirectColorModelImage
,
java.awt.image.DirectColorModel
public PngEncoder(java.awt.Image image, boolean encodeAlpha)
image
- A Java Image object which uses the DirectColorModelencodeAlpha
- Encode the alpha channel? false=no; true=yesImage
,
java.awt.image.DirectColorModel
public PngEncoder(java.awt.Image image, boolean encodeAlpha, int which_filter)
image
- A Java Image object which uses the DirectColorModelencodeAlpha
- Encode the alpha channel? false=no; true=yeswhich_filter
- 0=none, 1=sub, 2=upImage
,
java.awt.image.DirectColorModel
public PngEncoder(java.awt.Image image, boolean encodeAlpha, int which_filter, int comp_level)
image
- A Java Image object which uses the DirectColorModelencodeAlpha
- Encode the alpha channel? false=no; true=yeswhich_filter
- 0=none, 1=sub, 2=upcomp_level
- 0..9Image
,
java.awt.image.DirectColorModel
Method Detail |
public void setImage(java.awt.Image image)
image
- A Java Image object which uses the DirectColorModelImage
,
java.awt.image.DirectColorModel
public byte[] pngEncode(boolean encodeAlpha)
encodeAlpha
- boolean false=no alpha, true=encode alphapublic byte[] pngEncode()
public void setEncodeAlpha(boolean encodeAlpha)
encodeAlpha
- false=no, true=yespublic boolean getEncodeAlpha()
public void setFilter(int which_filter)
which_filter
- from constant listpublic int getFilter()
public void setCompressionLevel(int level)
level
- 0 through 9public int getCompressionLevel()
protected byte[] resizeByteArray(byte[] array, int newLength)
array
- The original array.newLength
- The length you wish the new array to have.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |