public class GifImageGenerator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
firstFree |
protected int |
freeCode |
protected int |
need |
protected int[][] |
StrTab |
Constructor and Description |
---|
GifImageGenerator() |
Modifier and Type | Method and Description |
---|---|
protected int |
addCodeToBuffer(int code,
int n,
byte[] buf,
int pos)
Adds the code to buffer adjusting for the bit offset.
|
protected void |
initTable()
Initializes the string table with first,next as unassigned
|
protected int |
lookupCode(int code,
int c)
Looks up a code
Take the current code and see if there is a longer string
that contains the new character.
|
byte[] |
makeGifImage(java.awt.Image image)
Makes a gif image from the passed image.
|
protected int need
protected int firstFree
protected int freeCode
protected int[][] StrTab
public byte[] makeGifImage(java.awt.Image image)
image
- The image to convertprotected int lookupCode(int code, int c)
code
- The code to lookupc
- The next characterprotected int addCodeToBuffer(int code, int n, byte[] buf, int pos)
code
- The code to addn
- The number of bits in the codebuf
- The bufferpos
- The current byte positionprotected void initTable()