Package com.drew.imaging.tiff
Class TiffReader
- java.lang.Object
-
- com.drew.imaging.tiff.TiffReader
-
public class TiffReader extends java.lang.Object
Processes TIFF-formatted data, calling into client code via thatTiffHandler
interface.
-
-
Constructor Summary
Constructors Constructor Description TiffReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
processIfd(TiffHandler handler, RandomAccessReader reader, java.util.Set<java.lang.Integer> processedIfdOffsets, int ifdOffset, int tiffHeaderOffset)
Processes a TIFF IFD.void
processTiff(RandomAccessReader reader, TiffHandler handler, int tiffHeaderOffset)
Processes a TIFF data sequence.
-
-
-
Method Detail
-
processTiff
public void processTiff(RandomAccessReader reader, TiffHandler handler, int tiffHeaderOffset) throws TiffProcessingException, java.io.IOException
Processes a TIFF data sequence.- Parameters:
reader
- theRandomAccessReader
from which the data should be readhandler
- theTiffHandler
that will coordinate processing and accept read valuestiffHeaderOffset
- the offset withinreader
at which the TIFF header starts- Throws:
TiffProcessingException
- if an error occurred during the processing of TIFF data that could not be ignored or recovered fromjava.io.IOException
- an error occurred while accessing the required data
-
processIfd
public static void processIfd(TiffHandler handler, RandomAccessReader reader, java.util.Set<java.lang.Integer> processedIfdOffsets, int ifdOffset, int tiffHeaderOffset) throws java.io.IOException
Processes a TIFF IFD. IFD Header:- 2 bytes number of tags
- 2 bytes tag type
- 2 bytes format code (values 1 to 12, inclusive)
- 4 bytes component count
- 4 bytes inline value, or offset pointer if too large to fit in four bytes
- Parameters:
handler
- theTiffHandler
that will coordinate processing and accept read valuesreader
- theRandomAccessReader
from which the data should be readprocessedIfdOffsets
- the set of visited IFD offsets, to avoid revisiting the same IFD in an endless loopifdOffset
- the offset withinreader
at which the IFD data startstiffHeaderOffset
- the offset withinreader
at which the TIFF header starts- Throws:
java.io.IOException
- an error occurred while accessing the required data
-
-