Class TJDecompressor
- java.lang.Object
- 
- org.libjpegturbo.turbojpeg.TJDecompressor
 
- 
- All Implemented Interfaces:
- java.io.Closeable,- java.lang.AutoCloseable
 - Direct Known Subclasses:
- TJTransformer
 
 public class TJDecompressor extends java.lang.Object implements java.io.CloseableTurboJPEG decompressor
- 
- 
Constructor SummaryConstructors Constructor Description TJDecompressor()Create a TurboJPEG decompresssor instance.TJDecompressor(byte[] jpegImage)Create a TurboJPEG decompressor instance and associate the JPEG source image or "abbreviated table specification" (AKA "tables-only") datastream stored injpegImagewith the newly created instance.TJDecompressor(byte[] jpegImage, int imageSize)Create a TurboJPEG decompressor instance and associate the JPEG source image or "abbreviated table specification" (AKA "tables-only") datastream of lengthimageSizebytes stored injpegImagewith the newly created instance.TJDecompressor(YUVImage yuvImage)Create a TurboJPEG decompressor instance and associate the 8-bit-per-sample planar YUV source image stored inyuvImagewith the newly created instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidclose()Free the native structures associated with this decompressor instance.voiddecompress(byte[] dstBuf, int x, int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)Deprecated.voiddecompress(int[] dstBuf, int x, int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat, int flags)Deprecated.java.awt.image.BufferedImagedecompress(int desiredWidth, int desiredHeight, int bufferedImageType, int flags)Deprecated.byte[]decompress(int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags)Deprecated.voiddecompress(java.awt.image.BufferedImage dstImage, int flags)Deprecated.short[]decompress12(int pitch, int pixelFormat)Decompress the 12-bit-per-sample JPEG source image associated with this decompressor instance and return a buffer containing a 12-bit-per-sample packed-pixel decompressed image.voiddecompress12(short[] dstBuf, int x, int y, int pitch, int pixelFormat)Decompress the 12-bit-per-sample JPEG source image associated with this decompressor instance and output a 12-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.short[]decompress16(int pitch, int pixelFormat)Decompress the 16-bit-per-sample JPEG source image associated with this decompressor instance and return a buffer containing a 16-bit-per-sample packed-pixel decompressed image.voiddecompress16(short[] dstBuf, int x, int y, int pitch, int pixelFormat)Decompress the 16-bit-per-sample lossless JPEG source image associated with this decompressor instance and output a 16-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.voiddecompress8(byte[] dstBuf, int x, int y, int pitch, int pixelFormat)Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.java.awt.image.BufferedImagedecompress8(int bufferedImageType)Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and return aBufferedImageinstance containing the 8-bit-per-sample packed-pixel decompressed/decoded image.voiddecompress8(int[] dstBuf, int x, int y, int stride, int pixelFormat)Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.byte[]decompress8(int pitch, int pixelFormat)Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and return a buffer containing an 8-bit-per-sample packed-pixel decompressed image.voiddecompress8(java.awt.image.BufferedImage dstImage)Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel decompressed/decoded image to the givenBufferedImageinstance.YUVImagedecompressToYUV(int align)Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into an 8-bit-per-sample unified planar YUV image and return aYUVImageinstance containing the decompressed image.YUVImagedecompressToYUV(int[] strides)Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes and return aYUVImageinstance containing the decompressed image planes.YUVImagedecompressToYUV(int desiredWidth, int[] strides, int desiredHeight, int flags)Deprecated.YUVImagedecompressToYUV(int desiredWidth, int align, int desiredHeight, int flags)Deprecated.voiddecompressToYUV(YUVImage dstImage)Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into an 8-bit-per-sample planar YUV image and store it in the givenYUVImageinstance.voiddecompressToYUV(YUVImage dstImage, int flags)Deprecated.protected voidfinalize()intget(int param)Get the value of a decompression parameter.intgetColorspace()Deprecated.Useget(TJ.PARAM_COLORSPACE)intgetHeight()Returns the height of the source image (JPEG or YUV) associated with this decompressor instance.byte[]getJPEGBuf()Returns the JPEG buffer associated with this decompressor instance.intgetJPEGSize()Returns the size of the JPEG image (in bytes) associated with this decompressor instance.intgetScaledHeight(int desiredWidth, int desiredHeight)Deprecated.UsesetScalingFactor()andTJScalingFactor.getScaled()instead.intgetScaledWidth(int desiredWidth, int desiredHeight)Deprecated.UsesetScalingFactor()andTJScalingFactor.getScaled()instead.intgetSubsamp()Deprecated.Useget(TJ.PARAM_SUBSAMP)intgetWidth()Returns the width of the source image (JPEG or YUV) associated with this decompressor instance.voidset(int param, int value)Set the value of a decompression parameter.voidsetCroppingRegion(java.awt.Rectangle croppingRegion)Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.voidsetScalingFactor(TJScalingFactor scalingFactor)Set the scaling factor for subsequent lossy decompression operations.voidsetSourceImage(byte[] jpegImage, int imageSize)Associate the JPEG image or "abbreviated table specification" (AKA "tables-only") datastream of lengthimageSizebytes stored injpegImagewith this decompressor instance.voidsetSourceImage(YUVImage srcImage)Associate the specified planar YUV source image with this decompressor instance.
 
