final class LZWCodec
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) int |
bitsLeft |
(package private) int |
bitsPerPixel |
(package private) byte[] |
block |
(package private) int |
blockIndex |
(package private) int |
blockSize |
(package private) int |
clearCode |
(package private) int |
codeMask |
(package private) int |
codeSize |
(package private) int |
currentByte |
(package private) int |
currentSlot |
(package private) int |
endCode |
(package private) ImageData |
image |
(package private) int |
imageHeight |
(package private) int |
imageWidth |
(package private) int |
imageX |
(package private) int |
imageY |
(package private) LEDataInputStream |
inputStream |
(package private) boolean |
interlaced |
(package private) int |
line |
(package private) byte[] |
lineArray |
(package private) ImageLoader |
loader |
(package private) static int[] |
MASK_TABLE |
(package private) int |
newCodes |
(package private) LZWNode[] |
nodeStack |
(package private) LEDataOutputStream |
outputStream |
(package private) int |
pass |
(package private) int[] |
prefix |
(package private) int[] |
stack |
(package private) int[] |
suffix |
(package private) int |
topSlot |
Constructor and Description |
---|
LZWCodec() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
copyRow(byte[] buf,
int copies)
Copy duplicate rows of pixel values to the image.
|
(package private) void |
decode()
Decode the input.
|
void |
decode(LEDataInputStream inputStream,
ImageLoader loader,
ImageData image,
boolean interlaced,
int depth)
Decode the LZW-encoded bytes in the given byte stream
into the given DeviceIndependentImage.
|
(package private) void |
encode()
Encode the image.
|
void |
encode(LEDataOutputStream byteStream,
ImageData image)
Encode the bytes into the given byte stream
from the given DeviceIndependentImage.
|
(package private) int |
encodeLoop()
Encoding loop broken out to allow early return.
|
(package private) void |
initializeForDecoding()
Initialize the receiver for decoding the given
byte array.
|
(package private) void |
initializeForEncoding()
Initialize the receiver for encoding the given
byte array.
|
(package private) int |
nextCode()
Answer the next code from the input byte array.
|
(package private) int |
nextPixel()
Answer the next pixel to encode in the image
|
(package private) void |
nextPixels(byte[] buf,
int lineWidth)
Copy a row of pixel values from the image.
|
(package private) void |
nextPutCode(int aCode)
Output aCode to the output stream.
|
(package private) void |
nextPutPixels(byte[] buf)
Copy a row of pixel values to the image.
|
(package private) int |
readBlock()
Read a block from the byte stream.
|
(package private) void |
writeBlock()
Write a block to the byte stream.
|
int bitsPerPixel
int blockSize
int blockIndex
int currentByte
int bitsLeft
int codeSize
int clearCode
int endCode
int newCodes
int topSlot
int currentSlot
int imageWidth
int imageHeight
int imageX
int imageY
int pass
int line
int codeMask
byte[] block
byte[] lineArray
int[] stack
int[] suffix
int[] prefix
LZWNode[] nodeStack
LEDataInputStream inputStream
LEDataOutputStream outputStream
ImageData image
ImageLoader loader
boolean interlaced
static final int[] MASK_TABLE
void decode()
public void decode(LEDataInputStream inputStream, ImageLoader loader, ImageData image, boolean interlaced, int depth)
void encode()
public void encode(LEDataOutputStream byteStream, ImageData image)
int encodeLoop()
void initializeForDecoding()
void initializeForEncoding()
int nextCode()
int nextPixel()
void nextPixels(byte[] buf, int lineWidth)
void nextPutCode(int aCode)
void nextPutPixels(byte[] buf)
void copyRow(byte[] buf, int copies)
int readBlock()
void writeBlock()