1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <title>TJTransformer</title>
6 <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
9 <script type="text/javascript"><!--
11 if (location.href.indexOf('is-external=true') == -1) {
12 parent.document.title="TJTransformer";
20 <div>JavaScript is disabled on your browser.</div>
22 <!-- ========= START OF TOP NAVBAR ======= -->
23 <div class="topNav"><a name="navbar_top">
25 </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
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>
39 <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
40 <li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
43 <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top">Frames</a></li>
44 <li><a href="TJTransformer.html" target="_top">No Frames</a></li>
46 <ul class="navList" id="allclasses_navbar_top">
47 <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
50 <script type="text/javascript"><!--
51 allClassesLink = document.getElementById("allclasses_navbar_top");
53 allClassesLink.style.display = "block";
56 allClassesLink.style.display = "none";
62 <ul class="subNavList">
63 <li>Summary: </li>
64 <li>Nested | </li>
65 <li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </li>
66 <li><a href="#constructor_summary">Constr</a> | </li>
67 <li><a href="#method_summary">Method</a></li>
69 <ul class="subNavList">
70 <li>Detail: </li>
71 <li>Field | </li>
72 <li><a href="#constructor_detail">Constr</a> | </li>
73 <li><a href="#method_detail">Method</a></li>
76 <a name="skip-navbar_top">
79 <!-- ========= END OF TOP NAVBAR ========= -->
80 <!-- ======== START OF CLASS DATA ======== -->
82 <div class="subTitle">org.libjpegturbo.turbojpeg</div>
83 <h2 title="Class TJTransformer" class="title">Class TJTransformer</h2>
85 <div class="contentContainer">
86 <ul class="inheritance">
87 <li>java.lang.Object</li>
89 <ul class="inheritance">
90 <li><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">org.libjpegturbo.turbojpeg.TJDecompressor</a></li>
92 <ul class="inheritance">
93 <li>org.libjpegturbo.turbojpeg.TJTransformer</li>
99 <div class="description">
100 <ul class="blockList">
101 <li class="blockList">
103 <dt>All Implemented Interfaces:</dt>
104 <dd>java.io.Closeable, java.lang.AutoCloseable</dd>
108 <pre>public class <span class="strong">TJTransformer</span>
109 extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></pre>
110 <div class="block">TurboJPEG lossless transformer</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">
122 <h3>Field Summary</h3>
123 <ul class="blockList">
124 <li class="blockList"><a name="fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
127 <h3>Fields inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
128 <code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li>
132 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
133 <ul class="blockList">
134 <li class="blockList"><a name="constructor_summary">
137 <h3>Constructor Summary</h3>
138 <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
139 <caption><span>Constructors</span><span class="tabEnd"> </span></caption>
141 <th class="colOne" scope="col">Constructor and Description</th>
143 <tr class="altColor">
144 <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer()">TJTransformer</a></strong>()</code>
145 <div class="block">Create a TurboJPEG lossless transformer instance.</div>
148 <tr class="rowColor">
149 <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[])">TJTransformer</a></strong>(byte[] jpegImage)</code>
150 <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
151 image stored in <code>jpegImage</code> with the newly created instance.</div>
154 <tr class="altColor">
155 <td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer</a></strong>(byte[] jpegImage,
156 int imageSize)</code>
157 <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
158 image of length <code>imageSize</code> bytes stored in
159 <code>jpegImage</code> with the newly created instance.</div>
165 <!-- ========== METHOD SUMMARY =========== -->
166 <ul class="blockList">
167 <li class="blockList"><a name="method_summary">
170 <h3>Method Summary</h3>
171 <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
172 <caption><span>Methods</span><span class="tabEnd"> </span></caption>
174 <th class="colFirst" scope="col">Modifier and Type</th>
175 <th class="colLast" scope="col">Method and Description</th>
177 <tr class="altColor">
178 <td class="colFirst"><code>int[]</code></td>
179 <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#getTransformedSizes()">getTransformedSizes</a></strong>()</code>
180 <div class="block">Returns an array containing the sizes of the transformed JPEG images
181 generated by the most recent transform operation.</div>
184 <tr class="rowColor">
185 <td class="colFirst"><code>void</code></td>
186 <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(byte[][] dstBufs,
187 <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
188 int flags)</code>
189 <div class="block">Losslessly transform the JPEG image associated with this transformer
190 instance into one or more JPEG images stored in the given destination
194 <tr class="altColor">
195 <td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]</code></td>
196 <td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
197 int flags)</code>
198 <div class="block">Losslessly transform the JPEG image associated with this transformer
199 instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
200 which has a transformed JPEG image associated with it.</div>
204 <ul class="blockList">
205 <li class="blockList"><a name="methods_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">
208 <h3>Methods inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
209 <code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></code></li>
211 <ul class="blockList">
212 <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
215 <h3>Methods inherited from class java.lang.Object</h3>
216 <code>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
223 <div class="details">
224 <ul class="blockList">
225 <li class="blockList">
226 <!-- ========= CONSTRUCTOR DETAIL ======== -->
227 <ul class="blockList">
228 <li class="blockList"><a name="constructor_detail">
231 <h3>Constructor Detail</h3>
232 <a name="TJTransformer()">
235 <ul class="blockList">
236 <li class="blockList">
237 <h4>TJTransformer</h4>
238 <pre>public TJTransformer()
239 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
240 <div class="block">Create a TurboJPEG lossless transformer instance.</div>
241 <dl><dt><span class="strong">Throws:</span></dt>
242 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
245 <a name="TJTransformer(byte[])">
248 <ul class="blockList">
249 <li class="blockList">
250 <h4>TJTransformer</h4>
251 <pre>public TJTransformer(byte[] jpegImage)
252 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
253 <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
254 image stored in <code>jpegImage</code> with the newly created instance.</div>
255 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer (size of the JPEG image is assumed to
256 be the length of the array.) This buffer is not modified.</dd>
257 <dt><span class="strong">Throws:</span></dt>
258 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
261 <a name="TJTransformer(byte[], int)">
264 <ul class="blockListLast">
265 <li class="blockList">
266 <h4>TJTransformer</h4>
267 <pre>public TJTransformer(byte[] jpegImage,
269 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
270 <div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
271 image of length <code>imageSize</code> bytes stored in
272 <code>jpegImage</code> with the newly created instance.</div>
273 <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>
274 <dt><span class="strong">Throws:</span></dt>
275 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
280 <!-- ============ METHOD DETAIL ========== -->
281 <ul class="blockList">
282 <li class="blockList"><a name="method_detail">
285 <h3>Method Detail</h3>
286 <a name="transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">
289 <ul class="blockList">
290 <li class="blockList">
292 <pre>public void transform(byte[][] dstBufs,
293 <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
295 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
296 <div class="block">Losslessly transform the JPEG image associated with this transformer
297 instance into one or more JPEG images stored in the given destination
298 buffers. Lossless transforms work by moving the raw coefficients from one
299 JPEG image structure to another without altering the values of the
300 coefficients. While this is typically faster than decompressing the
301 image, transforming it, and re-compressing it, lossless transforms are not
302 free. Each lossless transform requires reading and performing Huffman
303 decoding on all of the coefficients in the source image, regardless of the
304 size of the destination image. Thus, this method provides a means of
305 generating multiple transformed images from the same source or of applying
306 multiple transformations simultaneously, in order to eliminate the need to
307 read the source coefficients multiple times.</div>
308 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers. <code>dstbufs[i]</code> will
309 receive a JPEG image that has been transformed using the parameters in
310 <code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the
311 maximum size for each buffer based on the transformed or cropped width and
312 height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
313 which specifies the transform parameters and/or cropping region for the
314 corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
315 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
316 <dt><span class="strong">Throws:</span></dt>
317 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
320 <a name="transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">
323 <ul class="blockList">
324 <li class="blockList">
326 <pre>public <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[] transform(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
328 throws <a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></pre>
329 <div class="block">Losslessly transform the JPEG image associated with this transformer
330 instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
331 which has a transformed JPEG image associated with it.</div>
332 <dl><dt><span class="strong">Parameters:</span></dt><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
333 which specifies the transform parameters and/or cropping region for the
334 corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
335 <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
336 <dt><span class="strong">Returns:</span></dt><dd>an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
337 which has a transformed JPEG image associated with it.</dd>
338 <dt><span class="strong">Throws:</span></dt>
339 <dd><code><a href="../../../org/libjpegturbo/turbojpeg/TJException.html" title="class in org.libjpegturbo.turbojpeg">TJException</a></code></dd></dl>
342 <a name="getTransformedSizes()">
345 <ul class="blockListLast">
346 <li class="blockList">
347 <h4>getTransformedSizes</h4>
348 <pre>public int[] getTransformedSizes()</pre>
349 <div class="block">Returns an array containing the sizes of the transformed JPEG images
350 generated by the most recent transform operation.</div>
351 <dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images
352 generated by the most recent transform operation.</dd></dl>
361 <!-- ========= END OF CLASS DATA ========= -->
362 <!-- ======= START OF BOTTOM NAVBAR ====== -->
363 <div class="bottomNav"><a name="navbar_bottom">
365 </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
368 <ul class="navList" title="Navigation">
369 <li><a href="../../../org/libjpegturbo/turbojpeg/package-summary.html">Package</a></li>
370 <li class="navBarCell1Rev">Class</li>
371 <li><a href="package-tree.html">Tree</a></li>
372 <li><a href="../../../deprecated-list.html">Deprecated</a></li>
373 <li><a href="../../../index-all.html">Index</a></li>
374 <li><a href="../../../help-doc.html">Help</a></li>
379 <li><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Prev Class</span></a></li>
380 <li><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">Next Class</span></a></li>
383 <li><a href="../../../index.html?org/libjpegturbo/turbojpeg/TJTransformer.html" target="_top">Frames</a></li>
384 <li><a href="TJTransformer.html" target="_top">No Frames</a></li>
386 <ul class="navList" id="allclasses_navbar_bottom">
387 <li><a href="../../../allclasses-noframe.html">All Classes</a></li>
390 <script type="text/javascript"><!--
391 allClassesLink = document.getElementById("allclasses_navbar_bottom");
393 allClassesLink.style.display = "block";
396 allClassesLink.style.display = "none";
402 <ul class="subNavList">
403 <li>Summary: </li>
404 <li>Nested | </li>
405 <li><a href="#fields_inherited_from_class_org.libjpegturbo.turbojpeg.TJDecompressor">Field</a> | </li>
406 <li><a href="#constructor_summary">Constr</a> | </li>
407 <li><a href="#method_summary">Method</a></li>
409 <ul class="subNavList">
410 <li>Detail: </li>
411 <li>Field | </li>
412 <li><a href="#constructor_detail">Constr</a> | </li>
413 <li><a href="#method_detail">Method</a></li>
416 <a name="skip-navbar_bottom">
419 <!-- ======== END OF BOTTOM NAVBAR ======= -->