net.sourceforge.jiu.codecs.tiff

Class TIFFDecoderModifiedHuffman


public class TIFFDecoderModifiedHuffman
extends TIFFDecoder

A TIFF decoder for files compresseed with the Modified Huffman method (also known as CCITT 1D Modified Huffman Run Length Encoding). This compression algorithm has the value 2 in the compression tag of an image file directory. Only bilevel images can be encoded with that method.
Author:
Marco Schmidt
Since:
0.9.0

Field Summary

private int
bitBuffer
private DataInput
in
private int
numBufferedBits

Fields inherited from class net.sourceforge.jiu.codecs.tiff.TIFFDecoder

bottomRow, bufferIndex, codec, currentRow, ifd, leftColumn, processedTileRows, rightColumn, rowBuffer, tileIndex, topRow, totalTileRows

Method Summary

void
decode()
private int
decodeBlackRun()
private void
decodeRow(byte[] row)
private int
decodeRun(int[][][] codes, int minCodeSize)
private int
decodeWhiteRun()
Integer[]
getCompressionTypes()
void
initialize()
private int
readBit()
private int
readBits(int number)
private void
reset()

Methods inherited from class net.sourceforge.jiu.codecs.tiff.TIFFDecoder

decode, getBytesPerRow, getCodec, getCompressionTypes, getImageFileDirectory, getInput, getTileIndex, getX1, getX2, getY1, getY2, initialize, putBytes, setCodec, setImageFileDirectory, setTileIndex, storeRow

Field Details

bitBuffer

private int bitBuffer

in

private DataInput in

numBufferedBits

private int numBufferedBits

Method Details

decode

public void decode()
            throws InvalidFileStructureException,
                   IOException
Overrides:
decode in interface TIFFDecoder

decodeBlackRun

private int decodeBlackRun()
            throws InvalidFileStructureException,
                   IOException

decodeRow

private void decodeRow(byte[] row)
            throws InvalidFileStructureException,
                   IOException

decodeRun

private int decodeRun(int[][][] codes,
                      int minCodeSize)
            throws InvalidFileStructureException,
                   IOException

decodeWhiteRun

private int decodeWhiteRun()
            throws InvalidFileStructureException,
                   IOException

getCompressionTypes

public Integer[] getCompressionTypes()
Overrides:
getCompressionTypes in interface TIFFDecoder

initialize

public void initialize()
            throws IOException,
                   MissingParameterException
Overrides:
initialize in interface TIFFDecoder

readBit

private int readBit()
            throws IOException

readBits

private int readBits(int number)
            throws IOException

reset

private void reset()