- 
- 
- 
Constructor Detail- 
TJDecompressorpublic TJDecompressor() throws TJExceptionCreate a TurboJPEG decompresssor instance.- Throws:
- TJException
 
 - 
TJDecompressorpublic TJDecompressor(byte[] jpegImage) throws TJExceptionCreate a TurboJPEG decompressor instance and associate the JPEG source image or "abbreviated table specification" (AKA "tables-only") datastream stored injpegImagewith the newly created instance. Refer tosetSourceImage(byte[], int)for more details.- Parameters:
- jpegImage- buffer containing a JPEG source image or tables-only datastream. (The size of the JPEG image or datastream is assumed to be the length of the array.) This buffer is not modified.
- Throws:
- TJException
 
 - 
TJDecompressorpublic TJDecompressor(byte[] jpegImage, int imageSize) throws TJExceptionCreate a TurboJPEG decompressor instance and associate the JPEG source image or "abbreviated table specification" (AKA "tables-only") datastream of lengthimageSizebytes stored injpegImagewith the newly created instance. Refer tosetSourceImage(byte[], int)for more details.- Parameters:
- jpegImage- buffer containing a JPEG source image or tables-only datastream. This buffer is not modified.
- imageSize- size of the JPEG source image or tables-only datastream (in bytes)
- Throws:
- TJException
 
 - 
TJDecompressorpublic TJDecompressor(YUVImage yuvImage) throws TJException Create a TurboJPEG decompressor instance and associate the 8-bit-per-sample planar YUV source image stored inyuvImagewith the newly created instance. Refer tosetSourceImage(YUVImage)for more details.- Parameters:
- yuvImage-- YUVImageinstance containing a planar YUV source image to be decoded. This image is not modified.
- Throws:
- TJException
 
 
- 
 - 
Method Detail- 
setSourceImagepublic void setSourceImage(byte[] jpegImage, int imageSize) throws TJExceptionAssociate the JPEG image or "abbreviated table specification" (AKA "tables-only") datastream of lengthimageSizebytes stored injpegImagewith this decompressor instance. IfjpegImagecontains a JPEG image, then this image will be used as the source image for subsequent decompression operations. Passing a tables-only datastream to this method primes the decompressor with quantization and Huffman tables that can be used when decompressing subsequent "abbreviated image" datastreams. This is useful, for instance, when decompressing video streams in which all frames share the same quantization and Huffman tables. If a JPEG image is passed to this method, then theparametersthat describe the JPEG image will be set when the method returns.- Parameters:
- jpegImage- buffer containing a JPEG source image or tables-only datastream. This buffer is not modified.
- imageSize- size of the JPEG source image or tables-only datastream (in bytes)
- Throws:
- TJException
 
 - 
