Class TIFFYCbCrDecompressor
-
Field Summary
Fields inherited from class com.sun.media.imageio.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 TypeMethodDescriptionvoidThis routine is called prior to a sequence of calls to thedecodemethod, in order to allow any necessary tables or other structures to be initialized based on metadata values.voiddecodeRaw(byte[] buf, int dstOffset, int bitsPerPixel, int scanlineStride) Decodes the source data into the providedbytearrayb, starting at the offset given bydstOffset.voidsetActiveSrcHeight(int activeSrcHeight) Sets the value of theactiveSrcHeightfield.voidsetActiveSrcMinX(int activeSrcMinX) Sets the value of theactiveSrcMinXfield.voidsetActiveSrcMinY(int activeSrcMinY) Sets the value of theactiveSrcMinYfield.voidsetActiveSrcWidth(int activeSrcWidth) Sets the value of theactiveSrcWidthfield.voidsetBitsPerSample(int[] bitsPerSample) Sets the value of thebitsPerSamplefield.voidsetByteCount(int byteCount) Sets the value of thebyteCountfield.voidsetColorMap(char[] colorMap) Sets the value of thecolorMapfield.voidsetCompression(int compression) Sets the value of thecompressionfield.voidsetDestinationBands(int[] destinationBands) Sets the value of thedestinationBandsfield.voidsetDstHeight(int dstHeight) Sets the value of thedstHeightfield.voidsetDstMinX(int dstMinX) Sets the value of thedstMinXfield.voidsetDstMinY(int dstMinY) Sets the value of thedstMinYfield.voidsetDstWidth(int dstWidth) Sets the value of thedstWidthfield.voidsetDstXOffset(int dstXOffset) Sets the value of thedstXOffsetfield.voidsetDstYOffset(int dstYOffset) Sets the value of thedstYOffsetfield.voidsetExtraSamples(int[] extraSamples) Sets the value of theextraSamplesfield.voidsetImage(BufferedImage image) Sets the value of theimagefield.voidsetMetadata(IIOMetadata metadata) Sets the value of themetadatafield.voidsetOffset(long offset) Sets the value of theoffsetfield.voidsetPhotometricInterpretation(int photometricInterpretation) Sets the value of thephotometricInterpretationfield.voidsetPlanar(boolean planar) Sets the value of theplanarfield.voidsetReader(ImageReader reader) Sets the value of thereaderfield.voidsetSampleFormat(int[] sampleFormat) Sets the value of thesampleFormatfield.voidsetSamplesPerPixel(int samplesPerPixel) Sets the value of thesamplesPerPixelfield.voidsetSourceBands(int[] sourceBands) Sets the value of thesourceBandsfield.voidsetSourceXOffset(int sourceXOffset) Sets the value of thesourceXOffsetfield.voidsetSourceYOffset(int sourceYOffset) Sets the value of thesourceYOffset.voidsetSrcHeight(int srcHeight) Sets the value of thesrcHeightfield.voidsetSrcMinX(int srcMinX) Sets the value of thesrcMinXfield.voidsetSrcMinY(int srcMinY) Sets the value of thesrcMinYfield.voidsetSrcWidth(int srcWidth) Sets the value of thesrcWidthfield.voidsetStream(ImageInputStream stream) Sets the value of thestreamfield.Methods inherited from class com.sun.media.imageio.plugins.tiff.TIFFDecompressor
createRawImage, decode, decodeRaw, decodeRaw, decodeRaw, getRawImageType, getRawImageTypeSpecifier, setColorConverter, setSubsampleX, setSubsampleY
-
Constructor Details
-
TIFFYCbCrDecompressor
-
-
Method Details
-
setReader
Description copied from class:TIFFDecompressorSets the value of thereaderfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setReaderin classTIFFDecompressor- Parameters:
reader- the currentImageReader.
-
setMetadata
Description copied from class:TIFFDecompressorSets the value of themetadatafield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setMetadatain classTIFFDecompressor- Parameters:
metadata- theIIOMetadataobject for the image being read.
-
setPhotometricInterpretation
public void setPhotometricInterpretation(int photometricInterpretation) Description copied from class:TIFFDecompressorSets the value of thephotometricInterpretationfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setPhotometricInterpretationin classTIFFDecompressor- Parameters:
photometricInterpretation- the photometric interpretation value.
-
setCompression
public void setCompression(int compression) Description copied from class:TIFFDecompressorSets the value of thecompressionfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setCompressionin classTIFFDecompressor- Parameters:
compression- the compression type.
-
setPlanar
public void setPlanar(boolean planar) Description copied from class:TIFFDecompressorSets the value of theplanarfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setPlanarin classTIFFDecompressor- Parameters:
planar-trueif the image to be decoded is stored in planar format.
-
setSamplesPerPixel
public void setSamplesPerPixel(int samplesPerPixel) Description copied from class:TIFFDecompressorSets the value of thesamplesPerPixelfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSamplesPerPixelin classTIFFDecompressor- Parameters:
samplesPerPixel- the number of samples in each source pixel.
-
setBitsPerSample
public void setBitsPerSample(int[] bitsPerSample) Description copied from class:TIFFDecompressorSets the value of thebitsPerSamplefield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setBitsPerSamplein classTIFFDecompressor- Parameters:
bitsPerSample- the number of bits for each source image sample.
-
setSampleFormat
public void setSampleFormat(int[] sampleFormat) Description copied from class:TIFFDecompressorSets the value of thesampleFormatfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSampleFormatin 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:TIFFDecompressorSets the value of theextraSamplesfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setExtraSamplesin 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:TIFFDecompressorSets the value of thecolorMapfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setColorMapin classTIFFDecompressor- Parameters:
colorMap- the color map to apply to the source data, as an array ofchars.
-
setStream
Description copied from class:TIFFDecompressorSets the value of thestreamfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setStreamin classTIFFDecompressor- Parameters:
stream- theImageInputStreamto be read.
-
setOffset
public void setOffset(long offset) Description copied from class:TIFFDecompressorSets the value of theoffsetfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setOffsetin classTIFFDecompressor- Parameters:
offset- the offset of the beginning of the compressed data.
-
setByteCount
public void setByteCount(int byteCount) Description copied from class:TIFFDecompressorSets the value of thebyteCountfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setByteCountin classTIFFDecompressor- Parameters:
byteCount- the number of bytes of compressed data.
-
setSrcMinX
public void setSrcMinX(int srcMinX) Description copied from class:TIFFDecompressorSets the value of thesrcMinXfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSrcMinXin 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:TIFFDecompressorSets the value of thesrcMinYfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSrcMinYin 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:TIFFDecompressorSets the value of thesrcWidthfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSrcWidthin 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:TIFFDecompressorSets the value of thesrcHeightfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSrcHeightin 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:TIFFDecompressorSets the value of thesourceXOffsetfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSourceXOffsetin 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:TIFFDecompressorSets the value of thedstXOffsetfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstXOffsetin 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:TIFFDecompressorSets the value of thesourceYOffset.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSourceYOffsetin 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:TIFFDecompressorSets the value of thedstYOffsetfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstYOffsetin 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:TIFFDecompressorSets the value of thesourceBandsfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setSourceBandsin classTIFFDecompressor- Parameters:
sourceBands- an array ofints specifying the source bands to be read.
-
setDestinationBands
public void setDestinationBands(int[] destinationBands) Description copied from class:TIFFDecompressorSets the value of thedestinationBandsfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDestinationBandsin classTIFFDecompressor- Parameters:
destinationBands- an array ofints specifying the destination bands to be written.
-
setImage
Description copied from class:TIFFDecompressorSets the value of theimagefield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setImagein classTIFFDecompressor- Parameters:
image- the destinationBufferedImage.
-
setDstMinX
public void setDstMinX(int dstMinX) Description copied from class:TIFFDecompressorSets the value of thedstMinXfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstMinXin classTIFFDecompressor- Parameters:
dstMinX- the minimum X coordinate of the destination region.
-
setDstMinY
public void setDstMinY(int dstMinY) Description copied from class:TIFFDecompressorSets the value of thedstMinYfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstMinYin classTIFFDecompressor- Parameters:
dstMinY- the minimum Y coordinate of the destination region.
-
setDstWidth
public void setDstWidth(int dstWidth) Description copied from class:TIFFDecompressorSets the value of thedstWidthfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstWidthin classTIFFDecompressor- Parameters:
dstWidth- the width of the destination region.
-
setDstHeight
public void setDstHeight(int dstHeight) Description copied from class:TIFFDecompressorSets the value of thedstHeightfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setDstHeightin classTIFFDecompressor- Parameters:
dstHeight- the height of the destination region.
-
setActiveSrcMinX
public void setActiveSrcMinX(int activeSrcMinX) Description copied from class:TIFFDecompressorSets the value of theactiveSrcMinXfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcMinXin classTIFFDecompressor- Parameters:
activeSrcMinX- the minimum X coordinate of the active source region.
-
setActiveSrcMinY
public void setActiveSrcMinY(int activeSrcMinY) Description copied from class:TIFFDecompressorSets the value of theactiveSrcMinYfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcMinYin classTIFFDecompressor- Parameters:
activeSrcMinY- the minimum Y coordinate of the active source region.
-
setActiveSrcWidth
public void setActiveSrcWidth(int activeSrcWidth) Description copied from class:TIFFDecompressorSets the value of theactiveSrcWidthfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcWidthin classTIFFDecompressor- Parameters:
activeSrcWidth- the width of the active source region.
-
setActiveSrcHeight
public void setActiveSrcHeight(int activeSrcHeight) Description copied from class:TIFFDecompressorSets the value of theactiveSrcHeightfield.If this method is called, the
beginDecodingmethod must be called prior to calling any of the decode methods.- Overrides:
setActiveSrcHeightin classTIFFDecompressor- Parameters:
activeSrcHeight- the height of the active source region.
-
beginDecoding
public void beginDecoding()Description copied from class:TIFFDecompressorThis routine is called prior to a sequence of calls to thedecodemethod, 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
decodemethod to rescale components to different bit depths. Thus, if this method is overridden, it is important for the subclass method to callsuper(), unless it overridesdecodeas well.- Overrides:
beginDecodingin classTIFFDecompressor
-
decodeRaw
public void decodeRaw(byte[] buf, int dstOffset, int bitsPerPixel, int scanlineStride) throws IOException Description copied from class:TIFFDecompressorDecodes the source data into the providedbytearrayb, starting at the offset given bydstOffset. Each pixel occupiesbitsPerPixelbits, with no padding between pixels. Scanlines are separated byscanlineStridebytes.- Specified by:
decodeRawin classTIFFDecompressor- Parameters:
buf- abytearray to be written.dstOffset- the starting offset inbto be written.bitsPerPixel- the number of bits for each pixel.scanlineStride- the number ofbytes to advance between that starting pixels of each scanline.- Throws:
IOException- if an error occurs reading from the sourceImageInputStream.
-