Class TiffDirectory
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.apache.commons.imaging.formats.tiff.AbstractTiffElementAbstractTiffElement.DataElement, AbstractTiffElement.Stub
- 
Field SummaryFieldsFields inherited from class org.apache.commons.imaging.formats.tiff.AbstractTiffElementCOMPARATOR, length, offset
- 
Constructor SummaryConstructorsConstructorDescriptionTiffDirectory(int type, List<TiffField> entries, long offset, long nextDirectoryOffset, ByteOrder byteOrder) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic Stringdescription(int type) voiddump()Gets the byte order used by the source file for storing this directory and its content.getFieldValue(TagInfo tag) String[]getFieldValue(TagInfoAscii tag, boolean mustExist) bytegetFieldValue(TagInfoByte tag) byte[]getFieldValue(TagInfoBytes tag, boolean mustExist) doubledouble[]getFieldValue(TagInfoDoubles tag, boolean mustExist) floatfloat[]getFieldValue(TagInfoFloats tag, boolean mustExist) getFieldValue(TagInfoGpsText tag, boolean mustExist) intgetFieldValue(TagInfoLong tag) int[]getFieldValue(TagInfoLongs tag, boolean mustExist) getFieldValue(TagInfoRationals tag, boolean mustExist) bytebyte[]getFieldValue(TagInfoSBytes tag, boolean mustExist) shortint[]getFieldValue(TagInfoShortOrLong tag, boolean mustExist) short[]getFieldValue(TagInfoShorts tag, boolean mustExist) intint[]getFieldValue(TagInfoSLongs tag, boolean mustExist) getFieldValue(TagInfoSRationals tag, boolean mustExist) shortshort[]getFieldValue(TagInfoSShorts tag, boolean mustExist) getFieldValue(TagInfoXpString tag, boolean mustExist) longgetRasterData(TiffImagingParameters params) Reads the numerical data stored in this TIFF directory, if available.intGets the image associated with the directory, if any.getTiffImage(ByteOrder byteOrder) Gets the image associated with the directory, if any.getTiffImage(ByteOrder byteOrder, TiffImagingParameters params) Gets the image associated with the directory, if any.getTiffImage(TiffImagingParameters params) Gets the image associated with the directory, if any.booleanbooleanIndicates whether the directory definition specifies a float-point data format.booleanbooleanIndicates whether the content associated with the directory is given in a supported numerical-data format.booleaniterator()voidsetJpegImageData(JpegImageData value) voidsetTiffImageData(AbstractTiffImageData rawImageData) intsize()Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Field Details- 
type
 
- 
- 
Constructor Details- 
TiffDirectorypublic TiffDirectory(int type, List<TiffField> entries, long offset, long nextDirectoryOffset, ByteOrder byteOrder) 
 
- 
- 
Method Details- 
description
- 
description
- 
dump
- 
findField- Throws:
- ImagingException
 
- 
findField- Throws:
- ImagingException
 
- 
getByteOrderGets the byte order used by the source file for storing this directory and its content.- Returns:
- A valid byte order instance.
 
- 
getDirectoryEntries
- 
getElementDescription- Specified by:
- getElementDescriptionin class- AbstractTiffElement
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValuepublic RationalNumber[] getFieldValue(TagInfoRationals tag, boolean mustExist) throws ImagingException - Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValuepublic RationalNumber[] getFieldValue(TagInfoSRationals tag, boolean mustExist) throws ImagingException - Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getFieldValue- Throws:
- ImagingException
 
- 
getJpegImageData
- 
getJpegRawImageDataElement- Throws:
- ImagingException
 
