|
|||||||||
| Home >> All >> nextapp >> echoservlet >> [ image overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
nextapp.echoservlet.image
Class PngEncoder

java.lang.Objectnextapp.echoservlet.image.PngEncoder
- public class PngEncoder
- extends java.lang.Object
Encodes a java.awt.Image into PNG format. For more information on the PNG specification, see the W3C PNG page at http://www.w3.org/TR/REC-png.html.
| Nested Class Summary | |
private static class |
PngEncoder.AverageFilter
An implementation of an "Average" filter. |
private class |
PngEncoder.ByteTranslator
Translates byte-based rasters. |
static interface |
PngEncoder.Filter
An interface for PNG filters. |
private class |
PngEncoder.IntTranslator
Translates integer-based rasters. |
private static class |
PngEncoder.PaethFilter
An implementation of a "Paeth" filter. |
private static class |
PngEncoder.SubFilter
An implementation of a "Sub" filter. |
(package private) static interface |
PngEncoder.Translator
An interface for translators, which translate pixel data from a writable raster into an R/G/B/A ordering required by the PNG specification. |
private static class |
PngEncoder.UpFilter
An implementation of an "Up" filter. |
| Field Summary | |
static PngEncoder.Filter |
AVERAGE_FILTER
|
private static int |
AVERAGE_FILTER_TYPE
|
private static byte |
BIT_DEPTH
|
private static byte |
COLOR_TYPE_INDEXED
|
private static byte |
COLOR_TYPE_RGB
|
private static byte |
COLOR_TYPE_RGBA
|
private int |
compressionLevel
|
private boolean |
encodeAlpha
|
private PngEncoder.Filter |
filter
|
private int |
height
|
private static byte[] |
IDAT
|
private static byte[] |
IEND
|
private static byte[] |
IHDR
|
private java.awt.image.BufferedImage |
image
|
private int |
inputBpp
|
private static int[] |
INT_TRANSLATOR_CHANNEL_MAP
|
private int |
outputBpp
|
static PngEncoder.Filter |
PAETH_FILTER
|
private static int |
PAETH_FILTER_TYPE
|
private static byte[] |
PLTE
|
private java.awt.image.Raster |
raster
|
private static byte[] |
SIGNATURE
|
static PngEncoder.Filter |
SUB_FILTER
|
private static int |
SUB_FILTER_TYPE
|
private int |
transferType
|
private PngEncoder.Translator |
translator
|
static PngEncoder.Filter |
UP_FILTER
|
private static int |
UP_FILTER_TYPE
|
private int |
width
|
| Constructor Summary | |
PngEncoder(java.awt.Image image,
boolean encodeAlpha,
PngEncoder.Filter filter,
int compressionLevel)
Creates a PNG encoder for an image. |
|
| Method Summary | |
void |
encode(java.io.OutputStream out)
Encodes the image. |
private void |
writeIdatChunks(java.io.OutputStream out,
java.util.zip.Checksum csum)
Writes the IDAT (Image data) chunks to the output stream. |
private void |
writeIendChunk(java.io.OutputStream out,
java.util.zip.Checksum csum)
Writes the IEND (End-of-file) chunk to the output stream. |
private void |
writeIhdrChunk(java.io.OutputStream out,
java.util.zip.Checksum csum)
Writes the IHDR (Image Header) chunk to the output stream. |
private static void |
writeInt(java.io.OutputStream out,
int i)
Writes an 32-bit integer value to the output stream. |
private void |
writePlteChunk(java.io.OutputStream out,
java.util.zip.Checksum csum)
Writes the PLTE (Palette) chunk to the output stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
SUB_FILTER
public static final PngEncoder.Filter SUB_FILTER
UP_FILTER
public static final PngEncoder.Filter UP_FILTER
AVERAGE_FILTER
public static final PngEncoder.Filter AVERAGE_FILTER
PAETH_FILTER
public static final PngEncoder.Filter PAETH_FILTER
SIGNATURE
private static final byte[] SIGNATURE
IHDR
private static final byte[] IHDR
PLTE
private static final byte[] PLTE
IDAT
private static final byte[] IDAT
IEND
private static final byte[] IEND
SUB_FILTER_TYPE
private static final int SUB_FILTER_TYPE
- See Also:
- Constant Field Values
UP_FILTER_TYPE
private static final int UP_FILTER_TYPE
- See Also:
- Constant Field Values
AVERAGE_FILTER_TYPE
private static final int AVERAGE_FILTER_TYPE
- See Also:
- Constant Field Values
PAETH_FILTER_TYPE
private static final int PAETH_FILTER_TYPE
- See Also:
- Constant Field Values
BIT_DEPTH
private static final byte BIT_DEPTH
- See Also:
- Constant Field Values
COLOR_TYPE_INDEXED
private static final byte COLOR_TYPE_INDEXED
- See Also:
- Constant Field Values
COLOR_TYPE_RGB
private static final byte COLOR_TYPE_RGB
- See Also:
- Constant Field Values
COLOR_TYPE_RGBA
private static final byte COLOR_TYPE_RGBA
- See Also:
- Constant Field Values
INT_TRANSLATOR_CHANNEL_MAP
private static final int[] INT_TRANSLATOR_CHANNEL_MAP
image
private java.awt.image.BufferedImage image
encodeAlpha
private boolean encodeAlpha
filter
private PngEncoder.Filter filter
compressionLevel
private int compressionLevel
width
private int width
height
private int height
transferType
private int transferType
raster
private java.awt.image.Raster raster
inputBpp
private int inputBpp
outputBpp
private int outputBpp
translator
private PngEncoder.Translator translator
| Constructor Detail |
PngEncoder
public PngEncoder(java.awt.Image image, boolean encodeAlpha, PngEncoder.Filter filter, int compressionLevel)
- Creates a PNG encoder for an image.
| Method Detail |
writeInt
private static void writeInt(java.io.OutputStream out, int i) throws java.io.IOException
- Writes an 32-bit integer value to the output stream.
encode
public void encode(java.io.OutputStream out) throws java.io.IOException
- Encodes the image.
writeIdatChunks
private void writeIdatChunks(java.io.OutputStream out, java.util.zip.Checksum csum) throws java.io.IOException
- Writes the IDAT (Image data) chunks to the output stream.
writeIendChunk
private void writeIendChunk(java.io.OutputStream out, java.util.zip.Checksum csum) throws java.io.IOException
- Writes the IEND (End-of-file) chunk to the output stream.
writeIhdrChunk
private void writeIhdrChunk(java.io.OutputStream out, java.util.zip.Checksum csum) throws java.io.IOException
- Writes the IHDR (Image Header) chunk to the output stream.
writePlteChunk
private void writePlteChunk(java.io.OutputStream out, java.util.zip.Checksum csum) throws java.io.IOException
- Writes the PLTE (Palette) chunk to the output stream.
|
|||||||||
| Home >> All >> nextapp >> echoservlet >> [ image overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
nextapp.echoservlet.image.PngEncoder