Class TIFFYCbCrDecompressor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private int
private float
private boolean
private static final boolean
private TIFFDecompressor
private static final int
private static final float
private int[]
private int[]
private int[]
private int[]
private int[]
private int[]
private float
private float
private float
private float
private float
private float
private float
private float
private float
private BufferedImage
Fields inherited from class com.github.jaiimageio.plugins.tiff.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This routine is called prior to a sequence of calls to thedecode
method, in order to allow any necessary tables or other structures to be initialized based on metadata values.private byte
clamp
(int f) void
decodeRaw
(byte[] buf, int dstOffset, int bitsPerPixel, int scanlineStride) Decodes the source data into the providedbyte
arrayb
, starting at the offset given bydstOffset
.void
setActiveSrcHeight
(int activeSrcHeight) Sets the value of theactiveSrcHeight
field.void
setActiveSrcMinX
(int activeSrcMinX) Sets the value of theactiveSrcMinX
field.void
setActiveSrcMinY
(int activeSrcMinY) Sets the value of theactiveSrcMinY
field.void
setActiveSrcWidth
(int activeSrcWidth) Sets the value of theactiveSrcWidth
field.void
setBitsPerSample
(int[] bitsPerSample) Sets the value of thebitsPerSample
field.void
setByteCount
(int byteCount) Sets the value of thebyteCount
field.void
setColorMap
(char[] colorMap) Sets the value of thecolorMap
field.void
setCompression
(int compression) Sets the value of thecompression
field.void
setDestinationBands
(int[] destinationBands) Sets the value of thedestinationBands
field.void
setDstHeight
(int dstHeight) Sets the value of thedstHeight
field.void
setDstMinX
(int dstMinX) Sets the value of thedstMinX
field.void
setDstMinY
(int dstMinY) Sets the value of thedstMinY
field.void
setDstWidth
(int dstWidth) Sets the value of thedstWidth
field.void
setDstXOffset
(int dstXOffset) Sets the value of thedstXOffset
field.void
setDstYOffset
(int dstYOffset) Sets the value of thedstYOffset
field.void
setExtraSamples
(int[] extraSamples) Sets the value of theextraSamples
field.void
setImage
(BufferedImage image) Sets the value of theimage
field.void
setMetadata
(IIOMetadata metadata) Sets the value of themetadata
field.void
setOffset
(long offset) Sets the value of theoffset
field.void
setPhotometricInterpretation
(int photometricInterpretation) Sets the value of thephotometricInterpretation
field.void
setPlanar
(boolean planar) Sets the value of theplanar
field.void
setReader
(ImageReader reader) Sets the value of thereader
field.void
setSampleFormat
(int[] sampleFormat) Sets the value of thesampleFormat
field.void
setSamplesPerPixel
(int samplesPerPixel) Sets the value of thesamplesPerPixel
field.void
setSourceBands
(int[] sourceBands) Sets the value of thesourceBands
field.void
setSourceXOffset
(int sourceXOffset) Sets the value of thesourceXOffset
field.void
setSourceYOffset
(int sourceYOffset) Sets the value of thesourceYOffset
.void
setSrcHeight
(int srcHeight) Sets the value of thesrcHeight
field.void
setSrcMinX
(int srcMinX) Sets the value of thesrcMinX
field.void
setSrcMinY
(int srcMinY) Sets the value of thesrcMinY
field.void
setSrcWidth
(int srcWidth) Sets the value of thesrcWidth
field.void
setStream
(ImageInputStream stream) Sets the value of thestream
field.private void
Methods inherited from class com.github.jaiimageio.plugins.tiff.TIFFDecompressor
createRawImage, decode, decodeRaw, decodeRaw, decodeRaw, getRawImageType, getRawImageTypeSpecifier, setColorConverter, setSubsampleX, setSubsampleY
-
Field Details
-
debug
private static final boolean debug- See Also:
-
FRAC_BITS
private static final int FRAC_BITS- See Also:
-
FRAC_SCALE
private static final float FRAC_SCALE- See Also:
-
LumaRed
private float LumaRed -
LumaGreen
private float LumaGreen -
LumaBlue
private float LumaBlue -
referenceBlackY
private float referenceBlackY -
referenceWhiteY
private float referenceWhiteY -
referenceBlackCb
private float referenceBlackCb -
referenceWhiteCb
private float referenceWhiteCb -
referenceBlackCr
private float referenceBlackCr -
referenceWhiteCr
private float referenceWhiteCr -
codingRangeY
private float codingRangeY -
iYTab
private int[] iYTab -
iCbTab
private int[] iCbTab -
iCrTab
private int[] iCrTab -
iGYTab
private int[] iGYTab -
iGCbTab
private int[] iGCbTab -
iGCrTab
private int[] iGCrTab -
chromaSubsampleH
private int chromaSubsampleH -
chromaSubsampleV
private int chromaSubsampleV -
colorConvert
private boolean colorConvert -
decompressor
-
tmpImage
-
-
Constructor Details
-
TIFFYCbCrDecompressor
-
-
Method Details
-
warning
-
setReader
Description copied from class:TIFFDecompressor
Sets the value of thereader
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setReader
in classTIFFDecompressor
- Parameters:
reader
- the currentImageReader
.
-
setMetadata
Description copied from class:TIFFDecompressor
Sets the value of themetadata
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setMetadata
in classTIFFDecompressor
- Parameters:
metadata
- theIIOMetadata
object for the image being read.
-
setPhotometricInterpretation
public void setPhotometricInterpretation(int photometricInterpretation) Description copied from class:TIFFDecompressor
Sets the value of thephotometricInterpretation
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setPhotometricInterpretation
in classTIFFDecompressor
- Parameters:
photometricInterpretation
- the photometric interpretation value.
-
setCompression
public void setCompression(int compression) Description copied from class:TIFFDecompressor
Sets the value of thecompression
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setCompression
in classTIFFDecompressor
- Parameters:
compression
- the compression type.
-
setPlanar
public void setPlanar(boolean planar) Description copied from class:TIFFDecompressor
Sets the value of theplanar
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setPlanar
in classTIFFDecompressor
- 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 thesamplesPerPixel
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSamplesPerPixel
in classTIFFDecompressor
- 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 thebitsPerSample
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setBitsPerSample
in classTIFFDecompressor
- 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 thesampleFormat
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSampleFormat
in classTIFFDecompressor
- 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 theextraSamples
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setExtraSamples
in classTIFFDecompressor
- 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 thecolorMap
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setColorMap
in classTIFFDecompressor
- Parameters:
colorMap
- the color map to apply to the source data, as an array ofchar
s.
-
setStream
Description copied from class:TIFFDecompressor
Sets the value of thestream
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setStream
in classTIFFDecompressor
- Parameters:
stream
- theImageInputStream
to be read.
-
setOffset
public void setOffset(long offset) Description copied from class:TIFFDecompressor
Sets the value of theoffset
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setOffset
in classTIFFDecompressor
- 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 thebyteCount
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setByteCount
in classTIFFDecompressor
- Parameters:
byteCount
- the number of bytes of compressed data.
-
setSrcMinX
public void setSrcMinX(int srcMinX) Description copied from class:TIFFDecompressor
Sets the value of thesrcMinX
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSrcMinX
in classTIFFDecompressor
- 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 thesrcMinY
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSrcMinY
in classTIFFDecompressor
- 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 thesrcWidth
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSrcWidth
in classTIFFDecompressor
- 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 thesrcHeight
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSrcHeight
in classTIFFDecompressor
- 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 thesourceXOffset
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSourceXOffset
in classTIFFDecompressor
- 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 thedstXOffset
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstXOffset
in classTIFFDecompressor
- 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 thesourceYOffset
.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSourceYOffset
in classTIFFDecompressor
- 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 thedstYOffset
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstYOffset
in classTIFFDecompressor
- 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 thesourceBands
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setSourceBands
in classTIFFDecompressor
- Parameters:
sourceBands
- an array ofint
s specifying the source bands to be read.
-
setDestinationBands
public void setDestinationBands(int[] destinationBands) Description copied from class:TIFFDecompressor
Sets the value of thedestinationBands
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDestinationBands
in classTIFFDecompressor
- Parameters:
destinationBands
- an array ofint
s specifying the destination bands to be written.
-
setImage
Description copied from class:TIFFDecompressor
Sets the value of theimage
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setImage
in classTIFFDecompressor
- Parameters:
image
- the destinationBufferedImage
.
-
setDstMinX
public void setDstMinX(int dstMinX) Description copied from class:TIFFDecompressor
Sets the value of thedstMinX
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstMinX
in classTIFFDecompressor
- 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 thedstMinY
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstMinY
in classTIFFDecompressor
- 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 thedstWidth
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstWidth
in classTIFFDecompressor
- Parameters:
dstWidth
- the width of the destination region.
-
setDstHeight
public void setDstHeight(int dstHeight) Description copied from class:TIFFDecompressor
Sets the value of thedstHeight
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setDstHeight
in classTIFFDecompressor
- Parameters:
dstHeight
- the height of the destination region.
-
setActiveSrcMinX
public void setActiveSrcMinX(int activeSrcMinX) Description copied from class:TIFFDecompressor
Sets the value of theactiveSrcMinX
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcMinX
in classTIFFDecompressor
- 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 theactiveSrcMinY
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcMinY
in classTIFFDecompressor
- 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 theactiveSrcWidth
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcWidth
in classTIFFDecompressor
- Parameters:
activeSrcWidth
- the width of the active source region.
-
setActiveSrcHeight
public void setActiveSrcHeight(int activeSrcHeight) Description copied from class:TIFFDecompressor
Sets the value of theactiveSrcHeight
field.If this method is called, the
beginDecoding
method must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcHeight
in classTIFFDecompressor
- Parameters:
activeSrcHeight
- the height of the active source region.
-
clamp
private byte clamp(int f) -
beginDecoding
public void beginDecoding()Description copied from class:TIFFDecompressor
This routine is called prior to a sequence of calls to thedecode
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 callsuper()
, unless it overridesdecode
as well.- Overrides:
beginDecoding
in classTIFFDecompressor
-
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 providedbyte
arrayb
, starting at the offset given bydstOffset
. Each pixel occupiesbitsPerPixel
bits, with no padding between pixels. Scanlines are separated byscanlineStride
byte
s.- Specified by:
decodeRaw
in classTIFFDecompressor
- Parameters:
buf
- abyte
array to be written.dstOffset
- the starting offset inb
to be written.bitsPerPixel
- the number of bits for each pixel.scanlineStride
- the number ofbyte
s to advance between that starting pixels of each scanline.- Throws:
IOException
- if an error occurs reading from the sourceImageInputStream
.
-