Package gov.nih.mipav.model.file
Class TIFFLZWDecoder
- java.lang.Object
-
- gov.nih.mipav.model.file.TIFFLZWDecoder
-
public class TIFFLZWDecoder extends java.lang.Object
A class for performing LZW decoding.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int[]
andTable
DOCUMENT ME!(package private) int
bitPointer
DOCUMENT ME!(package private) int
bitsToGet
DOCUMENT ME!(package private) int
bytePointer
DOCUMENT ME!(package private) byte[]
data
DOCUMENT ME!(package private) int
dstIndex
DOCUMENT ME!(package private) int
h
DOCUMENT ME!(package private) int
nextBits
DOCUMENT ME!(package private) int
nextData
DOCUMENT ME!(package private) int
predictor
DOCUMENT ME!(package private) int
samplesPerPixel
DOCUMENT ME!(package private) byte[][]
stringTable
DOCUMENT ME!(package private) int
tableIndex
DOCUMENT ME!(package private) byte[]
uncompData
DOCUMENT ME!(package private) int
w
DOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description TIFFLZWDecoder(int w, int predictor, int samplesPerPixel)
Creates a new TIFFLZWDecoder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStringToTable(byte[] string)
Add a new string to the string table.void
addStringToTable(byte[] oldString, byte newString)
Add a new string to the string table.byte[]
composeString(byte[] oldString, byte newString)
AppendnewString
to the end ofoldString
.byte[]
decode(byte[] data, byte[] uncompData, int h)
Method to decode LZW compressed data.int
getNextCode()
Returns the next 9, 10, 11 or 12 bits.void
initializeStringTable()
Initialize the string table.void
writeString(byte[] string)
Write out the string just uncompressed.
-
-
-
Field Detail
-
andTable
int[] andTable
DOCUMENT ME!
-
bytePointer
int bytePointer
DOCUMENT ME!
-
bitPointer
int bitPointer
DOCUMENT ME!
-
data
byte[] data
DOCUMENT ME!
-
uncompData
byte[] uncompData
DOCUMENT ME!
-
dstIndex
int dstIndex
DOCUMENT ME!
-
nextBits
int nextBits
DOCUMENT ME!
-
nextData
int nextData
DOCUMENT ME!
-
predictor
int predictor
DOCUMENT ME!
-
samplesPerPixel
int samplesPerPixel
DOCUMENT ME!
-
stringTable
byte[][] stringTable
DOCUMENT ME!
-
tableIndex
int tableIndex
DOCUMENT ME!
-
bitsToGet
int bitsToGet
DOCUMENT ME!
-
w
int w
DOCUMENT ME!
-
h
int h
DOCUMENT ME!
-
-
Method Detail
-
addStringToTable
public void addStringToTable(byte[] string)
Add a new string to the string table.- Parameters:
string
- DOCUMENT ME!
-
addStringToTable
public void addStringToTable(byte[] oldString, byte newString)
Add a new string to the string table.- Parameters:
oldString
- DOCUMENT ME!newString
- DOCUMENT ME!
-
composeString
public byte[] composeString(byte[] oldString, byte newString)
AppendnewString
to the end ofoldString
.- Parameters:
oldString
- DOCUMENT ME!newString
- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
decode
public byte[] decode(byte[] data, byte[] uncompData, int h)
Method to decode LZW compressed data.- Parameters:
data
- The compressed data.uncompData
- Array to return the uncompressed data in.h
- The number of rows the compressed data contains.- Returns:
- DOCUMENT ME!
- Throws:
java.lang.UnsupportedOperationException
- DOCUMENT ME!
-
getNextCode
public int getNextCode()
Returns the next 9, 10, 11 or 12 bits.- Returns:
- DOCUMENT ME!
-
initializeStringTable
public void initializeStringTable()
Initialize the string table.
-
writeString
public void writeString(byte[] string)
Write out the string just uncompressed.- Parameters:
string
- DOCUMENT ME!
-
-