Class TiffImagingParameters
- java.lang.Object
-
- org.apache.commons.imaging.ImagingParameters<E>
-
- org.apache.commons.imaging.common.XmpImagingParameters<TiffImagingParameters>
-
- org.apache.commons.imaging.formats.tiff.TiffImagingParameters
-
public class TiffImagingParameters extends XmpImagingParameters<TiffImagingParameters>
TIFF format parameters.- Since:
- 1.0-alpha3
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.IntegercompressionTIFF compression algorithm, if any.private AbstractPhotometricInterpretercustomPhotometricInterpreterSpecifies that an application-specified photometric interpreter is to be used when reading TIFF files to convert raster data samples to RGB values for the output image.private java.lang.IntegerlzwCompressionBlockSizeSpecifies the amount of memory in bytes to be used for a strip or tile size when employing LZW compression.private booleanreadThumbnailsIndicates whether to read embedded thumbnails or not.private intsubImageHeightHeight of a sub-image.private intsubImageWidthWidth of a sub-image.private intsubImageXX-coordinate of a sub-image.private intsubImageYY-coordinate of a sub-image.private java.lang.Integert4OptionsUsed in write operations to indicate the desired T.4 options to use when using TIFF_COMPRESSION_CCITT_GROUP_3.private java.lang.Integert6OptionsUsed in write operations to indicate the desired T.6 options to use when using TIFF_COMPRESSION_CCITT_GROUP_4.private TiffOutputSettiffOutputSetUser providedTiffOutputSetused to write into the image's metadata including standard directory and EXIF tags.
-
Constructor Summary
Constructors Constructor Description TiffImagingParameters()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearSubImage()Clears settings for sub-image.java.lang.IntegergetCompression()AbstractPhotometricInterpretergetCustomPhotometricInterpreter()java.lang.IntegergetLzwCompressionBlockSize()TiffOutputSetgetOutputSet()Gets the TIFF output set for writing TIFF files.intgetSubImageHeight()Gets the height for a sub-image setting.intgetSubImageWidth()Gets the width for a sub-image setting.intgetSubImageX()Gets the X coordinate of a sub-image.intgetSubImageY()Gets the Y coordinate of a sub-image.java.lang.IntegergetT4Options()java.lang.IntegergetT6Options()booleanisReadThumbnails()booleanisSubImageSet()Indicates whether the application has set sub-image parameters.TiffImagingParameterssetCompression(java.lang.Integer compression)TiffImagingParameterssetCustomPhotometricInterpreter(AbstractPhotometricInterpreter customPhotometricInterpreter)TiffImagingParameterssetLzwCompressionBlockSize(java.lang.Integer lzwCompressionBlockSize)TiffImagingParameterssetOutputSet(TiffOutputSet tiffOutputSet)Sets the TIFF output set for writing TIFF files.TiffImagingParameterssetReadThumbnails(boolean readThumbnails)TiffImagingParameterssetSubImage(int x, int y, int width, int height)Sets parameters for performing a partial read operation on an image.TiffImagingParameterssetT4Options(java.lang.Integer t4Options)TiffImagingParameterssetT6Options(java.lang.Integer t6Options)-
Methods inherited from class org.apache.commons.imaging.common.XmpImagingParameters
getXmpXml, setXmpXml
-
Methods inherited from class org.apache.commons.imaging.ImagingParameters
asThis, getBufferedImageFactory, getFileName, getPixelDensity, isStrict, setBufferedImageFactory, setFileName, setPixelDensity, setStrict
-
-
-
-
Field Detail
-
readThumbnails
private boolean readThumbnails
Indicates whether to read embedded thumbnails or not. Only applies to read EXIF metadata from JPEG/JFIF files.Default value is
true.
-
tiffOutputSet
private TiffOutputSet tiffOutputSet
User providedTiffOutputSetused to write into the image's metadata including standard directory and EXIF tags.
-
subImageX
private int subImageX
X-coordinate of a sub-image.
-
subImageY
private int subImageY
Y-coordinate of a sub-image.
-
subImageWidth
private int subImageWidth
Width of a sub-image.
-
subImageHeight
private int subImageHeight
Height of a sub-image.
-
customPhotometricInterpreter
private AbstractPhotometricInterpreter customPhotometricInterpreter
Specifies that an application-specified photometric interpreter is to be used when reading TIFF files to convert raster data samples to RGB values for the output image.The value supplied with this key should be a valid instance of a class that implements PhotometricInterpreter.
-
compression
private java.lang.Integer compression
TIFF compression algorithm, if any.
-
lzwCompressionBlockSize
private java.lang.Integer lzwCompressionBlockSize
Specifies the amount of memory in bytes to be used for a strip or tile size when employing LZW compression. The default is 8000 (roughly 8K). Minimum value is 8000.
-
t4Options
private java.lang.Integer t4Options
Used in write operations to indicate the desired T.4 options to use when using TIFF_COMPRESSION_CCITT_GROUP_3.Valid values: any Integer containing a mixture of the TIFF_FLAG_T4_OPTIONS_2D, TIFF_FLAG_T4_OPTIONS_UNCOMPRESSED_MODE, and TIFF_FLAG_T4_OPTIONS_FILL flags.
-
t6Options
private java.lang.Integer t6Options
Used in write operations to indicate the desired T.6 options to use when using TIFF_COMPRESSION_CCITT_GROUP_4.Valid values: any Integer containing either zero or TIFF_FLAG_T6_OPTIONS_UNCOMPRESSED_MODE.
-
-
Method Detail
-
clearSubImage
public void clearSubImage()
Clears settings for sub-image. Subsequent read operations will retrieve the entire image.
-
getCompression
public java.lang.Integer getCompression()
-
getCustomPhotometricInterpreter
public AbstractPhotometricInterpreter getCustomPhotometricInterpreter()
-
getLzwCompressionBlockSize
public java.lang.Integer getLzwCompressionBlockSize()
-
getOutputSet
public TiffOutputSet getOutputSet()
Gets the TIFF output set for writing TIFF files.- Returns:
- if set, a valid instance; otherwise, a null reference.
-
getSubImageHeight
public int getSubImageHeight()
Gets the height for a sub-image setting. For a sub-image setting to be meaningful, both the width and height must be set.- Returns:
- if the sub-image feature is enabled, a value greater than zero; otherwise, zero.
-
getSubImageWidth
public int getSubImageWidth()
Gets the width for a sub-image setting. For a sub-image setting to be meaningful, both the width and height must be set.- Returns:
- if the sub-image feature is enabled, a value greater than zero; otherwise, zero.
-
getSubImageX
public int getSubImageX()
Gets the X coordinate of a sub-image. This setting is meaningful only if a sub-image is set.- Returns:
- a positive integer
-
getSubImageY
public int getSubImageY()
Gets the Y coordinate of a sub-image. This setting is meaningful only if a sub-image is set.- Returns:
- a positive integer
-
getT4Options
public java.lang.Integer getT4Options()
-
getT6Options
public java.lang.Integer getT6Options()
-
isReadThumbnails
public boolean isReadThumbnails()
-
isSubImageSet
public boolean isSubImageSet()
Indicates whether the application has set sub-image parameters.- Returns:
- true if the sub-image parameters are set; otherwise, false.
-
setCompression
public TiffImagingParameters setCompression(java.lang.Integer compression)
-
setCustomPhotometricInterpreter
public TiffImagingParameters setCustomPhotometricInterpreter(AbstractPhotometricInterpreter customPhotometricInterpreter)
-
setLzwCompressionBlockSize
public TiffImagingParameters setLzwCompressionBlockSize(java.lang.Integer lzwCompressionBlockSize)
-
setOutputSet
public TiffImagingParameters setOutputSet(TiffOutputSet tiffOutputSet)
Sets the TIFF output set for writing TIFF files. An output set may contain various types of TiffDirectories including image directories, EXIF directories, GPS-related directories, etc.- Parameters:
tiffOutputSet- A valid instance.- Returns:
thisinstance.
-
setReadThumbnails
public TiffImagingParameters setReadThumbnails(boolean readThumbnails)
-
setSubImage
public TiffImagingParameters setSubImage(int x, int y, int width, int height)
Sets parameters for performing a partial read operation on an image. This method is useful for reducing memory and run-time overhead when accessing large source images.Note that the corner x and y coordinates must be positive integers (zero or greater). The width and height must be greater than zero.
- Parameters:
x- pixel coordinate of the upper-left corner of the source image, must be zero or greater.y- pixel coordinate of the upper-left corner of the source image, must be zero or greater.width- width of the image subset to be read, must be greater than zero.height- height of the image subset to be read, must be greater than zero.- Returns:
thisinstance.
-
setT4Options
public TiffImagingParameters setT4Options(java.lang.Integer t4Options)
-
setT6Options
public TiffImagingParameters setT6Options(java.lang.Integer t6Options)
-
-