|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream java.io.FilterOutputStream jwo.utils.gifutils.BitOutputStream jwo.utils.gifutils.GIFOutputStream
public class GIFOutputStream
GIFOutputStream provides writeXXX() methods useful for writing out a bitmap image to a GIF file. Included are methods which handle LZW compression of the image data.
Field Summary | |
---|---|
static int |
MAXIMUM_CODE_LENGTH
Maximum code size in bits for GIF LZW compression |
protected jwo.utils.gifutils.LZWStringTable |
stringTable
String table for LZW compression |
Fields inherited from class jwo.utils.gifutils.BitOutputStream |
---|
cachedBits, numCachedBits |
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
GIFOutputStream(OutputStream os)
Creates an output stream suitable for writing .gif files. |
Method Summary | |
---|---|
protected void |
writeCode(short code,
BitOutputStream bos)
Writes a code to the given BitOutputStream using the current bit length from the string table. |
void |
writeColor(Color colour)
Writes a color as 3 bytes in RRGGBB hex format. |
void |
writeDataBlock(byte[] block)
Writes the given bytes to the underlying output stream as a series of data sub-blocks. |
void |
writeDataSubBlock(byte[] subBlock)
Writes a data sub-block from the underlying stream. |
void |
writeImageData(byte[] pixels,
int bpp)
LZW compresses the given pixel data and writes it to the underlying output stream as a data block. |
void |
writeWord(int word)
Writes an unsigned LSB-first 16 byte word to the underlying stream. |
Methods inherited from class jwo.utils.gifutils.BitOutputStream |
---|
flush, write, writeBit, writeBits |
Methods inherited from class java.io.FilterOutputStream |
---|
close, write, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAXIMUM_CODE_LENGTH
protected jwo.utils.gifutils.LZWStringTable stringTable
Constructor Detail |
---|
public GIFOutputStream(OutputStream os)
os
- Underlying output stream.Method Detail |
---|
public void writeWord(int word) throws IOException
word
- Word to write.
IOException
- if problem writing word.public void writeColor(Color colour) throws IOException
colour
- Colour to write.
IOException
- if problem writing to output stream.public void writeDataSubBlock(byte[] subBlock) throws IOException
subBlock
- Sub-block to write.
IOException
- if problem writing sub-block.public void writeDataBlock(byte[] block) throws IOException
block
- Block to write.
IOException
- if problem writing block.protected void writeCode(short code, BitOutputStream bos) throws IOException
code
- Code to write. Sub-block to write.bos
- Output stream to write to.
IOException
- if problem writing code.public void writeImageData(byte[] pixels, int bpp) throws IOException
pixels
- Pixel data to write.bpp
- Image depth.
IOException
- If problem writing the compressed data.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |