Debian Codegraph @

java/doc/org/libjpegturbo/turbojpeg/TJCompressor.html

raw
1 <!DOCTYPE HTML>
2 <!-- NewPage -->
3 <html lang="en">
4 <head>
5 <!-- Generated by javadoc -->
6 <title>TJCompressor</title>
7 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8 <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
9 <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.min.css" title="Style">
10 <link rel="stylesheet" type="text/css" href="../../../jquery-ui.overrides.css" title="Style">
11 <script type="text/javascript" src="../../../script.js"></script>
12 <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
13 <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
14 <!--[if IE]>
15 <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
16 <![endif]-->
17 <script type="text/javascript" src="../../../jquery/jquery-3.7.1.min.js"></script>
18 <script type="text/javascript" src="../../../jquery/jquery-ui.min.js"></script>
19 </head>
20 <body>
21 <script type="text/javascript"><!--
22 try {
23 if (location.href.indexOf('is-external=true') == -1) {
24 parent.document.title="TJCompressor";
25 }
26 }
27 catch(err) {
28 }
29 //-->
30 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};
31 var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
32 var altColor = "altColor";
33 var rowColor = "rowColor";
34 var tableTab = "tableTab";
35 var activeTableTab = "activeTableTab";
36 var pathtoroot = "../../../";
37 var useModuleDirectories = true;
38 loadScripts(document, 'script');</script>
39 <noscript>
40 <div>JavaScript is disabled on your browser.</div>
41 </noscript>
42 <header role="banner">
43 <nav role="navigation">
44 <div class="fixedNav">
45 <!-- ========= START OF TOP NAVBAR ======= -->
46 <div class="topNav"><a id="navbar.top">
47 <!-- -->
48 </a>
49 <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
50 <a id="navbar.top.firstrow">
51 <!-- -->
52 </a>
53 <ul class="navList" title="Navigation">
54 <li><a href="package-summary.html">Package</a></li>
55 <li class="navBarCell1Rev">Class</li>
56 <li><a href="package-tree.html">Tree</a></li>
57 <li><a href="../../../deprecated-list.html">Deprecated</a></li>
58 <li><a href="../../../index-all.html">Index</a></li>
59 <li><a href="../../../help-doc.html">Help</a></li>
60 </ul>
61 </div>
62 <div class="subNav">
63 <ul class="navList" id="allclasses_navbar_top">
64 <li><a href="../../../allclasses.html">All&nbsp;Classes</a></li>
65 </ul>
66 <ul class="navListSearch">
67 <li><label for="search">SEARCH:</label>
68 <input type="text" id="search" value="search" disabled="disabled">
69 <input type="reset" id="reset" value="reset" disabled="disabled">
70 </li>
71 </ul>
72 <div>
73 <script type="text/javascript"><!--
74 allClassesLink = document.getElementById("allclasses_navbar_top");
75 if(window==top) {
76 allClassesLink.style.display = "block";
77 }
78 else {
79 allClassesLink.style.display = "none";
80 }
81 //-->
82 </script>
83 <noscript>
84 <div>JavaScript is disabled on your browser.</div>
85 </noscript>
86 </div>
87 <div>
88 <ul class="subNavList">
89 <li>Summary:&nbsp;</li>
90 <li>Nested&nbsp;|&nbsp;</li>
91 <li>Field&nbsp;|&nbsp;</li>
92 <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
93 <li><a href="#method.summary">Method</a></li>
94 </ul>
95 <ul class="subNavList">
96 <li>Detail:&nbsp;</li>
97 <li>Field&nbsp;|&nbsp;</li>
98 <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
99 <li><a href="#method.detail">Method</a></li>
100 </ul>
101 </div>
102 <a id="skip.navbar.top">
103 <!-- -->
104 </a></div>
105 <!-- ========= END OF TOP NAVBAR ========= -->
106 </div>
107 <div class="navPadding">&nbsp;</div>
108 <script type="text/javascript"><!--
109 $('.navPadding').css('padding-top', $('.fixedNav').css("height"));
110 //-->
111 </script>
112 </nav>
113 </header>
114 <!-- ======== START OF CLASS DATA ======== -->
115 <main role="main">
116 <div class="header">
117 <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.libjpegturbo.turbojpeg</a></div>
118 <h2 title="Class TJCompressor" class="title">Class TJCompressor</h2>
119 </div>
120 <div class="contentContainer">
121 <ul class="inheritance">
122 <li>java.lang.Object</li>
123 <li>
124 <ul class="inheritance">
125 <li>org.libjpegturbo.turbojpeg.TJCompressor</li>
126 </ul>
127 </li>
128 </ul>
129 <div class="description">
130 <ul class="blockList">
131 <li class="blockList">
132 <dl>
133 <dt>All Implemented Interfaces:</dt>
134 <dd><code>java.io.Closeable</code>, <code>java.lang.AutoCloseable</code></dd>
135 </dl>
136 <hr>
137 <pre>public class <span class="typeNameLabel">TJCompressor</span>
138 extends java.lang.Object
139 implements java.io.Closeable</pre>
140 <div class="block">TurboJPEG compressor</div>
141 </li>
142 </ul>
143 </div>
144 <div class="summary">
145 <ul class="blockList">
146 <li class="blockList">
147 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
148 <section>
149 <ul class="blockList">
150 <li class="blockList"><a id="constructor.summary">
151 <!-- -->
152 </a>
153 <h3>Constructor Summary</h3>
154 <table class="memberSummary">
155 <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
156 <tr>
157 <th class="colFirst" scope="col">Constructor</th>
158 <th class="colLast" scope="col">Description</th>
159 </tr>
160 <tr class="altColor">
161 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">TJCompressor</a></span>()</code></th>
162 <td class="colLast">
163 <div class="block">Create a TurboJPEG compressor instance.</div>
164 </td>
165 </tr>
166 <tr class="rowColor">
167 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D,int,int,int,int,int,int)">TJCompressor</a></span>&#8203;(byte[]&nbsp;srcImage,
168 int&nbsp;x,
169 int&nbsp;y,
170 int&nbsp;width,
171 int&nbsp;pitch,
172 int&nbsp;height,
173 int&nbsp;pixelFormat)</code></th>
174 <td class="colLast">
175 <div class="block">Create a TurboJPEG compressor instance and associate the packed-pixel
176 source image, stored in <code>srcImage</code> with 2 to 8 bits of data
177 precision per sample, with the newly created instance.</div>
178 </td>
179 </tr>
180 <tr class="altColor">
181 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(java.awt.image.BufferedImage,int,int,int,int)">TJCompressor</a></span>&#8203;(java.awt.image.BufferedImage&nbsp;srcImage,
182 int&nbsp;x,
183 int&nbsp;y,
184 int&nbsp;width,
185 int&nbsp;height)</code></th>
186 <td class="colLast">
187 <div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
188 packed-pixel source image stored in <code>srcImage</code> with the newly
189 created instance.</div>
190 </td>
191 </tr>
192 </table>
193 </li>
194 </ul>
195 </section>
196 <!-- ========== METHOD SUMMARY =========== -->
197 <section>
198 <ul class="blockList">
199 <li class="blockList"><a id="method.summary">
200 <!-- -->
201 </a>
202 <h3>Method Summary</h3>
203 <table class="memberSummary">
204 <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
205 <tr>
206 <th class="colFirst" scope="col">Modifier and Type</th>
207 <th class="colSecond" scope="col">Method</th>
208 <th class="colLast" scope="col">Description</th>
209 </tr>
210 <tr id="i0" class="altColor">
211 <td class="colFirst"><code>void</code></td>
212 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#close()">close</a></span>()</code></th>
213 <td class="colLast">
214 <div class="block">Free the native structures associated with this compressor instance.</div>
215 </td>
216 </tr>
217 <tr id="i1" class="rowColor">
218 <td class="colFirst"><code>byte[]</code></td>
219 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress()">compress</a></span>()</code></th>
220 <td class="colLast">
221 <div class="block">Compress the packed-pixel or planar YUV source image associated with this
222 compressor instance and return a buffer containing a JPEG image.</div>
223 </td>
224 </tr>
225 <tr id="i2" class="altColor">
226 <td class="colFirst"><code>void</code></td>
227 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#compress(byte%5B%5D)">compress</a></span>&#8203;(byte[]&nbsp;dstBuf)</code></th>
228 <td class="colLast">
229 <div class="block">Compress the packed-pixel or planar YUV source image associated with this
230 compressor instance and output a JPEG image to the given destination
231 buffer.</div>
232 </td>
233 </tr>
234 <tr id="i3" class="rowColor">
235 <td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
236 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int)">encodeYUV</a></span>&#8203;(int&nbsp;align)</code></th>
237 <td class="colLast">
238 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
239 compressor instance into an 8-bit-per-sample unified planar YUV image and
240 return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image.</div>
241 </td>
242 </tr>
243 <tr id="i4" class="altColor">
244 <td class="colFirst"><code><a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
245 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(int%5B%5D)">encodeYUV</a></span>&#8203;(int[]&nbsp;strides)</code></th>
246 <td class="colLast">
247 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
248 compressor instance into separate 8-bit-per-sample Y, U (Cb), and V (Cr)
249 image planes and return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded
250 image planes.</div>
251 </td>
252 </tr>
253 <tr id="i5" class="rowColor">
254 <td class="colFirst"><code>void</code></td>
255 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)">encodeYUV</a></span>&#8203;(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;dstImage)</code></th>
256 <td class="colLast">
257 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
258 compressor instance into an 8-bit-per-sample planar YUV image and store it
259 in the given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance.</div>
260 </td>
261 </tr>
262 <tr id="i6" class="altColor">
263 <td class="colFirst"><code>protected void</code></td>
264 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#finalize()">finalize</a></span>()</code></th>
265 <td class="colLast">&nbsp;</td>
266 </tr>
267 <tr id="i7" class="rowColor">
268 <td class="colFirst"><code>int</code></td>
269 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#get(int)">get</a></span>&#8203;(int&nbsp;param)</code></th>
270 <td class="colLast">
271 <div class="block">Get the value of a compression parameter.</div>
272 </td>
273 </tr>
274 <tr id="i8" class="altColor">
275 <td class="colFirst"><code>int</code></td>
276 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCompressedSize()">getCompressedSize</a></span>()</code></th>
277 <td class="colLast">
278 <div class="block">Returns the size of the image (in bytes) generated by the most recent
279 compression operation.</div>
280 </td>
281 </tr>
282 <tr id="i9" class="rowColor">
283 <td class="colFirst"><code>int</code></td>
284 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHeight()">getHeight</a></span>()</code></th>
285 <td class="colLast">
286 <div class="block">Returns the height of the source image (packed-pixel or YUV) associated
287 with this compressor instance.</div>
288 </td>
289 </tr>
290 <tr id="i10" class="altColor">
291 <td class="colFirst"><code>int</code></td>
292 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPitch()">getPitch</a></span>()</code></th>
293 <td class="colLast">
294 <div class="block">Returns the pitch (samples per row) of the packed-pixel source image
295 associated with this compressor instance.</div>
296 </td>
297 </tr>
298 <tr id="i11" class="rowColor">
299 <td class="colFirst"><code>int</code></td>
300 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPixelFormat()">getPixelFormat</a></span>()</code></th>
301 <td class="colLast">
302 <div class="block">Returns the pixel format of the packed-pixel source image associated with
303 this compressor instance.</div>
304 </td>
305 </tr>
306 <tr id="i12" class="altColor">
307 <td class="colFirst"><code>java.lang.Object</code></td>
308 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSourceBuf()">getSourceBuf</a></span>()</code></th>
309 <td class="colLast">
310 <div class="block">Returns the buffer containing the packed-pixel image associated with this
311 compressor instance.</div>
312 </td>
313 </tr>
314 <tr id="i13" class="rowColor">
315 <td class="colFirst"><code>int</code></td>
316 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWidth()">getWidth</a></span>()</code></th>
317 <td class="colLast">
318 <div class="block">Returns the width of the source image (packed-pixel or YUV) associated
319 with this compressor instance.</div>
320 </td>
321 </tr>
322 <tr id="i14" class="altColor">
323 <td class="colFirst"><code>void</code></td>
324 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#loadSourceImage(java.lang.String,int,int)">loadSourceImage</a></span>&#8203;(java.lang.String&nbsp;fileName,
325 int&nbsp;align,
326 int&nbsp;pixelFormat)</code></th>
327 <td class="colLast">
328 <div class="block">Load a packed-pixel RGB or grayscale source image with 2 to 16 bits of
329 data precision per sample from disk into memory and associate it with this
330 compressor instance.</div>
331 </td>
332 </tr>
333 <tr id="i15" class="rowColor">
334 <td class="colFirst"><code>void</code></td>
335 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#set(int,int)">set</a></span>&#8203;(int&nbsp;param,
336 int&nbsp;value)</code></th>
337 <td class="colLast">
338 <div class="block">Set the value of a compression parameter.</div>
339 </td>
340 </tr>
341 <tr id="i16" class="altColor">
342 <td class="colFirst"><code>void</code></td>
343 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setICCProfile(byte%5B%5D)">setICCProfile</a></span>&#8203;(byte[]&nbsp;iccBuf)</code></th>
344 <td class="colLast">
345 <div class="block">Embed an ICC (International Color Consortium) color management profile in
346 JPEG images generated by subsequent compression operations.</div>
347 </td>
348 </tr>
349 <tr id="i17" class="rowColor">
350 <td class="colFirst"><code>void</code></td>
351 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)">setSourceImage</a></span>&#8203;(byte[]&nbsp;srcImage,
352 int&nbsp;x,
353 int&nbsp;y,
354 int&nbsp;width,
355 int&nbsp;pitch,
356 int&nbsp;height,
357 int&nbsp;pixelFormat)</code></th>
358 <td class="colLast">
359 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 2 to 8
360 bits of data precision per sample with this compressor instance.</div>
361 </td>
362 </tr>
363 <tr id="i18" class="altColor">
364 <td class="colFirst"><code>void</code></td>
365 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)">setSourceImage</a></span>&#8203;(java.awt.image.BufferedImage&nbsp;srcImage,
366 int&nbsp;x,
367 int&nbsp;y,
368 int&nbsp;width,
369 int&nbsp;height)</code></th>
370 <td class="colLast">
371 <div class="block">Associate an 8-bit-per-sample packed-pixel RGB or grayscale source image
372 with this compressor instance.</div>
373 </td>
374 </tr>
375 <tr id="i19" class="rowColor">
376 <td class="colFirst"><code>void</code></td>
377 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></span>&#8203;(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;srcImage)</code></th>
378 <td class="colLast">
379 <div class="block">Associate an 8-bit-per-sample planar YUV source image with this compressor
380 instance.</div>
381 </td>
382 </tr>
383 <tr id="i20" class="altColor">
384 <td class="colFirst"><code>void</code></td>
385 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage12(short%5B%5D,int,int,int,int,int,int)">setSourceImage12</a></span>&#8203;(short[]&nbsp;srcImage,
386 int&nbsp;x,
387 int&nbsp;y,
388 int&nbsp;width,
389 int&nbsp;pitch,
390 int&nbsp;height,
391 int&nbsp;pixelFormat)</code></th>
392 <td class="colLast">
393 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 9 to 12
394 bits of data precision per sample with this compressor instance.</div>
395 </td>
396 </tr>
397 <tr id="i21" class="rowColor">
398 <td class="colFirst"><code>void</code></td>
399 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setSourceImage16(short%5B%5D,int,int,int,int,int,int)">setSourceImage16</a></span>&#8203;(short[]&nbsp;srcImage,
400 int&nbsp;x,
401 int&nbsp;y,
402 int&nbsp;width,
403 int&nbsp;pitch,
404 int&nbsp;height,
405 int&nbsp;pixelFormat)</code></th>
406 <td class="colLast">
407 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 13 to
408 16 bits of data precision per sample with this compressor instance.</div>
409 </td>
410 </tr>
411 </table>
412 <ul class="blockList">
413 <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
414 <!-- -->
415 </a>
416 <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
417 <code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
418 </ul>
419 </li>
420 </ul>
421 </section>
422 </li>
423 </ul>
424 </div>
425 <div class="details">
426 <ul class="blockList">
427 <li class="blockList">
428 <!-- ========= CONSTRUCTOR DETAIL ======== -->
429 <section>
430 <ul class="blockList">
431 <li class="blockList"><a id="constructor.detail">
432 <!-- -->
433 </a>
434 <h3>Constructor Detail</h3>
435 <a id="&lt;init&gt;()">
436 <!-- -->
437 </a>
438 <ul class="blockList">
439 <li class="blockList">
440 <h4>TJCompressor</h4>
441 <pre>public&nbsp;TJCompressor()
442 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
443 <div class="block">Create a TurboJPEG compressor instance.</div>
444 <dl>
445 <dt><span class="throwsLabel">Throws:</span></dt>
446 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
447 </dl>
448 </li>
449 </ul>
450 <a id="&lt;init&gt;(byte[],int,int,int,int,int,int)">
451 <!-- -->
452 </a>
453 <ul class="blockList">
454 <li class="blockList">
455 <h4>TJCompressor</h4>
456 <pre>public&nbsp;TJCompressor&#8203;(byte[]&nbsp;srcImage,
457 int&nbsp;x,
458 int&nbsp;y,
459 int&nbsp;width,
460 int&nbsp;pitch,
461 int&nbsp;height,
462 int&nbsp;pixelFormat)
463 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
464 <div class="block">Create a TurboJPEG compressor instance and associate the packed-pixel
465 source image, stored in <code>srcImage</code> with 2 to 8 bits of data
466 precision per sample, with the newly created instance.</div>
467 <dl>
468 <dt><span class="paramLabel">Parameters:</span></dt>
469 <dd><code>srcImage</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
470 <dd><code>x</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
471 <dd><code>y</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
472 <dd><code>width</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
473 <dd><code>pitch</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
474 <dd><code>height</code> - see <a href="#setSourceImage(byte%5B%5D,int,int,int,int,int,int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd>
475 <dd><code>pixelFormat</code> - pixel format of the source image (one of
476 <a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
477 <dt><span class="throwsLabel">Throws:</span></dt>
478 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
479 </dl>
480 </li>
481 </ul>
482 <a id="&lt;init&gt;(java.awt.image.BufferedImage,int,int,int,int)">
483 <!-- -->
484 </a>
485 <ul class="blockListLast">
486 <li class="blockList">
487 <h4>TJCompressor</h4>
488 <pre>public&nbsp;TJCompressor&#8203;(java.awt.image.BufferedImage&nbsp;srcImage,
489 int&nbsp;x,
490 int&nbsp;y,
491 int&nbsp;width,
492 int&nbsp;height)
493 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
494 <div class="block">Create a TurboJPEG compressor instance and associate the 8-bit-per-sample
495 packed-pixel source image stored in <code>srcImage</code> with the newly
496 created instance.</div>
497 <dl>
498 <dt><span class="paramLabel">Parameters:</span></dt>
499 <dd><code>srcImage</code> - see
500 <a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
501 <dd><code>x</code> - see
502 <a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
503 <dd><code>y</code> - see
504 <a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
505 <dd><code>width</code> - see
506 <a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
507 <dd><code>height</code> - see
508 <a href="#setSourceImage(java.awt.image.BufferedImage,int,int,int,int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
509 <dt><span class="throwsLabel">Throws:</span></dt>
510 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
511 </dl>
512 </li>
513 </ul>
514 </li>
515 </ul>
516 </section>
517 <!-- ============ METHOD DETAIL ========== -->
518 <section>
519 <ul class="blockList">
520 <li class="blockList"><a id="method.detail">
521 <!-- -->
522 </a>
523 <h3>Method Detail</h3>
524 <a id="setSourceImage(byte[],int,int,int,int,int,int)">
525 <!-- -->
526 </a>
527 <ul class="blockList">
528 <li class="blockList">
529 <h4>setSourceImage</h4>
530 <pre class="methodSignature">public&nbsp;void&nbsp;setSourceImage&#8203;(byte[]&nbsp;srcImage,
531 int&nbsp;x,
532 int&nbsp;y,
533 int&nbsp;width,
534 int&nbsp;pitch,
535 int&nbsp;height,
536 int&nbsp;pixelFormat)
537 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
538 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 2 to 8
539 bits of data precision per sample with this compressor instance. Note
540 that packed-pixel source images with 2 to 7 bits of data precision per
541 sample can only be compressed into lossless JPEG images.</div>
542 <dl>
543 <dt><span class="paramLabel">Parameters:</span></dt>
544 <dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
545 source image to be compressed or encoded. The data precision of the
546 source image (from 2 to 8 bits per sample) can be specified using
547 <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>
548 is unset or out of range. This buffer is not modified.</dd>
549 <dd><code>x</code> - x offset (in pixels) of the region in the source image from which
550 the JPEG or YUV image should be compressed/encoded</dd>
551 <dd><code>y</code> - y offset (in pixels) of the region in the source image from which
552 the JPEG or YUV image should be compressed/encoded</dd>
553 <dd><code>width</code> - width (in pixels) of the region in the source image from
554 which the JPEG or YUV image should be compressed/encoded</dd>
555 <dd><code>pitch</code> - bytes per row in the source image. Normally this should be
556 <code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
557 if the source image is unpadded. (Setting this parameter to 0 is the
558 equivalent of setting it to <code>width *
559 <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
560 you can also use this parameter to specify the row alignment/padding of
561 the source image, to skip rows, or to compress/encode a JPEG or YUV image
562 from a specific region of a larger source image.</dd>
563 <dd><code>height</code> - height (in pixels) of the region in the source image from
564 which the JPEG or YUV image should be compressed/encoded</dd>
565 <dd><code>pixelFormat</code> - pixel format of the source image (one of
566 <a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
567 <dt><span class="throwsLabel">Throws:</span></dt>
568 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
569 </dl>
570 </li>
571 </ul>
572 <a id="setSourceImage12(short[],int,int,int,int,int,int)">
573 <!-- -->
574 </a>
575 <ul class="blockList">
576 <li class="blockList">
577 <h4>setSourceImage12</h4>
578 <pre class="methodSignature">public&nbsp;void&nbsp;setSourceImage12&#8203;(short[]&nbsp;srcImage,
579 int&nbsp;x,
580 int&nbsp;y,
581 int&nbsp;width,
582 int&nbsp;pitch,
583 int&nbsp;height,
584 int&nbsp;pixelFormat)
585 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
586 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 9 to 12
587 bits of data precision per sample with this compressor instance. Note
588 that packed-pixel source images with 9 to 11 bits of data precision per
589 sample can only be compressed into lossless JPEG images.</div>
590 <dl>
591 <dt><span class="paramLabel">Parameters:</span></dt>
592 <dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
593 source image to be compressed. The data precision of the source image
594 (from 9 to 12 bits per sample) can be specified using
595 <a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a> and defaults to 12 if
596 <a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a> is unset or out of range. This buffer is not
597 modified.</dd>
598 <dd><code>x</code> - x offset (in pixels) of the region in the source image from which
599 the JPEG image should be compressed</dd>
600 <dd><code>y</code> - y offset (in pixels) of the region in the source image from which
601 the JPEG image should be compressed</dd>
602 <dd><code>width</code> - width (in pixels) of the region in the source image from
603 which the JPEG image should be compressed</dd>
604 <dd><code>pitch</code> - samples per row in the source image. Normally this should be
605 <code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
606 if the source image is unpadded. (Setting this parameter to 0 is the
607 equivalent of setting it to <code>width *
608 <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
609 you can also use this parameter to specify the row alignment/padding of
610 the source image, to skip rows, or to compress a JPEG image from a
611 specific region of a larger source image.</dd>
612 <dd><code>height</code> - height (in pixels) of the region in the source image from
613 which the JPEG image should be compressed</dd>
614 <dd><code>pixelFormat</code> - pixel format of the source image (one of
615 <a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
616 <dt><span class="throwsLabel">Throws:</span></dt>
617 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
618 </dl>
619 </li>
620 </ul>
621 <a id="setSourceImage16(short[],int,int,int,int,int,int)">
622 <!-- -->
623 </a>
624 <ul class="blockList">
625 <li class="blockList">
626 <h4>setSourceImage16</h4>
627 <pre class="methodSignature">public&nbsp;void&nbsp;setSourceImage16&#8203;(short[]&nbsp;srcImage,
628 int&nbsp;x,
629 int&nbsp;y,
630 int&nbsp;width,
631 int&nbsp;pitch,
632 int&nbsp;height,
633 int&nbsp;pixelFormat)
634 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
635 <div class="block">Associate a packed-pixel RGB, grayscale, or CMYK source image with 13 to
636 16 bits of data precision per sample with this compressor instance. Note
637 that packed-pixel source images with 13 to 16 bits of data precision per
638 sample can only be compressed into lossless JPEG images.</div>
639 <dl>
640 <dt><span class="paramLabel">Parameters:</span></dt>
641 <dd><code>srcImage</code> - buffer containing a packed-pixel RGB, grayscale, or CMYK
642 source image to be compressed. The data precision of the source image
643 (from 13 to 16 bits per sample) can be specified using
644 <a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a> and defaults to 16 if
645 <a href="TJ.html#PARAM_PRECISION"><code>TJ.PARAM_PRECISION</code></a> is unset or out of range. This buffer is not
646 modified.</dd>
647 <dd><code>x</code> - x offset (in pixels) of the region in the source image from which
648 the JPEG image should be compressed</dd>
649 <dd><code>y</code> - y offset (in pixels) of the region in the source image from which
650 the JPEG image should be compressed</dd>
651 <dd><code>width</code> - width (in pixels) of the region in the source image from
652 which the JPEG image should be compressed</dd>
653 <dd><code>pitch</code> - samples per row in the source image. Normally this should be
654 <code>width * <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>,
655 if the source image is unpadded. (Setting this parameter to 0 is the
656 equivalent of setting it to <code>width *
657 <a href="TJ.html#getPixelSize(int)"><code>TJ.getPixelSize</code></a>(pixelFormat)</code>.) However,
658 you can also use this parameter to specify the row alignment/padding of
659 the source image, to skip rows, or to compress a JPEG image from a
660 specific region of a larger source image.</dd>
661 <dd><code>height</code> - height (in pixels) of the region in the source image from
662 which the JPEG image should be compressed</dd>
663 <dd><code>pixelFormat</code> - pixel format of the source image (one of
664 <a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
665 <dt><span class="throwsLabel">Throws:</span></dt>
666 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
667 </dl>
668 </li>
669 </ul>
670 <a id="setSourceImage(java.awt.image.BufferedImage,int,int,int,int)">
671 <!-- -->
672 </a>
673 <ul class="blockList">
674 <li class="blockList">
675 <h4>setSourceImage</h4>
676 <pre class="methodSignature">public&nbsp;void&nbsp;setSourceImage&#8203;(java.awt.image.BufferedImage&nbsp;srcImage,
677 int&nbsp;x,
678 int&nbsp;y,
679 int&nbsp;width,
680 int&nbsp;height)
681 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
682 <div class="block">Associate an 8-bit-per-sample packed-pixel RGB or grayscale source image
683 with this compressor instance.</div>
684 <dl>
685 <dt><span class="paramLabel">Parameters:</span></dt>
686 <dd><code>srcImage</code> - a <code>BufferedImage</code> instance containing a
687 packed-pixel RGB or grayscale source image to be compressed or encoded.
688 This image is not modified.</dd>
689 <dd><code>x</code> - x offset (in pixels) of the region in the source image from which
690 the JPEG or YUV image should be compressed/encoded</dd>
691 <dd><code>y</code> - y offset (in pixels) of the region in the source image from which
692 the JPEG or YUV image should be compressed/encoded</dd>
693 <dd><code>width</code> - width (in pixels) of the region in the source image from
694 which the JPEG or YUV image should be compressed/encoded (0 = use the
695 width of the source image)</dd>
696 <dd><code>height</code> - height (in pixels) of the region in the source image from
697 which the JPEG or YUV image should be compressed/encoded (0 = use the
698 height of the source image)</dd>
699 <dt><span class="throwsLabel">Throws:</span></dt>
700 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
701 </dl>
702 </li>
703 </ul>
704 <a id="setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">
705 <!-- -->
706 </a>
707 <ul class="blockList">
708 <li class="blockList">
709 <h4>setSourceImage</h4>
710 <pre class="methodSignature">public&nbsp;void&nbsp;setSourceImage&#8203;(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;srcImage)
711 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
712 <div class="block">Associate an 8-bit-per-sample planar YUV source image with this compressor
713 instance. This method sets <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a> to the chrominance
714 subsampling level of the source image.</div>
715 <dl>
716 <dt><span class="paramLabel">Parameters:</span></dt>
717 <dd><code>srcImage</code> - planar YUV source image to be compressed. This image is
718 not modified.</dd>
719 <dt><span class="throwsLabel">Throws:</span></dt>
720 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
721 </dl>
722 </li>
723 </ul>
724 <a id="loadSourceImage(java.lang.String,int,int)">
725 <!-- -->
726 </a>
727 <ul class="blockList">
728 <li class="blockList">
729 <h4>loadSourceImage</h4>
730 <pre class="methodSignature">public&nbsp;void&nbsp;loadSourceImage&#8203;(java.lang.String&nbsp;fileName,
731 int&nbsp;align,
732 int&nbsp;pixelFormat)
733 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
734 <div class="block">Load a packed-pixel RGB or grayscale source image with 2 to 16 bits of
735 data precision per sample from disk into memory and associate it with this
736 compressor instance. Note that packed-pixel source images with 2 to 7, 9
737 to 11, or 13 to 16 bits of data precision per sample can only be
738 compressed into lossless JPEG images.
739
740 <p><a href="#getWidth()"><code>getWidth()</code></a>, <a href="#getPitch()"><code>getPitch()</code></a>, <a href="#getHeight()"><code>getHeight()</code></a>,
741 <a href="#getPixelFormat()"><code>getPixelFormat()</code></a>, and <a href="#getSourceBuf()"><code>getSourceBuf()</code></a> can be used to
742 obtain the source image's dimensions, pixel format, and buffer after it is
743 loaded.</div>
744 <dl>
745 <dt><span class="paramLabel">Parameters:</span></dt>
746 <dd><code>fileName</code> - name of a file containing a packed-pixel image in Windows
747 BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require
748 8-bit-per-sample data precision. When loading a PBMPLUS file, the target
749 data precision (from 2 to 16 bits per sample) can be specified using
750 <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>
751 is unset. If the data precision of the PBMPLUS file does not match the
752 target data precision, then upconverting or downconverting will be
753 performed.</dd>
754 <dd><code>align</code> - row alignment (in samples) of the packed-pixel buffer into
755 which the source image will be loaded (must be a power of 2.) Setting
756 this parameter to n will cause all rows in the buffer to be padded to the
757 nearest multiple of n samples (1 = unpadded.)</dd>
758 <dd><code>pixelFormat</code> - pixel format of the packed-pixel buffer into which the
759 source image will be loaded. The behavior of this method varies depending
760 on the value of <code>pixelFormat</code>:
761 <ul>
762 <li> <a href="TJ.html#PF_UNKNOWN"><code>TJ.PF_UNKNOWN</code></a> : The packed-pixel buffer created by this
763 method will use the most optimal pixel format for the file type. Use
764 <a href="#getPixelFormat()"><code>getPixelFormat()</code></a> to obtain the ID of that pixel format.
765 <li> <a href="TJ.html#PF_GRAY"><code>TJ.PF_GRAY</code></a> : Only PGM files and 8-bit-per-pixel BMP files
766 with a grayscale colormap can be loaded.
767 <li> <a href="TJ.html#PF_CMYK"><code>TJ.PF_CMYK</code></a> : The RGB or grayscale pixels stored in the file
768 will be converted using a quick &amp; dirty algorithm that is suitable
769 only for testing purposes. (Proper conversion between CMYK and other
770 formats requires a color management system.)
771 <li> Other <a href="TJ.html#PF_RGB"><code>pixel formats</code></a> : The packed-pixel buffer
772 will use the specified pixel format, and pixel format conversion will be
773 performed if necessary.
774 </ul></dd>
775 <dt><span class="throwsLabel">Throws:</span></dt>
776 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
777 </dl>
778 </li>
779 </ul>
780 <a id="getWidth()">
781 <!-- -->
782 </a>
783 <ul class="blockList">
784 <li class="blockList">
785 <h4>getWidth</h4>
786 <pre class="methodSignature">public&nbsp;int&nbsp;getWidth()</pre>
787 <div class="block">Returns the width of the source image (packed-pixel or YUV) associated
788 with this compressor instance.</div>
789 <dl>
790 <dt><span class="returnLabel">Returns:</span></dt>
791 <dd>the width of the source image (packed-pixel or YUV) associated
792 with this compressor instance.</dd>
793 </dl>
794 </li>
795 </ul>
796 <a id="getPitch()">
797 <!-- -->
798 </a>
799 <ul class="blockList">
800 <li class="blockList">
801 <h4>getPitch</h4>
802 <pre class="methodSignature">public&nbsp;int&nbsp;getPitch()</pre>
803 <div class="block">Returns the pitch (samples per row) of the packed-pixel source image
804 associated with this compressor instance. If the source image is a
805 <code>BufferedImage</code> instance with integer pixels, then the stride
806 (pixels per row) is returned instead.</div>
807 <dl>
808 <dt><span class="returnLabel">Returns:</span></dt>
809 <dd>the pitch (samples per row) of the packed-pixel source image
810 associated with this compressor instance.</dd>
811 </dl>
812 </li>
813 </ul>
814 <a id="getHeight()">
815 <!-- -->
816 </a>
817 <ul class="blockList">
818 <li class="blockList">
819 <h4>getHeight</h4>
820 <pre class="methodSignature">public&nbsp;int&nbsp;getHeight()</pre>
821 <div class="block">Returns the height of the source image (packed-pixel or YUV) associated
822 with this compressor instance.</div>
823 <dl>
824 <dt><span class="returnLabel">Returns:</span></dt>
825 <dd>the height of the source image (packed-pixel or YUV) associated
826 with this compressor instance.</dd>
827 </dl>
828 </li>
829 </ul>
830 <a id="getPixelFormat()">
831 <!-- -->
832 </a>
833 <ul class="blockList">
834 <li class="blockList">
835 <h4>getPixelFormat</h4>
836 <pre class="methodSignature">public&nbsp;int&nbsp;getPixelFormat()</pre>
837 <div class="block">Returns the pixel format of the packed-pixel source image associated with
838 this compressor instance. The pixel format is one of
839 <a href="TJ.html#PF_RGB"><code>TJ.PF_*</code></a>.</div>
840 <dl>
841 <dt><span class="returnLabel">Returns:</span></dt>
842 <dd>the pixel format of the packed-pixel source image associated with
843 this compressor instance.</dd>
844 </dl>
845 </li>
846 </ul>
847 <a id="getSourceBuf()">
848 <!-- -->
849 </a>
850 <ul class="blockList">
851 <li class="blockList">
852 <h4>getSourceBuf</h4>
853 <pre class="methodSignature">public&nbsp;java.lang.Object&nbsp;getSourceBuf()</pre>
854 <div class="block">Returns the buffer containing the packed-pixel image associated with this
855 compressor instance. The buffer is a <code>byte</code> array if the
856 source image has 2 to 8 bits of data precision per sample, a
857 <code>short</code> array if the source image has 9 to 16 bits of data
858 precision per sample, and either a <code>byte</code> or an
859 <code>int</code> array (depending on the image type) if the source image
860 is a <code>BufferedImage</code> instance.</div>
861 <dl>
862 <dt><span class="returnLabel">Returns:</span></dt>
863 <dd>the buffer containing the packed-pixel image associated with this
864 compressor instance.</dd>
865 </dl>
866 </li>
867 </ul>
868 <a id="set(int,int)">
869 <!-- -->
870 </a>
871 <ul class="blockList">
872 <li class="blockList">
873 <h4>set</h4>
874 <pre class="methodSignature">public&nbsp;void&nbsp;set&#8203;(int&nbsp;param,
875 int&nbsp;value)</pre>
876 <div class="block">Set the value of a compression parameter.</div>
877 <dl>
878 <dt><span class="paramLabel">Parameters:</span></dt>
879 <dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
880 <dd><code>value</code> - value of the compression parameter (refer to
881 <a href="TJ.html#PARAM_STOPONWARNING"><code>parameter documentation</code></a>)</dd>
882 </dl>
883 </li>
884 </ul>
885 <a id="get(int)">
886 <!-- -->
887 </a>
888 <ul class="blockList">
889 <li class="blockList">
890 <h4>get</h4>
891 <pre class="methodSignature">public&nbsp;int&nbsp;get&#8203;(int&nbsp;param)</pre>
892 <div class="block">Get the value of a compression parameter.</div>
893 <dl>
894 <dt><span class="paramLabel">Parameters:</span></dt>
895 <dd><code>param</code> - one of <a href="TJ.html#PARAM_STOPONWARNING"><code>TJ.PARAM_*</code></a></dd>
896 <dt><span class="returnLabel">Returns:</span></dt>
897 <dd>the value of the specified compression parameter, or -1 if the
898 value is unknown.</dd>
899 </dl>
900 </li>
901 </ul>
902 <a id="setICCProfile(byte[])">
903 <!-- -->
904 </a>
905 <ul class="blockList">
906 <li class="blockList">
907 <h4>setICCProfile</h4>
908 <pre class="methodSignature">public&nbsp;void&nbsp;setICCProfile&#8203;(byte[]&nbsp;iccBuf)
909 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
910 <div class="block">Embed an ICC (International Color Consortium) color management profile in
911 JPEG images generated by subsequent compression operations.</div>
912 <dl>
913 <dt><span class="paramLabel">Parameters:</span></dt>
914 <dd><code>iccBuf</code> - buffer containing an ICC profile. (The size of the ICC
915 profile is assumed to be the length of the array.) A copy is made of the
916 ICC profile, so this buffer can be reused as soon as this method returns.
917 Setting this parameter to null removes any ICC profile that was previously
918 associated with this compressor instance.</dd>
919 <dt><span class="throwsLabel">Throws:</span></dt>
920 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
921 </dl>
922 </li>
923 </ul>
924 <a id="compress(byte[])">
925 <!-- -->
926 </a>
927 <ul class="blockList">
928 <li class="blockList">
929 <h4>compress</h4>
930 <pre class="methodSignature">public&nbsp;void&nbsp;compress&#8203;(byte[]&nbsp;dstBuf)
931 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
932 <div class="block">Compress the packed-pixel or planar YUV source image associated with this
933 compressor instance and output a JPEG image to the given destination
934 buffer.</div>
935 <dl>
936 <dt><span class="paramLabel">Parameters:</span></dt>
937 <dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
938 <a href="TJ.html#bufSize(int,int,int)"><code>TJ.bufSize()</code></a> to determine the maximum size for this
939 buffer based on the source image's width and height and the desired level
940 of chrominance subsampling (see <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a>), then add the
941 size of the ICC profile (if any) that was previously associated with this
942 compressor instance (see <a href="#setICCProfile(byte%5B%5D)"><code>setICCProfile()</code></a>.)</dd>
943 <dt><span class="throwsLabel">Throws:</span></dt>
944 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
945 </dl>
946 </li>
947 </ul>
948 <a id="compress()">
949 <!-- -->
950 </a>
951 <ul class="blockList">
952 <li class="blockList">
953 <h4>compress</h4>
954 <pre class="methodSignature">public&nbsp;byte[]&nbsp;compress()
955 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
956 <div class="block">Compress the packed-pixel or planar YUV source image associated with this
957 compressor instance and return a buffer containing a JPEG image.</div>
958 <dl>
959 <dt><span class="returnLabel">Returns:</span></dt>
960 <dd>a buffer containing a JPEG image. The length of this buffer will
961 not be equal to the size of the JPEG image. Use
962 <a href="#getCompressedSize()"><code>getCompressedSize()</code></a> to obtain the size of the JPEG image.</dd>
963 <dt><span class="throwsLabel">Throws:</span></dt>
964 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
965 </dl>
966 </li>
967 </ul>
968 <a id="encodeYUV(org.libjpegturbo.turbojpeg.YUVImage)">
969 <!-- -->
970 </a>
971 <ul class="blockList">
972 <li class="blockList">
973 <h4>encodeYUV</h4>
974 <pre class="methodSignature">public&nbsp;void&nbsp;encodeYUV&#8203;(<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;dstImage)
975 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
976 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
977 compressor instance into an 8-bit-per-sample planar YUV image and store it
978 in the given <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance. This method performs color
979 conversion and downsampling (which are accelerated in the libjpeg-turbo
980 implementation) but does not execute any of the other steps in the JPEG
981 compression process. Encoding CMYK source images into YUV images is not
982 supported. This method sets <a href="TJ.html#PARAM_SUBSAMP"><code>TJ.PARAM_SUBSAMP</code></a> to the chrominance
983 subsampling level of the destination image.</div>
984 <dl>
985 <dt><span class="paramLabel">Parameters:</span></dt>
986 <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
987 image</dd>
988 <dt><span class="throwsLabel">Throws:</span></dt>
989 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
990 </dl>
991 </li>
992 </ul>
993 <a id="encodeYUV(int)">
994 <!-- -->
995 </a>
996 <ul class="blockList">
997 <li class="blockList">
998 <h4>encodeYUV</h4>
999 <pre class="methodSignature">public&nbsp;<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;encodeYUV&#8203;(int&nbsp;align)
1000 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
1001 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
1002 compressor instance into an 8-bit-per-sample unified planar YUV image and
1003 return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image. This
1004 method performs color conversion and downsampling (which are accelerated
1005 in the libjpeg-turbo implementation) but does not execute any of the other
1006 steps in the JPEG compression process. Encoding CMYK source images into
1007 YUV images is not supported.</div>
1008 <dl>
1009 <dt><span class="paramLabel">Parameters:</span></dt>
1010 <dd><code>align</code> - row alignment (in bytes) of the YUV image (must be a power of
1011 2.) Setting this parameter to n will cause each row in each plane of the
1012 YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.)</dd>
1013 <dt><span class="returnLabel">Returns:</span></dt>
1014 <dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the unified planar YUV
1015 encoded image</dd>
1016 <dt><span class="throwsLabel">Throws:</span></dt>
1017 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
1018 </dl>
1019 </li>
1020 </ul>
1021 <a id="encodeYUV(int[])">
1022 <!-- -->
1023 </a>
1024 <ul class="blockList">
1025 <li class="blockList">
1026 <h4>encodeYUV</h4>
1027 <pre class="methodSignature">public&nbsp;<a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a>&nbsp;encodeYUV&#8203;(int[]&nbsp;strides)
1028 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
1029 <div class="block">Encode the 8-bit-per-sample packed-pixel source image associated with this
1030 compressor instance into separate 8-bit-per-sample Y, U (Cb), and V (Cr)
1031 image planes and return a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded
1032 image planes. This method performs color conversion and downsampling
1033 (which are accelerated in the libjpeg-turbo implementation) but does not
1034 execute any of the other steps in the JPEG compression process. Encoding
1035 CMYK source images into YUV images is not supported.</div>
1036 <dl>
1037 <dt><span class="paramLabel">Parameters:</span></dt>
1038 <dd><code>strides</code> - an array of integers, each specifying the number of bytes
1039 per row in the corresponding plane of the YUV source image. Setting the
1040 stride for any plane to 0 is the same as setting it to the plane width
1041 (see <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a>.) If <code>strides</code> is null, then the strides
1042 for all planes will be set to their respective plane widths. You can
1043 adjust the strides in order to add an arbitrary amount of row padding to
1044 each plane.</dd>
1045 <dt><span class="returnLabel">Returns:</span></dt>
1046 <dd>a <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> instance containing the encoded image planes</dd>
1047 <dt><span class="throwsLabel">Throws:</span></dt>
1048 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
1049 </dl>
1050 </li>
1051 </ul>
1052 <a id="getCompressedSize()">
1053 <!-- -->
1054 </a>
1055 <ul class="blockList">
1056 <li class="blockList">
1057 <h4>getCompressedSize</h4>
1058 <pre class="methodSignature">public&nbsp;int&nbsp;getCompressedSize()</pre>
1059 <div class="block">Returns the size of the image (in bytes) generated by the most recent
1060 compression operation.</div>
1061 <dl>
1062 <dt><span class="returnLabel">Returns:</span></dt>
1063 <dd>the size of the image (in bytes) generated by the most recent
1064 compression operation.</dd>
1065 </dl>
1066 </li>
1067 </ul>
1068 <a id="close()">
1069 <!-- -->
1070 </a>
1071 <ul class="blockList">
1072 <li class="blockList">
1073 <h4>close</h4>
1074 <pre class="methodSignature">public&nbsp;void&nbsp;close()
1075 throws <a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
1076 <div class="block">Free the native structures associated with this compressor instance.</div>
1077 <dl>
1078 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
1079 <dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>
1080 <dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
1081 <dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>
1082 <dt><span class="throwsLabel">Throws:</span></dt>
1083 <dd><code><a href="TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd>
1084 </dl>
1085 </li>
1086 </ul>
1087 <a id="finalize()">
1088 <!-- -->
1089 </a>
1090 <ul class="blockListLast">
1091 <li class="blockList">
1092 <h4>finalize</h4>
1093 <pre class="methodSignature">protected&nbsp;void&nbsp;finalize()
1094 throws java.lang.Throwable</pre>
1095 <dl>
1096 <dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
1097 <dd><code>finalize</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
1098 <dt><span class="throwsLabel">Throws:</span></dt>
1099 <dd><code>java.lang.Throwable</code></dd>
1100 </dl>
1101 </li>
1102 </ul>
1103 </li>
1104 </ul>
1105 </section>
1106 </li>
1107 </ul>
1108 </div>
1109 </div>
1110 </main>
1111 <!-- ========= END OF CLASS DATA ========= -->
1112 <footer role="contentinfo">
1113 <nav role="navigation">
1114 <!-- ======= START OF BOTTOM NAVBAR ====== -->
1115 <div class="bottomNav"><a id="navbar.bottom">
1116 <!-- -->
1117 </a>
1118 <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
1119 <a id="navbar.bottom.firstrow">
1120 <!-- -->
1121 </a>
1122 <ul class="navList" title="Navigation">
1123 <li><a href="package-summary.html">Package</a></li>
1124 <li class="navBarCell1Rev">Class</li>
1125 <li><a href="package-tree.html">Tree</a></li>
1126 <li><a href="../../../deprecated-list.html">Deprecated</a></li>
1127 <li><a href="../../../index-all.html">Index</a></li>
1128 <li><a href="../../../help-doc.html">Help</a></li>
1129 </ul>
1130 </div>
1131 <div class="subNav">
1132 <ul class="navList" id="allclasses_navbar_bottom">
1133 <li><a href="../../../allclasses.html">All&nbsp;Classes</a></li>
1134 </ul>
1135 <div>
1136 <script type="text/javascript"><!--
1137 allClassesLink = document.getElementById("allclasses_navbar_bottom");
1138 if(window==top) {
1139 allClassesLink.style.display = "block";
1140 }
1141 else {
1142 allClassesLink.style.display = "none";
1143 }
1144 //-->
1145 </script>
1146 <noscript>
1147 <div>JavaScript is disabled on your browser.</div>
1148 </noscript>
1149 </div>
1150 <div>
1151 <ul class="subNavList">
1152 <li>Summary:&nbsp;</li>
1153 <li>Nested&nbsp;|&nbsp;</li>
1154 <li>Field&nbsp;|&nbsp;</li>
1155 <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
1156 <li><a href="#method.summary">Method</a></li>
1157 </ul>
1158 <ul class="subNavList">
1159 <li>Detail:&nbsp;</li>
1160 <li>Field&nbsp;|&nbsp;</li>
1161 <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
1162 <li><a href="#method.detail">Method</a></li>
1163 </ul>
1164 </div>
1165 <a id="skip.navbar.bottom">
1166 <!-- -->
1167 </a></div>
1168 <!-- ======== END OF BOTTOM NAVBAR ======= -->
1169 </nav>
1170 </footer>
1171 </body>
1172 </html>