237
237
int flags)</CODE>
240
<B>Deprecated.</B> <I>Use
241
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I></TD>
243
<TR BGCOLOR="white" CLASS="TableRowColor">
244
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
245
<CODE> void</CODE></FONT></TD>
246
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</A></B>(byte[] dstBuf,
249
int desiredWidth,
251
int desiredHeight,
252
int pixelFormat,
253
int flags)</CODE>
256
Decompress the JPEG source image associated with this decompressor
257
instance and output a decompressed image to the given destination buffer.</TD>
259
<TR BGCOLOR="white" CLASS="TableRowColor">
260
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
261
<CODE> void</CODE></FONT></TD>
262
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</A></B>(int[] dstBuf,
265
int desiredWidth,
267
int desiredHeight,
268
int pixelFormat,
269
int flags)</CODE>
240
272
Decompress the JPEG source image associated with this decompressor
241
273
instance and output a decompressed image to the given destination buffer.</TD>
707
741
buffer should normally be <code>pitch * scaledHeight</code> bytes in size,
708
742
where <code>scaledHeight</code> can be determined by calling <code>
709
743
scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegHeight)
710
</code> with one of the scaling factors returned from <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><CODE>TJ.getScalingFactors()</CODE></A> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><CODE>getScaledHeight(int, int)</CODE></A>.<DD><CODE>desiredWidth</CODE> - desired width (in pixels) of the decompressed image.
711
If the desired image dimensions are smaller than the dimensions of the
712
JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG
713
decompressor to generate the largest possible image that will fit within
714
the desired dimensions. Setting this to 0 is the same as setting it to
715
the width of the JPEG image (in other words, the width will not be
716
considered when determining the scaled image size.)<DD><CODE>pitch</CODE> - bytes per line of the destination image. Normally, this
744
</code> with one of the scaling factors returned from <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><CODE>TJ.getScalingFactors()</CODE></A> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><CODE>getScaledHeight(int, int)</CODE></A>. However,
745
the buffer may also be larger than the dimensions of the JPEG image, in
746
which case the <code>x</code>, <code>y</code>, and <code>pitch</code>
747
parameters can be used to specify the region into which the JPEG image
748
should be decompressed.<DD><CODE>x</CODE> - x offset (in pixels) of the region into which the JPEG image
749
should be decompressed, relative to the start of <code>dstBuf</code>.<DD><CODE>y</CODE> - y offset (in pixels) of the region into which the JPEG image
750
should be decompressed, relative to the start of <code>dstBuf</code>.<DD><CODE>desiredWidth</CODE> - desired width (in pixels) of the decompressed image
751
(or image region.) If the desired image dimensions are different than the
752
dimensions of the JPEG image being decompressed, then TurboJPEG will use
753
scaling in the JPEG decompressor to generate the largest possible image
754
that will fit within the desired dimensions. Setting this to 0 is the
755
same as setting it to the width of the JPEG image (in other words, the
756
width will not be considered when determining the scaled image size.)<DD><CODE>pitch</CODE> - bytes per line of the destination image. Normally, this
717
757
should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if
718
758
the decompressed image is unpadded, but you can use this to, for instance,
719
pad each line of the decompressed image to a 4-byte boundary. NOTE:
759
pad each line of the decompressed image to a 4-byte boundary or to
760
decompress the JPEG image into a region of a larger image. NOTE:
720
761
<code>scaledWidth</code> can be determined by calling <code>
721
762
scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegWidth)
722
763
</code> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><CODE>getScaledWidth(int, int)</CODE></A>. Setting this parameter to
723
764
0 is the equivalent of setting it to <code>scaledWidth *
724
TJ.pixelSize(pixelFormat)</code>.<DD><CODE>desiredHeight</CODE> - desired height (in pixels) of the decompressed image.
725
If the desired image dimensions are smaller than the dimensions of the
726
JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG
727
decompressor to generate the largest possible image that will fit within
728
the desired dimensions. Setting this to 0 is the same as setting it to
729
the height of the JPEG image (in other words, the height will not be
730
considered when determining the scaled image size.)<DD><CODE>pixelFormat</CODE> - pixel format of the decompressed image (one of
765
TJ.pixelSize(pixelFormat)</code>.<DD><CODE>desiredHeight</CODE> - desired height (in pixels) of the decompressed image
766
(or image region.) If the desired image dimensions are different than the
767
dimensions of the JPEG image being decompressed, then TurboJPEG will use
768
scaling in the JPEG decompressor to generate the largest possible image
769
that will fit within the desired dimensions. Setting this to 0 is the
770
same as setting it to the height of the JPEG image (in other words, the
771
height will not be considered when determining the scaled image size.)<DD><CODE>pixelFormat</CODE> - pixel format of the decompressed image (one of
731
772
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
732
773
<DT><B>Throws:</B>
733
774
<DD><CODE>java.lang.Exception</CODE></DL>
779
<A NAME="decompress(byte[], int, int, int, int, int)"><!-- --></A><H3>
782
public void <B>decompress</B>(byte[] dstBuf,
783
int desiredWidth,
785
int desiredHeight,
786
int pixelFormat,
788
throws java.lang.Exception</PRE>
790
<DD><B>Deprecated.</B> <I>Use
791
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A> instead.</I>
796
<DD><CODE>java.lang.Exception</CODE></DL>
738
801
<A NAME="decompress(int, int, int, int, int)"><!-- --></A><H3>
752
815
<DT><B>Parameters:</B><DD><CODE>desiredWidth</CODE> - see
753
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see
754
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int)</CODE></A> for description<DD><CODE>desiredHeight</CODE> - see
755
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the decompressed image (one of
816
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A>
817
for description<DD><CODE>pitch</CODE> - see
818
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A>
819
for description<DD><CODE>desiredHeight</CODE> - see
820
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A>
821
for description<DD><CODE>pixelFormat</CODE> - pixel format of the decompressed image (one of
756
822
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
757
823
<DT><B>Returns:</B><DD>a buffer containing the decompressed image
758
824
<DT><B>Throws:</B>
772
838
instance and output a YUV planar image to the given destination buffer.
773
839
This method performs JPEG decompression but leaves out the color
774
840
conversion step, so a planar YUV image is generated instead of an RGB
775
image. The padding of the planes in this image is the same as the images
776
generated by <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>TJCompressor.encodeYUV(byte[], int)</CODE></A>. Note that, if
777
the width or height of the image is not an even multiple of the MCU block
778
size (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><CODE>TJ.getMCUWidth(int)</CODE></A> and <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><CODE>TJ.getMCUHeight(int)</CODE></A>), then an
779
intermediate buffer copy will be performed within TurboJPEG.
841
image. The padding of the planes in this image is the same as in the
842
images generated by <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>TJCompressor.encodeYUV(byte[], int)</CODE></A>. Note
843
that, if the width or height of the image is not an even multiple of the
844
MCU block size (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><CODE>TJ.getMCUWidth(int)</CODE></A> and <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)"><CODE>TJ.getMCUHeight(int)</CODE></A>),
845
then an intermediate buffer copy will be performed within TurboJPEG.
782
848
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
875
<A NAME="decompress(int[], int, int, int, int, int, int, int)"><!-- --></A><H3>
878
public void <B>decompress</B>(int[] dstBuf,
881
int desiredWidth,
883
int desiredHeight,
884
int pixelFormat,
886
throws java.lang.Exception</PRE>
888
<DD>Decompress the JPEG source image associated with this decompressor
889
instance and output a decompressed image to the given destination buffer.
892
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the decompressed image. This
893
buffer should normally be <code>stride * scaledHeight</code> pixels in
894
size, where <code>scaledHeight</code> can be determined by calling <code>
895
scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegHeight)
896
</code> with one of the scaling factors returned from <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><CODE>TJ.getScalingFactors()</CODE></A> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><CODE>getScaledHeight(int, int)</CODE></A>. However,
897
the buffer may also be larger than the dimensions of the JPEG image, in
898
which case the <code>x</code>, <code>y</code>, and <code>stride</code>
899
parameters can be used to specify the region into which the JPEG image
900
should be decompressed.<DD><CODE>x</CODE> - x offset (in pixels) of the region into which the JPEG image
901
should be decompressed, relative to the start of <code>dstBuf</code>.<DD><CODE>y</CODE> - y offset (in pixels) of the region into which the JPEG image
902
should be decompressed, relative to the start of <code>dstBuf</code>.<DD><CODE>desiredWidth</CODE> - desired width (in pixels) of the decompressed image
903
(or image region.) If the desired image dimensions are different than the
904
dimensions of the JPEG image being decompressed, then TurboJPEG will use
905
scaling in the JPEG decompressor to generate the largest possible image
906
that will fit within the desired dimensions. Setting this to 0 is the
907
same as setting it to the width of the JPEG image (in other words, the
908
width will not be considered when determining the scaled image size.)<DD><CODE>stride</CODE> - pixels per line of the destination image. Normally, this
909
should be set to <code>scaledWidth</code>, but you can use this to, for
910
instance, decompress the JPEG image into a region of a larger image.
911
NOTE: <code>scaledWidth</code> can be determined by calling <code>
912
scalingFactor.<A HREF="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><CODE>getScaled</CODE></A>(jpegWidth)
913
</code> or by calling <A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><CODE>getScaledWidth(int, int)</CODE></A>. Setting this parameter to
914
0 is the equivalent of setting it to <code>scaledWidth</code>.<DD><CODE>desiredHeight</CODE> - desired height (in pixels) of the decompressed image
915
(or image region.) If the desired image dimensions are different than the
916
dimensions of the JPEG image being decompressed, then TurboJPEG will use
917
scaling in the JPEG decompressor to generate the largest possible image
918
that will fit within the desired dimensions. Setting this to 0 is the
919
same as setting it to the height of the JPEG image (in other words, the
920
height will not be considered when determining the scaled image size.)<DD><CODE>pixelFormat</CODE> - pixel format of the decompressed image (one of
921
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
923
<DD><CODE>java.lang.Exception</CODE></DL>
809
928
<A NAME="decompress(java.awt.image.BufferedImage, int)"><!-- --></A><H3>
843
962
<DT><B>Parameters:</B><DD><CODE>desiredWidth</CODE> - see
844
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int)</CODE></A> for description<DD><CODE>desiredHeight</CODE> - see
845
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int)</CODE></A> for description<DD><CODE>bufferedImageType</CODE> - the image type of the newly-created
963
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A> for
964
description<DD><CODE>desiredHeight</CODE> - see
965
<A HREF="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><CODE>decompress(byte[], int, int, int, int, int, int, int)</CODE></A> for
966
description<DD><CODE>bufferedImageType</CODE> - the image type of the newly-created
846
967
<code>BufferedImage</code> instance (for instance,
847
968
<code>BufferedImage.TYPE_INT_RGB</code>)<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
848
969
<DT><B>Returns:</B><DD>a <code>BufferedImage</code> instance containing the