setSourceImagepublic void setSourceImage(YUVImage srcImage) Associate the specified planar YUV source image with this decompressor instance. Subsequent decompression operations will decode this image into a packed-pixel RGB or grayscale destination image. This method setsTJ.PARAM_SUBSAMPto the chrominance subsampling level of the source image.- Parameters:
- srcImage-- YUVImageinstance containing a planar YUV source image to be decoded. This image is not modified.
 
 - 
getWidthpublic int getWidth() Returns the width of the source image (JPEG or YUV) associated with this decompressor instance.- Returns:
- the width of the source image (JPEG or YUV) associated with this decompressor instance.
 
 - 
getHeightpublic int getHeight() Returns the height of the source image (JPEG or YUV) associated with this decompressor instance.- Returns:
- the height of the source image (JPEG or YUV) associated with this decompressor instance.
 
 - 
setpublic void set(int param, int value)Set the value of a decompression parameter.- Parameters:
- param- one of- TJ.PARAM_*
- value- value of the decompression parameter (refer to- parameter documentation)
 
 - 
getpublic int get(int param) Get the value of a decompression parameter.- Parameters:
- param- one of- TJ.PARAM_*
- Returns:
- the value of the specified decompression parameter, or -1 if the value is unknown.
 
 - 
setScalingFactorpublic void setScalingFactor(TJScalingFactor scalingFactor) Set the scaling factor for subsequent lossy decompression operations.- Parameters:
- scalingFactor-- TJScalingFactorinstance that specifies a fractional scaling factor that the decompressor supports (see- TJ.getScalingFactors()), or- TJ.UNSCALEDfor no scaling. Decompression scaling is a function of the IDCT algorithm, so scaling factors are generally limited to multiples of 1/8. If the entire JPEG image will be decompressed, then the width and height of the scaled destination image can be determined by calling- scalingFactor.- getScaled()with the JPEG image width and height (see- getWidth()and- getHeight().) When decompressing into a planar YUV image, an intermediate buffer copy will be performed if the width or height of the scaled destination image is not an even multiple of the MCU block size (see- TJ.getMCUWidth()and- TJ.getMCUHeight().) Note that decompression scaling is not available (and the specified scaling factor is ignored) when decompressing lossless JPEG images (see- TJ.PARAM_LOSSLESS), since the IDCT algorithm is not used with those images. Note also that- TJ.PARAM_FASTDCTis ignored when decompression scaling is enabled.
 
 - 
