|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sun.jimi.core.encoder.xpm.XPMEncoder
Encoder class for XPM format.
Field Summary | |
protected int |
entrySize
size of each palette entry |
protected static java.lang.String |
HEADER_STRING
|
protected AdaptiveRasterImage |
jimiImage
JimiImage to get data from |
protected static java.lang.String |
MAGIC
|
protected java.io.PrintStream |
output
destination for encoded data |
protected int |
paletteSize
number of colors in palette |
protected static char[] |
paletteStringCharacters
|
protected java.lang.String[] |
paletteStrings
palette mapping index to string representation |
protected int |
state
current state of encoding |
Constructor Summary | |
XPMEncoder()
|
Method Summary | |
protected void |
createPaletteStrings(java.awt.image.IndexColorModel cm)
Generate the strings which are used as color values. |
protected void |
doImageEncode()
Workhorse method for actually encoding the image |
boolean |
driveEncoder()
Drive the encoder through the image encoding process. |
protected void |
generatePaletteStringCharacters()
Generate the characters which can legally be used to form palette strings. |
int |
getState()
Return the state of the encoder. |
void |
initSpecificEncoder(java.io.OutputStream out,
AdaptiveRasterImage image)
|
protected java.lang.String |
toPaddedHexString(int value)
Make a hex string out of an int, padding to 6 digits. |
protected void |
writeHeader()
Write the XPM header to the output stream. |
protected void |
writeImageData()
Write the image data to the output stream. |
protected void |
writePalette(java.awt.image.IndexColorModel cm)
Write palette information to the output stream. |
protected void |
writeTrailer()
Write the end of image marker. |
Field Detail |
protected static final java.lang.String MAGIC
protected static final java.lang.String HEADER_STRING
protected static char[] paletteStringCharacters
protected java.io.PrintStream output
protected AdaptiveRasterImage jimiImage
protected int state
protected int paletteSize
protected java.lang.String[] paletteStrings
protected int entrySize
Constructor Detail |
public XPMEncoder()
Method Detail |
public void initSpecificEncoder(java.io.OutputStream out, AdaptiveRasterImage image)
public boolean driveEncoder() throws JimiException
public int getState()
protected void doImageEncode() throws JimiException, java.io.IOException
protected void createPaletteStrings(java.awt.image.IndexColorModel cm)
protected void writeHeader() throws java.io.IOException
protected void writePalette(java.awt.image.IndexColorModel cm) throws java.io.IOException
protected void writeImageData() throws java.io.IOException, JimiException
protected void writeTrailer() throws java.io.IOException
protected java.lang.String toPaddedHexString(int value)
protected void generatePaletteStringCharacters()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |