Class TIFFFaxCompressor
java.lang.Object
com.sun.media.imageio.plugins.tiff.TIFFCompressor
com.sun.media.imageioimpl.plugins.tiff.TIFFFaxCompressor
- Direct Known Subclasses:
TIFFRLECompressor,TIFFT4Compressor,TIFFT6Compressor
-
Field Summary
FieldsModifier and TypeFieldDescriptionintOutput bit buffer.static final intThe CCITT numerical definition of black.static byte[]static int[][]Black and white horizontal mode table.static int[]Horizontal mode table.booleanWhether bits are inserted in reverse order (TIFF FillOrder 2).static int[][]Black and white make-up code table.static int[]Make-up codes for black runs.static int[]Make-up codes for white runs.intNumber of bits in the output bit buffer.static int[][]Black and white pass mode table.static int[]Pass mode table.static int[][]Black and white terminating code table.static int[]Terminating codes for black runs.static int[]Terminating codes for white runs.static int[][]Black and white vertical mode table.static int[]Vertical mode table.static final intThe CCITT numerical definition of white.Fields inherited from class com.sun.media.imageio.plugins.tiff.TIFFCompressor
compressionTagValue, compressionType, isCompressionLossless, metadata, stream, writer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTIFFFaxCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionintadd1DBits(byte[] buf, int where, int count, int color) Get code for run and add to compressed bitstream.intadd2DBits(byte[] buf, int where, int[][] mode, int entry) Place entry from mode table into compressed bitstream.intaddEOFB(byte[] buf, int where) Add an End-of-Facsimile-Block (EOFB == 0x001001) to the compressed bitstream.intaddEOL(boolean is1DMode, boolean addFill, boolean add1, byte[] buf, int where) Add an End-of-Line (EOL == 0x001) to the compressed bitstream with optional byte alignment.intencode1D(byte[] data, int rowOffset, int colOffset, int rowLength, byte[] compData, int compOffset) One-dimensionally encode a row of data using CCITT Huffman compression.voidInitialize bit buffer machinery.intnextState(byte[] data, int base, int bitOffset, int maxOffset) Return min ofmaxOffsetor offset of first pixel different from pixel atbitOffset.voidsetMetadata(IIOMetadata metadata) Sets the value of themetadatafield.Methods inherited from class com.sun.media.imageio.plugins.tiff.TIFFCompressor
encode, getCompressionTagValue, getCompressionType, getMetadata, getStream, getWriter, isCompressionLossless, setStream, setWriter
-
Field Details
-
WHITE
public static final int WHITEThe CCITT numerical definition of white.- See Also:
-
BLACK
public static final int BLACKThe CCITT numerical definition of black.- See Also:
-
byteTable
public static byte[] byteTable -
termCodesBlack
public static int[] termCodesBlackTerminating codes for black runs. -
termCodesWhite
public static int[] termCodesWhiteTerminating codes for white runs. -
makeupCodesBlack
public static int[] makeupCodesBlackMake-up codes for black runs. -
makeupCodesWhite
public static int[] makeupCodesWhiteMake-up codes for white runs. -
passMode
public static int[] passModePass mode table. -
vertMode
public static int[] vertModeVertical mode table. -
horzMode
public static int[] horzModeHorizontal mode table. -
termCodes
public static int[][] termCodesBlack and white terminating code table. -
makeupCodes
public static int[][] makeupCodesBlack and white make-up code table. -
pass
public static int[][] passBlack and white pass mode table. -
vert
public static int[][] vertBlack and white vertical mode table. -
horz
public static int[][] horzBlack and white horizontal mode table. -
inverseFill
public boolean inverseFillWhether bits are inserted in reverse order (TIFF FillOrder 2). -
bits
public int bitsOutput bit buffer. -
ndex
public int ndexNumber of bits in the output bit buffer.
-
-
Constructor Details
-
TIFFFaxCompressor
protected TIFFFaxCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless) Constructor. The superclass constructor is merely invoked with the same parameters.
-
-
Method Details
-
setMetadata
Sets the value of themetadatafield.The implementation in this class also sets local options from the FILL_ORDER field if it exists.
- Overrides:
setMetadatain classTIFFCompressor- Parameters:
metadata- theIIOMetadataobject for the image being written.- See Also:
-
nextState
public int nextState(byte[] data, int base, int bitOffset, int maxOffset) Return min ofmaxOffsetor offset of first pixel different from pixel atbitOffset. -
initBitBuf
public void initBitBuf()Initialize bit buffer machinery. -
add1DBits
public int add1DBits(byte[] buf, int where, int count, int color) Get code for run and add to compressed bitstream. -
add2DBits
public int add2DBits(byte[] buf, int where, int[][] mode, int entry) Place entry from mode table into compressed bitstream. -
addEOL
public int addEOL(boolean is1DMode, boolean addFill, boolean add1, byte[] buf, int where) Add an End-of-Line (EOL == 0x001) to the compressed bitstream with optional byte alignment. -
addEOFB
public int addEOFB(byte[] buf, int where) Add an End-of-Facsimile-Block (EOFB == 0x001001) to the compressed bitstream. -
encode1D
public int encode1D(byte[] data, int rowOffset, int colOffset, int rowLength, byte[] compData, int compOffset) One-dimensionally encode a row of data using CCITT Huffman compression. The bit buffer should be initialized as required before invoking this method and should be flushed after the method returns. The fill order is always highest-order to lowest-order bit so the calling routine should handle bit inversion.
-