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

public Class TIFFNullDecompressor

extends TIFFDecompressor
Class Inheritance
Imports
java.io.EOFException, .IOException

Field Summary

Modifier and TypeField and Description
private boolean
isReadActiveOnly

Whether to read the active source region only.

private int
originalSrcHeight

The original value of srcHeight.

private int
originalSrcMinX

The original value of srcMinX.

private int
originalSrcMinY

The original value of srcMinY.

private int
originalSrcWidth

The original value of srcWidth.

Inherited from com.sun.imageio.plugins.tiff.TIFFDecompressor:
activeSrcHeightactiveSrcMinXactiveSrcMinYactiveSrcWidthbitsPerSamplebyteCountcolorConvertercolorMapcompressiondestinationBandsdstHeightdstMinXdstMinYdstWidthdstXOffsetdstYOffsetextraSamplesimagemetadataoffsetphotometricInterpretationplanarplanarBandrawImagereadersampleFormatsamplesPerPixelsourceBandssourceXOffsetsourceYOffsetsrcHeightsrcMinXsrcMinYsrcWidthstreamsubsampleXsubsampleY

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
beginDecoding()

Overrides com.sun.imageio.plugins.tiff.TIFFDecompressor.beginDecoding.

This routine is called prior to a sequence of calls to the decode method, in order to allow any necessary tables or other structures to be initialized based on metadata values.

public void
decode()

Overrides com.sun.imageio.plugins.tiff.TIFFDecompressor.decode.

Decodes the input bit stream (located in the ImageInputStream stream, at offset offset, and continuing for byteCount bytes) into the output BufferedImage image.

public void
decodeRaw(byte[] b, int dstOffset, int bitsPerPixel, int scanlineStride)

Implements abstract com.sun.imageio.plugins.tiff.TIFFDecompressor.decodeRaw.

Decodes the source data into the provided byte array b, starting at the offset given by dstOffset.

Inherited from com.sun.imageio.plugins.tiff.TIFFDecompressor:
createComponentCMcreateInterleavedSMcreateRawImagedecodeRawdecodeRawdecodeRawdecodeRawgetRawImageTypegetRawImageTypeSpecifiersetActiveSrcHeightsetActiveSrcMinXsetActiveSrcMinYsetActiveSrcWidthsetBitsPerSamplesetByteCountsetColorConvertersetColorMapsetCompressionsetDestinationBandssetDstHeightsetDstMinXsetDstMinYsetDstWidthsetDstXOffsetsetDstYOffsetsetExtraSamplessetImagesetMetadatasetOffsetsetPhotometricInterpretationsetPlanarsetPlanarBandsetReadersetSampleFormatsetSamplesPerPixelsetSourceBandssetSourceXOffsetsetSourceYOffsetsetSrcHeightsetSrcMinXsetSrcMinYsetSrcWidthsetStreamsetSubsampleXsetSubsampleY

Field Detail

isReadActiveOnlyback to summary
private boolean isReadActiveOnly

Whether to read the active source region only.

originalSrcHeightback to summary
private int originalSrcHeight

The original value of srcHeight.

originalSrcMinXback to summary
private int originalSrcMinX

The original value of srcMinX.

originalSrcMinYback to summary
private int originalSrcMinY

The original value of srcMinY.

originalSrcWidthback to summary
private int originalSrcWidth

The original value of srcWidth.

Constructor Detail

TIFFNullDecompressorback to summary
public TIFFNullDecompressor()

Method Detail

beginDecodingback to summary
public void beginDecoding()

Overrides com.sun.imageio.plugins.tiff.TIFFDecompressor.beginDecoding.

Doc from com.sun.imageio.plugins.tiff.TIFFDecompressor.beginDecoding.

This routine is called prior to a sequence of calls to the decode method, in order to allow any necessary tables or other structures to be initialized based on metadata values. This routine is guaranteed to be called any time the metadata values have changed.

The default implementation computes tables used by the decode method to rescale components to different bit depths. Thus, if this method is overridden, it is important for the subclass method to call super(), unless it overrides decode as well.

Annotations
@Override
decodeback to summary
public void decode() throws IOException

Overrides com.sun.imageio.plugins.tiff.TIFFDecompressor.decode.

Doc from com.sun.imageio.plugins.tiff.TIFFDecompressor.decode.

Decodes the input bit stream (located in the ImageInputStream stream, at offset offset, and continuing for byteCount bytes) into the output BufferedImage image.

The default implementation analyzes the destination image to determine if it is suitable as the destination for the decodeRaw method. If not, a suitable image is created. Next, decodeRaw is called to perform the actual decoding, and the results are copied into the destination image if necessary. Subsampling and offsetting are performed automatically.

The precise responsibilities of this routine are as follows. The input bit stream is defined by the instance variables stream, offset, and byteCount. These bits contain the data for the region of the source image defined by srcMinX, srcMinY, srcWidth, and srcHeight.

The source data is required to be subsampling, starting at the sourceXOffsetth column and including every subsampleXth pixel thereafter (and similarly for sourceYOffset and subsampleY).

Pixels are copied into the destination with an addition shift of (dstXOffset, dstYOffset). The complete set of formulas relating the source and destination coordinate spaces are:

dx = (sx - sourceXOffset)/subsampleX + dstXOffset;
dy = (sy - sourceYOffset)/subsampleY + dstYOffset;
Only source pixels such that (sx - sourceXOffset) % subsampleX == 0 and (sy - sourceYOffset) % subsampleY == 0 are copied.

The inverse mapping, from destination to source coordinates, is one-to-one:

sx = (dx - dstXOffset)*subsampleX + sourceXOffset;
sy = (dy - dstYOffset)*subsampleY + sourceYOffset;

The region of the destination image to be updated is given by the instance variables dstMinX, dstMinY, dstWidth, and dstHeight.

It is possible that not all of the source data being read will contribute to the destination image. For example, the destination offsets could be set such that some of the source pixels land outside of the bounds of the image. As a convenience, the bounds of the active source region (that is, the region of the strip or tile being read that actually contributes to the destination image, taking clipping into account) are available as activeSrcMinX, activeSrcMinY, activeSrcWidth and activeSrcHeight. Thus, the source pixel at (activeSrcMinX, activeSrcMinY) will map to the destination pixel (dstMinX, dstMinY).

The sequence of source bands given by sourceBands are to be copied into the sequence of bands in the destination given by destinationBands.

Some standard tag information is provided the instance variables photometricInterpretation, compression, samplesPerPixel, bitsPerSample, sampleFormat, extraSamples, and colorMap.

In practice, unless there is a significant performance advantage to be gained by overriding this routine, most users will prefer to use the default implementation of this routine, and instead override the decodeRaw and/or getRawImageType methods.

Annotations
@Override
Exceptions
IOException:
if an error occurs in decodeRaw.
decodeRawback to summary
public void decodeRaw(byte[] b, int dstOffset, int bitsPerPixel, int scanlineStride) throws IOException

Implements abstract com.sun.imageio.plugins.tiff.TIFFDecompressor.decodeRaw.

Doc from com.sun.imageio.plugins.tiff.TIFFDecompressor.decodeRaw.

Decodes the source data into the provided byte array b, starting at the offset given by dstOffset. Each pixel occupies bitsPerPixel bits, with no padding between pixels. Scanlines are separated by scanlineStride bytes.

Annotations
@Override
Exceptions
IOException:
if an error occurs reading from the source ImageInputStream.