APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.imageio.plugins.tiff

public abstract Class TIFFBaseJPEGCompressor

extends TIFFCompressor
Class Inheritance
Known Direct Subclasses
com.sun.imageio.plugins.tiff.TIFFExifJPEGCompressor, com.sun.imageio.plugins.tiff.TIFFJPEGCompressor
Imports
java.awt.Point, .Transparency, java.awt.color.ColorSpace, java.awt.image.BufferedImage, .ColorModel, .ComponentColorModel, .DataBuffer, .DataBufferByte, .PixelInterleavedSampleModel, .Raster, .SampleModel, .WritableRaster, java.io.IOException, .ByteArrayOutputStream, java.util.ArrayList, .Arrays, .List, .Iterator, javax.imageio.IIOException, .IIOImage, .ImageIO, .ImageWriteParam, .ImageWriter, javax.imageio.metadata.IIOInvalidTreeException, .IIOMetadata, .IIOMetadataNode, javax.imageio.spi.ImageWriterSpi, javax.imageio.plugins.jpeg.JPEGImageWriteParam, javax.imageio.stream.ImageOutputStream, .MemoryCacheImageOutputStream, org.w3c.dom.Node, sun.java2d.Disposer, .DisposerRecord

Base class for all possible forms of JPEG compression in TIFF.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
TIFFBaseJPEGCompressor.IIOByteArrayOutputStream

A ByteArrayOutputStream which allows writing to an ImageOutputStream.

private static class

Field Summary

Modifier and TypeField and Description
private TIFFBaseJPEGCompressor.IIOByteArrayOutputStream
protected static final String
private IIOMetadata
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.

private ImageWriteParam
protected static final String
protected boolean
writeAbbreviatedStream

Whether to write abbreviated JPEG streams (default == false).

Inherited from com.sun.imageio.plugins.tiff.TIFFCompressor:
compressionTagValuecompressionTypeisCompressionLosslessmetadatastreamwriter

Constructor Summary

AccessConstructor and Description
public
TIFFBaseJPEGCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless, ImageWriteParam param)

Method Summary

Modifier and TypeMethod and Description
public final int
encode(byte[] b, int off, int width, int height, int[] bitsPerSample, int scanlineStride)

Implements abstract com.sun.imageio.plugins.tiff.TIFFCompressor.encode.

Encodes the supplied image data, writing to the currently set ImageOutputStream.

private static List<Node>
private IIOMetadata
getImageMetadata(boolean pruneTables)

Retrieves image metadata with non-core nodes removed.

protected void
initJPEGWriter(boolean
Whether the JPEG writer must support JPEG native stream metadata, i.e., be capable of writing abbreviated streams.
supportsStreamMetadata
,
boolean
Whether the JPEG writer must support JPEG native image metadata.
supportsImageMetadata
)

Initializes the JPEGWriter and JPEGParam instance variables.

private static void
pruneNodes(Node
A javax_imageio_jpeg_image_1.0 tree.
tree
,
boolean
Whether to prune Huffman and quantization tables.
pruneTables
)

Removes nonessential nodes from a JPEG native image metadata tree.

Inherited from com.sun.imageio.plugins.tiff.TIFFCompressor:
getCompressionTagValuegetCompressionTypegetMetadatagetStreamgetWriterisCompressionLosslesssetMetadatasetStreamsetWriter

Field Detail

baosback to summary
private TIFFBaseJPEGCompressor.IIOByteArrayOutputStream baos
IMAGE_METADATA_NAMEback to summary
protected static final String IMAGE_METADATA_NAME
JPEGImageMetadataback to summary
private IIOMetadata JPEGImageMetadata
JPEGParamback to summary
protected JPEGImageWriteParam JPEGParam

ImageWriteParam for JPEG writer. May be initialized by initJPEGWriter.

JPEGStreamMetadataback to summary
protected IIOMetadata JPEGStreamMetadata

Stream metadata equivalent to a tables-only stream such as in the JPEGTables. Default value is null. This should be set by any subclass which sets writeAbbreviatedStream to true.

JPEGWriterback to summary
protected ImageWriter JPEGWriter

The JPEG writer. May be initialized by initJPEGWriter.

