Class GifEncoder
public class GifEncoder
extends ImageEncoder
Attributes
final int BITS = 8
int ClearCode
int CountDown
final int EOF = -1
int EOFCode
final int HSIZE = 1024
int Height
boolean Interlace
int Pass = 0
int Width
int a_count
byte[] accum = new byte[256]
boolean clear_flg = false
int[] codetab = new int[HSIZE]
protected IntHashtable colorHash = null
int cur_accum = 0
int cur_bits = 0
int curx
int cury
int free_ent = 0
int g_init_bits
int height
int hsize = HSIZE
int[] htab = new int[HSIZE]
private boolean interlace = false
int[] masks = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F,
0x001F, 0x003F, 0x007F, 0x00FF,
0x01FF, 0x03FF, 0x07FF, 0x0FFF,
0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }
int maxbits = BITS
int maxcode
int maxmaxcode = 1 << BITS
int n_bits
int[][] rgbPixels
int width
Operations
void BumpPixel()
void GIFEncode(OutputStream outs, int Width, int Height, boolean Interlace, byte Background, int Transparent, int BitsPerPixel, byte[] Red, byte[] Green, byte[] Blue)
int GIFNextPixel()
byte GetPixel(int x, int y)
public GifEncoder(Image img, OutputStream out)
public GifEncoder(Image img, OutputStream out, boolean interlace)
public GifEncoder(ImageProducer prod, OutputStream out)
public GifEncoder(ImageProducer prod, OutputStream out, boolean interlace)
final int MAXCODE(int n_bits)
void Putbyte(byte b, OutputStream outs)
void Putword(int w, OutputStream outs)
void char_init()
void char_out(byte c, OutputStream outs)
void cl_block(OutputStream outs)
void cl_hash(int hsize)
void compress(int init_bits, OutputStream outs)
void encodeDone()
void encodePixels(int x, int y, int w, int h, int[] rgbPixels, int off, int scansize)
void encodeStart(int width, int height)
void flush_char(OutputStream outs)
void output(int code, OutputStream outs)
void writeString(OutputStream out, String str)