Imported Upstream version 3.0.1
[platform/upstream/libjpeg-turbo.git] / java / doc / org / libjpegturbo / turbojpeg / YUVImage.html
1 <!DOCTYPE HTML>
2 <!-- NewPage -->
3 <html lang="en">
4 <head>
5 <!-- Generated by javadoc -->
6 <title>YUVImage</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.6.0.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="YUVImage";
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};
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 YUVImage" class="title">Class YUVImage</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.YUVImage</li>
126 </ul>
127 </li>
128 </ul>
129 <div class="description">
130 <ul class="blockList">
131 <li class="blockList">
132 <hr>
133 <pre>public class <span class="typeNameLabel">YUVImage</span>
134 extends java.lang.Object</pre>
135 <div class="block">This class encapsulates a planar YUV image and the metadata
136  associated with it.  The TurboJPEG API allows both the JPEG compression and
137  decompression pipelines to be split into stages:  YUV encode, compress from
138  YUV, decompress to YUV, and YUV decode.  A <code>YUVImage</code> instance
139  serves as the destination image for YUV encode and decompress-to-YUV
140  operations and as the source image for compress-from-YUV and YUV decode
141  operations.
142  <p>
143  Technically, the JPEG format uses the YCbCr colorspace (which is technically
144  not a colorspace but a color transform), but per the convention of the
145  digital video community, the TurboJPEG API uses "YUV" to refer to an image
146  format consisting of Y, Cb, and Cr image planes.
147  <p>
148  Each plane is simply a 2D array of bytes, each byte representing the value
149  of one of the components (Y, Cb, or Cr) at a particular location in the
150  image.  The width and height of each plane are determined by the image
151  width, height, and level of chrominance subsampling.  The luminance plane
152  width is the image width padded to the nearest multiple of the horizontal
153  subsampling factor (1 in the case of 4:4:4, grayscale, 4:4:0, or 4:4:1; 2 in
154  the case of 4:2:2 or 4:2:0; 4 in the case of 4:1:1.)  Similarly, the
155  luminance plane height is the image height padded to the nearest multiple of
156  the vertical subsampling factor (1 in the case of 4:4:4, 4:2:2, grayscale,
157  or 4:1:1; 2 in the case of 4:2:0 or 4:4:0; 4 in the case of 4:4:1.)  This is
158  irrespective of any additional padding that may be specified as an argument
159  to the various YUVImage methods.  The chrominance plane width is equal to
160  the luminance plane width divided by the horizontal subsampling factor, and
161  the chrominance plane height is equal to the luminance plane height divided
162  by the vertical subsampling factor.
163  <p>
164  For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
165  used, then the luminance plane would be 36 x 35 bytes, and each of the
166  chrominance planes would be 18 x 35 bytes.  If you specify a row alignment
167  of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes,
168  and each of the chrominance planes would be 20 x 35 bytes.</div>
169 </li>
170 </ul>
171 </div>
172 <div class="summary">
173 <ul class="blockList">
174 <li class="blockList">
175 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
176 <section>
177 <ul class="blockList">
178 <li class="blockList"><a id="constructor.summary">
179 <!--   -->
180 </a>
181 <h3>Constructor Summary</h3>
182 <table class="memberSummary">
183 <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
184 <tr>
185 <th class="colFirst" scope="col">Constructor</th>
186 <th class="colLast" scope="col">Description</th>
187 </tr>
188 <tr class="altColor">
189 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D%5B%5D,int%5B%5D,int,int%5B%5D,int,int)">YUVImage</a></span>&#8203;(byte[][]&nbsp;planes,
190         int[]&nbsp;offsets,
191         int&nbsp;width,
192         int[]&nbsp;strides,
193         int&nbsp;height,
194         int&nbsp;subsamp)</code></th>
195 <td class="colLast">
196 <div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
197  planes.</div>
198 </td>
199 </tr>
200 <tr class="rowColor">
201 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(byte%5B%5D,int,int,int,int)">YUVImage</a></span>&#8203;(byte[]&nbsp;yuvImage,
202         int&nbsp;width,
203         int&nbsp;align,
204         int&nbsp;height,
205         int&nbsp;subsamp)</code></th>
206 <td class="colLast">
207 <div class="block">Create a new <code>YUVImage</code> instance from an existing unified
208  buffer.</div>
209 </td>
210 </tr>
211 <tr class="altColor">
212 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int%5B%5D,int,int)">YUVImage</a></span>&#8203;(int&nbsp;width,
213         int[]&nbsp;strides,
214         int&nbsp;height,
215         int&nbsp;subsamp)</code></th>
216 <td class="colLast">
217 <div class="block">Create a new <code>YUVImage</code> instance backed by separate image
218  planes, and allocate memory for the image planes.</div>
219 </td>
220 </tr>
221 <tr class="rowColor">
222 <th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(int,int,int,int)">YUVImage</a></span>&#8203;(int&nbsp;width,
223         int&nbsp;align,
224         int&nbsp;height,
225         int&nbsp;subsamp)</code></th>
226 <td class="colLast">
227 <div class="block">Create a new <code>YUVImage</code> instance backed by a unified buffer,
228  and allocate memory for the buffer.</div>
229 </td>
230 </tr>
231 </table>
232 </li>
233 </ul>
234 </section>
235 <!-- ========== METHOD SUMMARY =========== -->
236 <section>
237 <ul class="blockList">
238 <li class="blockList"><a id="method.summary">
239 <!--   -->
240 </a>
241 <h3>Method Summary</h3>
242 <table class="memberSummary">
243 <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>
244 <tr>
245 <th class="colFirst" scope="col">Modifier and Type</th>
246 <th class="colSecond" scope="col">Method</th>
247 <th class="colLast" scope="col">Description</th>
248 </tr>
249 <tr id="i0" class="altColor">
250 <td class="colFirst"><code>byte[]</code></td>
251 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBuf()">getBuf</a></span>()</code></th>
252 <td class="colLast">
253 <div class="block">Returns the YUV buffer (if this image is stored in a unified buffer rather
254  than separate image planes.)</div>
255 </td>
256 </tr>
257 <tr id="i1" class="rowColor">
258 <td class="colFirst"><code>int</code></td>
259 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getHeight()">getHeight</a></span>()</code></th>
260 <td class="colLast">
261 <div class="block">Returns the height of the YUV image (or subregion.)</div>
262 </td>
263 </tr>
264 <tr id="i2" class="altColor">
265 <td class="colFirst"><code>int[]</code></td>
266 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getOffsets()">getOffsets</a></span>()</code></th>
267 <td class="colLast">
268 <div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
269  YUV image.</div>
270 </td>
271 </tr>
272 <tr id="i3" class="rowColor">
273 <td class="colFirst"><code>int</code></td>
274 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPad()">getPad</a></span>()</code></th>
275 <td class="colLast">
276 <div class="block">Returns the row alignment (in bytes) of the YUV buffer (if this image is
277  stored in a unified buffer rather than separate image planes.)</div>
278 </td>
279 </tr>
280 <tr id="i4" class="altColor">
281 <td class="colFirst"><code>byte[][]</code></td>
282 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPlanes()">getPlanes</a></span>()</code></th>
283 <td class="colLast">
284 <div class="block">Returns the YUV image planes.</div>
285 </td>
286 </tr>
287 <tr id="i5" class="rowColor">
288 <td class="colFirst"><code>int</code></td>
289 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSize()">getSize</a></span>()</code></th>
290 <td class="colLast">
291 <div class="block">Returns the size (in bytes) of the YUV buffer (if this image is stored in
292  a unified buffer rather than separate image planes.)</div>
293 </td>
294 </tr>
295 <tr id="i6" class="altColor">
296 <td class="colFirst"><code>int[]</code></td>
297 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getStrides()">getStrides</a></span>()</code></th>
298 <td class="colLast">
299 <div class="block">Returns the number of bytes per row of each plane in the YUV image.</div>
300 </td>
301 </tr>
302 <tr id="i7" class="rowColor">
303 <td class="colFirst"><code>int</code></td>
304 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSubsamp()">getSubsamp</a></span>()</code></th>
305 <td class="colLast">
306 <div class="block">Returns the level of chrominance subsampling used in the YUV image.</div>
307 </td>
308 </tr>
309 <tr id="i8" class="altColor">
310 <td class="colFirst"><code>int</code></td>
311 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getWidth()">getWidth</a></span>()</code></th>
312 <td class="colLast">
313 <div class="block">Returns the width of the YUV image (or subregion.)</div>
314 </td>
315 </tr>
316 <tr id="i9" class="rowColor">
317 <td class="colFirst"><code>void</code></td>
318 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBuf(byte%5B%5D%5B%5D,int%5B%5D,int,int%5B%5D,int,int)">setBuf</a></span>&#8203;(byte[][]&nbsp;planes,
319       int[]&nbsp;offsets,
320       int&nbsp;width,
321       int[]&nbsp;strides,
322       int&nbsp;height,
323       int&nbsp;subsamp)</code></th>
324 <td class="colLast">
325 <div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
326 </td>
327 </tr>
328 <tr id="i10" class="altColor">
329 <td class="colFirst"><code>void</code></td>
330 <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setBuf(byte%5B%5D,int,int,int,int)">setBuf</a></span>&#8203;(byte[]&nbsp;yuvImage,
331       int&nbsp;width,
332       int&nbsp;align,
333       int&nbsp;height,
334       int&nbsp;subsamp)</code></th>
335 <td class="colLast">
336 <div class="block">Assign a unified buffer to this <code>YUVImage</code> instance.</div>
337 </td>
338 </tr>
339 </table>
340 <ul class="blockList">
341 <li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
342 <!--   -->
343 </a>
344 <h3>Methods inherited from class&nbsp;java.lang.Object</h3>
345 <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
346 </ul>
347 </li>
348 </ul>
349 </section>
350 </li>
351 </ul>
352 </div>
353 <div class="details">
354 <ul class="blockList">
355 <li class="blockList">
356 <!-- ========= CONSTRUCTOR DETAIL ======== -->
357 <section>
358 <ul class="blockList">
359 <li class="blockList"><a id="constructor.detail">
360 <!--   -->
361 </a>
362 <h3>Constructor Detail</h3>
363 <a id="&lt;init&gt;(int,int[],int,int)">
364 <!--   -->
365 </a>
366 <ul class="blockList">
367 <li class="blockList">
368 <h4>YUVImage</h4>
369 <pre>public&nbsp;YUVImage&#8203;(int&nbsp;width,
370                 int[]&nbsp;strides,
371                 int&nbsp;height,
372                 int&nbsp;subsamp)</pre>
373 <div class="block">Create a new <code>YUVImage</code> instance backed by separate image
374  planes, and allocate memory for the image planes.</div>
375 <dl>
376 <dt><span class="paramLabel">Parameters:</span></dt>
377 <dd><code>width</code> - width (in pixels) of the YUV image</dd>
378 <dd><code>strides</code> - an array of integers, each specifying the number of bytes
379  per row in the corresponding plane of the YUV image.  Setting the stride
380  for any plane to 0 is the same as setting it to the plane width (see
381  <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.)  If <code>strides</code> is null, then the
382  strides for all planes will be set to their respective plane widths.  When
383  using this constructor, the stride for each plane must be equal to or
384  greater than the plane width.</dd>
385 <dd><code>height</code> - height (in pixels) of the YUV image</dd>
386 <dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
387  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
388 </dl>
389 </li>
390 </ul>
391 <a id="&lt;init&gt;(int,int,int,int)">
392 <!--   -->
393 </a>
394 <ul class="blockList">
395 <li class="blockList">
396 <h4>YUVImage</h4>
397 <pre>public&nbsp;YUVImage&#8203;(int&nbsp;width,
398                 int&nbsp;align,
399                 int&nbsp;height,
400                 int&nbsp;subsamp)</pre>
401 <div class="block">Create a new <code>YUVImage</code> instance backed by a unified buffer,
402  and allocate memory for the buffer.</div>
403 <dl>
404 <dt><span class="paramLabel">Parameters:</span></dt>
405 <dd><code>width</code> - width (in pixels) of the YUV image</dd>
406 <dd><code>align</code> - row alignment (in bytes) of the YUV image (must be a power of
407  2.)  Setting this parameter to n specifies that each row in each plane of
408  the YUV image will be padded to the nearest multiple of n bytes
409  (1 = unpadded.)</dd>
410 <dd><code>height</code> - height (in pixels) of the YUV image</dd>
411 <dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
412  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
413 </dl>
414 </li>
415 </ul>
416 <a id="&lt;init&gt;(byte[][],int[],int,int[],int,int)">
417 <!--   -->
418 </a>
419 <ul class="blockList">
420 <li class="blockList">
421 <h4>YUVImage</h4>
422 <pre>public&nbsp;YUVImage&#8203;(byte[][]&nbsp;planes,
423                 int[]&nbsp;offsets,
424                 int&nbsp;width,
425                 int[]&nbsp;strides,
426                 int&nbsp;height,
427                 int&nbsp;subsamp)</pre>
428 <div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
429  planes.</div>
430 <dl>
431 <dt><span class="paramLabel">Parameters:</span></dt>
432 <dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
433  image planes (or just the Y plane, if the image is grayscale.)   These
434  planes can be contiguous or non-contiguous in memory.  Plane
435  <code>i</code> should be at least <code>offsets[i] +
436  <a href="TJ.html#planeSizeYUV(int,int,int,int,int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
437  bytes in size.</dd>
438 <dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
439  subregion of a larger image, then <code>offsets[i]</code> specifies the
440  offset (in bytes) of the subregion within plane <code>i</code> of the
441  larger image.  Setting this to null is the same as setting the offsets for
442  all planes to 0.</dd>
443 <dd><code>width</code> - width (in pixels) of the new YUV image (or subregion)</dd>
444 <dd><code>strides</code> - an array of integers, each specifying the number of bytes
445  per row in the corresponding plane of the YUV image.  Setting the stride
446  for any plane to 0 is the same as setting it to the plane width (see
447  <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.)  If <code>strides</code> is null, then the
448  strides for all planes will be set to their respective plane widths.  You
449  can adjust the strides in order to add an arbitrary amount of row padding
450  to each plane or to specify that this <code>YUVImage</code> instance is a
451  subregion of a larger image (in which case, <code>strides[i]</code> should
452  be set to the plane width of plane <code>i</code> in the larger image.)</dd>
453 <dd><code>height</code> - height (in pixels) of the new YUV image (or subregion)</dd>
454 <dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
455  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
456 </dl>
457 </li>
458 </ul>
459 <a id="&lt;init&gt;(byte[],int,int,int,int)">
460 <!--   -->
461 </a>
462 <ul class="blockListLast">
463 <li class="blockList">
464 <h4>YUVImage</h4>
465 <pre>public&nbsp;YUVImage&#8203;(byte[]&nbsp;yuvImage,
466                 int&nbsp;width,
467                 int&nbsp;align,
468                 int&nbsp;height,
469                 int&nbsp;subsamp)</pre>
470 <div class="block">Create a new <code>YUVImage</code> instance from an existing unified
471  buffer.</div>
472 <dl>
473 <dt><span class="paramLabel">Parameters:</span></dt>
474 <dd><code>yuvImage</code> - buffer that contains or will receive a unified planar YUV
475  image.  Use <a href="TJ.html#bufSizeYUV(int,int,int,int)"><code>TJ.bufSizeYUV()</code></a> to determine the minimum
476  size for this buffer.  The Y, U (Cb), and V (Cr) image planes are stored
477  sequentially in the buffer.  (See <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
478  of the image format.)</dd>
479 <dd><code>width</code> - width (in pixels) of the YUV image</dd>
480 <dd><code>align</code> - row alignment (in bytes) of the YUV image (must be a power of
481  2.)  Setting this parameter to n specifies that each row in each plane of
482  the YUV image will be padded to the nearest multiple of n bytes
483  (1 = unpadded.)</dd>
484 <dd><code>height</code> - height (in pixels) of the YUV image</dd>
485 <dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
486  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
487 </dl>
488 </li>
489 </ul>
490 </li>
491 </ul>
492 </section>
493 <!-- ============ METHOD DETAIL ========== -->
494 <section>
495 <ul class="blockList">
496 <li class="blockList"><a id="method.detail">
497 <!--   -->
498 </a>
499 <h3>Method Detail</h3>
500 <a id="setBuf(byte[][],int[],int,int[],int,int)">
501 <!--   -->
502 </a>
503 <ul class="blockList">
504 <li class="blockList">
505 <h4>setBuf</h4>
506 <pre class="methodSignature">public&nbsp;void&nbsp;setBuf&#8203;(byte[][]&nbsp;planes,
507                    int[]&nbsp;offsets,
508                    int&nbsp;width,
509                    int[]&nbsp;strides,
510                    int&nbsp;height,
511                    int&nbsp;subsamp)</pre>
512 <div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
513 <dl>
514 <dt><span class="paramLabel">Parameters:</span></dt>
515 <dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
516  image planes (or just the Y plane, if the image is grayscale.)  These
517  planes can be contiguous or non-contiguous in memory.  Plane
518  <code>i</code> should be at least <code>offsets[i] +
519  <a href="TJ.html#planeSizeYUV(int,int,int,int,int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
520  bytes in size.</dd>
521 <dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
522  subregion of a larger image, then <code>offsets[i]</code> specifies the
523  offset (in bytes) of the subregion within plane <code>i</code> of the
524  larger image.  Setting this to null is the same as setting the offsets for
525  all planes to 0.</dd>
526 <dd><code>width</code> - width (in pixels) of the YUV image (or subregion)</dd>
527 <dd><code>strides</code> - an array of integers, each specifying the number of bytes
528  per row in the corresponding plane of the YUV image.  Setting the stride
529  for any plane to 0 is the same as setting it to the plane width (see
530  <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.)  If <code>strides</code> is null, then the
531  strides for all planes will be set to their respective plane widths.  You
532  can adjust the strides in order to add an arbitrary amount of row padding
533  to each plane or to specify that this <code>YUVImage</code> instance is a
534  subregion of a larger image (in which case, <code>strides[i]</code> should
535  be set to the plane width of plane <code>i</code> in the larger image.)</dd>
536 <dd><code>height</code> - height (in pixels) of the YUV image (or subregion)</dd>
537 <dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
538  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
539 </dl>
540 </li>
541 </ul>
542 <a id="setBuf(byte[],int,int,int,int)">
543 <!--   -->
544 </a>
545 <ul class="blockList">
546 <li class="blockList">
547 <h4>setBuf</h4>
548 <pre class="methodSignature">public&nbsp;void&nbsp;setBuf&#8203;(byte[]&nbsp;yuvImage,
549                    int&nbsp;width,
550                    int&nbsp;align,
551                    int&nbsp;height,
552                    int&nbsp;subsamp)</pre>
553 <div class="block">Assign a unified buffer to this <code>YUVImage</code> instance.</div>
554 <dl>
555 <dt><span class="paramLabel">Parameters:</span></dt>
556 <dd><code>yuvImage</code> - buffer that contains or will receive a unified planar YUV
557  image.  Use <a href="TJ.html#bufSizeYUV(int,int,int,int)"><code>TJ.bufSizeYUV()</code></a> to determine the minimum
558  size for this buffer.  The Y, U (Cb), and V (Cr) image planes are stored
559  sequentially in the buffer.  (See <a href="YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
560  of the image format.)</dd>
561 <dd><code>width</code> - width (in pixels) of the YUV image</dd>
562 <dd><code>align</code> - row alignment (in bytes) of the YUV image (must be a power of
563  2.)  Setting this parameter to n specifies that each row in each plane of
564  the YUV image will be padded to the nearest multiple of n bytes
565  (1 = unpadded.)</dd>
566 <dd><code>height</code> - height (in pixels) of the YUV image</dd>
567 <dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
568  image (one of <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
569 </dl>
570 </li>
571 </ul>
572 <a id="getWidth()">
573 <!--   -->
574 </a>
575 <ul class="blockList">
576 <li class="blockList">
577 <h4>getWidth</h4>
578 <pre class="methodSignature">public&nbsp;int&nbsp;getWidth()</pre>
579 <div class="block">Returns the width of the YUV image (or subregion.)</div>
580 <dl>
581 <dt><span class="returnLabel">Returns:</span></dt>
582 <dd>the width of the YUV image (or subregion)</dd>
583 </dl>
584 </li>
585 </ul>
586 <a id="getHeight()">
587 <!--   -->
588 </a>
589 <ul class="blockList">
590 <li class="blockList">
591 <h4>getHeight</h4>
592 <pre class="methodSignature">public&nbsp;int&nbsp;getHeight()</pre>
593 <div class="block">Returns the height of the YUV image (or subregion.)</div>
594 <dl>
595 <dt><span class="returnLabel">Returns:</span></dt>
596 <dd>the height of the YUV image (or subregion)</dd>
597 </dl>
598 </li>
599 </ul>
600 <a id="getPad()">
601 <!--   -->
602 </a>
603 <ul class="blockList">
604 <li class="blockList">
605 <h4>getPad</h4>
606 <pre class="methodSignature">public&nbsp;int&nbsp;getPad()</pre>
607 <div class="block">Returns the row alignment (in bytes) of the YUV buffer (if this image is
608  stored in a unified buffer rather than separate image planes.)</div>
609 <dl>
610 <dt><span class="returnLabel">Returns:</span></dt>
611 <dd>the row alignment of the YUV buffer</dd>
612 </dl>
613 </li>
614 </ul>
615 <a id="getStrides()">
616 <!--   -->
617 </a>
618 <ul class="blockList">
619 <li class="blockList">
620 <h4>getStrides</h4>
621 <pre class="methodSignature">public&nbsp;int[]&nbsp;getStrides()</pre>
622 <div class="block">Returns the number of bytes per row of each plane in the YUV image.</div>
623 <dl>
624 <dt><span class="returnLabel">Returns:</span></dt>
625 <dd>the number of bytes per row of each plane in the YUV image</dd>
626 </dl>
627 </li>
628 </ul>
629 <a id="getOffsets()">
630 <!--   -->
631 </a>
632 <ul class="blockList">
633 <li class="blockList">
634 <h4>getOffsets</h4>
635 <pre class="methodSignature">public&nbsp;int[]&nbsp;getOffsets()</pre>
636 <div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
637  YUV image.</div>
638 <dl>
639 <dt><span class="returnLabel">Returns:</span></dt>
640 <dd>the offsets (in bytes) of each plane within the planes of a larger
641  YUV image</dd>
642 </dl>
643 </li>
644 </ul>
645 <a id="getSubsamp()">
646 <!--   -->
647 </a>
648 <ul class="blockList">
649 <li class="blockList">
650 <h4>getSubsamp</h4>
651 <pre class="methodSignature">public&nbsp;int&nbsp;getSubsamp()</pre>
652 <div class="block">Returns the level of chrominance subsampling used in the YUV image.  See
653  <a href="TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
654 <dl>
655 <dt><span class="returnLabel">Returns:</span></dt>
656 <dd>the level of chrominance subsampling used in the YUV image</dd>
657 </dl>
658 </li>
659 </ul>
660 <a id="getPlanes()">
661 <!--   -->
662 </a>
663 <ul class="blockList">
664 <li class="blockList">
665 <h4>getPlanes</h4>
666 <pre class="methodSignature">public&nbsp;byte[][]&nbsp;getPlanes()</pre>
667 <div class="block">Returns the YUV image planes.  If the image is stored in a unified buffer,
668  then all image planes will point to that buffer.</div>
669 <dl>
670 <dt><span class="returnLabel">Returns:</span></dt>
671 <dd>the YUV image planes</dd>
672 </dl>
673 </li>
674 </ul>
675 <a id="getBuf()">
676 <!--   -->
677 </a>
678 <ul class="blockList">
679 <li class="blockList">
680 <h4>getBuf</h4>
681 <pre class="methodSignature">public&nbsp;byte[]&nbsp;getBuf()</pre>
682 <div class="block">Returns the YUV buffer (if this image is stored in a unified buffer rather
683  than separate image planes.)</div>
684 <dl>
685 <dt><span class="returnLabel">Returns:</span></dt>
686 <dd>the YUV buffer</dd>
687 </dl>
688 </li>
689 </ul>
690 <a id="getSize()">
691 <!--   -->
692 </a>
693 <ul class="blockListLast">
694 <li class="blockList">
695 <h4>getSize</h4>
696 <pre class="methodSignature">public&nbsp;int&nbsp;getSize()</pre>
697 <div class="block">Returns the size (in bytes) of the YUV buffer (if this image is stored in
698  a unified buffer rather than separate image planes.)</div>
699 <dl>
700 <dt><span class="returnLabel">Returns:</span></dt>
701 <dd>the size (in bytes) of the YUV buffer</dd>
702 </dl>
703 </li>
704 </ul>
705 </li>
706 </ul>
707 </section>
708 </li>
709 </ul>
710 </div>
711 </div>
712 </main>
713 <!-- ========= END OF CLASS DATA ========= -->
714 <footer role="contentinfo">
715 <nav role="navigation">
716 <!-- ======= START OF BOTTOM NAVBAR ====== -->
717 <div class="bottomNav"><a id="navbar.bottom">
718 <!--   -->
719 </a>
720 <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
721 <a id="navbar.bottom.firstrow">
722 <!--   -->
723 </a>
724 <ul class="navList" title="Navigation">
725 <li><a href="package-summary.html">Package</a></li>
726 <li class="navBarCell1Rev">Class</li>
727 <li><a href="package-tree.html">Tree</a></li>
728 <li><a href="../../../deprecated-list.html">Deprecated</a></li>
729 <li><a href="../../../index-all.html">Index</a></li>
730 <li><a href="../../../help-doc.html">Help</a></li>
731 </ul>
732 </div>
733 <div class="subNav">
734 <ul class="navList" id="allclasses_navbar_bottom">
735 <li><a href="../../../allclasses.html">All&nbsp;Classes</a></li>
736 </ul>
737 <div>
738 <script type="text/javascript"><!--
739   allClassesLink = document.getElementById("allclasses_navbar_bottom");
740   if(window==top) {
741     allClassesLink.style.display = "block";
742   }
743   else {
744     allClassesLink.style.display = "none";
745   }
746   //-->
747 </script>
748 <noscript>
749 <div>JavaScript is disabled on your browser.</div>
750 </noscript>
751 </div>
752 <div>
753 <ul class="subNavList">
754 <li>Summary:&nbsp;</li>
755 <li>Nested&nbsp;|&nbsp;</li>
756 <li>Field&nbsp;|&nbsp;</li>
757 <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
758 <li><a href="#method.summary">Method</a></li>
759 </ul>
760 <ul class="subNavList">
761 <li>Detail:&nbsp;</li>
762 <li>Field&nbsp;|&nbsp;</li>
763 <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
764 <li><a href="#method.detail">Method</a></li>
765 </ul>
766 </div>
767 <a id="skip.navbar.bottom">
768 <!--   -->
769 </a></div>
770 <!-- ======== END OF BOTTOM NAVBAR ======= -->
771 </nav>
772 </footer>
773 </body>
774 </html>