Package net.sourceforge.jiu.codecs.tiff
Class TIFFDecoderDeflated
- java.lang.Object
-
- net.sourceforge.jiu.codecs.tiff.TIFFDecoder
-
- net.sourceforge.jiu.codecs.tiff.TIFFDecoderDeflated
-
public class TIFFDecoderDeflated extends TIFFDecoder
A TIFF decoder for files compressed with the Deflated method. This compression algorithm has the values31946
(TIFFConstants.COMPRESSION_DEFLATED_INOFFICIAL
) and8
(TIFFConstants.COMPRESSION_DEFLATED_OFFICIAL
) in the compression tag of an image file directory. All types of image data can be compressed with this method.This decoder makes use of the package java.util.zip which comes with an Inflater class that does most of the work. All the decoder has to do is feed the Inflater object with compressed data from the input file and give decompressed data received from the Inflater to the putBytes method.
- Since:
- 0.9.0
- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private int
compressedSize
private DataInput
in
-
Constructor Summary
Constructors Constructor Description TIFFDecoderDeflated()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decode()
Decode data from input and write the decompressed pixel data to the image associated with this decoder.Integer[]
getCompressionTypes()
Returns an array with Integer values of all compression types supported by this decoder (see the COMPRESSION_xyz constants inTIFFConstants
.void
initialize()
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
-
-
Method Detail
-
decode
public void decode() throws InvalidFileStructureException, IOException
Description copied from class:TIFFDecoder
Decode 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:
decode
in classTIFFDecoder
- Throws:
InvalidFileStructureException
IOException
-
getCompressionTypes
public Integer[] getCompressionTypes()
Description copied from class:TIFFDecoder
Returns 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:
getCompressionTypes
in classTIFFDecoder
- Returns:
- array with Integer objects of all TIFF compression constants supported by this decoder
-
initialize
public void initialize() throws IOException, MissingParameterException
Description copied from class:TIFFDecoder
Check 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:
initialize
in classTIFFDecoder
- Throws:
IOException
MissingParameterException
-
-