|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--PngEncoder
| Field Summary | |
(package private) int |
bytesPerPixel
|
static int |
chunksize
|
static int |
compress
|
protected java.util.zip.CRC32 |
crc
|
protected long |
crcValue
|
(package private) byte[] |
deflatebuff
|
(package private) int |
defpos
|
static boolean |
ENCODE_ALPHA
Constant specifying that alpha channel should be encoded. |
boolean |
encodeAlpha
|
static int |
filter
|
static int |
FILTER_LAST
|
static int |
FILTER_NONE
Constants for filters |
static int |
FILTER_SUB
|
static int |
FILTER_UP
|
protected int |
height
|
(package private) byte[] |
lastline
|
(package private) byte[] |
line
|
java.lang.String |
message
|
static boolean |
NO_ALPHA
Constant specifying that alpha channel should not be encoded. |
protected java.io.OutputStream |
out
|
(package private) int[] |
pixels
|
(package private) byte[] |
raw
|
(package private) java.util.zip.Deflater |
scrunch
|
javax.swing.JLabel |
status
|
protected int |
width
|
| Constructor Summary | |
PngEncoder(int width,
int height,
java.io.OutputStream out)
Class constructor specifying Size of image, and stream to write to. |
|
| Method Summary | |
void |
addSlice(java.awt.image.BufferedImage image,
javax.swing.JLabel status,
java.lang.String message)
Write a slice of image data to the output stream. |
void |
clean()
|
void |
finish()
|
void |
start()
Writes the current image to the output stream in PNG format, specifying whether to encode alpha or not. |
protected void |
writeByte(int b)
Write a single byte into the output. |
protected void |
writeBytes(byte[] data)
Write an array of bytes output stream Note: This routine has the side effect of updating the crc. |
protected void |
writeBytes(byte[] data,
int nBytes)
Write an array of bytes into the pngBytes array, specifying number of bytes to write. |
protected void |
writeDat(byte[] data,
int size)
Write an IDAT chunk. |
protected void |
writeEnd()
Write a PNG "IEND" chunk into the pngBytes array. |
protected void |
writeHeader()
Write a PNG "IHDR" chunk to the output. |
protected void |
writeInt2(int n)
Write a two-byte integer into the output. |
protected void |
writeInt4(int n)
Write a four-byte integer into the output. |
protected void |
writeInt4nocrc(int n)
Write a four-byte integer into the output. |
protected void |
writeString(java.lang.String s)
Write a string into the output. |
| 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
public static int compress
public static int filter
public static int chunksize
protected java.io.OutputStream out
protected int width
protected int height
protected java.util.zip.CRC32 crc
protected long crcValue
public boolean encodeAlpha
public javax.swing.JLabel status
public java.lang.String message
int bytesPerPixel
byte[] lastline
byte[] raw
byte[] line
int[] pixels
byte[] deflatebuff
int defpos
java.util.zip.Deflater scrunch
| Constructor Detail |
public PngEncoder(int width,
int height,
java.io.OutputStream out)
Image| Method Detail |
protected void writeBytes(byte[] data)
throws java.io.IOException
data - The data to be written .
java.io.IOException
protected void writeBytes(byte[] data,
int nBytes)
throws java.io.IOException
data - The data to be written.nBytes - The number of bytes to be written.
java.io.IOException
protected void writeInt2(int n)
throws java.io.IOException
n - The integer to be written.
java.io.IOException
protected void writeInt4(int n)
throws java.io.IOException
n - The integer to be written.
java.io.IOException
protected void writeInt4nocrc(int n)
throws java.io.IOException
n - The integer to be written.
java.io.IOException
protected void writeByte(int b)
throws java.io.IOException
java.io.IOException
protected void writeString(java.lang.String s)
throws java.io.IOException
java.io.IOExceptionString.getBytes()
protected void writeHeader()
throws java.io.IOException
java.io.IOException
public void start()
throws java.io.IOException
java.io.IOException
public void addSlice(java.awt.image.BufferedImage image,
javax.swing.JLabel status,
java.lang.String message)
throws java.io.IOException,
CookKillException
java.io.IOException
CookKillException
public void finish()
throws java.io.IOException
java.io.IOExceptionpublic void clean()
protected void writeDat(byte[] data,
int size)
throws java.io.IOException
data - the (compressed) data to be written.size - The number of bytes.
java.io.IOException
protected void writeEnd()
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||