Class TIFFLZWDecompressor
- java.lang.Object
-
- com.github.jaiimageio.plugins.tiff.TIFFDecompressor
-
- com.github.jaiimageio.impl.plugins.tiff.TIFFLZWDecompressor
-
public class TIFFLZWDecompressor extends TIFFDecompressor
-
-
Field Summary
Fields Modifier and Type Field Description private static int[]
andTable
(package private) int
bitsToGet
private static boolean
DEBUG
(package private) byte[]
dstData
(package private) int
dstIndex
(package private) boolean
isLSB
(package private) int
nextBits
(package private) int
nextData
(package private) int
predictor
(package private) byte[]
srcData
(package private) int
srcIndex
(package private) byte[][]
stringTable
(package private) int
tableIndex
private static boolean
TRACE
-
Fields inherited from class com.github.jaiimageio.plugins.tiff.TIFFDecompressor
activeSrcHeight, activeSrcMinX, activeSrcMinY, activeSrcWidth, bitsPerSample, byteCount, colorConverter, colorMap, compression, destinationBands, dstHeight, dstMinX, dstMinY, dstWidth, dstXOffset, dstYOffset, extraSamples, image, metadata, offset, photometricInterpretation, planar, rawImage, reader, sampleFormat, samplesPerPixel, sourceBands, sourceXOffset, sourceYOffset, srcHeight, srcMinX, srcMinY, srcWidth, stream, subsampleX, subsampleY
-
-
Constructor Summary
Constructors Constructor Description TIFFLZWDecompressor(int predictor)
-
Method Summary
All Methods Static 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
.int
decode(byte[] sdata, int srcOffset, byte[] ddata, int dstOffset)
void
decodeRaw(byte[] b, int dstOffset, int bitsPerPixel, int scanlineStride)
Decodes the source data into the providedbyte
arrayb
, starting at the offset given bydstOffset
.static void
generateBitsreverseBits()
int
getNextCode()
void
initializeStringTable()
Initialize the string table.int
reverseBits(int inp)
void
writeString(byte[] string)
Write out the string just uncompressed.-
Methods inherited from class com.github.jaiimageio.plugins.tiff.TIFFDecompressor
beginDecoding, createRawImage, decode, decodeRaw, decodeRaw, decodeRaw, getRawImageType, getRawImageTypeSpecifier, setActiveSrcHeight, setActiveSrcMinX, setActiveSrcMinY, setActiveSrcWidth, setBitsPerSample, setByteCount, setColorConverter, setColorMap, setCompression, setDestinationBands, setDstHeight, setDstMinX, setDstMinY, setDstWidth, setDstXOffset, setDstYOffset, setExtraSamples, setImage, setMetadata, setOffset, setPhotometricInterpretation, setPlanar, setReader, setSampleFormat, setSamplesPerPixel, setSourceBands, setSourceXOffset, setSourceYOffset, setSrcHeight, setSrcMinX, setSrcMinY, setSrcWidth, setStream, setSubsampleX, setSubsampleY
-
-
-
-
Field Detail
-
DEBUG
private static final boolean DEBUG
- See Also:
- Constant Field Values
-
TRACE
private static final boolean TRACE
- See Also:
- Constant Field Values
-
andTable
private static final int[] andTable
-
predictor
int predictor
-
srcData
byte[] srcData
-
dstData
byte[] dstData
-
srcIndex
int srcIndex
-
dstIndex
int dstIndex
-
stringTable
byte[][] stringTable
-
tableIndex
int tableIndex
-
bitsToGet
int bitsToGet
-
nextData
int nextData
-
nextBits
int nextBits
-
isLSB
boolean isLSB
-
-
Method Detail
-
decodeRaw
public void decodeRaw(byte[] b, int dstOffset, int bitsPerPixel, int scanlineStride) throws java.io.IOException
Description copied from class:TIFFDecompressor
Decodes the source data into the providedbyte
arrayb
, starting at the offset given bydstOffset
. Each pixel occupiesbitsPerPixel
bits, with no padding between pixels. Scanlines are separated byscanlineStride
byte
s.- Specified by:
decodeRaw
in classTIFFDecompressor
- Parameters:
b
- abyte
array to be written.dstOffset
- the starting offset inb
to be written.bitsPerPixel
- the number of bits for each pixel.scanlineStride
- the number ofbyte
s to advance between that starting pixels of each scanline.- Throws:
java.io.IOException
- if an error occurs reading from the sourceImageInputStream
.
-
decode
public int decode(byte[] sdata, int srcOffset, byte[] ddata, int dstOffset) throws java.io.IOException
- Throws:
java.io.IOException
-
initializeStringTable
public void initializeStringTable()
Initialize the string table.
-
writeString
public void writeString(byte[] string)
Write out the string just uncompressed.
-
addStringToTable
public void addStringToTable(byte[] oldString, byte newString)
Add a new string to the string table.
-
addStringToTable
public void addStringToTable(byte[] string)
Add a new string to the string table.
-
composeString
public byte[] composeString(byte[] oldString, byte newString)
AppendnewString
to the end ofoldString
.
-
reverseBits
public int reverseBits(int inp)
-
generateBitsreverseBits
public static void generateBitsreverseBits()
-
getNextCode
public int getNextCode()
-
-