Class CCITTFaxDecoderStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxDecoderStream
- All Implemented Interfaces:
Closeable, AutoCloseable
CCITT Modified Huffman RLE, Group 3 (T4) and Group 4 (T6) fax compression.
- Version:
- $Id: CCITTFaxDecoderStream.java,v 1.0 23.05.12 15:55 haraldk Exp$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final short[][](package private) static final short[][](package private) static final CCITTFaxDecoderStream.Tree(package private) int(package private) intprivate int[]private intprivate int[]private int(package private) static final CCITTFaxDecoderStream.Treeprivate final intprivate intprivate intprivate final byte[](package private) static final CCITTFaxDecoderStream.Node(package private) static final CCITTFaxDecoderStream.Tree(package private) static final CCITTFaxDecoderStream.Nodeprivate intprivate final booleanprivate final booleanprivate final booleanprivate final booleanprivate intprivate final int(package private) static final int(package private) static final int(package private) static final int(package private) static final intstatic final short[][]static final short[][](package private) static final CCITTFaxDecoderStream.TreeFields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionCCITTFaxDecoderStream(InputStream stream, int columns, int rows, int type, long options, boolean byteAligned) CCITTFaxDecoderStream(InputStream stream, int columns, int type, long options) Creates a CCITTFaxDecoderStream.CCITTFaxDecoderStream(InputStream stream, int columns, int type, long options, boolean byteAligned) Creates a CCITTFaxDecoderStream. -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddecode1D()private voiddecode2D()private voidprivate voidprivate voidprivate voidprivate intprivate voidfetch()(package private) static intfindCompressionType(int encodedType, InputStream stream) private intgetNextChangingElement(int a0, boolean white) booleanintread()intread(byte[] b, int off, int len) private booleanreadBit()voidreset()private voidlongskip(long n) Methods inherited from class FilterInputStream
available, close, mark, readMethods inherited from class InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Field Details
-
columns
private final int columns -
rowsLeft
private int rowsLeft -
decodedRow
private final byte[] decodedRow -
optionG32D
private final boolean optionG32D -
optionG3Fill
private final boolean optionG3Fill -
optionUncompressed
private final boolean optionUncompressed -
optionByteAligned
private final boolean optionByteAligned -
type
private final int type -
decodedLength
private int decodedLength -
decodedPos
private int decodedPos -
changesReferenceRow
private int[] changesReferenceRow -
changesCurrentRow
private int[] changesCurrentRow -
changesReferenceRowCount
private int changesReferenceRowCount -
changesCurrentRowCount
private int changesCurrentRowCount -
lastChangingElement
private int lastChangingElement -
buffer
int buffer -
bufferPos
int bufferPos -
BLACK_CODES
static final short[][] BLACK_CODES -
BLACK_RUN_LENGTHS
static final short[][] BLACK_RUN_LENGTHS -
WHITE_CODES
public static final short[][] WHITE_CODES -
WHITE_RUN_LENGTHS
public static final short[][] WHITE_RUN_LENGTHS -
EOL
-
FILL
-
blackRunTree
-
whiteRunTree
-
eolOnlyTree
-
codeTree
-
VALUE_EOL
static final int VALUE_EOL- See Also:
-
VALUE_FILL
static final int VALUE_FILL- See Also:
-
VALUE_PASSMODE
static final int VALUE_PASSMODE- See Also:
-
VALUE_HMODE
static final int VALUE_HMODE- See Also:
-
-
Constructor Details
-
CCITTFaxDecoderStream
Creates a CCITTFaxDecoderStream.- Parameters:
stream- the compressed CCITT stream.columns- the number of columns in the stream.type- the type of stream, must be one ofCOMPRESSION_CCITT_MODIFIED_HUFFMAN_RLE,COMPRESSION_CCITT_T4orCOMPRESSION_CCITT_T6.options- CCITT T.4 or T.6 options.
-
CCITTFaxDecoderStream
public CCITTFaxDecoderStream(InputStream stream, int columns, int type, long options, boolean byteAligned) Creates a CCITTFaxDecoderStream. This constructor may be used for CCITT streams embedded in PDF files, which use EncodedByteAlign.- Parameters:
stream- the compressed CCITT stream.columns- the number of columns in the stream.type- the type of stream, must be one ofCOMPRESSION_CCITT_MODIFIED_HUFFMAN_RLE,COMPRESSION_CCITT_T4orCOMPRESSION_CCITT_T6.options- CCITT T.4 or T.6 options.byteAligned- enable byte alignment used in PDF files (EncodedByteAlign).
-
CCITTFaxDecoderStream
CCITTFaxDecoderStream(InputStream stream, int columns, int rows, int type, long options, boolean byteAligned)
-
-
Method Details
-
findCompressionType
- Throws:
IOException
-
fetch
- Throws:
IOException
-
decode1D
- Throws:
IOException
-
decode2D
- Throws:
IOException
-
getNextChangingElement
private int getNextChangingElement(int a0, boolean white) -
decodeRowType2
- Throws:
IOException
-
decodeRowType4
- Throws:
IOException
-
decodeRowType6
- Throws:
IOException
-
decodeRow
- Throws:
IOException
-
decodeRun
- Throws:
IOException
-
resetBuffer
- Throws:
IOException
-
readBit
- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classFilterInputStream- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupportedin classFilterInputStream
-
reset
- Overrides:
resetin classFilterInputStream- Throws:
IOException
-