266
280
int pixelFormat)</CODE>
283
<B>Deprecated.</B> <I>Use
284
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I></TD>
286
<TR BGCOLOR="white" CLASS="TableRowColor">
287
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
288
<CODE> void</CODE></FONT></TD>
289
<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage</A></B>(byte[] srcImage,
295
int pixelFormat)</CODE>
269
298
Associate an uncompressed source image with this compressor instance.</TD>
271
300
<TR BGCOLOR="white" CLASS="TableRowColor">
333
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int)</CODE></A> for description
362
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
363
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
365
<DD><CODE>java.lang.Exception</CODE></DL>
369
<A NAME="TJCompressor(byte[], int, int, int, int, int, int)"><!-- --></A><H3>
372
public <B>TJCompressor</B>(byte[] srcImage,
378
int pixelFormat)
379
throws java.lang.Exception</PRE>
381
<DD>Create a TurboJPEG compressor instance and associate the uncompressed
382
source image stored in <code>srcImage</code> with the newly-created
386
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>x</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>y</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
387
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
334
388
<DT><B>Throws:</B>
335
389
<DD><CODE>java.lang.Exception</CODE></DL>
361
417
<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - image buffer containing RGB or grayscale pixels to be
362
compressed<DD><CODE>width</CODE> - width (in pixels) of the source image<DD><CODE>pitch</CODE> - bytes per line of the source image. Normally, this should be
418
compressed<DD><CODE>x</CODE> - x offset (in pixels) of the region from which the JPEG image
419
should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>y</CODE> - y offset (in pixels) of the region from which the JPEG image
420
should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>width</CODE> - width (in pixels) of the region in the source image from
421
which the JPEG image should be compressed.<DD><CODE>pitch</CODE> - bytes per line of the source image. Normally, this should be
363
422
<code>width * TJ.pixelSize(pixelFormat)</code> if the source image is
364
423
unpadded, but you can use this parameter to, for instance, specify that
365
the scanlines in the source image are padded to 4-byte boundaries, as is
366
the case for Windows bitmaps. You can also be clever and use this
367
parameter to skip lines, etc. Setting this parameter to 0 is the
368
equivalent of setting it to <code>width *
369
TJ.pixelSize(pixelFormat)</code>.<DD><CODE>height</CODE> - height (in pixels) of the source image<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
424
the scanlines in the source image are padded to a 4-byte boundary or to
425
compress a JPEG image from a region of a larger source image. You can
426
also be clever and use this parameter to skip lines, etc. Setting this
427
parameter to 0 is the equivalent of setting it to <code>width *
428
TJ.pixelSize(pixelFormat)</code>.<DD><CODE>height</CODE> - height (in pixels) of the region in the source image from
429
which the JPEG image should be compressed.<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
370
430
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
371
431
<DT><B>Throws:</B>
372
432
<DD><CODE>java.lang.Exception</CODE></DL>
437
<A NAME="setSourceImage(byte[], int, int, int, int)"><!-- --></A><H3>
440
public void <B>setSourceImage</B>(byte[] srcImage,
444
int pixelFormat)
445
throws java.lang.Exception</PRE>
447
<DD><B>Deprecated.</B> <I>Use
448
<A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I>
453
<DD><CODE>java.lang.Exception</CODE></DL>
377
458
<A NAME="setSubsamp(int)"><!-- --></A><H3>
504
585
TurboJPEG's underlying codec to produce a planar YUV image that is
505
586
suitable for direct video display. Specifically, if the chrominance
506
587
components are subsampled along the horizontal dimension, then the width
507
of the luminance plane is padded to 2 in the output image (same goes for
508
the height of the luminance plane, if the chrominance components are
509
subsampled along the vertical dimension.) Also, each line of each plane
510
in the output image is padded to 4 bytes. Although this will work with
511
any subsampling option, it is really only useful in combination with
512
<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_420"><CODE>TJ.SAMP_420</CODE></A>, which produces an image compatible with the I420 (AKA
588
of the luminance plane is padded to the nearest multiple of 2 in the
589
output image (same goes for the height of the luminance plane, if the
590
chrominance components are subsampled along the vertical dimension.)
591
Also, each line of each plane in the output image is padded to 4 bytes.
592
Although this will work with any subsampling option, it is really only
593
useful in combination with <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_420"><CODE>TJ.SAMP_420</CODE></A>, which produces an image
594
compatible with the I420 (AKA "YUV420P") format.
516
597
<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use