Class CCITTFaxEncoderStream
- java.lang.Object
-
- java.io.OutputStream
-
- com.twelvemonkeys.imageio.plugins.tiff.CCITTFaxEncoderStream
-
- All Implemented Interfaces:
java.io.Closeable,java.io.Flushable,java.lang.AutoCloseable
final class CCITTFaxEncoderStream extends java.io.OutputStreamCCITT Modified Huffman RLE, Group 3 (T4) and Group 4 (T6) fax compression.- Version:
- $Id$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCCITTFaxEncoderStream.Code
-
Field Summary
Fields Modifier and Type Field Description static CCITTFaxEncoderStream.Code[]BLACK_NONTERMINATING_CODESstatic CCITTFaxEncoderStream.Code[]BLACK_TERMINATING_CODESprivate int[]changesCurrentRowprivate intchangesCurrentRowLengthprivate int[]changesReferenceRowprivate intchangesReferenceRowLengthprivate intcolumnsprivate intcurrentBufferLengthprivate intcurrentRowprivate intfillOrderprivate byte[]inputBufferprivate intinputBufferLengthprivate booleanoptionG32Dprivate booleanoptionG3Fillprivate booleanoptionUncompressedprivate byteoutputBufferprivate byteoutputBufferBitLengthprivate introwsprivate java.io.OutputStreamstreamprivate inttypestatic CCITTFaxEncoderStream.Code[]WHITE_NONTERMINATING_CODESstatic CCITTFaxEncoderStream.Code[]WHITE_TERMINATING_CODES
-
Constructor Summary
Constructors Constructor Description CCITTFaxEncoderStream(java.io.OutputStream stream, int columns, int rows, int type, int fillOrder, long options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidclearOutputBuffer()voidclose()private voidencode1D()private voidencode2D()private voidencodeRow()private voidencodeRowType2()private voidencodeRowType4()private voidencodeRowType6()private voidfill()voidflush()private int[]getNextChanges(int pos, boolean white)private int[]getNextRefChanges(int a0, boolean white)voidwrite(int b)private voidwrite(int code, int codeLength)private voidwriteEOL()private voidwriteRun(int runLength, boolean white)
-
-
-
Field Detail
-
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
private java.io.OutputStream stream
-
WHITE_TERMINATING_CODES
public static final CCITTFaxEncoderStream.Code[] WHITE_TERMINATING_CODES
-
WHITE_NONTERMINATING_CODES
public static final CCITTFaxEncoderStream.Code[] WHITE_NONTERMINATING_CODES
-
BLACK_TERMINATING_CODES
public static final CCITTFaxEncoderStream.Code[] BLACK_TERMINATING_CODES
-
BLACK_NONTERMINATING_CODES
public static final CCITTFaxEncoderStream.Code[] BLACK_NONTERMINATING_CODES
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Specified by:
writein classjava.io.OutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.OutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.OutputStream- Throws:
java.io.IOException
-
encodeRow
private void encodeRow() throws java.io.IOException- Throws:
java.io.IOException
-
encodeRowType2
private void encodeRowType2() throws java.io.IOException- Throws:
java.io.IOException
-
encodeRowType4
private void encodeRowType4() throws java.io.IOException- Throws:
java.io.IOException
-
encodeRowType6
private void encodeRowType6() throws java.io.IOException- Throws:
java.io.IOException
-
encode1D
private void encode1D() throws java.io.IOException- Throws:
java.io.IOException
-
getNextChanges
private int[] getNextChanges(int pos, boolean white)
-
writeRun
private void writeRun(int runLength, boolean white) throws java.io.IOException- Throws:
java.io.IOException
-
encode2D
private void encode2D() throws java.io.IOException- Throws:
java.io.IOException
-
getNextRefChanges
private int[] getNextRefChanges(int a0, boolean white)
-
write
private void write(int code, int codeLength) throws java.io.IOException- Throws:
java.io.IOException
-
writeEOL
private void writeEOL() throws java.io.IOException- Throws:
java.io.IOException
-
fill
private void fill() throws java.io.IOException- Throws:
java.io.IOException
-
clearOutputBuffer
private void clearOutputBuffer()
-
-