public abstract class TIFFBaseJPEGCompressor extends TIFFCompressor
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
IMAGE_METADATA_NAME |
protected javax.imageio.plugins.jpeg.JPEGImageWriteParam |
JPEGParam
ImageWriteParam for JPEG writer.
|
protected javax.imageio.metadata.IIOMetadata |
JPEGStreamMetadata
Stream metadata equivalent to a tables-only stream such as in
the
JPEGTables . |
protected javax.imageio.ImageWriter |
JPEGWriter
The JPEG writer.
|
protected static java.lang.String |
STREAM_METADATA_NAME |
protected boolean |
writeAbbreviatedStream
Whether to write abbreviated JPEG streams (default == false).
|
compressionTagValue, compressionType, isCompressionLossless, metadata, stream, writer
Constructor and Description |
---|
TIFFBaseJPEGCompressor(java.lang.String compressionType,
int compressionTagValue,
boolean isCompressionLossless,
javax.imageio.ImageWriteParam param) |
Modifier and Type | Method and Description |
---|---|
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.
|
getCompressionTagValue, getCompressionType, getMetadata, getStream, getWriter, isCompressionLossless, setMetadata, setStream, setWriter
protected static final java.lang.String STREAM_METADATA_NAME
protected static final java.lang.String IMAGE_METADATA_NAME
protected javax.imageio.plugins.jpeg.JPEGImageWriteParam JPEGParam
#initJPEGWriter()
.protected javax.imageio.ImageWriter JPEGWriter
#initJPEGWriter()
.protected boolean writeAbbreviatedStream
true
should also
initialized JPEGStreamMetadata
.protected javax.imageio.metadata.IIOMetadata JPEGStreamMetadata
JPEGTables
. Default value is null
.
This should be set by any subclass which sets
writeAbbreviatedStream
to true
.public TIFFBaseJPEGCompressor(java.lang.String compressionType, int compressionTagValue, boolean isCompressionLossless, javax.imageio.ImageWriteParam param)
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 java.io.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.java.io.IOException
- if the supplied data cannot be encoded by
this TIFFCompressor
, or if any I/O error occurs
during writing.protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright © 2014 Open Microscopy Environment