it.geosolutions.imageioimpl.plugins.tiff
Class TIFFYCbCrDecompressor

Object
  extended by TIFFDecompressor
      extended by TIFFYCbCrDecompressor

public class TIFFYCbCrDecompressor
extends TIFFDecompressor


Field Summary
 
Fields inherited from class TIFFDecompressor
activeSrcHeight, activeSrcMinX, activeSrcMinY, activeSrcWidth, bitsPerSample, byteCount, colorConverter, colorMap, compression, destinationBands, dstHeight, dstMinX, dstMinY, dstWidth, dstXOffset, dstYOffset, extraSamples, image, metadata, offset, photometricInterpretation, planar, rawImage, reader, sampleFormat, samplesPerPixel, sourceBands, sourceXOffset, sourceYOffset, srcHeight, srcMinX, srcMinY, srcWidth, stream, subsampleX, subsampleY
 
Constructor Summary
TIFFYCbCrDecompressor(TIFFDecompressor decompressor, boolean colorConvert)
           
 
Method Summary
 void 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.
 void decodeRaw(byte[] buf, int dstOffset, int bitsPerPixel, int scanlineStride)
          Decodes the source data into the provided byte array b, starting at the offset given by dstOffset.
 void setActiveSrcHeight(int activeSrcHeight)
          Sets the value of the activeSrcHeight field.
 void setActiveSrcMinX(int activeSrcMinX)
          Sets the value of the activeSrcMinX field.
 void setActiveSrcMinY(int activeSrcMinY)
          Sets the value of the activeSrcMinY field.
 void setActiveSrcWidth(int activeSrcWidth)
          Sets the value of the activeSrcWidth field.
 void setBitsPerSample(int[] bitsPerSample)
          Sets the value of the bitsPerSample field.
 void setByteCount(int byteCount)
          Sets the value of the byteCount field.
 void setColorMap(char[] colorMap)
          Sets the value of the colorMap field.
 void setCompression(int compression)
          Sets the value of the compression field.
 void setDestinationBands(int[] destinationBands)
          Sets the value of the destinationBands field.
 void setDstHeight(int dstHeight)
          Sets the value of the dstHeight field.
 void setDstMinX(int dstMinX)
          Sets the value of the dstMinX field.
 void setDstMinY(int dstMinY)
          Sets the value of the dstMinY field.
 void setDstWidth(int dstWidth)
          Sets the value of the dstWidth field.
 void setDstXOffset(int dstXOffset)
          Sets the value of the dstXOffset field.
 void setDstYOffset(int dstYOffset)
          Sets the value of the dstYOffset field.
 void setExtraSamples(int[] extraSamples)
          Sets the value of the extraSamples field.
 void setImage(BufferedImage image)
          Sets the value of the image field.
 void setMetadata(IIOMetadata metadata)
          Sets the value of the metadata field.
 void setOffset(long offset)
          Sets the value of the offset field.
 void setPhotometricInterpretation(int photometricInterpretation)
          Sets the value of the photometricInterpretation field.
 void setPlanar(boolean planar)
          Sets the value of the planar field.
 void setReader(ImageReader reader)
          Sets the value of the reader field.
 void setSampleFormat(int[] sampleFormat)
          Sets the value of the sampleFormat field.
 void setSamplesPerPixel(int samplesPerPixel)
          Sets the value of the samplesPerPixel field.
 void setSourceBands(int[] sourceBands)
          Sets the value of the sourceBands field.
 void setSourceXOffset(int sourceXOffset)
          Sets the value of the sourceXOffset field.
 void setSourceYOffset(int sourceYOffset)
          Sets the value of the sourceYOffset.
 void setSrcHeight(int srcHeight)
          Sets the value of the srcHeight field.
 void setSrcMinX(int srcMinX)
          Sets the value of the srcMinX field.
 void setSrcMinY(int srcMinY)
          Sets the value of the srcMinY field.
 void setSrcWidth(int srcWidth)
          Sets the value of the srcWidth field.
 void setStream(ImageInputStream stream)
          Sets the value of the stream field.
 
Methods inherited from class TIFFDecompressor
createRawImage, decode, decodeRaw, decodeRaw, decodeRaw, decodeRaw, getRawImageType, getRawImageTypeSpecifier, setColorConverter, setSubsampleX, setSubsampleY
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TIFFYCbCrDecompressor

public TIFFYCbCrDecompressor(TIFFDecompressor decompressor,
                             boolean colorConvert)
Method Detail

setReader

public void setReader(ImageReader reader)
Description copied from class: TIFFDecompressor
Sets the value of the reader field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setReader in class TIFFDecompressor
Parameters:
reader - the current ImageReader.