- 
getNextDirectoryOffset
- 
getRasterDatapublic AbstractTiffRasterData getRasterData(TiffImagingParameters params) throws ImagingException, IOException Reads the numerical data stored in this TIFF directory, if available. Note that this method is defined only for TIFF directories that contain floating-point data or two-byte signed integer data.TIFF directories that provide numerical data do not directly specify images, though it is possible to interpret the data as an image using this library. TIFF files may contain multiple directories which are allowed to have different formats. Thus it is possible for a TIFF file to contain a mix of image and floating-point raster data. If desired, sub-image data can be read from the file by using a Java Map instance to specify the subsection of the image that is required. The following code illustrates the approach: int x; // coordinate (column) of corner of sub-image int y; // coordinate (row) of corner of sub-image int width; // width of sub-image int height; // height of sub-image Map<String, Object> params = new HashMap<>(); params.put(TiffConstants.PARAM_KEY_SUBIMAGE_X, x); params.put(TiffConstants.PARAM_KEY_SUBIMAGE_Y, y); params.put(TiffConstants.PARAM_KEY_SUBIMAGE_WIDTH, width); params.put(TiffConstants.PARAM_KEY_SUBIMAGE_HEIGHT, height); TiffRasterData raster = directory.readFloatingPointRasterData(params); - Parameters:
- params- an optional parameter map instance
- Returns:
- a valid instance
- Throws:
- ImagingException- in the event of incompatible or malformed data
- IOException- in the event of an I/O error
 
- 
getSingleFieldValue- Throws:
- ImagingException
 
- 
getSingleFieldValue- Throws:
- ImagingException
 
- 
getTiffImageGets the image associated with the directory, if any. Note that not all directories contain images.- Returns:
- if successful, a valid BufferedImage instance.
- Throws:
- ImagingException- in the event of an invalid or incompatible data format.
- IOException- in the event of an I/O error.
 
- 
getTiffImageGets the image associated with the directory, if any. Note that not all directories contain images.This method comes from an older version of this class in which byte order was required from an external source. Developers are encouraged to use the simpler version of getTiffImage that does not require the byte-order argument. - Parameters:
- byteOrder- byte-order obtained from the containing TIFF file
- Returns:
- if successful, a valid BufferedImage instance.
- Throws:
- ImagingException- in the event of an invalid or incompatible data format.
- IOException- in the event of an I/O error.
 
- 
getTiffImagepublic BufferedImage getTiffImage(ByteOrder byteOrder, TiffImagingParameters params) throws ImagingException, IOException Gets the image associated with the directory, if any. Note that not all directories contain images.This method comes from an older version of this class in which byte order was required from an external source. Developers are encouraged to use the simpler version of getTiffImage that does not require the byte-order argument. - Parameters:
- byteOrder- byte-order obtained from the containing TIFF file
- params- an object containing optional parameters to be applied to the read operation.
- Returns:
- if successful, a valid BufferedImage instance.
- Throws:
- ImagingException- in the event of an invalid or incompatible data format.
- IOException- in the event of an I/O error.
 
- 
getTiffImagepublic BufferedImage getTiffImage(TiffImagingParameters params) throws ImagingException, IOException Gets the image associated with the directory, if any. Note that not all directories contain images.The optional parameters object can be used to specify image access or rendering options such as reading only a part of the overall image (i.e. reading a sub-image) or applying a custom photometric interpreter. - Parameters:
- params- an object containing optional parameters to be applied to the read operation.
- Returns:
- if successful, a valid BufferedImage instance.
- Throws:
- ImagingException- in the event of an invalid or incompatible data format.
- IOException- in the event of an I/O error.
 
- 
getTiffImageData
- 
getTiffRawImageDataElements- Throws:
- ImagingException
 
- 
hasJpegImageData- Throws:
- ImagingException
 
- 
hasTiffFloatingPointRasterDataIndicates whether the directory definition specifies a float-point data format.- Returns:
- trueif the directory contains floating point data; otherwise,- false
- Throws:
- ImagingException- in the event of an invalid or malformed specification.
 
- 
hasTiffImageData- Throws:
- ImagingException
 
- 
hasTiffRasterDataIndicates whether the content associated with the directory is given in a supported numerical-data format. If this method returnstrue, the Imaging API will be able to extract a TiffRasterData instance from the associated TIFF file using this directory.- Returns:
- trueif the directory contains a supported raster data format; otherwise,- false.
- Throws:
- ImagingException- in the event of an invalid or malformed specification.
 
- 
imageDataInStrips- Throws:
- ImagingException
 
- 
iterator
- 
setJpegImageData
- 
setTiffImageData
- 
size
 
-