|
|||||||||
| Home >> All >> org >> apache >> batik >> ext >> awt >> image >> codec >> [ tiff overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.batik.ext.awt.image.codec.tiff
Class TIFFEncodeParam

java.lang.Objectorg.apache.batik.ext.awt.image.codec.tiff.TIFFEncodeParam
- All Implemented Interfaces:
- java.lang.Cloneable, org.apache.batik.ext.awt.image.codec.ImageDecodeParam, org.apache.batik.ext.awt.image.codec.ImageEncodeParam, java.io.Serializable
- public class TIFFEncodeParam
- extends java.lang.Object
- implements org.apache.batik.ext.awt.image.codec.ImageEncodeParam
- extends java.lang.Object
An instance of ImageEncodeParam for encoding images in
the TIFF format.
This class allows for the specification of encoding parameters. By
default, the image is encoded without any compression, and is written
out consisting of strips, not tiles. The particular compression scheme
to be used can be specified by using the setCompression()
method. The compression scheme specified will be honored only if it is
compatible with the type of image being written out. For example,
Group3 and Group4 compressions can only be used with Bilevel images.
Writing of tiled TIFF images can be enabled by calling the
setWriteTiled() method.
This class is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.
| Field Summary | |
private int |
compression
|
static int |
COMPRESSION_DEFLATE
DEFLATE lossless compression (also known as "Zip-in-TIFF"). |
static int |
COMPRESSION_GROUP3_1D
Modified Huffman Compression (CCITT Group 3 1D facsimile compression). |
static int |
COMPRESSION_GROUP3_2D
CCITT T.4 bilevel compression (CCITT Group 3 2D facsimile compression). |
static int |
COMPRESSION_GROUP4
CCITT T.6 bilevel compression (CCITT Group 4 facsimile compression). |
static int |
COMPRESSION_JPEG_BROKEN
Code for original JPEG-in-TIFF compression which has been depricated (for many good reasons) in favor of Tech Note 2 JPEG compression (compression scheme 7). |
static int |
COMPRESSION_JPEG_TTN2
JPEG-in-TIFF compression. |
static int |
COMPRESSION_LZW
LZW compression. |
static int |
COMPRESSION_NONE
No compression. |
static int |
COMPRESSION_PACKBITS
Byte-oriented run-length encoding "PackBits" compression. |
private boolean |
convertJPEGRGBToYCbCr
|
private int |
deflateLevel
|
private TIFFField[] |
extraFields
|
private java.util.Iterator |
extraImages
|
private com.sun.image.codec.jpeg.JPEGEncodeParam |
jpegEncodeParam
|
private int |
tileHeight
|
private int |
tileWidth
|
private boolean |
writeTiled
|
| Constructor Summary | |
TIFFEncodeParam()
Constructs a TIFFEncodeParam object with default values for all parameters. |
|
| Method Summary | |
int |
getCompression()
Returns the value of the compression parameter. |
int |
getDeflateLevel()
Gets the compression level for DEFLATE compression. |
TIFFField[] |
getExtraFields()
Returns the value set by setExtraFields(). |
java.util.Iterator |
getExtraImages()
Returns the additional image Iterator specified via
setExtraImages() or null if none was
supplied or if a null value was supplied. |
boolean |
getJPEGCompressRGBToYCbCr()
Whether RGB data will be converted to YCbCr when using JPEG compression. |
com.sun.image.codec.jpeg.JPEGEncodeParam |
getJPEGEncodeParam()
Retrieves the JPEG compression parameters. |
int |
getTileHeight()
Retrieves the tile height set via setTileSize(). |
int |
getTileWidth()
Retrieves the tile width set via setTileSize(). |
boolean |
getWriteTiled()
Returns the value of the writeTiled parameter. |
void |
setCompression(int compression)
Specifies the type of compression to be used. |
void |
setDeflateLevel(int deflateLevel)
Sets the compression level for DEFLATE-compressed data which should either be java.util.Deflater.DEFAULT_COMPRESSION or a
value in the range [1,9] where larger values indicate more compression. |
void |
setExtraFields(TIFFField[] extraFields)
Sets an array of extra fields to be written to the TIFF Image File Directory (IFD). |
void |
setExtraImages(java.util.Iterator extraImages)
Sets an Iterator of additional images to be written
after the image passed as an argument to the ImageEncoder. |
void |
setJPEGCompressRGBToYCbCr(boolean convertJPEGRGBToYCbCr)
Sets flag indicating whether to convert RGB data to YCbCr when the compression type is JPEG. |
void |
setJPEGEncodeParam(com.sun.image.codec.jpeg.JPEGEncodeParam jpegEncodeParam)
Sets the JPEG compression parameters. |
void |
setTileSize(int tileWidth,
int tileHeight)
Sets the dimensions of the tiles to be written. |
void |
setWriteTiled(boolean writeTiled)
If set, the data will be written out in tiled format, instead of in strips. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
COMPRESSION_NONE
public static final int COMPRESSION_NONE
- No compression.
- See Also:
- Constant Field Values
COMPRESSION_GROUP3_1D
public static final int COMPRESSION_GROUP3_1D
- Modified Huffman Compression (CCITT Group 3 1D facsimile compression).
Not currently supported.
- See Also:
- Constant Field Values
COMPRESSION_GROUP3_2D
public static final int COMPRESSION_GROUP3_2D
- CCITT T.4 bilevel compression (CCITT Group 3 2D facsimile compression).
Not currently supported.
- See Also:
- Constant Field Values
COMPRESSION_GROUP4
public static final int COMPRESSION_GROUP4
- CCITT T.6 bilevel compression (CCITT Group 4 facsimile compression).
Not currently supported.
- See Also:
- Constant Field Values
COMPRESSION_LZW
public static final int COMPRESSION_LZW
- LZW compression.
Not supported.
- See Also:
- Constant Field Values
COMPRESSION_JPEG_BROKEN
public static final int COMPRESSION_JPEG_BROKEN
- Code for original JPEG-in-TIFF compression which has been
depricated (for many good reasons) in favor of Tech Note 2
JPEG compression (compression scheme 7).
Not supported.
- See Also:
- Constant Field Values
COMPRESSION_JPEG_TTN2
public static final int COMPRESSION_JPEG_TTN2
-
JPEG-in-TIFF compression.
- See Also:
- Constant Field Values
COMPRESSION_PACKBITS
public static final int COMPRESSION_PACKBITS
- Byte-oriented run-length encoding "PackBits" compression.
- See Also:
- Constant Field Values
COMPRESSION_DEFLATE
public static final int COMPRESSION_DEFLATE
-
DEFLATE lossless compression (also known as "Zip-in-TIFF").
- See Also:
- Constant Field Values
compression
private int compression
writeTiled
private boolean writeTiled
tileWidth
private int tileWidth
tileHeight
private int tileHeight
extraImages
private java.util.Iterator extraImages
extraFields
private TIFFField[] extraFields
convertJPEGRGBToYCbCr
private boolean convertJPEGRGBToYCbCr
jpegEncodeParam
private com.sun.image.codec.jpeg.JPEGEncodeParam jpegEncodeParam
deflateLevel
private int deflateLevel
| Constructor Detail |
TIFFEncodeParam
public TIFFEncodeParam()
- Constructs a TIFFEncodeParam object with default values for
all parameters.
| Method Detail |
getCompression
public int getCompression()
- Returns the value of the compression parameter.
setCompression
public void setCompression(int compression)
- Specifies the type of compression to be used. The compression type
specified will be honored only if it is compatible with the image
being written out. Currently only PackBits, JPEG, and DEFLATE
compression schemes are supported.
If
compressionis set to any value butCOMPRESSION_NONEand theOutputStreamsupplied to theImageEncoderis not aSeekableOutputStream, then the encoder will use either a temporary file or a memory cache when compressing the data depending on whether the file system is accessible. Compression will therefore be more efficient if aSeekableOutputStreamis supplied.
getWriteTiled
public boolean getWriteTiled()
- Returns the value of the writeTiled parameter.
setWriteTiled
public void setWriteTiled(boolean writeTiled)
- If set, the data will be written out in tiled format, instead of
in strips.
setTileSize
public void setTileSize(int tileWidth,
int tileHeight)
- Sets the dimensions of the tiles to be written. If either
value is non-positive, the encoder will use a default value.
If the data are being written as tiles, i.e.,
getWriteTiled()returnstrue, then the default tile dimensions used by the encoder are those of the tiles of the image being encoded.If the data are being written as strips, i.e.,
getWriteTiled()returnsfalse, the width of each strip is always the width of the image and the default number of rows per strip is 8.If JPEG compession is being used, the dimensions of the strips or tiles may be modified to conform to the JPEG-in-TIFF specification.
getTileWidth
public int getTileWidth()
- Retrieves the tile width set via
setTileSize().
getTileHeight
public int getTileHeight()
- Retrieves the tile height set via
setTileSize().
setExtraImages
public void setExtraImages(java.util.Iterator extraImages)
- Sets an
Iteratorof additional images to be written after the image passed as an argument to theImageEncoder. The methods on the suppliedIteratormust only be invoked by theImageEncoderwhich will exhaust the available values unless an error occurs.The value returned by an invocation of
next()on theIteratormust return either aRenderedImageor anObject[]of length 2 wherein the element at index zero is aRenderedImageamd the other element is aTIFFEncodeParam. If noTIFFEncodeParamis supplied in this manner for an additional image, the parameters used to create theImageEncoderwill be used. The extra imageIteratorset on anyTIFFEncodeParamof an additional image will in all cases be ignored.
getExtraImages
public java.util.Iterator getExtraImages()
- Returns the additional image
Iteratorspecified viasetExtraImages()ornullif none was supplied or if anullvalue was supplied.
setDeflateLevel
public void setDeflateLevel(int deflateLevel)
- Sets the compression level for DEFLATE-compressed data which should
either be
java.util.Deflater.DEFAULT_COMPRESSIONor a value in the range [1,9] where larger values indicate more compression. The default setting isDeflater.DEFAULT_COMPRESSION. This setting is ignored if the compression type is not DEFLATE.
getDeflateLevel
public int getDeflateLevel()
- Gets the compression level for DEFLATE compression.
setJPEGCompressRGBToYCbCr
public void setJPEGCompressRGBToYCbCr(boolean convertJPEGRGBToYCbCr)
- Sets flag indicating whether to convert RGB data to YCbCr when the
compression type is JPEG. The default value is
true. This flag is ignored if the compression type is not JPEG.
getJPEGCompressRGBToYCbCr
public boolean getJPEGCompressRGBToYCbCr()
- Whether RGB data will be converted to YCbCr when using JPEG compression.
setJPEGEncodeParam
public void setJPEGEncodeParam(com.sun.image.codec.jpeg.JPEGEncodeParam jpegEncodeParam)
- Sets the JPEG compression parameters. These parameters are ignored
if the compression type is not JPEG. The argument may be
nullto indicate that default compression parameters are to be used. For maximum conformance with the specification it is recommended in most cases that only the quality compression parameter be set.The
writeTablesOnlyandJFIFHeaderflags of theJPEGEncodeParamare ignored. ThewriteImageOnlyflag is used to determine whether the JPEGTables field will be written to the TIFF stream: ifwriteImageOnlyistrue, then the JPEGTables field will be written and will contain a valid JPEG abbreviated table specification datastream. In this case the data in each data segment (strip or tile) will contain an abbreviated JPEG image datastream. If thewriteImageOnlyflag isfalse, then the JPEGTables field will not be written and each data segment will contain a complete JPEG interchange datastream.
getJPEGEncodeParam
public com.sun.image.codec.jpeg.JPEGEncodeParam getJPEGEncodeParam()
- Retrieves the JPEG compression parameters.
setExtraFields
public void setExtraFields(TIFFField[] extraFields)
- Sets an array of extra fields to be written to the TIFF Image File
Directory (IFD). Fields with tags equal to the tag of any
automatically generated fields are ignored. No error checking is
performed with respect to the validity of the field contents or
the appropriateness of the field for the image being encoded.
getExtraFields
public TIFFField[] getExtraFields()
- Returns the value set by
setExtraFields().
|
|||||||||
| Home >> All >> org >> apache >> batik >> ext >> awt >> image >> codec >> [ tiff overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.batik.ext.awt.image.codec.tiff.TIFFEncodeParam