public class TiffReader
extends java.lang.Object
TiffHandler
interface.Constructor and Description |
---|
TiffReader() |
Modifier and Type | Method and Description |
---|---|
private static int |
calculateTagOffset(int ifdStartOffset,
int entryNumber)
Determine the offset of a given tag within the specified IFD.
|
static void |
processIfd(TiffHandler handler,
RandomAccessReader reader,
java.util.Set<java.lang.Integer> processedIfdOffsets,
int ifdOffset,
int tiffHeaderOffset)
Processes a TIFF IFD.
|
private static void |
processTag(TiffHandler handler,
int tagId,
int tagValueOffset,
int componentCount,
int formatCode,
RandomAccessReader reader) |
void |
processTiff(RandomAccessReader reader,
TiffHandler handler,
int tiffHeaderOffset)
Processes a TIFF data sequence.
|
public void processTiff(RandomAccessReader reader, TiffHandler handler, int tiffHeaderOffset) throws TiffProcessingException, java.io.IOException
reader
- the RandomAccessReader
from which the data should be readhandler
- the TiffHandler
that will coordinate processing and accept read valuestiffHeaderOffset
- the offset within reader
at which the TIFF header startsTiffProcessingException
- 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 datapublic static void processIfd(TiffHandler handler, RandomAccessReader reader, java.util.Set<java.lang.Integer> processedIfdOffsets, int ifdOffset, int tiffHeaderOffset) throws java.io.IOException
handler
- the TiffHandler
that will coordinate processing and accept read valuesreader
- the RandomAccessReader
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 within reader
at which the IFD data startstiffHeaderOffset
- the offset within reader
at which the TIFF header startsjava.io.IOException
- an error occurred while accessing the required dataprivate static void processTag(TiffHandler handler, int tagId, int tagValueOffset, int componentCount, int formatCode, RandomAccessReader reader) throws java.io.IOException
java.io.IOException
private static int calculateTagOffset(int ifdStartOffset, int entryNumber)
ifdStartOffset
- the offset at which the IFD startsentryNumber
- the zero-based entry number