setMetadata

public void setMetadata(IIOMetadata metadata)
Description copied from class: TIFFDecompressor
Sets the value of the metadata field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setMetadata in class TIFFDecompressor
Parameters:
metadata - the IIOMetadata object for the image being read.

setPhotometricInterpretation

public void setPhotometricInterpretation(int photometricInterpretation)
Description copied from class: TIFFDecompressor
Sets the value of the photometricInterpretation field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setPhotometricInterpretation in class TIFFDecompressor
Parameters:
photometricInterpretation - the photometric interpretation value.

setCompression

public void setCompression(int compression)
Description copied from class: TIFFDecompressor
Sets the value of the compression field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setCompression in class TIFFDecompressor
Parameters:
compression - the compression type.

setPlanar

public void setPlanar(boolean planar)
Description copied from class: TIFFDecompressor
Sets the value of the planar field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setPlanar in class TIFFDecompressor
Parameters:
planar - true if the image to be decoded is stored in planar format.

setSamplesPerPixel

public void setSamplesPerPixel(int samplesPerPixel)
Description copied from class: TIFFDecompressor
Sets the value of the samplesPerPixel field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSamplesPerPixel in class TIFFDecompressor
Parameters:
samplesPerPixel - the number of samples in each source pixel.

setBitsPerSample

public void setBitsPerSample(int[] bitsPerSample)
Description copied from class: TIFFDecompressor
Sets the value of the bitsPerSample field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setBitsPerSample in class TIFFDecompressor
Parameters:
bitsPerSample - the number of bits for each source image sample.

setSampleFormat

public void setSampleFormat(int[] sampleFormat)
Description copied from class: TIFFDecompressor
Sets the value of the sampleFormat field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSampleFormat in class TIFFDecompressor
Parameters:
sampleFormat - the format of the source image data, for example unsigned integer or floating-point.

setExtraSamples

public void setExtraSamples(int[] extraSamples)
Description copied from class: TIFFDecompressor
Sets the value of the extraSamples field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setExtraSamples in class TIFFDecompressor
Parameters:
extraSamples - the interpretation of any samples in the source file beyond those used for basic color or grayscale information.

setColorMap

public void setColorMap(char[] colorMap)
Description copied from class: TIFFDecompressor
Sets the value of the colorMap field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setColorMap in class TIFFDecompressor
Parameters:
colorMap - the color map to apply to the source data, as an array of chars.

setStream

public void setStream(ImageInputStream stream)
Description copied from class: TIFFDecompressor
Sets the value of the stream field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setStream in class TIFFDecompressor
Parameters:
stream - the ImageInputStream to be read.

setOffset

public void setOffset(long offset)
Description copied from class: TIFFDecompressor
Sets the value of the offset field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setOffset in class TIFFDecompressor
Parameters:
offset - the offset of the beginning of the compressed data.

setByteCount

public void setByteCount(int byteCount)
Description copied from class: TIFFDecompressor
Sets the value of the byteCount field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setByteCount in class TIFFDecompressor
Parameters:
byteCount - the number of bytes of compressed data.

setSrcMinX

public void setSrcMinX(int srcMinX)
Description copied from class: TIFFDecompressor
Sets the value of the srcMinX field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSrcMinX in class TIFFDecompressor
Parameters:
srcMinX - the minimum X coordinate of the source region being decoded, irrespective of how it will be copied into the destination.

setSrcMinY

public void setSrcMinY(int srcMinY)
Description copied from class: TIFFDecompressor
Sets the value of the srcMinY field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSrcMinY in class TIFFDecompressor
Parameters:
srcMinY - the minimum Y coordinate of the source region being decoded, irrespective of how it will be copied into the destination.

setSrcWidth

public void setSrcWidth(int srcWidth)
Description copied from class: TIFFDecompressor
Sets the value of the srcWidth field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSrcWidth in class TIFFDecompressor
Parameters:
srcWidth - the width of the source region being decoded, irrespective of how it will be copied into the destination.

setSrcHeight

public void setSrcHeight(int srcHeight)
Description copied from class: TIFFDecompressor
Sets the value of the srcHeight field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSrcHeight in class TIFFDecompressor
Parameters:
srcHeight - the height of the source region being decoded, irrespective of how it will be copied into the destination.

setSourceXOffset

public void setSourceXOffset(int sourceXOffset)
Description copied from class: TIFFDecompressor
Sets the value of the sourceXOffset field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSourceXOffset in class TIFFDecompressor
Parameters:
sourceXOffset - the horizontal source offset to be used when mapping between source and destination coordinates.

