<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>TJDecompressor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.min.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TJDecompressor";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses.html">All Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">org.libjpegturbo.turbojpeg</a></div>
<h2 title="Class TJDecompressor" class="title">Class TJDecompressor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.libjpegturbo.turbojpeg.TJDecompressor</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code>java.io.Closeable</code>, <code>java.lang.AutoCloseable</code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">TJDecompressor</span>
extends java.lang.Object
implements java.io.Closeable</pre>
<div class="block">TurboJPEG decompressor</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">TJDecompressor</a></span>()</code></th>
<td class="colLast">
<div class="block">Create a TurboJPEG decompresssor instance.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D)">TJDecompressor</a></span>​(byte[] jpegImage)</code></th>
<td class="colLast">
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image or "abbreviated table specification" (AKA "tables-only") datastream
stored in <code>jpegImage</code> with the newly created instance.</div>
</td>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D,int)">TJDecompressor</a></span>​(byte[] jpegImage,
int imageSize)</code></th>
<td class="colLast">
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image or "abbreviated table specification" (AKA "tables-only") datastream
of length <code>imageSize</code> bytes stored in <code>jpegImage</code>
with the newly created instance.</div>
</td>
</tr>
<tr class="rowColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.libjpegturbo.turbojpeg.YUVImage)">TJDecompressor</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)</code></th>
<td class="colLast">
<div class="block">Create a TurboJPEG decompressor instance and associate the
8-bit-per-sample planar YUV source image stored in <code>yuvImage</code>
with the newly created instance.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th>
<td class="colLast">
<div class="block">Free the native structures associated with this decompressor instance.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>short[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress12(int,int)">decompress12</a></span>​(int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 9 to 12 bits per sample associated
with this decompressor instance and return a buffer containing a
packed-pixel decompressed image with the same data precision.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress12(short%5B%5D,int,int,int,int)">decompress12</a></span>​(short[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 9 to 12 bits per sample associated
with this decompressor instance and output a packed-pixel grayscale, RGB,
or CMYK image with the same data precision to the given destination
buffer.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>short[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress16(int,int)">decompress16</a></span>​(int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 13 to 16 bits per sample associated
with this decompressor instance and return a buffer containing a
packed-pixel decompressed image with the same data precision.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress16(short%5B%5D,int,int,int,int)">decompress16</a></span>​(short[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 13 to 16 bits per sample associated
with this decompressor instance and output a packed-pixel grayscale, RGB,
or CMYK image with the same data precision to the given destination
buffer.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress8(byte%5B%5D,int,int,int,int)">decompress8</a></span>​(byte[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 2 to 8 bits per sample, or decode
the 8-bit-per-sample planar YUV source image, associated with this
decompressor instance and output a packed-pixel grayscale, RGB, or CMYK
image with the same data precision to the given destination buffer.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.awt.image.BufferedImage</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress8(int)">decompress8</a></span>​(int bufferedImageType)</code></th>
<td class="colLast">
<div class="block">Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV
source image associated with this decompressor instance and return a
<code>BufferedImage</code> instance containing the 8-bit-per-sample
packed-pixel decompressed/decoded image.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress8(int%5B%5D,int,int,int,int)">decompress8</a></span>​(int[] dstBuf,
int x,
int y,
int stride,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">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.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress8(int,int)">decompress8</a></span>​(int pitch,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Decompress the JPEG source image with 2 to 8 bits per sample, or decode
the 8-bit-per-sample planar YUV source image, associated with this
decompressor instance and return a buffer containing a packed-pixel
decompressed image with the same data precision.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompress8(java.awt.image.BufferedImage)">decompress8</a></span>​(java.awt.image.BufferedImage dstImage)</code></th>
<td class="colLast">
<div class="block">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 given
<code>BufferedImage</code> instance.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompressToYUV(int)">decompressToYUV</a></span>​(int align)</code></th>
<td class="colLast">
<div class="block">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 a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the decompressed image.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompressToYUV(int%5B%5D)">decompressToYUV</a></span>​(int[] strides)</code></th>
<td class="colLast">
<div class="block">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 a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the
decompressed image planes.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage)">decompressToYUV</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage)</code></th>
<td class="colLast">
<div class="block">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 given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#finalize()">finalize</a></span>()</code></th>
<td class="colLast"> </td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get(int)">get</a></span>​(int param)</code></th>
<td class="colLast">
<div class="block">Get the value of a decompression parameter.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHeight()">getHeight</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the height of the source image (JPEG or YUV) associated with this
decompressor instance.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getICCProfile()">getICCProfile</a></span>()</code></th>
<td class="colLast">
<div class="block">Retrieve the ICC (International Color Consortium) color management profile
(if any) that was previously extracted from the JPEG image associated with
this decompressor instance (see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>), and
return a buffer containing the ICC profile.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getICCSize()">getICCSize</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the size of the ICC profile (if any) that was previously extracted
from the JPEG image associated with this decompressor instance
(see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>), or 0 if there is no ICC
profile to retrieve.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>byte[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getJPEGBuf()">getJPEGBuf</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the JPEG buffer associated with this decompressor instance.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getJPEGSize()">getJPEGSize</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
decompressor instance.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWidth()">getWidth</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the width of the source image (JPEG or YUV) associated with this
decompressor instance.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#saveImage(java.lang.String,java.lang.Object,int,int,int,int,int,int)">saveImage</a></span>​(java.lang.String fileName,
java.lang.Object image,
int x,
int y,
int width,
int pitch,
int height,
int pixelFormat)</code></th>
<td class="colLast">
<div class="block">Save a packed-pixel image with 2 to 16 bits of data precision per sample
from memory to disk.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(int,int)">set</a></span>​(int param,
int value)</code></th>
<td class="colLast">
<div class="block">Set the value of a decompression parameter.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setCroppingRegion(java.awt.Rectangle)">setCroppingRegion</a></span>​(java.awt.Rectangle croppingRegion)</code></th>
<td class="colLast">
<div class="block">Set the cropping region for partially decompressing a lossy JPEG image
into a packed-pixel image.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)">setScalingFactor</a></span>​(<a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> scalingFactor)</code></th>
<td class="colLast">
<div class="block">Set the scaling factor for subsequent lossy decompression operations.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(byte%5B%5D,int)">setSourceImage</a></span>​(byte[] jpegImage,
int imageSize)</code></th>
<td class="colLast">
<div class="block">Associate the JPEG image or "abbreviated table specification" (AKA
"tables-only") datastream of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with this decompressor instance.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></span>​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code></th>
<td class="colLast">
<div class="block">Associate the specified planar YUV source image with this decompressor
instance.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="<init>()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor()
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompresssor instance.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="<init>(byte[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor​(byte[] jpegImage)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image or "abbreviated table specification" (AKA "tables-only") datastream
stored in <code>jpegImage</code> with the newly created instance. Refer
to <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a> for more details.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jpegImage</code> - 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.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="<init>(byte[],int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor​(byte[] jpegImage,
int imageSize)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
image or "abbreviated table specification" (AKA "tables-only") datastream
of length <code>imageSize</code> bytes stored in <code>jpegImage</code>
with the newly created instance. Refer to
<a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a> for more details.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jpegImage</code> - buffer containing a JPEG source image or tables-only
datastream. This buffer is not modified.</dd>
<dd><code>imageSize</code> - size of the JPEG source image or tables-only datastream
(in bytes)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="<init>(org.libjpegturbo.turbojpeg.YUVImage)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TJDecompressor</h4>
<pre>public TJDecompressor​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Create a TurboJPEG decompressor instance and associate the
8-bit-per-sample planar YUV source image stored in <code>yuvImage</code>
with the newly created instance. Refer to
<a href="#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)"><code>setSourceImage(YUVImage)</code></a> for more details.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>yuvImage</code> - <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a planar YUV source
image to be decoded. This image is not modified.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section>
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="setSourceImage(byte[],int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSourceImage</h4>
<pre class="methodSignature">public void setSourceImage​(byte[] jpegImage,
int imageSize)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Associate the JPEG image or "abbreviated table specification" (AKA
"tables-only") datastream of length <code>imageSize</code> bytes stored in
<code>jpegImage</code> with this decompressor instance. If
<code>jpegImage</code> contains 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 the <a href="TJ.html#PARAM_STOPONWARNING"><code>parameters</code></a> that describe
the JPEG image will be set when the method returns. If a JPEG image is
passed to this method and <a href="TJ.html#PARAM_SAVEMARKERS"><code>TJ.PARAM_SAVEMARKERS</code></a> is set to
<code>2</code> or <code>4</code>, then the ICC profile (if any) will be
extracted from the JPEG image. (<a href="#getICCProfile()"><code>getICCProfile()</code></a> can then be used
to retrieve the profile.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jpegImage</code> - buffer containing a JPEG source image or tables-only
datastream. This buffer is not modified.</dd>
<dd><code>imageSize</code> - size of the JPEG source image or tables-only datastream
(in bytes)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSourceImage</h4>
<pre class="methodSignature">public void setSourceImage​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</pre>
<div class="block">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 sets
<a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a> to the chrominance subsampling level of the
source image.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>srcImage</code> - <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a planar YUV source
image to be decoded. This image is not modified.</dd>
</dl>
</li>
</ul>
<a id="getWidth()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWidth</h4>
<pre class="methodSignature">public int getWidth()</pre>
<div class="block">Returns the width of the source image (JPEG or YUV) associated with this
decompressor instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the width of the source image (JPEG or YUV) associated with this
decompressor instance.</dd>
</dl>
</li>
</ul>
<a id="getHeight()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHeight</h4>
<pre class="methodSignature">public int getHeight()</pre>
<div class="block">Returns the height of the source image (JPEG or YUV) associated with this
decompressor instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the height of the source image (JPEG or YUV) associated with this
decompressor instance.</dd>
</dl>
</li>
</ul>
<a id="set(int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>set</h4>
<pre class="methodSignature">public void set​(int param,
int value)</pre>
<div class="block">Set the value of a decompression parameter.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
<dd><code>value</code> - value of the decompression parameter (refer to
<a href="TJ.html#PARAM_STOPONWARNING"><code>parameter documentation</code></a>)</dd>
</dl>
</li>
</ul>
<a id="get(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre class="methodSignature">public int get​(int param)</pre>
<div class="block">Get the value of a decompression parameter.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value of the specified decompression parameter, or -1 if the
value is unknown.</dd>
</dl>
</li>
</ul>
<a id="getICCProfile()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getICCProfile</h4>
<pre class="methodSignature">public byte[] getICCProfile()
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Retrieve the ICC (International Color Consortium) color management profile
(if any) that was previously extracted from the JPEG image associated with
this decompressor instance (see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>), and
return a buffer containing the ICC profile. Once the ICC profile is
retrieved, it must be re-extracted before it can be retrieved again.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a buffer containing the ICC profile</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="getICCSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getICCSize</h4>
<pre class="methodSignature">public int getICCSize()</pre>
<div class="block">Returns the size of the ICC profile (if any) that was previously extracted
from the JPEG image associated with this decompressor instance
(see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>), or 0 if there is no ICC
profile to retrieve.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the size of the ICC profile (if any) that was previously extracted
from the JPEG image associated with this decompressor instance
(see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>), or 0 if there is no ICC
profile to retrieve.</dd>
</dl>
</li>
</ul>
<a id="setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setScalingFactor</h4>
<pre class="methodSignature">public void setScalingFactor​(<a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a> scalingFactor)</pre>
<div class="block">Set the scaling factor for subsequent lossy decompression operations.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>scalingFactor</code> - <a href="TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJScalingFactor</code></a> instance that specifies a
fractional scaling factor that the decompressor supports (see
<a href="TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a>), or <a href="TJ.html#UNSCALED"><code>TJ.UNSCALED</code></a> for 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
<code>scalingFactor.</code><a href="TJScalingFactor.html#getScaled(int)"><code>getScaled()</code></a>
with the JPEG image width and height (see <a href="#getWidth()"><code>getWidth()</code></a> and
<a href="#getHeight()"><code>getHeight()</code></a>.) 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 iMCU size (see
<a href="TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth()</code></a> and <a href="TJ.html#getMCUHeight(int)"><code>TJ.getMCUHeight()</code></a>.) Note that decompression scaling is not available
(and the specified scaling factor is ignored) when decompressing lossless
JPEG images (see <a href="TJ.html#PARAM_LOSSLESS"><code>TJ.PARAM_LOSSLESS</code></a>), since the IDCT algorithm is
not used with those images. Note also that <a href="TJ.html#PARAM_FASTDCT"><code>TJ.PARAM_FASTDCT</code></a> is
ignored when decompression scaling is enabled.</dd>
</dl>
</li>
</ul>
<a id="setCroppingRegion(java.awt.Rectangle)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setCroppingRegion</h4>
<pre class="methodSignature">public void setCroppingRegion​(java.awt.Rectangle croppingRegion)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Set the cropping region for partially decompressing a lossy JPEG image
into a packed-pixel image.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>croppingRegion</code> - <code>java.awt.Rectangle</code> instance that
specifies a subregion of the JPEG image to decompress, or
<a href="TJ.html#UNCROPPED"><code>TJ.UNCROPPED</code></a> for no cropping. The left boundary of the cropping
region must be evenly divisible by the scaled iMCU width, which can be
determined by calling <a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a> with the specified scaling factor (see
<a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>) and the iMCU width (see
<a href="TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth()</code></a>) for the level of chrominance
subsampling in the JPEG image (see <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a>.) The
cropping region should be specified relative to the scaled image
dimensions. Unless <code>croppingRegion</code> is <a href="TJ.html#UNCROPPED"><code>TJ.UNCROPPED</code></a>,
the JPEG header must be read (see <a href="#setSourceImage(byte%5B%5D,int)"><code>setSourceImage(byte[], int)</code></a>)
prior to calling this method.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="getJPEGBuf()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJPEGBuf</h4>
<pre class="methodSignature">public byte[] getJPEGBuf()</pre>
<div class="block">Returns the JPEG buffer associated with this decompressor instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the JPEG buffer associated with this decompressor instance.</dd>
</dl>
</li>
</ul>
<a id="getJPEGSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJPEGSize</h4>
<pre class="methodSignature">public int getJPEGSize()</pre>
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
decompressor instance.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the size of the JPEG image (in bytes) associated with this
decompressor instance.</dd>
</dl>
</li>
</ul>
<a id="decompress8(byte[],int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress8</h4>
<pre class="methodSignature">public void decompress8​(byte[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 2 to 8 bits per sample, or decode
the 8-bit-per-sample planar YUV source image, associated with this
decompressor instance and output a packed-pixel grayscale, RGB, or CMYK
image with the same data precision to the given destination buffer.
<p>NOTE: The destination image is fully recoverable if this method throws
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstBuf</code> - buffer that will receive the packed-pixel
decompressed/decoded image. This buffer should normally be
<code>pitch * destinationHeight</code> bytes in size. However, the buffer
may also be larger, in which case the <code>x</code>, <code>y</code>, and
<code>pitch</code> parameters 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 <code>destinationHeight</code> is either
the scaled JPEG height (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
<a href="#getHeight()"><code>getHeight()</code></a>) or the height of the cropping region (see
<a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If the source image is a
YUV image or a lossless JPEG image, then <code>destinationHeight</code> is
the height of the source image.</dd>
<dd><code>x</code> - x offset (in pixels) of the region in the destination image into
which the source image should be decompressed/decoded</dd>
<dd><code>y</code> - y offset (in pixels) of the region in the destination image into
which the source image should be decompressed/decoded</dd>
<dd><code>pitch</code> - bytes per row in the destination image. Normally this should
be set to <code>destinationWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>, if the
destination image will be unpadded. (Setting this parameter to 0 is the
equivalent of setting it to <code>destinationWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) 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 <code>destinationWidth</code> is either the scaled JPEG
width (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
<a href="#getWidth()"><code>getWidth()</code></a>) or the width of the cropping region (see
<a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If the source image is a
YUV image or a lossless JPEG image, then <code>destinationWidth</code> is
the width of the source image.</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed/decoded image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress8(int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress8</h4>
<pre class="methodSignature">public byte[] decompress8​(int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 2 to 8 bits per sample, or decode
the 8-bit-per-sample planar YUV source image, associated with this
decompressor instance and return a buffer containing a packed-pixel
decompressed image with the same data precision.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pitch</code> - see
<a href="#decompress8(byte%5B%5D,int,int,int,int)"><code>decompress8(byte[], int, int, int, int)</code></a> for description</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a buffer containing a packed-pixel decompressed image with 2 to 8
bits of data precision per sample.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress12(short[],int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress12</h4>
<pre class="methodSignature">public void decompress12​(short[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 9 to 12 bits per sample associated
with this decompressor instance and output a packed-pixel grayscale, RGB,
or CMYK image with the same data precision to the given destination
buffer.
<p>NOTE: The destination image is fully recoverable if this method throws
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstBuf</code> - buffer that will receive the packed-pixel
decompressed image. This buffer should normally be
<code>pitch * destinationHeight</code> samples in size. However, the
buffer may also be larger, in which case the <code>x</code>,
<code>y</code>, and <code>pitch</code> parameters 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
<code>destinationHeight</code> is either the scaled JPEG height (see
<a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
<a href="#getHeight()"><code>getHeight()</code></a>) or the height of the cropping region (see
<a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If the source image is a
lossless JPEG image, then <code>destinationHeight</code> is the height of
the source image.</dd>
<dd><code>x</code> - x offset (in pixels) of the region in the destination image into
which the source image should be decompressed</dd>
<dd><code>y</code> - y offset (in pixels) of the region in the destination image into
which the source image should be decompressed</dd>
<dd><code>pitch</code> - samples per row in the destination image. Normally this
should be set to <code>destinationWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>, if the
destination image will be unpadded. (Setting this parameter to 0 is the
equivalent of setting it to <code>destinationWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) 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 <code>destinationWidth</code> is either the scaled JPEG width
(see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
<a href="#getWidth()"><code>getWidth()</code></a>) or the width of the cropping region (see
<a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If the source image is a
YUV image or a lossless JPEG image, then <code>destinationWidth</code> is
the width of the source image.</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress12(int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress12</h4>
<pre class="methodSignature">public short[] decompress12​(int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 9 to 12 bits per sample associated
with this decompressor instance and return a buffer containing a
packed-pixel decompressed image with the same data precision.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pitch</code> - see
<a href="#decompress12(short%5B%5D,int,int,int,int)"><code>decompress12(short[], int, int, int, int)</code></a> for description</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a buffer containing a packed-pixel decompressed image with 9 to 12
bits of data precision per sample.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress16(short[],int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress16</h4>
<pre class="methodSignature">public void decompress16​(short[] dstBuf,
int x,
int y,
int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 13 to 16 bits per sample associated
with this decompressor instance and output a packed-pixel grayscale, RGB,
or CMYK image with the same data precision to the given destination
buffer.
<p>NOTE: The destination image is fully recoverable if this method throws
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is
set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstBuf</code> - buffer that will receive the packed-pixel
decompressed image. This buffer should normally be
<code>pitch * jpegHeight</code> samples in size. However, the buffer may
also be larger, in which case the <code>x</code>,
<code>y</code>, and <code>pitch</code> parameters can be used to specify
the region into which the source image should be decompressed.</dd>
<dd><code>x</code> - x offset (in pixels) of the region in the destination image into
which the source image should be decompressed</dd>
<dd><code>y</code> - y offset (in pixels) of the region in the destination image into
which the source image should be decompressed</dd>
<dd><code>pitch</code> - samples per row in the destination image. Normally this
should be set to <code>jpegWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>, if the
destination image will be unpadded. (Setting this parameter to 0 is the
equivalent of setting it to <code>jpegWidth *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) 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.</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress16(int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress16</h4>
<pre class="methodSignature">public short[] decompress16​(int pitch,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the JPEG source image with 13 to 16 bits per sample associated
with this decompressor instance and return a buffer containing a
packed-pixel decompressed image with the same data precision.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>pitch</code> - see
<a href="#decompress16(short%5B%5D,int,int,int,int)"><code>decompress16(short[], int, int, int, int)</code></a> for description</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a buffer containing a packed-pixel decompressed image with 13 to
16 bits of data precision per sample.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompressToYUV</h4>
<pre class="methodSignature">public void decompressToYUV​(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">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 given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance. 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.
<p>NOTE: The planar YUV destination image is fully recoverable if this
method throws a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless
<a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a> is set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstImage</code> - <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the planar YUV
decompressed image. The level of subsampling specified in this
<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance must match that of the JPEG image, and the width
and height specified in the <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance must match the
scaled JPEG width and height (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>, <a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, <a href="#getWidth()"><code>getWidth()</code></a>, and <a href="#getHeight()"><code>getHeight()</code></a>.)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompressToYUV(int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompressToYUV</h4>
<pre class="methodSignature">public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV​(int[] strides)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">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 a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance 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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>strides</code> - 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 <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a>.) If <code>strides</code> is 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.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the decompressed image
planes</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompressToYUV(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompressToYUV</h4>
<pre class="methodSignature">public <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV​(int align)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">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 a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance 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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>align</code> - 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.)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the unified planar YUV
decompressed image</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress8(int[],int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress8</h4>
<pre class="methodSignature">public void decompress8​(int[] dstBuf,
int x,
int y,
int stride,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">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.
<p>NOTE: The destination image is fully recoverable if this method throws
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
is set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstBuf</code> - buffer that will receive the packed-pixel
decompressed/decoded image. This buffer should normally be
<code>stride * destinationHeight</code> pixels in size. However, the
buffer may also be larger, in which case the <code>x</code>,
<code>y</code>, and <code>pitch</code> parameters 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
<code>destinationHeight</code> is either the scaled JPEG height (see
<a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and
<a href="#getHeight()"><code>getHeight()</code></a>) or the height of the cropping region (see
<a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If the source image is a
YUV image or a lossless JPEG image, then <code>destinationHeight</code> is
the height of the source image.</dd>
<dd><code>x</code> - x offset (in pixels) of the region in the destination image into
which the source image should be decompressed/decoded</dd>
<dd><code>y</code> - y offset (in pixels) of the region in the destination image into
which the source image should be decompressed/decoded</dd>
<dd><code>stride</code> - pixels per row in the destination image. Normally this
should be set to <code>destinationWidth</code>. (Setting this parameter
to 0 is the equivalent of setting it to <code>destinationWidth</code>.)
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 <code>destinationWidth</code> is
either the scaled JPEG width (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>, <a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>, and <a href="#getWidth()"><code>getWidth()</code></a>) or the width of the
cropping region (see <a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If
the source image is a YUV image or a lossless JPEG image, then
<code>destinationWidth</code> is the width of the source image.</dd>
<dd><code>pixelFormat</code> - pixel format of the decompressed/decoded image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress8(java.awt.image.BufferedImage)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress8</h4>
<pre class="methodSignature">public void decompress8​(java.awt.image.BufferedImage dstImage)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">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 given
<code>BufferedImage</code> instance.
<p>NOTE: The destination image is fully recoverable if this method throws
a non-fatal <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_STOPONWARNING</code></a>
is set.)</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dstImage</code> - a <code>BufferedImage</code> instance 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
<code>BufferedImage</code> instance must match the scaled JPEG width and
height (see <a href="#setScalingFactor(org.libjpegturbo.turbojpeg.TJScalingFactor)"><code>setScalingFactor()</code></a>,
<a href="TJScalingFactor.html#getScaled(int)"><code>TJScalingFactor.getScaled()</code></a>,
<a href="#getWidth()"><code>getWidth()</code></a>, and <a href="#getHeight()"><code>getHeight()</code></a>) or the width and height of the
cropping region (see <a href="#setCroppingRegion(java.awt.Rectangle)"><code>setCroppingRegion()</code></a>.) If
the source image is a YUV image or a lossless JPEG image, then the width
and height of the <code>BufferedImage</code> instance must match the width
and height of the source image.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="decompress8(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>decompress8</h4>
<pre class="methodSignature">public java.awt.image.BufferedImage decompress8​(int bufferedImageType)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Decompress the 8-bit-per-sample JPEG source image or decode the planar YUV
source image associated with this decompressor instance and return a
<code>BufferedImage</code> instance containing the 8-bit-per-sample
packed-pixel decompressed/decoded image.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>bufferedImageType</code> - the image type of the <code>BufferedImage</code>
instance that will be created (for instance,
<code>BufferedImage.TYPE_INT_RGB</code>)</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a <code>BufferedImage</code> instance containing the
8-bit-per-sample packed-pixel decompressed/decoded image.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="saveImage(java.lang.String,java.lang.Object,int,int,int,int,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>saveImage</h4>
<pre class="methodSignature">public void saveImage​(java.lang.String fileName,
java.lang.Object image,
int x,
int y,
int width,
int pitch,
int height,
int pixelFormat)
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Save a packed-pixel image with 2 to 16 bits of data precision per sample
from memory to disk.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>fileName</code> - name of a file to which to save the packed-pixel image.
The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format,
depending on the file extension. Windows BMP files require
8-bit-per-sample data precision. When saving a PBMPLUS file, the source
data precision (from 2 to 16 bits per sample) can be specified using
<a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a> and defaults to 8 if <a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a>
is unset.</dd>
<dd><code>image</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
image to be saved. The buffer is a <code>byte</code> array if the image
has 2 to 8 bits of data precision per sample and a <code>short</code>
array otherwise.</dd>
<dd><code>x</code> - x offset (in pixels) of the region in the buffer from which to
save the packed-pixel image</dd>
<dd><code>y</code> - y offset (in pixels) of the region in the buffer from which to
save the packed-pixel image</dd>
<dd><code>width</code> - width (in pixels) of the region in the buffer from which to
save the packed-pixel image</dd>
<dd><code>pitch</code> - samples per row in the packed-pixel buffer. Setting this
parameter to 0 is the equivalent of setting it to <code>width *
<a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.</dd>
<dd><code>height</code> - height (in pixels) of the region in the buffer from which to
save the packed-pixel image</dd>
<dd><code>pixelFormat</code> - pixel format of the packed-pixel image (one of
<a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>). If this parameter is set to
<a href="TJ.html#PF_GRAY"><code>TJ.PF_GRAY</code></a>, then the image will be stored in PGM or
8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be
stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to
<a href="TJ.html#PF_CMYK"><code>TJ.PF_CMYK</code></a>, then the CMYK pixels will be converted to RGB using a
quick & dirty algorithm that is suitable only for testing purposes.
(Proper conversion between CMYK and other formats requires a color
management system.)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="close()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre class="methodSignature">public void close()
throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
<div class="block">Free the native structures associated with this decompressor instance.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code> in interface <code>java.io.Closeable</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
</dl>
</li>
</ul>
<a id="finalize()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>finalize</h4>
<pre class="methodSignature">protected void finalize()
throws java.lang.Throwable</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>finalize</code> in class <code>java.lang.Object</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Throwable</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>