Package net.sourceforge.jiu.codecs.tiff
Class TIFFDecoderLogLuv
- java.lang.Object
-
- net.sourceforge.jiu.codecs.tiff.TIFFDecoder
-
- net.sourceforge.jiu.codecs.tiff.TIFFDecoderLogLuv
-
public class TIFFDecoderLogLuv extends TIFFDecoder
A TIFF decoder for files compressed with the LogLuv RLE method. This compression algorithm has the value34676(TIFFConstants.COMPRESSION_SGI_LOG_RLE) in the compression tag of an image file directory. Only image data with a photometric interpretation value ofTIFFConstants.PHOTOMETRIC_TRUECOLOR_LOGLUVcan be compressed with this method.This implementation is based on the file
tif_luv.cwhich is part of the TIFF library libtiff. The original implementation was written by Greg W. Larson.Learn more about the color type and its encoding on Greg's page LogLuv Encoding for TIFF Images. You will also find numerous sample image files there.
- Since:
- 0.10.0
- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private intcompressedSizeprivate DataInputinprivate booleanrleprivate inttileWidth
-
Constructor Summary
Constructors Constructor Description TIFFDecoderLogLuv()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddecode()Decode data from input and write the decompressed pixel data to the image associated with this decoder.private voiddecodeRow(byte[] row)private voiddecodeRowPacked24(byte[] row)private voiddecodeRowRLE(byte[] row)Integer[]getCompressionTypes()Returns an array with Integer values of all compression types supported by this decoder (see the COMPRESSION_xyz constants inTIFFConstants.voidinitialize()Check if all necessary parameters have been given to this decoder and initialize several internal fields from them.-
Methods inherited from class net.sourceforge.jiu.codecs.tiff.TIFFDecoder
getBytesPerRow, getCodec, getImageFileDirectory, getInput, getTileIndex, getX1, getX2, getY1, getY2, putBytes, setCodec, setImageFileDirectory, setTileIndex
-
-
-
-
Field Detail
-
in
private DataInput in
-
compressedSize
private int compressedSize
-
tileWidth
private int tileWidth
-
rle
private boolean rle
-
-
Method Detail
-
decode
public void decode() throws InvalidFileStructureException, IOExceptionDescription copied from class:TIFFDecoderDecode data from input and write the decompressed pixel data to the image associated with this decoder. Child classes must override this method to implement the decoding for a particular compression type.- Specified by:
decodein classTIFFDecoder- Throws:
InvalidFileStructureExceptionIOException
-
decodeRow
private void decodeRow(byte[] row) throws InvalidFileStructureException, IOException
-
decodeRowPacked24
private void decodeRowPacked24(byte[] row) throws InvalidFileStructureException, IOException
-
decodeRowRLE
private void decodeRowRLE(byte[] row) throws InvalidFileStructureException, IOException
-
getCompressionTypes
public Integer[] getCompressionTypes()
Description copied from class:TIFFDecoderReturns an array with Integer values of all compression types supported by this decoder (see the COMPRESSION_xyz constants inTIFFConstants. Normally, this is only one value, but some compression types got assigned more than one constant (e.g. deflated). Also, a decoder could be capable of dealing with more than one type of compression if the compression types are similar enough to justify that. However, typically a decoder can only deal with one type of compression.- Specified by:
getCompressionTypesin classTIFFDecoder- Returns:
- array with Integer objects of all TIFF compression constants supported by this decoder
-
initialize
public void initialize() throws IOException, MissingParameterExceptionDescription copied from class:TIFFDecoderCheck if all necessary parameters have been given to this decoder and initialize several internal fields from them. Required parameters are a TIFFCodec object, a TIFFImageFileDirectory object and a tile index.- Overrides:
initializein classTIFFDecoder- Throws:
IOExceptionMissingParameterException
-
-