setDstXOffset

public void setDstXOffset(int dstXOffset)
Description copied from class: TIFFDecompressor
Sets the value of the dstXOffset field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstXOffset in class TIFFDecompressor
Parameters:
dstXOffset - the horizontal destination offset to be used when mapping between source and destination coordinates.

setSourceYOffset

public void setSourceYOffset(int sourceYOffset)
Description copied from class: TIFFDecompressor
Sets the value of the sourceYOffset.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSourceYOffset in class TIFFDecompressor
Parameters:
sourceYOffset - the vertical source offset to be used when mapping between source and destination coordinates.

setDstYOffset

public void setDstYOffset(int dstYOffset)
Description copied from class: TIFFDecompressor
Sets the value of the dstYOffset field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstYOffset in class TIFFDecompressor
Parameters:
dstYOffset - the vertical destination offset to be used when mapping between source and destination coordinates.

setSourceBands

public void setSourceBands(int[] sourceBands)
Description copied from class: TIFFDecompressor
Sets the value of the sourceBands field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setSourceBands in class TIFFDecompressor
Parameters:
sourceBands - an array of ints specifying the source bands to be read.

setDestinationBands

public void setDestinationBands(int[] destinationBands)
Description copied from class: TIFFDecompressor
Sets the value of the destinationBands field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDestinationBands in class TIFFDecompressor
Parameters:
destinationBands - an array of ints specifying the destination bands to be written.

setImage

public void setImage(BufferedImage image)
Description copied from class: TIFFDecompressor
Sets the value of the image field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setImage in class TIFFDecompressor
Parameters:
image - the destination BufferedImage.

setDstMinX

public void setDstMinX(int dstMinX)
Description copied from class: TIFFDecompressor
Sets the value of the dstMinX field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstMinX in class TIFFDecompressor
Parameters:
dstMinX - the minimum X coordinate of the destination region.

setDstMinY

public void setDstMinY(int dstMinY)
Description copied from class: TIFFDecompressor
Sets the value of the dstMinY field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstMinY in class TIFFDecompressor
Parameters:
dstMinY - the minimum Y coordinate of the destination region.

setDstWidth

public void setDstWidth(int dstWidth)
Description copied from class: TIFFDecompressor
Sets the value of the dstWidth field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstWidth in class TIFFDecompressor
Parameters:
dstWidth - the width of the destination region.

setDstHeight

public void setDstHeight(int dstHeight)
Description copied from class: TIFFDecompressor
Sets the value of the dstHeight field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setDstHeight in class TIFFDecompressor
Parameters:
dstHeight - the height of the destination region.

setActiveSrcMinX

public void setActiveSrcMinX(int activeSrcMinX)
Description copied from class: TIFFDecompressor
Sets the value of the activeSrcMinX field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setActiveSrcMinX in class TIFFDecompressor
Parameters:
activeSrcMinX - the minimum X coordinate of the active source region.

setActiveSrcMinY

public void setActiveSrcMinY(int activeSrcMinY)
Description copied from class: TIFFDecompressor
Sets the value of the activeSrcMinY field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setActiveSrcMinY in class TIFFDecompressor
Parameters:
activeSrcMinY - the minimum Y coordinate of the active source region.

setActiveSrcWidth

public void setActiveSrcWidth(int activeSrcWidth)
Description copied from class: TIFFDecompressor
Sets the value of the activeSrcWidth field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setActiveSrcWidth in class TIFFDecompressor
Parameters:
activeSrcWidth - the width of the active source region.

setActiveSrcHeight

public void setActiveSrcHeight(int activeSrcHeight)
Description copied from class: TIFFDecompressor
Sets the value of the activeSrcHeight field.

If this method is called, the beginDecoding method must be called prior to calling any of the decode methods.

Overrides:
setActiveSrcHeight in class TIFFDecompressor
Parameters:
activeSrcHeight - the height of the active source region.

beginDecoding

public void beginDecoding()
Description copied from class: TIFFDecompressor
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.

Overrides:
beginDecoding in class TIFFDecompressor

decodeRaw

public void decodeRaw(byte[] buf,
                      int dstOffset,
                      int bitsPerPixel,
                      int scanlineStride)
               throws IOException
Description copied from class: TIFFDecompressor
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.

Specified by:
decodeRaw in class TIFFDecompressor
Parameters:
buf - a byte array to be written.
dstOffset - the starting offset in b to be written.
bitsPerPixel - the number of bits for each pixel.
scanlineStride - the number of bytes to advance between that starting pixels of each scanline.
Throws:
IOException - if an error occurs reading from the source ImageInputStream.


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.