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) intbitsToGetprivate static booleanDEBUG(package private) byte[]dstData(package private) intdstIndex(package private) booleanisLSB(package private) intnextBits(package private) intnextData(package private) intpredictor(package private) byte[]srcData(package private) intsrcIndex(package private) byte[][]stringTable(package private) inttableIndexprivate static booleanTRACE-
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 voidaddStringToTable(byte[] string)Add a new string to the string table.voidaddStringToTable(byte[] oldString, byte newString)Add a new string to the string table.byte[]composeString(byte[] oldString, byte newString)AppendnewStringto the end ofoldString.intdecode(byte[] sdata, int srcOffset, byte[] ddata, int dstOffset)voiddecodeRaw(byte[] b, int dstOffset, int bitsPerPixel, int scanlineStride)Decodes the source data into the providedbytearrayb, starting at the offset given bydstOffset.static voidgenerateBitsreverseBits()intgetNextCode()voidinitializeStringTable()Initialize the string table.intreverseBits(int inp)voidwriteString(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.IOExceptionDescription copied from class:TIFFDecompressorDecodes the source data into the providedbytearrayb, starting at the offset given bydstOffset. Each pixel occupiesbitsPerPixelbits, with no padding between pixels. Scanlines are separated byscanlineStridebytes.- Specified by:
decodeRawin classTIFFDecompressor- Parameters:
b- abytearray to be written.dstOffset- the starting offset inbto be written.bitsPerPixel- the number of bits for each pixel.scanlineStride- the number ofbytes 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)AppendnewStringto the end ofoldString.
-
reverseBits
public int reverseBits(int inp)
-
generateBitsreverseBits
public static void generateBitsreverseBits()
-
getNextCode
public int getNextCode()
-
-