<li><ahref="../../../org/libjpegturbo/turbojpeg/TJ.html"title="class in org.libjpegturbo.turbojpeg"><spanclass="strong">Prev Class</span></a></li>
<li><ahref="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html"title="interface in org.libjpegturbo.turbojpeg"><spanclass="strong">Next Class</span></a></li>
<tdclass="colFirst"><code><ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into separate Y, U (Cb), and V (Cr) image planes and return a
<code>YUVImage</code> instance containing the encoded image planes.</div>
</td>
</tr>
<trclass="altColor">
<tdclass="colFirst"><code><ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into a unified YUV planar image buffer and return a
<code>YUVImage</code> instance containing the encoded image.</div>
</td>
</tr>
<trclass="rowColor">
<tdclass="colFirst"><code>void</code></td>
<tdclass="colLast"><code><strong><ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">encodeYUV</a></strong>(<ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
int flags)</code>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into a YUV planar image and store it in the given
<divclass="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this
compressor instance.</div>
</td>
</tr>
<trclass="altColor">
<tdclass="colFirst"><code>void</code></td>
<tdclass="colLast"><code><strong><ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code>
<divclass="block">Associate an uncompressed YUV planar source image with this compressor
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>srcImage</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
<divclass="block">Create a TurboJPEG compressor instance and associate the uncompressed
source image stored in <code>srcImage</code> with the newly created
instance.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>srcImage</code> - see
<ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see
<ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see
<ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see
<ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see
<ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
grayscale pixels to be compressed or encoded. This image is not modified.</dd><dd><code>x</code> - x offset (in pixels) of the region in the source image from which
<pre>public void setSourceImage(<ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)
throws java.lang.Exception</pre>
<divclass="block">Associate an uncompressed YUV planar source image with this compressor
<divclass="block">Set the level of chrominance subsampling for subsequent compress/encode
operations. When pixels are converted from RGB to YCbCr (see
<ahref="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>) or from CMYK to YCCK (see <ahref="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><code>TJ.CS_YCCK</code></a>) as part
of the JPEG compression process, some of the Cb and Cr (chrominance)
components can be discarded or averaged together to produce a smaller
image with little perceptible loss of image clarity (the human eye is more
sensitive to small changes in brightness than to small changes in color.)
This is called "chrominance subsampling".
<p>
NOTE: This method has no effect when compressing a JPEG image from a YUV
planar source. In that case, the level of chrominance subsampling in
the JPEG image is determined by the source. Further, this method has no
effect when encoding to a pre-allocated <ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance. In
that case, the level of chrominance subsampling is determined by the
destination.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>newSubsamp</code> - the level of chrominance subsampling to use in
<divclass="block">Compress the uncompressed source image associated with this compressor
instance and output a JPEG image to the given destination buffer.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
<ahref="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the maximum size for this buffer based on
<dt><spanclass="strong">Returns:</span></dt><dd>a buffer containing a JPEG image. The length of this buffer will
not be equal to the size of the JPEG image. Use <ahref="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>
<pre>public void encodeYUV(<ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
int flags)
throws java.lang.Exception</pre>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into a YUV planar image and store it in the given
<code>YUVImage</code> instance. This method uses the accelerated color
conversion routines in TurboJPEG's underlying codec but does not execute
any of the other steps in the JPEG compression process. Encoding
CMYK source images to YUV is not supported.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>dstImage</code> - <ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the YUV planar
image</dd><dd><code>flags</code> - the bitwise OR of one or more of
<pre>public <ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int pad,
int flags)
throws java.lang.Exception</pre>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into a unified YUV planar image buffer and return a
<code>YUVImage</code> instance containing the encoded image. This method
uses the accelerated color conversion routines in TurboJPEG's underlying
codec but does not execute any of the other steps in the JPEG compression
process. Encoding CMYK source images to YUV is not supported.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>pad</code> - the width of each line in each plane of the YUV image will be
padded to the nearest multiple of this number of bytes (must be a power of
2.)</dd><dd><code>flags</code> - the bitwise OR of one or more of
<pre>public <ahref="../../../org/libjpegturbo/turbojpeg/YUVImage.html"title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int[] strides,
int flags)
throws java.lang.Exception</pre>
<divclass="block">Encode the uncompressed source image associated with this compressor
instance into separate Y, U (Cb), and V (Cr) image planes and return a
<code>YUVImage</code> instance containing the encoded image planes. This
method uses the accelerated color conversion routines in TurboJPEG's
underlying codec but does not execute any of the other steps in the JPEG
compression process. Encoding CMYK source images to YUV is not supported.</div>
<dl><dt><spanclass="strong">Parameters:</span></dt><dd><code>strides</code> - an array of integers, each specifying the number of bytes
per line in the corresponding plane of the output image. Setting the
stride for any plane to 0 is the same as setting it to the component width
of the plane. If <code>strides</code> is null, then the strides for all
planes will be set to their respective component widths. You can adjust
the strides in order to add an arbitrary amount of line padding to each
plane.</dd><dd><code>flags</code> - the bitwise OR of one or more of
<li><ahref="../../../org/libjpegturbo/turbojpeg/TJ.html"title="class in org.libjpegturbo.turbojpeg"><spanclass="strong">Prev Class</span></a></li>
<li><ahref="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html"title="interface in org.libjpegturbo.turbojpeg"><spanclass="strong">Next Class</span></a></li>