| java.lang.Object com.sun.media.imageio.plugins.tiff.TIFFCompressor
All known Subclasses: com.sun.media.imageioimpl.plugins.tiff.TIFFPackBitsCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFNullCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFLSBCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFFaxCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFLZWCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFBaseJPEGCompressor, com.sun.media.imageioimpl.plugins.tiff.TIFFDeflater,
TIFFCompressor | abstract public class TIFFCompressor (Code) | | An abstract superclass for pluggable TIFF compressors.
|
Constructor Summary | |
public | TIFFCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless) Creates a compressor object for use in compressing TIFF data. |
Method Summary | |
abstract public int | encode(byte[] b, int off, int width, int height, int[] bitsPerSample, int scanlineStride) Encodes the supplied image data, writing to the currently set
ImageOutputStream .
Parameters: b - an array of byte s containing the packedbut uncompressed image data. Parameters: off - the starting offset of the data to be written in thearray b . Parameters: width - the width of the rectangle of pixels to be written. Parameters: height - the height of the rectangle of pixels to be written. Parameters: bitsPerSample - an array of int s indictingthe number of bits used to represent each image sample withina pixel. Parameters: scanlineStride - the number of bytes separating eachrow of the input data. | public int | getCompressionTagValue() Retrieve the value to be assigned to the TIFF Compression tag
in the TIFF image metadata. | public String | getCompressionType() Retrieve the name of the compression type supported by this compressor. | public IIOMetadata | getMetadata() Returns the current IIOMetadata object. | public ImageOutputStream | getStream() Returns the ImageOutputStream that will be written. | public ImageWriter | getWriter() Returns the current ImageWriter . | public boolean | isCompressionLossless() Retrieves a value indicating whether the compression is lossless. | public void | setMetadata(IIOMetadata metadata) Sets the value of the metadata field. | public void | setStream(ImageOutputStream stream) Sets the ImageOutputStream to be written. | public void | setWriter(ImageWriter writer) Sets the value of the writer field. |
compressionTagValue | protected int compressionTagValue(Code) | | The value to be assigned to the TIFF Compression tag in the
TIFF image metadata.
|
compressionType | protected String compressionType(Code) | | The name of the compression type supported by this compressor.
|
isCompressionLossless | protected boolean isCompressionLossless(Code) | | Whether the compression is lossless.
|
metadata | protected IIOMetadata metadata(Code) | | The IIOMetadata object containing metadata for the
current image.
|
writer | protected ImageWriter writer(Code) | | The ImageWriter calling this
TIFFCompressor .
|
TIFFCompressor | public TIFFCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless)(Code) | | Creates a compressor object for use in compressing TIFF data. This
object may be passed to the
TIFFImageWriteParam.setTIFFCompressor(TIFFCompressor) method to override the compressor of a supported compression type or
to provide the implementation of the compression algorithm of an
unsupported compression type.
The parameters compressionTagValue and
isCompressionLossless are provided to accomodate
compression types which are unknown. A compression type is
"known" if it is either among those already supported by the
TIFF writer (see
TIFFImageWriteParam ), or is listed in
the TIFF 6.0 specification but not supported. If the compression
type is unknown, the compressionTagValue and
isCompressionLossless parameters are ignored.
Parameters: compressionType - The name of the compression type. Parameters: compressionTagValue - The value to be assigned to the TIFFCompression tag in the TIFF image metadata; ignored ifcompressionType is a known type. Parameters: isCompressionLossless - Whether the compression is lossless;ignored if compressionType is a known type. throws: IllegalArgumentException - if compressionType isnull or compressionTagValue is less than1 . |
encode | abstract public int encode(byte[] b, int off, int width, int height, int[] bitsPerSample, int scanlineStride) throws IOException(Code) | | Encodes the supplied image data, writing to the currently set
ImageOutputStream .
Parameters: b - an array of byte s containing the packedbut uncompressed image data. Parameters: off - the starting offset of the data to be written in thearray b . Parameters: width - the width of the rectangle of pixels to be written. Parameters: height - the height of the rectangle of pixels to be written. Parameters: bitsPerSample - an array of int s indictingthe number of bits used to represent each image sample withina pixel. Parameters: scanlineStride - the number of bytes separating eachrow of the input data. the number of bytes written. throws: IOException - if the supplied data cannot be encoded bythis TIFFCompressor , or if any I/O error occursduring writing. |
getCompressionTagValue | public int getCompressionTagValue()(Code) | | Retrieve the value to be assigned to the TIFF Compression tag
in the TIFF image metadata.
The Compression tag value. |
getCompressionType | public String getCompressionType()(Code) | | Retrieve the name of the compression type supported by this compressor.
The compression type name. |
isCompressionLossless | public boolean isCompressionLossless()(Code) | | Retrieves a value indicating whether the compression is lossless.
Whether the compression is lossless. |
|
|