1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<!-- NewPage --> 3<html lang="en"> 4<head> 5<title>TJDecompressor</title> 6<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> 7</head> 8<body> 9<script type="text/javascript"><!-- 10 try { 11 if (location.href.indexOf('is-external=true') == -1) { 12 parent.document.title="TJDecompressor"; 13 } 14 } 15 catch(err) { 16 } 17//--> 18</script> 19<noscript> 20<div>JavaScript is disabled on your browser.</div> 21</noscript> 22<!-- ========= START OF TOP NAVBAR ======= --> 23<div class="topNav"><a name="navbar_top"> 24<!-- --> 25</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> 26<!-- --> 27</a> 28<ul class="navList" title="Navigation"> 29<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li> 30<li class="navBarCell1Rev">Class</li> 31<li><a href="package-tree.html">Tree</a></li> 32<li><a href="../../../deprecated-list.html">Deprecated</a></li> 33<li><a href="../../../index-all.html">Index</a></li> 34<li><a href="../../../help-doc.html">Help</a></li> 35</ul> 36</div> 37<div class="subNav"> 38<ul class="navList"> 39<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> 40<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li> 41</ul> 42<ul class="navList"> 43<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li> 44<li><a href="TJDecompressor.html" target="_top">No Frames</a></li> 45</ul> 46<ul class="navList" id="allclasses_navbar_top"> 47<li><a href="../../../allclasses-noframe.html">All Classes</a></li> 48</ul> 49<div> 50<script type="text/javascript"><!-- 51 allClassesLink = document.getElementById("allclasses_navbar_top"); 52 if(window==top) { 53 allClassesLink.style.display = "block"; 54 } 55 else { 56 allClassesLink.style.display = "none"; 57 } 58 //--> 59</script> 60</div> 61<div> 62<ul class="subNavList"> 63<li>Summary: </li> 64<li>Nested | </li> 65<li><a href="#field_summary">Field</a> | </li> 66<li><a href="#constructor_summary">Constr</a> | </li> 67<li><a href="#method_summary">Method</a></li> 68</ul> 69<ul class="subNavList"> 70<li>Detail: </li> 71<li><a href="#field_detail">Field</a> | </li> 72<li><a href="#constructor_detail">Constr</a> | </li> 73<li><a href="#method_detail">Method</a></li> 74</ul> 75</div> 76<a name="skip-navbar_top"> 77<!-- --> 78</a></div> 79<!-- ========= END OF TOP NAVBAR ========= --> 80<!-- ======== START OF CLASS DATA ======== --> 81<div class="header"> 82<div class="subTitle">org.libjpegturbo.turbojpeg</div> 83<h2 title="Class TJDecompressor" class="title">Class TJDecompressor</h2> 84</div> 85<div class="contentContainer"> 86<ul class="inheritance"> 87<li>java.lang.Object</li> 88<li> 89<ul class="inheritance"> 90<li>org.libjpegturbo.turbojpeg.TJDecompressor</li> 91</ul> 92</li> 93</ul> 94<div class="description"> 95<ul class="blockList"> 96<li class="blockList"> 97<dl> 98<dt>All Implemented Interfaces:</dt> 99<dd>java.io.Closeable, java.lang.AutoCloseable</dd> 100</dl> 101<dl> 102<dt>Direct Known Subclasses:</dt> 103<dd><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dd> 104</dl> 105<hr> 106<br> 107<pre>public class <span class="strong">TJDecompressor</span> 108extends java.lang.Object 109implements java.io.Closeable</pre> 110<div class="block">TurboJPEG decompressor</div> 111</li> 112</ul> 113</div> 114<div class="summary"> 115<ul class="blockList"> 116<li class="blockList"> 117<!-- =========== FIELD SUMMARY =========== --> 118<ul class="blockList"> 119<li class="blockList"><a name="field_summary"> 120<!-- --> 121</a> 122<h3>Field Summary</h3> 123<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> 124<caption><span>Fields</span><span class="tabEnd"> </span></caption> 125<tr> 126<th class="colFirst" scope="col">Modifier and Type</th> 127<th class="colLast" scope="col">Field and Description</th> 128</tr> 129<tr class="altColor"> 130<td class="colFirst"><code>protected long</code></td> 131<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a></strong></code> </td> 132</tr> 133<tr class="rowColor"> 134<td class="colFirst"><code>protected byte[]</code></td> 135<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a></strong></code> </td> 136</tr> 137<tr class="altColor"> 138<td class="colFirst"><code>protected int</code></td> 139<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a></strong></code> </td> 140</tr> 141<tr class="rowColor"> 142<td class="colFirst"><code>protected int</code></td> 143<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a></strong></code> </td> 144</tr> 145<tr class="altColor"> 146<td class="colFirst"><code>protected int</code></td> 147<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a></strong></code> </td> 148</tr> 149<tr class="rowColor"> 150<td class="colFirst"><code>protected int</code></td> 151<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a></strong></code> </td> 152</tr> 153<tr class="altColor"> 154<td class="colFirst"><code>protected int</code></td> 155<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a></strong></code> </td> 156</tr> 157<tr class="rowColor"> 158<td class="colFirst"><code>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> 159<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></strong></code> </td> 160</tr> 161</table> 162</li> 163</ul> 164<!-- ======== CONSTRUCTOR SUMMARY ======== --> 165<ul class="blockList"> 166<li class="blockList"><a name="constructor_summary"> 167<!-- --> 168</a> 169<h3>Constructor Summary</h3> 170<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> 171<caption><span>Constructors</span><span class="tabEnd"> </span></caption> 172<tr> 173<th class="colOne" scope="col">Constructor and Description</th> 174</tr> 175<tr class="altColor"> 176<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor()">TJDecompressor</a></strong>()</code> 177<div class="block">Create a TurboJPEG decompresssor instance.</div> 178</td> 179</tr> 180<tr class="rowColor"> 181<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[])">TJDecompressor</a></strong>(byte[] jpegImage)</code> 182<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source 183 image stored in <code>jpegImage</code> with the newly created instance.</div> 184</td> 185</tr> 186<tr class="altColor"> 187<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)">TJDecompressor</a></strong>(byte[] jpegImage, 188 int imageSize)</code> 189<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source 190 image of length <code>imageSize</code> bytes stored in 191 <code>jpegImage</code> with the newly created instance.</div> 192</td> 193</tr> 194<tr class="rowColor"> 195<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)">TJDecompressor</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage)</code> 196<div class="block">Create a TurboJPEG decompressor instance and associate the YUV planar 197 source image stored in <code>yuvImage</code> with the newly created 198 instance.</div> 199</td> 200</tr> 201</table> 202</li> 203</ul> 204<!-- ========== METHOD SUMMARY =========== --> 205<ul class="blockList"> 206<li class="blockList"><a name="method_summary"> 207<!-- --> 208</a> 209<h3>Method Summary</h3> 210<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> 211<caption><span>Methods</span><span class="tabEnd"> </span></caption> 212<tr> 213<th class="colFirst" scope="col">Modifier and Type</th> 214<th class="colLast" scope="col">Method and Description</th> 215</tr> 216<tr class="altColor"> 217<td class="colFirst"><code>void</code></td> 218<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a></strong>()</code> 219<div class="block">Free the native structures associated with this decompressor instance.</div> 220</td> 221</tr> 222<tr class="rowColor"> 223<td class="colFirst"><code>void</code></td> 224<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a></strong>(java.awt.image.BufferedImage dstImage, 225 int flags)</code> 226<div class="block">Decompress the JPEG source image or decode the YUV source image associated 227 with this decompressor instance and output a decompressed/decoded image to 228 the given <code>BufferedImage</code> instance.</div> 229</td> 230</tr> 231<tr class="altColor"> 232<td class="colFirst"><code>void</code></td> 233<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf, 234 int desiredWidth, 235 int pitch, 236 int desiredHeight, 237 int pixelFormat, 238 int flags)</code> 239<div class="block"><strong>Deprecated.</strong> 240<div class="block"><i>Use 241 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div> 242</div> 243</td> 244</tr> 245<tr class="rowColor"> 246<td class="colFirst"><code>void</code></td> 247<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf, 248 int x, 249 int y, 250 int desiredWidth, 251 int pitch, 252 int desiredHeight, 253 int pixelFormat, 254 int flags)</code> 255<div class="block">Decompress the JPEG source image or decode the YUV source image associated 256 with this decompressor instance and output a grayscale, RGB, or CMYK image 257 to the given destination buffer.</div> 258</td> 259</tr> 260<tr class="altColor"> 261<td class="colFirst"><code>void</code></td> 262<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int[] dstBuf, 263 int x, 264 int y, 265 int desiredWidth, 266 int stride, 267 int desiredHeight, 268 int pixelFormat, 269 int flags)</code> 270<div class="block">Decompress the JPEG source image or decode the YUV source image associated 271 with this decompressor instance and output a grayscale, RGB, or CMYK image 272 to the given destination buffer.</div> 273</td> 274</tr> 275<tr class="rowColor"> 276<td class="colFirst"><code>java.awt.image.BufferedImage</code></td> 277<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth, 278 int desiredHeight, 279 int bufferedImageType, 280 int flags)</code> 281<div class="block">Decompress the JPEG source image or decode the YUV source image associated 282 with this decompressor instance and return a <code>BufferedImage</code> 283 instance containing the decompressed/decoded image.</div> 284</td> 285</tr> 286<tr class="altColor"> 287<td class="colFirst"><code>byte[]</code></td> 288<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth, 289 int pitch, 290 int desiredHeight, 291 int pixelFormat, 292 int flags)</code> 293<div class="block">Decompress the JPEG source image associated with this decompressor 294 instance and return a buffer containing the decompressed image.</div> 295</td> 296</tr> 297<tr class="rowColor"> 298<td class="colFirst"><code>void</code></td> 299<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a></strong>(byte[] dstBuf, 300 int flags)</code> 301<div class="block"><strong>Deprecated.</strong> 302<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div> 303</div> 304</td> 305</tr> 306<tr class="altColor"> 307<td class="colFirst"><code>byte[]</code></td> 308<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a></strong>(int flags)</code> 309<div class="block"><strong>Deprecated.</strong> 310<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div> 311</div> 312</td> 313</tr> 314<tr class="rowColor"> 315<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> 316<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth, 317 int[] strides, 318 int desiredHeight, 319 int flags)</code> 320<div class="block">Decompress the JPEG source image associated with this decompressor 321 instance into a set of Y, U (Cb), and V (Cr) image planes and return a 322 <code>YUVImage</code> instance containing the decompressed image planes.</div> 323</td> 324</tr> 325<tr class="altColor"> 326<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td> 327<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth, 328 int pad, 329 int desiredHeight, 330 int flags)</code> 331<div class="block">Decompress the JPEG source image associated with this decompressor 332 instance into a unified YUV planar image buffer and return a 333 <code>YUVImage</code> instance containing the decompressed image.</div> 334</td> 335</tr> 336<tr class="rowColor"> 337<td class="colFirst"><code>void</code></td> 338<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage, 339 int flags)</code> 340<div class="block">Decompress the JPEG source image associated with this decompressor 341 instance into a YUV planar image and store it in the given 342 <code>YUVImage</code> instance.</div> 343</td> 344</tr> 345<tr class="altColor"> 346<td class="colFirst"><code>protected void</code></td> 347<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a></strong>()</code> </td> 348</tr> 349<tr class="rowColor"> 350<td class="colFirst"><code>int</code></td> 351<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a></strong>()</code> 352<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated 353 with this decompressor instance.</div> 354</td> 355</tr> 356<tr class="altColor"> 357<td class="colFirst"><code>int</code></td> 358<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a></strong>()</code> 359<div class="block">Returns the height of the source image (JPEG or YUV) associated with this 360 decompressor instance.</div> 361</td> 362</tr> 363<tr class="rowColor"> 364<td class="colFirst"><code>byte[]</code></td> 365<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a></strong>()</code> 366<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div> 367</td> 368</tr> 369<tr class="altColor"> 370<td class="colFirst"><code>int</code></td> 371<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a></strong>()</code> 372<div class="block">Returns the size of the JPEG image (in bytes) associated with this 373 decompressor instance.</div> 374</td> 375</tr> 376<tr class="rowColor"> 377<td class="colFirst"><code>int</code></td> 378<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a></strong>(int desiredWidth, 379 int desiredHeight)</code> 380<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG 381 decompressor can generate without exceeding the desired image width and 382 height.</div> 383</td> 384</tr> 385<tr class="altColor"> 386<td class="colFirst"><code>int</code></td> 387<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a></strong>(int desiredWidth, 388 int desiredHeight)</code> 389<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG 390 decompressor can generate without exceeding the desired image width and 391 height.</div> 392</td> 393</tr> 394<tr class="rowColor"> 395<td class="colFirst"><code>int</code></td> 396<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a></strong>()</code> 397<div class="block">Returns the level of chrominance subsampling used in the source image 398 (JPEG or YUV) associated with this decompressor instance.</div> 399</td> 400</tr> 401<tr class="altColor"> 402<td class="colFirst"><code>int</code></td> 403<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a></strong>()</code> 404<div class="block">Returns the width of the source image (JPEG or YUV) associated with this 405 decompressor instance.</div> 406</td> 407</tr> 408<tr class="rowColor"> 409<td class="colFirst"><code>void</code></td> 410<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a></strong>(byte[] jpegImage, 411 int imageSize)</code> 412<div class="block"><strong>Deprecated.</strong> 413<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div> 414</div> 415</td> 416</tr> 417<tr class="altColor"> 418<td class="colFirst"><code>void</code></td> 419<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a></strong>(byte[] jpegImage, 420 int imageSize)</code> 421<div class="block">Associate the JPEG image or "abbreviated table specification" (AKA 422 "tables-only") datastream of length <code>imageSize</code> bytes stored in 423 <code>jpegImage</code> with this decompressor instance.</div> 424</td> 425</tr> 426<tr class="rowColor"> 427<td class="colFirst"><code>void</code></td> 428<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code> 429<div class="block">Associate the specified YUV planar source image with this decompressor 430 instance.</div> 431</td> 432</tr> 433</table> 434<ul class="blockList"> 435<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> 436<!-- --> 437</a> 438<h3>Methods inherited from class java.lang.Object</h3> 439<code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> 440</ul> 441</li> 442</ul> 443</li> 444</ul> 445</div> 446<div class="details"> 447<ul class="blockList"> 448<li class="blockList"> 449<!-- ============ FIELD DETAIL =========== --> 450<ul class="blockList"> 451<li class="blockList"><a name="field_detail"> 452<!-- --> 453</a> 454<h3>Field Detail</h3> 455<a name="handle"> 456<!-- --> 457</a> 458<ul class="blockList"> 459<li class="blockList"> 460<h4>handle</h4> 461<pre>protected long handle</pre> 462</li> 463</ul> 464<a name="jpegBuf"> 465<!-- --> 466</a> 467<ul class="blockList"> 468<li class="blockList"> 469<h4>jpegBuf</h4> 470<pre>protected byte[] jpegBuf</pre> 471</li> 472</ul> 473<a name="jpegBufSize"> 474<!-- --> 475</a> 476<ul class="blockList"> 477<li class="blockList"> 478<h4>jpegBufSize</h4> 479<pre>protected int jpegBufSize</pre> 480</li> 481</ul> 482<a name="yuvImage"> 483<!-- --> 484</a> 485<ul class="blockList"> 486<li class="blockList"> 487<h4>yuvImage</h4> 488<pre>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage</pre> 489</li> 490</ul> 491<a name="jpegWidth"> 492<!-- --> 493</a> 494<ul class="blockList"> 495<li class="blockList"> 496<h4>jpegWidth</h4> 497<pre>protected int jpegWidth</pre> 498</li> 499</ul> 500<a name="jpegHeight"> 501<!-- --> 502</a> 503<ul class="blockList"> 504<li class="blockList"> 505<h4>jpegHeight</h4> 506<pre>protected int jpegHeight</pre> 507</li> 508</ul> 509<a name="jpegSubsamp"> 510<!-- --> 511</a> 512<ul class="blockList"> 513<li class="blockList"> 514<h4>jpegSubsamp</h4> 515<pre>protected int jpegSubsamp</pre> 516</li> 517</ul> 518<a name="jpegColorspace"> 519<!-- --> 520</a> 521<ul class="blockListLast"> 522<li class="blockList"> 523<h4>jpegColorspace</h4> 524<pre>protected int jpegColorspace</pre> 525</li> 526</ul> 527</li> 528</ul> 529<!-- ========= CONSTRUCTOR DETAIL ======== --> 530<ul class="blockList"> 531<li class="blockList"><a name="constructor_detail"> 532<!-- --> 533</a> 534<h3>Constructor Detail</h3> 535<a name="TJDecompressor()"> 536<!-- --> 537</a> 538<ul class="blockList"> 539<li class="blockList"> 540<h4>TJDecompressor</h4> 541<pre>public TJDecompressor() 542 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 543<div class="block">Create a TurboJPEG decompresssor instance.</div> 544<dl><dt><span class="strong">Throws:</span></dt> 545<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 546</li> 547</ul> 548<a name="TJDecompressor(byte[])"> 549<!-- --> 550</a> 551<ul class="blockList"> 552<li class="blockList"> 553<h4>TJDecompressor</h4> 554<pre>public TJDecompressor(byte[] jpegImage) 555 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 556<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source 557 image stored in <code>jpegImage</code> with the newly created instance.</div> 558<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to 559 be the length of the array.) This buffer is not modified.</dd> 560<dt><span class="strong">Throws:</span></dt> 561<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 562</li> 563</ul> 564<a name="TJDecompressor(byte[], int)"> 565<!-- --> 566</a> 567<ul class="blockList"> 568<li class="blockList"> 569<h4>TJDecompressor</h4> 570<pre>public TJDecompressor(byte[] jpegImage, 571 int imageSize) 572 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 573<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source 574 image of length <code>imageSize</code> bytes stored in 575 <code>jpegImage</code> with the newly created instance.</div> 576<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer. This buffer is not modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd> 577<dt><span class="strong">Throws:</span></dt> 578<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 579</li> 580</ul> 581<a name="TJDecompressor(org.libjpegturbo.turbojpeg.YUVImage)"> 582<!-- --> 583</a> 584<ul class="blockListLast"> 585<li class="blockList"> 586<h4>TJDecompressor</h4> 587<pre>public TJDecompressor(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage) 588 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 589<div class="block">Create a TurboJPEG decompressor instance and associate the YUV planar 590 source image stored in <code>yuvImage</code> with the newly created 591 instance.</div> 592<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar 593 image to be decoded. This image is not modified.</dd> 594<dt><span class="strong">Throws:</span></dt> 595<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 596</li> 597</ul> 598</li> 599</ul> 600<!-- ============ METHOD DETAIL ========== --> 601<ul class="blockList"> 602<li class="blockList"><a name="method_detail"> 603<!-- --> 604</a> 605<h3>Method Detail</h3> 606<a name="setSourceImage(byte[], int)"> 607<!-- --> 608</a> 609<ul class="blockList"> 610<li class="blockList"> 611<h4>setSourceImage</h4> 612<pre>public void setSourceImage(byte[] jpegImage, 613 int imageSize) 614 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 615<div class="block">Associate the JPEG image or "abbreviated table specification" (AKA 616 "tables-only") datastream of length <code>imageSize</code> bytes stored in 617 <code>jpegImage</code> with this decompressor instance. If 618 <code>jpegImage</code> contains a JPEG image, then this image will be used 619 as the source image for subsequent decompress operations. Passing a 620 tables-only datastream to this method primes the decompressor with 621 quantization and Huffman tables that can be used when decompressing 622 subsequent "abbreviated image" datastreams. This is useful, for instance, 623 when decompressing video streams in which all frames share the same 624 quantization and Huffman tables.</div> 625<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - buffer containing a JPEG image or an "abbreviated table 626 specification" (AKA "tables-only") datastream. This buffer is not 627 modified.</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd> 628<dt><span class="strong">Throws:</span></dt> 629<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 630</li> 631</ul> 632<a name="setJPEGImage(byte[], int)"> 633<!-- --> 634</a> 635<ul class="blockList"> 636<li class="blockList"> 637<h4>setJPEGImage</h4> 638<pre>@Deprecated 639public void setJPEGImage(byte[] jpegImage, 640 int imageSize) 641 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 642<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div> 643<dl><dt><span class="strong">Throws:</span></dt> 644<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 645</li> 646</ul> 647<a name="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)"> 648<!-- --> 649</a> 650<ul class="blockList"> 651<li class="blockList"> 652<h4>setSourceImage</h4> 653<pre>public void setSourceImage(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</pre> 654<div class="block">Associate the specified YUV planar source image with this decompressor 655 instance. Subsequent decompress operations will decode this image into an 656 RGB or grayscale destination image.</div> 657<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing a YUV planar image to 658 be decoded. This image is not modified.</dd></dl> 659</li> 660</ul> 661<a name="getWidth()"> 662<!-- --> 663</a> 664<ul class="blockList"> 665<li class="blockList"> 666<h4>getWidth</h4> 667<pre>public int getWidth()</pre> 668<div class="block">Returns the width of the source image (JPEG or YUV) associated with this 669 decompressor instance.</div> 670<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the source image (JPEG or YUV) associated with this 671 decompressor instance.</dd></dl> 672</li> 673</ul> 674<a name="getHeight()"> 675<!-- --> 676</a> 677<ul class="blockList"> 678<li class="blockList"> 679<h4>getHeight</h4> 680<pre>public int getHeight()</pre> 681<div class="block">Returns the height of the source image (JPEG or YUV) associated with this 682 decompressor instance.</div> 683<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the source image (JPEG or YUV) associated with this 684 decompressor instance.</dd></dl> 685</li> 686</ul> 687<a name="getSubsamp()"> 688<!-- --> 689</a> 690<ul class="blockList"> 691<li class="blockList"> 692<h4>getSubsamp</h4> 693<pre>public int getSubsamp()</pre> 694<div class="block">Returns the level of chrominance subsampling used in the source image 695 (JPEG or YUV) associated with this decompressor instance. See 696 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div> 697<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the source image 698 (JPEG or YUV) associated with this decompressor instance.</dd></dl> 699</li> 700</ul> 701<a name="getColorspace()"> 702<!-- --> 703</a> 704<ul class="blockList"> 705<li class="blockList"> 706<h4>getColorspace</h4> 707<pre>public int getColorspace()</pre> 708<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated 709 with this decompressor instance. See <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB"><code>TJ.CS_*</code></a>. If the 710 source image is YUV, then this always returns <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>.</div> 711<dl><dt><span class="strong">Returns:</span></dt><dd>the colorspace used in the source image (JPEG or YUV) associated 712 with this decompressor instance.</dd></dl> 713</li> 714</ul> 715<a name="getJPEGBuf()"> 716<!-- --> 717</a> 718<ul class="blockList"> 719<li class="blockList"> 720<h4>getJPEGBuf</h4> 721<pre>public byte[] getJPEGBuf()</pre> 722<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div> 723<dl><dt><span class="strong">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd></dl> 724</li> 725</ul> 726<a name="getJPEGSize()"> 727<!-- --> 728</a> 729<ul class="blockList"> 730<li class="blockList"> 731<h4>getJPEGSize</h4> 732<pre>public int getJPEGSize()</pre> 733<div class="block">Returns the size of the JPEG image (in bytes) associated with this 734 decompressor instance.</div> 735<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the JPEG image (in bytes) associated with this 736 decompressor instance.</dd></dl> 737</li> 738</ul> 739<a name="getScaledWidth(int, int)"> 740<!-- --> 741</a> 742<ul class="blockList"> 743<li class="blockList"> 744<h4>getScaledWidth</h4> 745<pre>public int getScaledWidth(int desiredWidth, 746 int desiredHeight)</pre> 747<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG 748 decompressor can generate without exceeding the desired image width and 749 height.</div> 750<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image. 751 Setting this to 0 is the same as setting it to the width of the JPEG image 752 (in other words, the width will not be considered when determining the 753 scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image. 754 Setting this to 0 is the same as setting it to the height of the JPEG 755 image (in other words, the height will not be considered when determining 756 the scaled image size.)</dd> 757<dt><span class="strong">Returns:</span></dt><dd>the width of the largest scaled-down image that the TurboJPEG 758 decompressor can generate without exceeding the desired image width and 759 height.</dd></dl> 760</li> 761</ul> 762<a name="getScaledHeight(int, int)"> 763<!-- --> 764</a> 765<ul class="blockList"> 766<li class="blockList"> 767<h4>getScaledHeight</h4> 768<pre>public int getScaledHeight(int desiredWidth, 769 int desiredHeight)</pre> 770<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG 771 decompressor can generate without exceeding the desired image width and 772 height.</div> 773<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the decompressed image. 774 Setting this to 0 is the same as setting it to the width of the JPEG image 775 (in other words, the width will not be considered when determining the 776 scaled image size.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the decompressed image. 777 Setting this to 0 is the same as setting it to the height of the JPEG 778 image (in other words, the height will not be considered when determining 779 the scaled image size.)</dd> 780<dt><span class="strong">Returns:</span></dt><dd>the height of the largest scaled-down image that the TurboJPEG 781 decompressor can generate without exceeding the desired image width and 782 height.</dd></dl> 783</li> 784</ul> 785<a name="decompress(byte[], int, int, int, int, int, int, int)"> 786<!-- --> 787</a> 788<ul class="blockList"> 789<li class="blockList"> 790<h4>decompress</h4> 791<pre>public void decompress(byte[] dstBuf, 792 int x, 793 int y, 794 int desiredWidth, 795 int pitch, 796 int desiredHeight, 797 int pixelFormat, 798 int flags) 799 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 800<div class="block">Decompress the JPEG source image or decode the YUV source image associated 801 with this decompressor instance and output a grayscale, RGB, or CMYK image 802 to the given destination buffer. 803 <p> 804 NOTE: The output image is fully recoverable if this method throws a 805 non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless 806 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> 807<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image. 808 If the source image is a JPEG image, then this buffer should normally be 809 <code>pitch * scaledHeight</code> bytes in size, where 810 <code>scaledHeight</code> can be determined by calling <code> 811 scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight) 812 </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,%20int)"><code>getScaledHeight(int, int)</code></a>. If the 813 source image is a YUV image, then this buffer should normally be 814 <code>pitch * height</code> bytes in size, where <code>height</code> is 815 the height of the YUV image. However, the buffer may also be larger than 816 the dimensions of the source image, in which case the <code>x</code>, 817 <code>y</code>, and <code>pitch</code> parameters can be used to specify 818 the region into which the source image should be decompressed/decoded.</dd><dd><code>x</code> - x offset (in pixels) of the region in the destination image into 819 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 820 which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this 821 specifies the desired width (in pixels) of the decompressed image (or 822 image region.) If the desired destination image dimensions are different 823 than the source image dimensions, then TurboJPEG will use scaling in the 824 JPEG decompressor to generate the largest possible image that will fit 825 within the desired dimensions. Setting this to 0 is the same as setting 826 it to the width of the JPEG image (in other words, the width will not be 827 considered when determining the scaled image size.) This parameter is 828 ignored if the source image is a YUV image.</dd><dd><code>pitch</code> - bytes per line of the destination image. Normally, this 829 should be set to <code>scaledWidth * TJ.pixelSize(pixelFormat)</code> if 830 the destination image is unpadded, but you can use this to, for instance, 831 pad each line of the destination image to a 4-byte boundary or to 832 decompress/decode the source image into a region of a larger image. NOTE: 833 if the source image is a JPEG image, then <code>scaledWidth</code> can be 834 determined by calling <code> 835 scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth) 836 </code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a 837 YUV image, then <code>scaledWidth</code> is the width of the YUV image. 838 Setting this parameter to 0 is the equivalent of setting it to 839 <code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this 840 specifies the desired height (in pixels) of the decompressed image (or 841 image region.) If the desired destination image dimensions are different 842 than the source image dimensions, then TurboJPEG will use scaling in the 843 JPEG decompressor to generate the largest possible image that will fit 844 within the desired dimensions. Setting this to 0 is the same as setting 845 it to the height of the JPEG image (in other words, the height will not be 846 considered when determining the scaled image size.) This parameter is 847 ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed/decoded image (one of 848 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of 849 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 850<dt><span class="strong">Throws:</span></dt> 851<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 852</li> 853</ul> 854<a name="decompress(byte[], int, int, int, int, int)"> 855<!-- --> 856</a> 857<ul class="blockList"> 858<li class="blockList"> 859<h4>decompress</h4> 860<pre>@Deprecated 861public void decompress(byte[] dstBuf, 862 int desiredWidth, 863 int pitch, 864 int desiredHeight, 865 int pixelFormat, 866 int flags) 867 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 868<div class="block"><span class="strong">Deprecated.</span> <i>Use 869 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div> 870<dl><dt><span class="strong">Throws:</span></dt> 871<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 872</li> 873</ul> 874<a name="decompress(int, int, int, int, int)"> 875<!-- --> 876</a> 877<ul class="blockList"> 878<li class="blockList"> 879<h4>decompress</h4> 880<pre>public byte[] decompress(int desiredWidth, 881 int pitch, 882 int desiredHeight, 883 int pixelFormat, 884 int flags) 885 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 886<div class="block">Decompress the JPEG source image associated with this decompressor 887 instance and return a buffer containing the decompressed image.</div> 888<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see 889 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> 890 for description</dd><dd><code>pitch</code> - see 891 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> 892 for description</dd><dd><code>desiredHeight</code> - see 893 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> 894 for description</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of 895 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of 896 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 897<dt><span class="strong">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd> 898<dt><span class="strong">Throws:</span></dt> 899<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 900</li> 901</ul> 902<a name="decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"> 903<!-- --> 904</a> 905<ul class="blockList"> 906<li class="blockList"> 907<h4>decompressToYUV</h4> 908<pre>public void decompressToYUV(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage, 909 int flags) 910 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 911<div class="block">Decompress the JPEG source image associated with this decompressor 912 instance into a YUV planar image and store it in the given 913 <code>YUVImage</code> instance. This method performs JPEG decompression 914 but leaves out the color conversion step, so a planar YUV image is 915 generated instead of an RGB or grayscale image. This method cannot be 916 used to decompress JPEG source images with the CMYK or YCCK colorspace. 917 <p> 918 NOTE: The YUV planar output image is fully recoverable if this method 919 throws a non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless 920 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> 921<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstImage</code> - <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance that will receive the YUV planar 922 image. The level of subsampling specified in this <code>YUVImage</code> 923 instance must match that of the JPEG image, and the width and height 924 specified in the <code>YUVImage</code> instance must match one of the 925 scaled image sizes that TurboJPEG is capable of generating from the JPEG 926 source image.</dd><dd><code>flags</code> - the bitwise OR of one or more of 927 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 928<dt><span class="strong">Throws:</span></dt> 929<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 930</li> 931</ul> 932<a name="decompressToYUV(byte[], int)"> 933<!-- --> 934</a> 935<ul class="blockList"> 936<li class="blockList"> 937<h4>decompressToYUV</h4> 938<pre>@Deprecated 939public void decompressToYUV(byte[] dstBuf, 940 int flags) 941 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 942<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div> 943<dl><dt><span class="strong">Throws:</span></dt> 944<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 945</li> 946</ul> 947<a name="decompressToYUV(int, int[], int, int)"> 948<!-- --> 949</a> 950<ul class="blockList"> 951<li class="blockList"> 952<h4>decompressToYUV</h4> 953<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV(int desiredWidth, 954 int[] strides, 955 int desiredHeight, 956 int flags) 957 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 958<div class="block">Decompress the JPEG source image associated with this decompressor 959 instance into a set of Y, U (Cb), and V (Cr) image planes and return a 960 <code>YUVImage</code> instance containing the decompressed image planes. 961 This method performs JPEG decompression but leaves out the color 962 conversion step, so a planar YUV image is generated instead of an RGB or 963 grayscale image. This method cannot be used to decompress JPEG source 964 images with the CMYK or YCCK colorspace.</div> 965<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the 966 desired image dimensions are different than the dimensions of the JPEG 967 image being decompressed, then TurboJPEG will use scaling in the JPEG 968 decompressor to generate the largest possible image that will fit within 969 the desired dimensions. Setting this to 0 is the same as setting it to 970 the width of the JPEG image (in other words, the width will not be 971 considered when determining the scaled image size.)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes 972 per line in the corresponding plane of the output image. Setting the 973 stride for any plane to 0 is the same as setting it to the scaled 974 component width of the plane. If <tt>strides</tt> is NULL, then the 975 strides for all planes will be set to their respective scaled component 976 widths. You can adjust the strides in order to add an arbitrary amount of 977 line padding to each plane.</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image. If the 978 desired image dimensions are different than the dimensions of the JPEG 979 image being decompressed, then TurboJPEG will use scaling in the JPEG 980 decompressor to generate the largest possible image that will fit within 981 the desired dimensions. Setting this to 0 is the same as setting it to 982 the height of the JPEG image (in other words, the height will not be 983 considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of 984 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 985<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd> 986<dt><span class="strong">Throws:</span></dt> 987<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 988</li> 989</ul> 990<a name="decompressToYUV(int, int, int, int)"> 991<!-- --> 992</a> 993<ul class="blockList"> 994<li class="blockList"> 995<h4>decompressToYUV</h4> 996<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV(int desiredWidth, 997 int pad, 998 int desiredHeight, 999 int flags) 1000 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1001<div class="block">Decompress the JPEG source image associated with this decompressor 1002 instance into a unified YUV planar image buffer and return a 1003 <code>YUVImage</code> instance containing the decompressed image. This 1004 method performs JPEG decompression but leaves out the color conversion 1005 step, so a planar YUV image is generated instead of an RGB or grayscale 1006 image. This method cannot be used to decompress JPEG source images with 1007 the CMYK or YCCK colorspace.</div> 1008<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the 1009 desired image dimensions are different than the dimensions of the JPEG 1010 image being decompressed, then TurboJPEG will use scaling in the JPEG 1011 decompressor to generate the largest possible image that will fit within 1012 the desired dimensions. Setting this to 0 is the same as setting it to 1013 the width of the JPEG image (in other words, the width will not be 1014 considered when determining the scaled image size.)</dd><dd><code>pad</code> - the width of each line in each plane of the YUV image will be 1015 padded to the nearest multiple of this number of bytes (must be a power of 1016 2.)</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image. If the 1017 desired image dimensions are different than the dimensions of the JPEG 1018 image being decompressed, then TurboJPEG will use scaling in the JPEG 1019 decompressor to generate the largest possible image that will fit within 1020 the desired dimensions. Setting this to 0 is the same as setting it to 1021 the height of the JPEG image (in other words, the height will not be 1022 considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of 1023 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 1024<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd> 1025<dt><span class="strong">Throws:</span></dt> 1026<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1027</li> 1028</ul> 1029<a name="decompressToYUV(int)"> 1030<!-- --> 1031</a> 1032<ul class="blockList"> 1033<li class="blockList"> 1034<h4>decompressToYUV</h4> 1035<pre>@Deprecated 1036public byte[] decompressToYUV(int flags) 1037 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1038<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div> 1039<dl><dt><span class="strong">Throws:</span></dt> 1040<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1041</li> 1042</ul> 1043<a name="decompress(int[], int, int, int, int, int, int, int)"> 1044<!-- --> 1045</a> 1046<ul class="blockList"> 1047<li class="blockList"> 1048<h4>decompress</h4> 1049<pre>public void decompress(int[] dstBuf, 1050 int x, 1051 int y, 1052 int desiredWidth, 1053 int stride, 1054 int desiredHeight, 1055 int pixelFormat, 1056 int flags) 1057 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1058<div class="block">Decompress the JPEG source image or decode the YUV source image associated 1059 with this decompressor instance and output a grayscale, RGB, or CMYK image 1060 to the given destination buffer. 1061 <p> 1062 NOTE: The output image is fully recoverable if this method throws a 1063 non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless 1064 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> 1065<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the decompressed/decoded image. 1066 If the source image is a JPEG image, then this buffer should normally be 1067 <code>stride * scaledHeight</code> pixels in size, where 1068 <code>scaledHeight</code> can be determined by calling <code> 1069 scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight) 1070 </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,%20int)"><code>getScaledHeight(int, int)</code></a>. If the 1071 source image is a YUV image, then this buffer should normally be 1072 <code>stride * height</code> pixels in size, where <code>height</code> is 1073 the height of the YUV image. However, the buffer may also be larger than 1074 the dimensions of the JPEG image, in which case the <code>x</code>, 1075 <code>y</code>, and <code>stride</code> parameters can be used to specify 1076 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 1077 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 1078 which the source image should be decompressed/decoded</dd><dd><code>desiredWidth</code> - If the source image is a JPEG image, then this 1079 specifies the desired width (in pixels) of the decompressed image (or 1080 image region.) If the desired destination image dimensions are different 1081 than the source image dimensions, then TurboJPEG will use scaling in the 1082 JPEG decompressor to generate the largest possible image that will fit 1083 within the desired dimensions. Setting this to 0 is the same as setting 1084 it to the width of the JPEG image (in other words, the width will not be 1085 considered when determining the scaled image size.) This parameter is 1086 ignored if the source image is a YUV image.</dd><dd><code>stride</code> - pixels per line of the destination image. Normally, this 1087 should be set to <code>scaledWidth</code>, but you can use this to, for 1088 instance, decompress the JPEG image into a region of a larger image. 1089 NOTE: if the source image is a JPEG image, then <code>scaledWidth</code> 1090 can be determined by calling <code> 1091 scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth) 1092 </code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a 1093 YUV image, then <code>scaledWidth</code> is the width of the YUV image. 1094 Setting this parameter to 0 is the equivalent of setting it to 1095 <code>scaledWidth</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this 1096 specifies the desired height (in pixels) of the decompressed image (or 1097 image region.) If the desired destination image dimensions are different 1098 than the source image dimensions, then TurboJPEG will use scaling in the 1099 JPEG decompressor to generate the largest possible image that will fit 1100 within the desired dimensions. Setting this to 0 is the same as setting 1101 it to the height of the JPEG image (in other words, the height will not be 1102 considered when determining the scaled image size.) This parameter is 1103 ignored if the source image is a YUV image.</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of 1104 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of 1105 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 1106<dt><span class="strong">Throws:</span></dt> 1107<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1108</li> 1109</ul> 1110<a name="decompress(java.awt.image.BufferedImage, int)"> 1111<!-- --> 1112</a> 1113<ul class="blockList"> 1114<li class="blockList"> 1115<h4>decompress</h4> 1116<pre>public void decompress(java.awt.image.BufferedImage dstImage, 1117 int flags) 1118 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1119<div class="block">Decompress the JPEG source image or decode the YUV source image associated 1120 with this decompressor instance and output a decompressed/decoded image to 1121 the given <code>BufferedImage</code> instance. 1122 <p> 1123 NOTE: The output image is fully recoverable if this method throws a 1124 non-fatal <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><code>TJException</code></a> (unless 1125 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_STOPONWARNING"><code>TJ.FLAG_STOPONWARNING</code></a> is specified.)</div> 1126<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstImage</code> - a <code>BufferedImage</code> instance that will receive 1127 the decompressed/decoded image. If the source image is a JPEG image, then 1128 the width and height of the <code>BufferedImage</code> instance must match 1129 one of the scaled image sizes that TurboJPEG is capable of generating from 1130 the JPEG image. If the source image is a YUV image, then the width and 1131 height of the <code>BufferedImage</code> instance must match the width and 1132 height of the YUV image.</dd><dd><code>flags</code> - the bitwise OR of one or more of 1133 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 1134<dt><span class="strong">Throws:</span></dt> 1135<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1136</li> 1137</ul> 1138<a name="decompress(int, int, int, int)"> 1139<!-- --> 1140</a> 1141<ul class="blockList"> 1142<li class="blockList"> 1143<h4>decompress</h4> 1144<pre>public java.awt.image.BufferedImage decompress(int desiredWidth, 1145 int desiredHeight, 1146 int bufferedImageType, 1147 int flags) 1148 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1149<div class="block">Decompress the JPEG source image or decode the YUV source image associated 1150 with this decompressor instance and return a <code>BufferedImage</code> 1151 instance containing the decompressed/decoded image.</div> 1152<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see 1153 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for 1154 description</dd><dd><code>desiredHeight</code> - see 1155 <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for 1156 description</dd><dd><code>bufferedImageType</code> - the image type of the <code>BufferedImage</code> 1157 instance that will be created (for instance, 1158 <code>BufferedImage.TYPE_INT_RGB</code>)</dd><dd><code>flags</code> - the bitwise OR of one or more of 1159 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd> 1160<dt><span class="strong">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the 1161 decompressed/decoded image.</dd> 1162<dt><span class="strong">Throws:</span></dt> 1163<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1164</li> 1165</ul> 1166<a name="close()"> 1167<!-- --> 1168</a> 1169<ul class="blockList"> 1170<li class="blockList"> 1171<h4>close</h4> 1172<pre>public void close() 1173 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre> 1174<div class="block">Free the native structures associated with this decompressor instance.</div> 1175<dl> 1176<dt><strong>Specified by:</strong></dt> 1177<dd><code>close</code> in interface <code>java.io.Closeable</code></dd> 1178<dt><strong>Specified by:</strong></dt> 1179<dd><code>close</code> in interface <code>java.lang.AutoCloseable</code></dd> 1180<dt><span class="strong">Throws:</span></dt> 1181<dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl> 1182</li> 1183</ul> 1184<a name="finalize()"> 1185<!-- --> 1186</a> 1187<ul class="blockListLast"> 1188<li class="blockList"> 1189<h4>finalize</h4> 1190<pre>protected void finalize() 1191 throws java.lang.Throwable</pre> 1192<dl> 1193<dt><strong>Overrides:</strong></dt> 1194<dd><code>finalize</code> in class <code>java.lang.Object</code></dd> 1195<dt><span class="strong">Throws:</span></dt> 1196<dd><code>java.lang.Throwable</code></dd></dl> 1197</li> 1198</ul> 1199</li> 1200</ul> 1201</li> 1202</ul> 1203</div> 1204</div> 1205<!-- ========= END OF CLASS DATA ========= --> 1206<!-- ======= START OF BOTTOM NAVBAR ====== --> 1207<div class="bottomNav"><a name="navbar_bottom"> 1208<!-- --> 1209</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> 1210<!-- --> 1211</a> 1212<ul class="navList" title="Navigation"> 1213<li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li> 1214<li class="navBarCell1Rev">Class</li> 1215<li><a href="package-tree.html">Tree</a></li> 1216<li><a href="../../../deprecated-list.html">Deprecated</a></li> 1217<li><a href="../../../index-all.html">Index</a></li> 1218<li><a href="../../../help-doc.html">Help</a></li> 1219</ul> 1220</div> 1221<div class="subNav"> 1222<ul class="navList"> 1223<li><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li> 1224<li><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li> 1225</ul> 1226<ul class="navList"> 1227<li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJDecompressor.html" target="_top">Frames</a></li> 1228<li><a href="TJDecompressor.html" target="_top">No Frames</a></li> 1229</ul> 1230<ul class="navList" id="allclasses_navbar_bottom"> 1231<li><a href="../../../allclasses-noframe.html">All Classes</a></li> 1232</ul> 1233<div> 1234<script type="text/javascript"><!-- 1235 allClassesLink = document.getElementById("allclasses_navbar_bottom"); 1236 if(window==top) { 1237 allClassesLink.style.display = "block"; 1238 } 1239 else { 1240 allClassesLink.style.display = "none"; 1241 } 1242 //--> 1243</script> 1244</div> 1245<div> 1246<ul class="subNavList"> 1247<li>Summary: </li> 1248<li>Nested | </li> 1249<li><a href="#field_summary">Field</a> | </li> 1250<li><a href="#constructor_summary">Constr</a> | </li> 1251<li><a href="#method_summary">Method</a></li> 1252</ul> 1253<ul class="subNavList"> 1254<li>Detail: </li> 1255<li><a href="#field_detail">Field</a> | </li> 1256<li><a href="#constructor_detail">Constr</a> | </li> 1257<li><a href="#method_detail">Method</a></li> 1258</ul> 1259</div> 1260<a name="skip-navbar_bottom"> 1261<!-- --> 1262</a></div> 1263<!-- ======== END OF BOTTOM NAVBAR ======= --> 1264</body> 1265</html> 1266