|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectTIFFCompressor
TIFFBaseJPEGCompressor
public abstract class TIFFBaseJPEGCompressor
Base class for all possible forms of JPEG compression in TIFF.
Field Summary | |
---|---|
protected static String |
IMAGE_METADATA_NAME
|
protected JPEGImageWriteParam |
JPEGParam
ImageWriteParam for JPEG writer. |
protected IIOMetadata |
JPEGStreamMetadata
Stream metadata equivalent to a tables-only stream such as in the JPEGTables . |
protected ImageWriter |
JPEGWriter
The JPEG writer. |
protected static String |
STREAM_METADATA_NAME
|
protected boolean |
writeAbbreviatedStream
Whether to write abbreviated JPEG streams (default == false). |
Fields inherited from class TIFFCompressor |
---|
compressionTagValue, compressionType, isCompressionLossless, metadata, stream, writer |
Constructor Summary | |
---|---|
TIFFBaseJPEGCompressor(String compressionType,
int compressionTagValue,
boolean isCompressionLossless,
ImageWriteParam param)
|
Method Summary | |
---|---|
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 . |
protected void |
finalize()
|
protected void |
initJPEGWriter(boolean supportsStreamMetadata,
boolean supportsImageMetadata)
Initializes the JPEGWriter and JPEGParam instance variables. |
Methods inherited from class TIFFCompressor |
---|
getCompressionTagValue, getCompressionType, getMetadata, getStream, getWriter, isCompressionLossless, setMetadata, setStream, setWriter |
Methods inherited from class Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String STREAM_METADATA_NAME
protected static final String IMAGE_METADATA_NAME
protected JPEGImageWriteParam JPEGParam
#initJPEGWriter()
.
protected ImageWriter JPEGWriter
#initJPEGWriter()
.
protected boolean writeAbbreviatedStream
true
should also
initialized JPEGStreamMetadata
.
protected IIOMetadata JPEGStreamMetadata
JPEGTables
. Default value is null
.
This should be set by any subclass which sets
writeAbbreviatedStream
to true
.
Constructor Detail |
---|
public TIFFBaseJPEGCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless, ImageWriteParam param)
Method Detail |
---|
protected void initJPEGWriter(boolean supportsStreamMetadata, boolean supportsImageMetadata)
supportsStreamMetadata
- Whether the JPEG writer must
support JPEG native stream metadata, i.e., be capable of writing
abbreviated streams.supportsImageMetadata
- Whether the JPEG writer must
support JPEG native image metadata.public final int encode(byte[] b, int off, int width, int height, int[] bitsPerSample, int scanlineStride) throws IOException
TIFFCompressor
ImageOutputStream
.
encode
in class TIFFCompressor
b
- an array of byte
s containing the packed
but uncompressed image data.off
- the starting offset of the data to be written in the
array b
.width
- the width of the rectangle of pixels to be written.height
- the height of the rectangle of pixels to be written.bitsPerSample
- an array of int
s indicting
the number of bits used to represent each image sample within
a pixel.scanlineStride
- the number of bytes separating each
row of the input data.
IOException
- if the supplied data cannot be encoded by
this TIFFCompressor
, or if any I/O error occurs
during writing.protected void finalize() throws Throwable
finalize
in class Object
Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |