public class TIFFYCbCrDecompressor extends 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 and Description |
---|
TIFFYCbCrDecompressor(TIFFDecompressor decompressor,
boolean colorConvert) |
Modifier and Type | Method and Description |
---|---|
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(java.awt.image.BufferedImage image)
Sets the value of the
image field. |
void |
setMetadata(javax.imageio.metadata.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(javax.imageio.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(javax.imageio.stream.ImageInputStream stream)
Sets the value of the
stream field. |
createRawImage, decode, decodeRaw, decodeRaw, decodeRaw, getRawImageType, getRawImageTypeSpecifier, setColorConverter, setSubsampleX, setSubsampleY
public TIFFYCbCrDecompressor(TIFFDecompressor decompressor, boolean colorConvert)
public void setReader(javax.imageio.ImageReader reader)
TIFFDecompressor
reader
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setReader
in class TIFFDecompressor
reader
- the current ImageReader
.public void setMetadata(javax.imageio.metadata.IIOMetadata metadata)
TIFFDecompressor
metadata
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setMetadata
in class TIFFDecompressor
metadata
- the IIOMetadata
object for the
image being read.public void setPhotometricInterpretation(int photometricInterpretation)
TIFFDecompressor
photometricInterpretation
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setPhotometricInterpretation
in class TIFFDecompressor
photometricInterpretation
- the photometric interpretation
value.public void setCompression(int compression)
TIFFDecompressor
compression
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setCompression
in class TIFFDecompressor
compression
- the compression type.public void setPlanar(boolean planar)
TIFFDecompressor
planar
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setPlanar
in class TIFFDecompressor
planar
- true
if the image to be decoded is
stored in planar format.public void setSamplesPerPixel(int samplesPerPixel)
TIFFDecompressor
samplesPerPixel
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSamplesPerPixel
in class TIFFDecompressor
samplesPerPixel
- the number of samples in each source
pixel.public void setBitsPerSample(int[] bitsPerSample)
TIFFDecompressor
bitsPerSample
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setBitsPerSample
in class TIFFDecompressor
bitsPerSample
- the number of bits for each source image
sample.public void setSampleFormat(int[] sampleFormat)
TIFFDecompressor
sampleFormat
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSampleFormat
in class TIFFDecompressor
sampleFormat
- the format of the source image data,
for example unsigned integer or floating-point.public void setExtraSamples(int[] extraSamples)
TIFFDecompressor
extraSamples
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setExtraSamples
in class TIFFDecompressor
extraSamples
- the interpretation of any samples in the
source file beyond those used for basic color or grayscale
information.public void setColorMap(char[] colorMap)
TIFFDecompressor
colorMap
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setColorMap
in class TIFFDecompressor
colorMap
- the color map to apply to the source data,
as an array of char
s.public void setStream(javax.imageio.stream.ImageInputStream stream)
TIFFDecompressor
stream
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setStream
in class TIFFDecompressor
stream
- the ImageInputStream
to be read.public void setOffset(long offset)
TIFFDecompressor
offset
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setOffset
in class TIFFDecompressor
offset
- the offset of the beginning of the compressed
data.public void setByteCount(int byteCount)
TIFFDecompressor
byteCount
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setByteCount
in class TIFFDecompressor
byteCount
- the number of bytes of compressed data.public void setSrcMinX(int srcMinX)
TIFFDecompressor
srcMinX
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSrcMinX
in class TIFFDecompressor
srcMinX
- the minimum X coordinate of the source region
being decoded, irrespective of how it will be copied into the
destination.public void setSrcMinY(int srcMinY)
TIFFDecompressor
srcMinY
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSrcMinY
in class TIFFDecompressor
srcMinY
- the minimum Y coordinate of the source region
being decoded, irrespective of how it will be copied into the
destination.public void setSrcWidth(int srcWidth)
TIFFDecompressor
srcWidth
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSrcWidth
in class TIFFDecompressor
srcWidth
- the width of the source region being decoded,
irrespective of how it will be copied into the destination.public void setSrcHeight(int srcHeight)
TIFFDecompressor
srcHeight
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSrcHeight
in class TIFFDecompressor
srcHeight
- the height of the source region being decoded,
irrespective of how it will be copied into the destination.public void setSourceXOffset(int sourceXOffset)
TIFFDecompressor
sourceXOffset
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSourceXOffset
in class TIFFDecompressor
sourceXOffset
- the horizontal source offset to be used when
mapping between source and destination coordinates.public void setDstXOffset(int dstXOffset)
TIFFDecompressor
dstXOffset
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstXOffset
in class TIFFDecompressor
dstXOffset
- the horizontal destination offset to be
used when mapping between source and destination coordinates.public void setSourceYOffset(int sourceYOffset)
TIFFDecompressor
sourceYOffset
.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSourceYOffset
in class TIFFDecompressor
sourceYOffset
- the vertical source offset to be used when
mapping between source and destination coordinates.public void setDstYOffset(int dstYOffset)
TIFFDecompressor
dstYOffset
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstYOffset
in class TIFFDecompressor
dstYOffset
- the vertical destination offset to be
used when mapping between source and destination coordinates.public void setSourceBands(int[] sourceBands)
TIFFDecompressor
sourceBands
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setSourceBands
in class TIFFDecompressor
sourceBands
- an array of int
s
specifying the source bands to be read.public void setDestinationBands(int[] destinationBands)
TIFFDecompressor
destinationBands
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDestinationBands
in class TIFFDecompressor
destinationBands
- an array of int
s
specifying the destination bands to be written.public void setImage(java.awt.image.BufferedImage image)
TIFFDecompressor
image
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setImage
in class TIFFDecompressor
image
- the destination BufferedImage
.public void setDstMinX(int dstMinX)
TIFFDecompressor
dstMinX
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstMinX
in class TIFFDecompressor
dstMinX
- the minimum X coordinate of the destination
region.public void setDstMinY(int dstMinY)
TIFFDecompressor
dstMinY
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstMinY
in class TIFFDecompressor
dstMinY
- the minimum Y coordinate of the destination
region.public void setDstWidth(int dstWidth)
TIFFDecompressor
dstWidth
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstWidth
in class TIFFDecompressor
dstWidth
- the width of the destination region.public void setDstHeight(int dstHeight)
TIFFDecompressor
dstHeight
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setDstHeight
in class TIFFDecompressor
dstHeight
- the height of the destination region.public void setActiveSrcMinX(int activeSrcMinX)
TIFFDecompressor
activeSrcMinX
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setActiveSrcMinX
in class TIFFDecompressor
activeSrcMinX
- the minimum X coordinate of the active
source region.public void setActiveSrcMinY(int activeSrcMinY)
TIFFDecompressor
activeSrcMinY
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setActiveSrcMinY
in class TIFFDecompressor
activeSrcMinY
- the minimum Y coordinate of the active
source region.public void setActiveSrcWidth(int activeSrcWidth)
TIFFDecompressor
activeSrcWidth
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setActiveSrcWidth
in class TIFFDecompressor
activeSrcWidth
- the width of the active source region.public void setActiveSrcHeight(int activeSrcHeight)
TIFFDecompressor
activeSrcHeight
field.
If this method is called, the beginDecoding
method must be called prior to calling any of the decode
methods.
setActiveSrcHeight
in class TIFFDecompressor
activeSrcHeight
- the height of the active source region.public void beginDecoding()
TIFFDecompressor
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.
beginDecoding
in class TIFFDecompressor
public void decodeRaw(byte[] buf, int dstOffset, int bitsPerPixel, int scanlineStride) throws java.io.IOException
TIFFDecompressor
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
byte
s.decodeRaw
in class TIFFDecompressor
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 byte
s to
advance between that starting pixels of each scanline.java.io.IOException
- if an error occurs reading from the source
ImageInputStream
.Copyright © 2014 Open Microscopy Environment