paramback to summary
private ImageWriteParam param
STREAM_METADATA_NAMEback to summary
protected static final String STREAM_METADATA_NAME
writeAbbreviatedStreamback to summary
protected boolean writeAbbreviatedStream

Whether to write abbreviated JPEG streams (default == false). A subclass which sets this to true should also initialized JPEGStreamMetadata.

Constructor Detail

TIFFBaseJPEGCompressorback to summary
public TIFFBaseJPEGCompressor(String compressionType, int compressionTagValue, boolean isCompressionLossless, ImageWriteParam param)

Method Detail

encodeback to summary
public final int encode(byte[] b, int off, int width, int height, int[] bitsPerSample, int scanlineStride) throws IOException

Implements abstract com.sun.imageio.plugins.tiff.TIFFCompressor.encode.

Doc from com.sun.imageio.plugins.tiff.TIFFCompressor.encode.

Encodes the supplied image data, writing to the currently set ImageOutputStream.

Annotations
@Override
Exceptions
IOException:
if the supplied data cannot be encoded by this TIFFCompressor, or if any I/O error occurs during writing.
getAllNodesback to summary
private static List<Node> getAllNodes(IIOMetadataNode root, List<Node> nodes)
getImageMetadataback to summary
private IIOMetadata getImageMetadata(boolean pruneTables) throws IIOException

Retrieves image metadata with non-core nodes removed.

initJPEGWriterback to summary
protected void initJPEGWriter(boolean supportsStreamMetadata, boolean supportsImageMetadata)

Initializes the JPEGWriter and JPEGParam instance variables. This method must be called before encode() is invoked.

Parameters
supportsStreamMetadata:boolean

Whether the JPEG writer must support JPEG native stream metadata, i.e., be capable of writing abbreviated streams.

supportsImageMetadata:boolean

Whether the JPEG writer must support JPEG native image metadata.

pruneNodesback to summary
private static void pruneNodes(Node tree, boolean pruneTables)

Removes nonessential nodes from a JPEG native image metadata tree. All nodes derived from JPEG marker segments other than DHT, DQT, SOF, SOS segments are removed unless pruneTables is true in which case the nodes derived from the DHT and DQT marker segments are also removed.

Parameters
tree:Node

A javax_imageio_jpeg_image_1.0 tree.

pruneTables:boolean

Whether to prune Huffman and quantization tables.

Exceptions
NullPointerException:
if tree is null.
IllegalArgumentException:
if tree is not the root of a JPEG native image metadata tree.
com.sun.imageio.plugins.tiff back to summary

private Class TIFFBaseJPEGCompressor.IIOByteArrayOutputStream

extends ByteArrayOutputStream
Class Inheritance

A ByteArrayOutputStream which allows writing to an ImageOutputStream.

Field Summary

Inherited from java.io.ByteArrayOutputStream:
bufcount

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
public synchronized void
Inherited from java.io.ByteArrayOutputStream:
closeresetsizetoByteArraytoStringtoStringtoStringtoStringwritewritewriteByteswriteTo

Constructor Detail

IIOByteArrayOutputStreamback to summary
pack-priv IIOByteArrayOutputStream()
IIOByteArrayOutputStreamback to summary
pack-priv IIOByteArrayOutputStream(int size)

Method Detail

writeToback to summary
public synchronized void writeTo(ImageOutputStream ios) throws IOException
com.sun.imageio.plugins.tiff back to summary

private Class TIFFBaseJPEGCompressor.ImageWriterDisposerRecord

extends Object
implements DisposerRecord
Class Inheritance
  • java.lang.Object
  • com.sun.imageio.plugins.tiff.TIFFBaseJPEGCompressor.ImageWriterDisposerRecord
All Implemented Interfaces
sun.java2d.DisposerRecord

Field Summary

Modifier and TypeField and Description
private final ImageWriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

writerback to summary
private final ImageWriter writer

Constructor Detail

ImageWriterDisposerRecordback to summary
public ImageWriterDisposerRecord(ImageWriter writer)

Method Detail

disposeback to summary
public void dispose()

Implements sun.java2d.DisposerRecord.dispose.

Annotations
@Override