Class CCITTFaxEncoderStream
java.lang.Object
java.io.OutputStream
com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxEncoderStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
CCITT Modified Huffman RLE, Group 3 (T4) and Group 4 (T6) fax compression.
- Version:
- $Id$
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CCITTFaxEncoderStream.Code[]
static final CCITTFaxEncoderStream.Code[]
private int[]
private int
private int[]
private int
private int
private int
private int
private int
private final byte[]
private final int
private boolean
private boolean
private boolean
private byte
private byte
private int
private OutputStream
private int
static final CCITTFaxEncoderStream.Code[]
static final CCITTFaxEncoderStream.Code[]
-
Constructor Summary
ConstructorsConstructorDescriptionCCITTFaxEncoderStream
(OutputStream stream, int columns, int rows, int type, int fillOrder, long options) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
void
close()
private void
encode1D()
private void
encode2D()
private void
private void
private void
private void
private void
fill()
void
flush()
private int[]
getNextChanges
(int pos, boolean white) private int[]
getNextRefChanges
(int a0, boolean white) void
write
(int b) private void
write
(int code, int codeLength) private void
writeEOL()
private void
writeRun
(int runLength, boolean white) Methods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Field Details
-
currentBufferLength
private int currentBufferLength -
inputBuffer
private final byte[] inputBuffer -
inputBufferLength
private final int inputBufferLength -
columns
private int columns -
rows
private int rows -
changesCurrentRow
private int[] changesCurrentRow -
changesReferenceRow
private int[] changesReferenceRow -
currentRow
private int currentRow -
changesCurrentRowLength
private int changesCurrentRowLength -
changesReferenceRowLength
private int changesReferenceRowLength -
outputBuffer
private byte outputBuffer -
outputBufferBitLength
private byte outputBufferBitLength -
type
private int type -
fillOrder
private int fillOrder -
optionG32D
private boolean optionG32D -
optionG3Fill
private boolean optionG3Fill -
optionUncompressed
private boolean optionUncompressed -
stream
-
WHITE_TERMINATING_CODES
-
WHITE_NONTERMINATING_CODES
-
BLACK_TERMINATING_CODES
-
BLACK_NONTERMINATING_CODES
-
-
Constructor Details
-
CCITTFaxEncoderStream
public CCITTFaxEncoderStream(OutputStream stream, int columns, int rows, int type, int fillOrder, long options)
-
-
Method Details
-
write
- Specified by:
write
in classOutputStream
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classOutputStream
- Throws:
IOException
-
encodeRow
- Throws:
IOException
-
encodeRowType2
- Throws:
IOException
-
encodeRowType4
- Throws:
IOException
-
encodeRowType6
- Throws:
IOException
-
encode1D
- Throws:
IOException
-
getNextChanges
private int[] getNextChanges(int pos, boolean white) -
writeRun
- Throws:
IOException
-
encode2D
- Throws:
IOException
-
getNextRefChanges
private int[] getNextRefChanges(int a0, boolean white) -
write
- Throws:
IOException
-
writeEOL
- Throws:
IOException
-
fill
- Throws:
IOException
-
clearOutputBuffer
private void clearOutputBuffer()
-