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 class
private 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) int
private int[]
private int
private int[]
private int
(package private) static final CCITTFaxDecoderStream.Tree
private final int
private int
private int
private final byte[]
(package private) static final CCITTFaxDecoderStream.Node
(package private) static final CCITTFaxDecoderStream.Tree
(package private) static final CCITTFaxDecoderStream.Node
private int
private final boolean
private final boolean
private final boolean
private final boolean
private int
private final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
static final short[][]
static final short[][]
(package private) static final CCITTFaxDecoderStream.Tree
Fields inherited from class java.io.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 void
decode1D()
private void
decode2D()
private void
private void
private void
private void
private int
private void
fetch()
(package private) static int
findCompressionType
(int encodedType, InputStream stream) private int
getNextChangingElement
(int a0, boolean white) boolean
int
read()
int
read
(byte[] b, int off, int len) private boolean
readBit()
void
reset()
private void
long
skip
(long n) Methods inherited from class java.io.FilterInputStream
available, close, mark, read
Methods inherited from class java.io.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_T4
orCOMPRESSION_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_T4
orCOMPRESSION_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:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
skip
- Overrides:
skip
in classFilterInputStream
- Throws:
IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classFilterInputStream
-
reset
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-