setCroppingRegionpublic void setCroppingRegion(java.awt.Rectangle croppingRegion) throws TJExceptionSet the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.- Parameters:
- croppingRegion-- java.awt.Rectangleinstance that specifies a subregion of the JPEG image to decompress, or- TJ.UNCROPPEDfor no cropping. The left boundary of the cropping region must be evenly divisible by the scaled MCU block width, which can be determined by calling- TJScalingFactor.getScaled()with the specified scaling factor (see- setScalingFactor()) and the MCU block width (see- TJ.getMCUWidth()) for the level of chrominance subsampling in the JPEG image (see- TJ.PARAM_SUBSAMP.) The cropping region should be specified relative to the scaled image dimensions. Unless- croppingRegionis- TJ.UNCROPPED, the JPEG header must be read (see- setSourceImage(byte[], int)prior to calling this method.
- Throws:
- TJException
 
 - 
getSubsamp@Deprecated public int getSubsamp() Deprecated.Useget(TJ.PARAM_SUBSAMP)
 - 
getColorspace@Deprecated public int getColorspace() Deprecated.Useget(TJ.PARAM_COLORSPACE)
 - 
getJPEGBufpublic byte[] getJPEGBuf() Returns the JPEG buffer associated with this decompressor instance.- Returns:
- the JPEG buffer associated with this decompressor instance.
 
 - 
getJPEGSizepublic int getJPEGSize() Returns the size of the JPEG image (in bytes) associated with this decompressor instance.- Returns:
- the size of the JPEG image (in bytes) associated with this decompressor instance.
 
 - 
getScaledWidth@Deprecated public int getScaledWidth(int desiredWidth, int desiredHeight)Deprecated.UsesetScalingFactor()andTJScalingFactor.getScaled()instead.
 - 
getScaledHeight@Deprecated public int getScaledHeight(int desiredWidth, int desiredHeight)Deprecated.UsesetScalingFactor()andTJScalingFactor.getScaled()instead.
 - 
decompress8public void decompress8(byte[] dstBuf, int x, int y, int pitch, int pixelFormat) throws TJExceptionDecompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.NOTE: The destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstBuf- buffer that will receive the packed-pixel decompressed/decoded image. This buffer should normally be- pitch * destinationHeightbytes in size. However, the buffer may also be larger, in which case the- x,- y, and- pitchparameters can be used to specify the region into which the source image should be decompressed/decoded. NOTE: If the source image is a lossy JPEG image, then- destinationHeightis either the scaled JPEG height (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getHeight()) or the height of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then- destinationHeightis the height of the source image.
- x- x offset (in pixels) of the region in the destination image into which the source image should be decompressed/decoded
- y- y offset (in pixels) of the region in the destination image into which the source image should be decompressed/decoded
- pitch- bytes per row in the destination image. Normally this should be set to- destinationWidth *, if the destination image will be unpadded. (Setting this parameter to 0 is the equivalent of setting it to- TJ.getPixelSize(pixelFormat)- destinationWidth *.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress/decode into a specific region of a larger image. NOTE: if the source image is a lossy JPEG image, then- TJ.getPixelSize(pixelFormat)- destinationWidthis either the scaled JPEG width (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getWidth()) or the width of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then- destinationWidthis the width of the source image.
- pixelFormat- pixel format of the decompressed/decoded image (one of- TJ.PF_*)
- Throws:
- TJException
 
 - 
decompress@Deprecated public void decompress(byte[] dstBuf, int x, int y, int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags) throws TJExceptionDeprecated.- Throws:
- TJException
 
 - 
decompress8public byte[] decompress8(int pitch, int pixelFormat) throws TJExceptionDecompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and return a buffer containing an 8-bit-per-sample packed-pixel decompressed image.- Parameters:
- pitch- see- decompress8(byte[], int, int, int, int)for description
- pixelFormat- pixel format of the decompressed image (one of- TJ.PF_*)
- Returns:
- a buffer containing an 8-bit-per-sample packed-pixel decompressed image.
- Throws:
- TJException
 
 - 
decompress@Deprecated public byte[] decompress(int desiredWidth, int pitch, int desiredHeight, int pixelFormat, int flags) throws TJExceptionDeprecated.- Throws:
- TJException
 
 - 
decompress12public void decompress12(short[] dstBuf, int x, int y, int pitch, int pixelFormat) throws TJExceptionDecompress the 12-bit-per-sample JPEG source image associated with this decompressor instance and output a 12-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.NOTE: The destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstBuf- buffer that will receive the packed-pixel decompressed image. This buffer should normally be- pitch * destinationHeightsamples in size. However, the buffer may also be larger, in which case the- x,- y, and- pitchparameters can be used to specify the region into which the source image should be decompressed. NOTE: If the source image is a lossy JPEG image, then- destinationHeightis either the scaled JPEG height (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getHeight()) or the height of the cropping region (see- setCroppingRegion().) If the source image is a lossless JPEG image, then- destinationHeightis the height of the source image.
- x- x offset (in pixels) of the region in the destination image into which the source image should be decompressed
- y- y offset (in pixels) of the region in the destination image into which the source image should be decompressed
- pitch- samples per row in the destination image. Normally this should be set to- destinationWidth *, if the destination image will be unpadded. (Setting this parameter to 0 is the equivalent of setting it to- TJ.getPixelSize(pixelFormat)- destinationWidth *.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger image. NOTE: if the source image is a lossy JPEG image, then- TJ.getPixelSize(pixelFormat)- destinationWidthis either the scaled JPEG width (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getWidth()) or the width of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then- destinationWidthis the width of the source image.
- pixelFormat- pixel format of the decompressed image (one of- TJ.PF_*)
- Throws:
- TJException
 
 - 
decompress12public short[] decompress12(int pitch, int pixelFormat) throws TJExceptionDecompress the 12-bit-per-sample JPEG source image associated with this decompressor instance and return a buffer containing a 12-bit-per-sample packed-pixel decompressed image.- Parameters:
- pitch- see- decompress12(short[], int, int, int, int)for description
- pixelFormat- pixel format of the decompressed image (one of- TJ.PF_*)
- Returns:
- a buffer containing an 8-bit-per-sample packed-pixel decompressed image.
- Throws:
- TJException
 
 - 
decompress16public void decompress16(short[] dstBuf, int x, int y, int pitch, int pixelFormat) throws TJExceptionDecompress the 16-bit-per-sample lossless JPEG source image associated with this decompressor instance and output a 16-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.NOTE: The destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstBuf- buffer that will receive the packed-pixel decompressed image. This buffer should normally be- pitch * jpegHeightsamples in size. However, the buffer may also be larger, in which case the- x,- y, and- pitchparameters can be used to specify the region into which the source image should be decompressed.
- x- x offset (in pixels) of the region in the destination image into which the source image should be decompressed
- y- y offset (in pixels) of the region in the destination image into which the source image should be decompressed
- pitch- samples per row in the destination image. Normally this should be set to- jpegWidth *, if the destination image will be unpadded. (Setting this parameter to 0 is the equivalent of setting it to- TJ.getPixelSize(pixelFormat)- jpegWidth *.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger image.- TJ.getPixelSize(pixelFormat)
- pixelFormat- pixel format of the decompressed image (one of- TJ.PF_*)
- Throws:
- TJException
 
 - 
decompress16public short[] decompress16(int pitch, int pixelFormat) throws TJExceptionDecompress the 16-bit-per-sample JPEG source image associated with this decompressor instance and return a buffer containing a 16-bit-per-sample packed-pixel decompressed image.- Parameters:
- pitch- see- decompress16(short[], int, int, int, int)for description
- pixelFormat- pixel format of the decompressed image (one of- TJ.PF_*)
- Returns:
- a buffer containing an 8-bit-per-sample packed-pixel decompressed image.
- Throws:
- TJException
 
 - 
decompressToYUVpublic void decompressToYUV(YUVImage dstImage) throws TJException Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into an 8-bit-per-sample planar YUV image and store it in the givenYUVImageinstance. This method performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. This method cannot be used to decompress JPEG source images with the CMYK or YCCK colorspace.NOTE: The planar YUV destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstImage-- YUVImageinstance that will receive the planar YUV decompressed image. The level of subsampling specified in this- YUVImageinstance must match that of the JPEG image, and the width and height specified in the- YUVImageinstance must match the scaled JPEG width and height (see- setScalingFactor(),- TJScalingFactor.getScaled(),- getWidth(), and- getHeight().)
- Throws:
- TJException
 
 - 
decompressToYUV@Deprecated public void decompressToYUV(YUVImage dstImage, int flags) throws TJException Deprecated.- Throws:
- TJException
 
 - 
decompressToYUVpublic YUVImage decompressToYUV(int[] strides) throws TJException Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes and return aYUVImageinstance containing the decompressed image planes. This method performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. This method cannot be used to decompress JPEG source images with the CMYK or YCCK colorspace.- Parameters:
- strides- an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see- YUVImage.) If- stridesis null, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of row padding to each plane.
- Returns:
- a YUVImageinstance containing the decompressed image planes
- Throws:
- TJException
 
 - 
decompressToYUV@Deprecated public YUVImage decompressToYUV(int desiredWidth, int[] strides, int desiredHeight, int flags) throws TJException Deprecated.- Throws:
- TJException
 
 - 
decompressToYUVpublic YUVImage decompressToYUV(int align) throws TJException Decompress the 8-bit-per-sample JPEG source image associated with this decompressor instance into an 8-bit-per-sample unified planar YUV image and return aYUVImageinstance containing the decompressed image. This method performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. This method cannot be used to decompress JPEG source images with the CMYK or YCCK colorspace.- Parameters:
- align- row alignment (in bytes) of the YUV image (must be a power of 2.) Setting this parameter to n will cause each row in each plane of the YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.)
- Returns:
- a YUVImageinstance containing the unified planar YUV decompressed image
- Throws:
- TJException
 
 - 
decompressToYUV@Deprecated public YUVImage decompressToYUV(int desiredWidth, int align, int desiredHeight, int flags) throws TJException Deprecated.- Throws:
- TJException
 
 - 
decompress8public void decompress8(int[] dstBuf, int x, int y, int stride, int pixelFormat) throws TJExceptionDecompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel grayscale, RGB, or CMYK image to the given destination buffer.NOTE: The destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstBuf- buffer that will receive the packed-pixel decompressed/decoded image. This buffer should normally be- stride * destinationHeightpixels in size. However, the buffer may also be larger, in which case the- x,- y, and- pitchparameters can be used to specify the region into which the source image should be decompressed/decoded. NOTE: If the source image is a lossy JPEG image, then- destinationHeightis either the scaled JPEG height (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getHeight()) or the height of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then- destinationHeightis the height of the source image.
- x- x offset (in pixels) of the region in the destination image into which the source image should be decompressed/decoded
- y- y offset (in pixels) of the region in the destination image into which the source image should be decompressed/decoded
- stride- pixels per row in the destination image. Normally this should be set to- destinationWidth. (Setting this parameter to 0 is the equivalent of setting it to- destinationWidth.) However, you can also use this parameter to skip rows or to decompress/decode into a specific region of a larger image. NOTE: if the source image is a lossy JPEG image, then- destinationWidthis either the scaled JPEG width (see- setScalingFactor(),- TJScalingFactor.getScaled(), and- getWidth()) or the width of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then- destinationWidthis the width of the source image.
- pixelFormat- pixel format of the decompressed/decoded image (one of- TJ.PF_*)
- Throws:
- TJException
 
 - 
decompress@Deprecated public void decompress(int[] dstBuf, int x, int y, int desiredWidth, int stride, int desiredHeight, int pixelFormat, int flags) throws TJExceptionDeprecated.- Throws:
- TJException
 
 - 
decompress8public void decompress8(java.awt.image.BufferedImage dstImage) throws TJExceptionDecompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and output an 8-bit-per-sample packed-pixel decompressed/decoded image to the givenBufferedImageinstance.NOTE: The destination image is fully recoverable if this method throws a non-fatal TJException(unlessTJ.PARAM_STOPONWARNINGis set.)- Parameters:
- dstImage- a- BufferedImageinstance that will receive the packed-pixel decompressed/decoded image. If the source image is a lossy JPEG image, then the width and height of the- BufferedImageinstance must match the scaled JPEG width and height (see- setScalingFactor(),- TJScalingFactor.getScaled(),- getWidth(), and- getHeight()) or the width and height of the cropping region (see- setCroppingRegion().) If the source image is a YUV image or a lossless JPEG image, then the width and height of the- BufferedImageinstance must match the width and height of the source image.
- Throws:
- TJException
 
 - 
decompress@Deprecated public void decompress(java.awt.image.BufferedImage dstImage, int flags) throws TJExceptionDeprecated.- Throws:
- TJException
 
 - 
decompress8public java.awt.image.BufferedImage decompress8(int bufferedImageType) throws TJExceptionDecompress the 8-bit-per-sample JPEG source image or decode the planar YUV source image associated with this decompressor instance and return aBufferedImageinstance containing the 8-bit-per-sample packed-pixel decompressed/decoded image.- Parameters:
- bufferedImageType- the image type of the- BufferedImageinstance that will be created (for instance,- BufferedImage.TYPE_INT_RGB)
- Returns:
- a BufferedImageinstance containing the 8-bit-per-sample packed-pixel decompressed/decoded image.
- Throws:
- TJException
 
 - 
decompress@Deprecated public java.awt.image.BufferedImage decompress(int desiredWidth, int desiredHeight, int bufferedImageType, int flags) throws TJExceptionDeprecated.- Throws:
- TJException
 
 - 
closepublic void close() throws TJExceptionFree the native structures associated with this decompressor instance.- Specified by:
- closein interface- java.lang.AutoCloseable
- Specified by:
- closein interface- java.io.Closeable
- Throws:
- TJException
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-