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.OutputStream
CCITT 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 class
CCITTFaxEncoderStream.Code
-
Field Summary
Fields Modifier and Type Field Description static CCITTFaxEncoderStream.Code[]
BLACK_NONTERMINATING_CODES
static CCITTFaxEncoderStream.Code[]
BLACK_TERMINATING_CODES
private int[]
changesCurrentRow
private int
changesCurrentRowLength
private int[]
changesReferenceRow
private int
changesReferenceRowLength
private int
columns
private int
currentBufferLength
private int
currentRow
private int
fillOrder
private byte[]
inputBuffer
private int
inputBufferLength
private boolean
optionG32D
private boolean
optionG3Fill
private boolean
optionUncompressed
private byte
outputBuffer
private byte
outputBufferBitLength
private int
rows
private java.io.OutputStream
stream
private int
type
static CCITTFaxEncoderStream.Code[]
WHITE_NONTERMINATING_CODES
static 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 void
clearOutputBuffer()
void
close()
private void
encode1D()
private void
encode2D()
private void
encodeRow()
private void
encodeRowType2()
private void
encodeRowType4()
private void
encodeRowType6()
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)
-
-
-
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:
write
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Overrides:
flush
in classjava.io.OutputStream
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in 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()
-
-