|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object O2Plib.image.WriteGifEncoder
public class WriteGifEncoder
Field Summary | |
---|---|
private int |
a_count
|
private byte[] |
accum
|
private byte[] |
b
|
private static int |
BITS
|
private boolean |
clear_flg
80% occupancy |
private int |
ClearCode
|
private int[] |
codetab
|
private int |
cur_accum
|
private int |
cur_bits
|
private static int |
EOF
|
private int |
EOFCode
|
private int |
free_ent
|
private byte[] |
g
|
private int |
g_init_bits
|
private int |
height
|
private int |
hsize
|
private static int |
HSIZE
|
private int[] |
htab
|
private boolean |
interlace
80% occupancy |
private int[] |
masks
|
private int |
maxbits
|
private int |
maxcode
|
private int |
maxmaxcode
|
private int |
n_bits
|
private int |
numPixels
|
private boolean |
ok
80% occupancy |
private int |
pixelIndex
|
private byte[] |
pixels
|
private byte[] |
r
|
private int |
width
|
Constructor Summary | |
---|---|
WriteGifEncoder(java.awt.Image img)
WriteGifEncoder() - Constructs using 24-bit Image. |
|
WriteGifEncoder(int width,
int height,
byte[] pixels,
byte[] r,
byte[] g,
byte[] b)
WriteGifEncoder() - Constructs a new WriteGifEncoder. |
Method Summary | |
---|---|
private void |
char_init()
char_init() - Set up the 'byte output' routine |
(package private) void |
char_out(byte c,
java.io.FileOutputStream outs)
char_out() - add char to end of current packet, and if it is 254 characters, flush the packet to disk. |
private void |
cl_block(java.io.FileOutputStream outs)
cl_block() - table clear for block compress Clear out the hash table. |
private void |
cl_hash(int hsize)
cl_hash() - reset code table |
private void |
compress(int init_bits,
java.io.FileOutputStream outs)
compress() - GIF Image compression - modified 'compress'. |
(package private) void |
flush_char(java.io.FileOutputStream outs)
flush_char() - flush packet to disk, and reset the accumulator |
private void |
GIFEncode(java.io.FileOutputStream outs,
int Width,
int Height,
boolean Interlace,
byte Background,
int Transparent,
int BitsPerPixel,
byte[] Red,
byte[] Green,
byte[] Blue)
GIFEncode() - encode the image Adapted from ppmtogif, which is based on GIFENCOD by David Rowley |
private int |
GIFNextPixel()
GIFNextPixel() - Return the next pixel from the image |
private int |
MAXCODE(int n_bits)
MAXCODE() - return n bits |
private void |
output(int code,
java.io.FileOutputStream outs)
output() - Output the given code. |
private void |
Putbyte(byte b,
java.io.FileOutputStream outs)
Putbyte() - Write out a byte to the GIF file |
private void |
Putword(int w,
java.io.FileOutputStream outs)
Putword() - Write out a word to the GIF file |
boolean |
writeFile(java.lang.String oGifFileName)
writeFile() - write the Gif encoded image to output file |
private void |
writeGif(java.io.FileOutputStream out)
writeGif() - Saves the image as a GIF file. |
private static void |
writeString(java.io.FileOutputStream out,
java.lang.String str)
writeString() - write string to the file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int EOF
private static final int BITS
private static final int HSIZE
private boolean ok
private boolean interlace
private boolean clear_flg
private int[] htab
private int[] codetab
private int a_count
private int hsize
private int free_ent
private int g_init_bits
private int ClearCode
private int EOFCode
private int width
private int height
private int pixelIndex
private int numPixels
private int n_bits
private int maxbits
private int maxcode
private int maxmaxcode
private int cur_accum
private int cur_bits
private int[] masks
private byte[] accum
private byte[] pixels
private byte[] r
private byte[] g
private byte[] b
Constructor Detail |
---|
public WriteGifEncoder(int width, int height, byte[] pixels, byte[] r, byte[] g, byte[] b)
width
- The image width.height
- The image height.pixels
- The pixel data.r
- The red look-up table.g
- The green look-up table.b
- The blue look-up table.
[Not used in MAExplorer]public WriteGifEncoder(java.awt.Image img)
img
- is the RGB imageMethod Detail |
---|
public boolean writeFile(java.lang.String oGifFileName)
oGifFileName
- is full path of file name to be written
private void writeGif(java.io.FileOutputStream out) throws java.io.IOException
out
- is file output stream
java.io.IOException
private static void writeString(java.io.FileOutputStream out, java.lang.String str) throws java.io.IOException
out
- is file output streamstr
- is string to write
java.io.IOException
private void GIFEncode(java.io.FileOutputStream outs, int Width, int Height, boolean Interlace, byte Background, int Transparent, int BitsPerPixel, byte[] Red, byte[] Green, byte[] Blue) throws java.io.IOException
outs
- is file output streamWidth
- of imageHeight
- of imageInterlace
- flagBackground
- valueTransparent
- flagBitsPerPixel
- bits per pixelRed
- is byte array of dataGreen
- byte array of dataBlue
- is byte array of data
java.io.IOException
private int GIFNextPixel() throws java.io.IOException
java.io.IOException
private void Putword(int w, java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
private void Putbyte(byte b, java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
private final int MAXCODE(int n_bits)
private void compress(int init_bits, java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
private void output(int code, java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
private void cl_block(java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
private void cl_hash(int hsize)
private void char_init()
void char_out(byte c, java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
void flush_char(java.io.FileOutputStream outs) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |