blob: 35114c709a182cfdf9b6910efcabe264c256c282 [file] [log] [blame]
DRC92549de2011-03-15 20:52:02 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
DRC92549de2011-03-15 20:52:02 +00005<TITLE>
6TJCompressor
7</TITLE>
8
DRC92549de2011-03-15 20:52:02 +00009
10<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
11
12<SCRIPT type="text/javascript">
13function windowTitle()
14{
15 if (location.href.indexOf('is-external=true') == -1) {
16 parent.document.title="TJCompressor";
17 }
18}
19</SCRIPT>
20<NOSCRIPT>
21</NOSCRIPT>
22
23</HEAD>
24
25<BODY BGCOLOR="white" onload="windowTitle();">
26<HR>
27
28
29<!-- ========= START OF TOP NAVBAR ======= -->
30<A NAME="navbar_top"><!-- --></A>
31<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
32<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
33<TR>
34<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
35<A NAME="navbar_top_firstrow"><!-- --></A>
36<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
37 <TR ALIGN="center" VALIGN="top">
38 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
39 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
40 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
41 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
42 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
43 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
44 </TR>
45</TABLE>
46</TD>
47<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
48</EM>
49</TD>
50</TR>
51
52<TR>
53<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
DRCb2f94152011-04-02 02:09:03 +000054&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
DRCf5467112011-09-20 05:02:19 +000055&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
DRC92549de2011-03-15 20:52:02 +000056<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
57 <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
58&nbsp;<A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
59&nbsp;<SCRIPT type="text/javascript">
60 <!--
61 if(window==top) {
62 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
63 }
64 //-->
65</SCRIPT>
66<NOSCRIPT>
67 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
68</NOSCRIPT>
69
70
71</FONT></TD>
72</TR>
73<TR>
74<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
75 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
76<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
77DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
78</TR>
79</TABLE>
80<A NAME="skip-navbar_top"></A>
81<!-- ========= END OF TOP NAVBAR ========= -->
82
83<HR>
84<!-- ======== START OF CLASS DATA ======== -->
85<H2>
86<FONT SIZE="-1">
87org.libjpegturbo.turbojpeg</FONT>
88<BR>
89Class TJCompressor</H2>
90<PRE>
91java.lang.Object
92 <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.libjpegturbo.turbojpeg.TJCompressor</B>
93</PRE>
94<HR>
95<DL>
96<DT><PRE>public class <B>TJCompressor</B><DT>extends java.lang.Object</DL>
97</PRE>
98
99<P>
100TurboJPEG compressor
101<P>
102
103<P>
104<HR>
105
106<P>
107
108<!-- ======== CONSTRUCTOR SUMMARY ======== -->
109
110<A NAME="constructor_summary"><!-- --></A>
111<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
112<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
113<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
114<B>Constructor Summary</B></FONT></TH>
115</TR>
116<TR BGCOLOR="white" CLASS="TableRowColor">
117<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor()">TJCompressor</A></B>()</CODE>
118
119<BR>
120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG compressor instance.</TD>
121</TR>
122<TR BGCOLOR="white" CLASS="TableRowColor">
DRC2c74e512011-03-16 00:02:53 +0000123<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">TJCompressor</A></B>(byte[]&nbsp;srcImage,
DRC92549de2011-03-15 20:52:02 +0000124 int&nbsp;width,
125 int&nbsp;pitch,
126 int&nbsp;height,
127 int&nbsp;pixelFormat)</CODE>
128
129<BR>
130&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG compressor instance and associate the uncompressed
DRC2c74e512011-03-16 00:02:53 +0000131 source image stored in <code>srcImage</code> with the newly-created
132 instance.</TD>
DRC92549de2011-03-15 20:52:02 +0000133</TR>
DRCfac3bea2012-09-24 02:27:55 +0000134<TR BGCOLOR="white" CLASS="TableRowColor">
135<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)">TJCompressor</A></B>(byte[]&nbsp;srcImage,
136 int&nbsp;x,
137 int&nbsp;y,
138 int&nbsp;width,
139 int&nbsp;pitch,
140 int&nbsp;height,
141 int&nbsp;pixelFormat)</CODE>
142
143<BR>
144&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a TurboJPEG compressor instance and associate the uncompressed
145 source image stored in <code>srcImage</code> with the newly-created
146 instance.</TD>
147</TR>
DRC92549de2011-03-15 20:52:02 +0000148</TABLE>
149&nbsp;
150<!-- ========== METHOD SUMMARY =========== -->
151
152<A NAME="method_summary"><!-- --></A>
153<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
154<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
155<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
156<B>Method Summary</B></FONT></TH>
157</TR>
158<TR BGCOLOR="white" CLASS="TableRowColor">
159<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
160<CODE>&nbsp;void</CODE></FONT></TD>
161<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#close()">close</A></B>()</CODE>
162
163<BR>
164&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Free the native structures associated with this compressor instance.</TD>
165</TR>
166<TR BGCOLOR="white" CLASS="TableRowColor">
167<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
168<CODE>&nbsp;void</CODE></FONT></TD>
169<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">compress</A></B>(java.awt.image.BufferedImage&nbsp;srcImage,
170 byte[]&nbsp;dstBuf,
171 int&nbsp;flags)</CODE>
172
173<BR>
174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compress the uncompressed source image stored in <code>srcImage</code>
175 and output a JPEG image to the given destination buffer.</TD>
176</TR>
177<TR BGCOLOR="white" CLASS="TableRowColor">
178<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
179<CODE>&nbsp;byte[]</CODE></FONT></TD>
180<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">compress</A></B>(java.awt.image.BufferedImage&nbsp;srcImage,
181 int&nbsp;flags)</CODE>
182
183<BR>
184&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compress the uncompressed source image stored in <code>srcImage</code>
185 and return a buffer containing a JPEG image.</TD>
186</TR>
187<TR BGCOLOR="white" CLASS="TableRowColor">
188<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
189<CODE>&nbsp;void</CODE></FONT></TD>
190<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)">compress</A></B>(byte[]&nbsp;dstBuf,
191 int&nbsp;flags)</CODE>
192
193<BR>
194&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compress the uncompressed source image associated with this compressor
195 instance and output a JPEG image to the given destination buffer.</TD>
196</TR>
197<TR BGCOLOR="white" CLASS="TableRowColor">
198<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
199<CODE>&nbsp;byte[]</CODE></FONT></TD>
200<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)">compress</A></B>(int&nbsp;flags)</CODE>
201
202<BR>
203&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Compress the uncompressed source image associated with this compressor
204 instance and return a buffer containing a JPEG image.</TD>
205</TR>
206<TR BGCOLOR="white" CLASS="TableRowColor">
207<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
208<CODE>&nbsp;void</CODE></FONT></TD>
209<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">encodeYUV</A></B>(java.awt.image.BufferedImage&nbsp;srcImage,
210 byte[]&nbsp;dstBuf,
211 int&nbsp;flags)</CODE>
212
213<BR>
214&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the uncompressed source image stored in <code>srcImage</code>
215 and output a YUV planar image to the given destination buffer.</TD>
216</TR>
217<TR BGCOLOR="white" CLASS="TableRowColor">
218<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
219<CODE>&nbsp;byte[]</CODE></FONT></TD>
220<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">encodeYUV</A></B>(java.awt.image.BufferedImage&nbsp;srcImage,
221 int&nbsp;flags)</CODE>
222
223<BR>
224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the uncompressed source image stored in <code>srcImage</code>
225 and return a buffer containing a YUV planar image.</TD>
226</TR>
227<TR BGCOLOR="white" CLASS="TableRowColor">
228<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
229<CODE>&nbsp;void</CODE></FONT></TD>
230<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">encodeYUV</A></B>(byte[]&nbsp;dstBuf,
231 int&nbsp;flags)</CODE>
232
233<BR>
234&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the uncompressed source image associated with this compressor
235 instance and output a YUV planar image to the given destination buffer.</TD>
236</TR>
237<TR BGCOLOR="white" CLASS="TableRowColor">
238<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
239<CODE>&nbsp;byte[]</CODE></FONT></TD>
240<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV</A></B>(int&nbsp;flags)</CODE>
241
242<BR>
243&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Encode the uncompressed source image associated with this compressor
244 instance and return a buffer containing a YUV planar image.</TD>
245</TR>
246<TR BGCOLOR="white" CLASS="TableRowColor">
247<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
248<CODE>protected &nbsp;void</CODE></FONT></TD>
249<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize</A></B>()</CODE>
250
251<BR>
252&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
253</TR>
254<TR BGCOLOR="white" CLASS="TableRowColor">
255<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
256<CODE>&nbsp;int</CODE></FONT></TD>
257<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize</A></B>()</CODE>
258
259<BR>
260&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the size of the image (in bytes) generated by the most recent
261 compress/encode operation.</TD>
262</TR>
263<TR BGCOLOR="white" CLASS="TableRowColor">
264<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
265<CODE>&nbsp;void</CODE></FONT></TD>
DRC92549de2011-03-15 20:52:02 +0000266<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality</A></B>(int&nbsp;quality)</CODE>
267
268<BR>
269&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the JPEG image quality level for subsequent compress operations.</TD>
270</TR>
271<TR BGCOLOR="white" CLASS="TableRowColor">
272<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
273<CODE>&nbsp;void</CODE></FONT></TD>
DRC2c74e512011-03-16 00:02:53 +0000274<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">setSourceImage</A></B>(byte[]&nbsp;srcImage,
275 int&nbsp;width,
276 int&nbsp;pitch,
277 int&nbsp;height,
278 int&nbsp;pixelFormat)</CODE>
279
280<BR>
DRC65d4a462013-04-27 01:06:52 +0000281&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<B>Deprecated.</B>&nbsp;<I>Use
282 <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I></TD>
DRC2c74e512011-03-16 00:02:53 +0000283</TR>
284<TR BGCOLOR="white" CLASS="TableRowColor">
285<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
286<CODE>&nbsp;void</CODE></FONT></TD>
DRCfac3bea2012-09-24 02:27:55 +0000287<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage</A></B>(byte[]&nbsp;srcImage,
288 int&nbsp;x,
289 int&nbsp;y,
290 int&nbsp;width,
291 int&nbsp;pitch,
292 int&nbsp;height,
293 int&nbsp;pixelFormat)</CODE>
294
295<BR>
296&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Associate an uncompressed source image with this compressor instance.</TD>
297</TR>
298<TR BGCOLOR="white" CLASS="TableRowColor">
299<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
300<CODE>&nbsp;void</CODE></FONT></TD>
DRC1e672742013-10-31 05:04:51 +0000301<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImageYUV(byte[], int, int, int)">setSourceImageYUV</A></B>(byte[]&nbsp;srcImage,
302 int&nbsp;width,
303 int&nbsp;pad,
304 int&nbsp;height)</CODE>
305
306<BR>
307&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Associate an uncompressed YUV planar source image with this compressor
308 instance.</TD>
309</TR>
310<TR BGCOLOR="white" CLASS="TableRowColor">
311<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
312<CODE>&nbsp;void</CODE></FONT></TD>
DRC92549de2011-03-15 20:52:02 +0000313<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp</A></B>(int&nbsp;newSubsamp)</CODE>
314
315<BR>
316&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the level of chrominance subsampling for subsequent compress/encode
317 operations.</TD>
318</TR>
DRCfef98522013-04-28 01:32:52 +0000319<TR BGCOLOR="white" CLASS="TableRowColor">
320<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
321<CODE>&nbsp;void</CODE></FONT></TD>
322<TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setYUVPad(int)">setYUVPad</A></B>(int&nbsp;pad)</CODE>
323
324<BR>
325&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the plane padding for subsequent YUV encode operations.</TD>
326</TR>
DRC92549de2011-03-15 20:52:02 +0000327</TABLE>
328&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
329<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
330<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
331<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
332</TR>
333<TR BGCOLOR="white" CLASS="TableRowColor">
334<TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
335</TR>
336</TABLE>
337&nbsp;
338<P>
339
340<!-- ========= CONSTRUCTOR DETAIL ======== -->
341
342<A NAME="constructor_detail"><!-- --></A>
343<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
344<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
345<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
346<B>Constructor Detail</B></FONT></TH>
347</TR>
348</TABLE>
349
350<A NAME="TJCompressor()"><!-- --></A><H3>
351TJCompressor</H3>
352<PRE>
353public <B>TJCompressor</B>()
354 throws java.lang.Exception</PRE>
355<DL>
356<DD>Create a TurboJPEG compressor instance.
357<P>
358<DL>
359
360<DT><B>Throws:</B>
361<DD><CODE>java.lang.Exception</CODE></DL>
362</DL>
363<HR>
364
365<A NAME="TJCompressor(byte[], int, int, int, int)"><!-- --></A><H3>
366TJCompressor</H3>
367<PRE>
DRC2c74e512011-03-16 00:02:53 +0000368public <B>TJCompressor</B>(byte[]&nbsp;srcImage,
DRC92549de2011-03-15 20:52:02 +0000369 int&nbsp;width,
370 int&nbsp;pitch,
371 int&nbsp;height,
372 int&nbsp;pixelFormat)
373 throws java.lang.Exception</PRE>
374<DL>
375<DD>Create a TurboJPEG compressor instance and associate the uncompressed
DRC2c74e512011-03-16 00:02:53 +0000376 source image stored in <code>srcImage</code> with the newly-created
377 instance.
DRC92549de2011-03-15 20:52:02 +0000378<P>
379<DL>
DRC65d4a462013-04-27 01:06:52 +0000380<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
381 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
DRCfac3bea2012-09-24 02:27:55 +0000382<DT><B>Throws:</B>
383<DD><CODE>java.lang.Exception</CODE></DL>
384</DL>
385<HR>
386
387<A NAME="TJCompressor(byte[], int, int, int, int, int, int)"><!-- --></A><H3>
388TJCompressor</H3>
389<PRE>
390public <B>TJCompressor</B>(byte[]&nbsp;srcImage,
391 int&nbsp;x,
392 int&nbsp;y,
393 int&nbsp;width,
394 int&nbsp;pitch,
395 int&nbsp;height,
396 int&nbsp;pixelFormat)
397 throws java.lang.Exception</PRE>
398<DL>
399<DD>Create a TurboJPEG compressor instance and associate the uncompressed
400 source image stored in <code>srcImage</code> with the newly-created
401 instance.
402<P>
403<DL>
DRC65d4a462013-04-27 01:06:52 +0000404<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>x</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>y</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>width</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pitch</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>height</CODE> - see <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> for description<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
405 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
DRC92549de2011-03-15 20:52:02 +0000406<DT><B>Throws:</B>
407<DD><CODE>java.lang.Exception</CODE></DL>
408</DL>
409
410<!-- ============ METHOD DETAIL ========== -->
411
412<A NAME="method_detail"><!-- --></A>
413<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
414<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
415<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
416<B>Method Detail</B></FONT></TH>
417</TR>
418</TABLE>
419
DRCfac3bea2012-09-24 02:27:55 +0000420<A NAME="setSourceImage(byte[], int, int, int, int, int, int)"><!-- --></A><H3>
421setSourceImage</H3>
422<PRE>
423public void <B>setSourceImage</B>(byte[]&nbsp;srcImage,
424 int&nbsp;x,
425 int&nbsp;y,
426 int&nbsp;width,
427 int&nbsp;pitch,
428 int&nbsp;height,
429 int&nbsp;pixelFormat)
430 throws java.lang.Exception</PRE>
431<DL>
432<DD>Associate an uncompressed source image with this compressor instance.
433<P>
434<DD><DL>
DRC38cb1ec2013-08-23 04:45:43 +0000435<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - image buffer containing RGB, grayscale, or CMYK pixels to
436 be compressed<DD><CODE>x</CODE> - x offset (in pixels) of the region from which the JPEG image
DRCfac3bea2012-09-24 02:27:55 +0000437 should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>y</CODE> - y offset (in pixels) of the region from which the JPEG image
438 should be compressed, relative to the start of <code>srcImage</code>.<DD><CODE>width</CODE> - width (in pixels) of the region in the source image from
439 which the JPEG image should be compressed.<DD><CODE>pitch</CODE> - bytes per line of the source image. Normally, this should be
440 <code>width * TJ.pixelSize(pixelFormat)</code> if the source image is
441 unpadded, but you can use this parameter to, for instance, specify that
442 the scanlines in the source image are padded to a 4-byte boundary or to
443 compress a JPEG image from a region of a larger source image. You can
444 also be clever and use this parameter to skip lines, etc. Setting this
445 parameter to 0 is the equivalent of setting it to <code>width *
446 TJ.pixelSize(pixelFormat)</code>.<DD><CODE>height</CODE> - height (in pixels) of the region in the source image from
447 which the JPEG image should be compressed.<DD><CODE>pixelFormat</CODE> - pixel format of the source image (one of
448 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.PF_*</CODE></A>)
449<DT><B>Throws:</B>
450<DD><CODE>java.lang.Exception</CODE></DL>
451</DD>
452</DL>
453<HR>
454
DRC2c74e512011-03-16 00:02:53 +0000455<A NAME="setSourceImage(byte[], int, int, int, int)"><!-- --></A><H3>
456setSourceImage</H3>
DRC92549de2011-03-15 20:52:02 +0000457<PRE>
DRCfef98522013-04-28 01:32:52 +0000458<FONT SIZE="-1">@Deprecated
459</FONT>public void <B>setSourceImage</B>(byte[]&nbsp;srcImage,
460 int&nbsp;width,
461 int&nbsp;pitch,
462 int&nbsp;height,
463 int&nbsp;pixelFormat)
DRC2c74e512011-03-16 00:02:53 +0000464 throws java.lang.Exception</PRE>
DRC92549de2011-03-15 20:52:02 +0000465<DL>
DRC65d4a462013-04-27 01:06:52 +0000466<DD><B>Deprecated.</B>&nbsp;<I>Use
467 <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><CODE>setSourceImage(byte[], int, int, int, int, int, int)</CODE></A> instead.</I>
DRC92549de2011-03-15 20:52:02 +0000468<P>
469<DD><DL>
DRC65d4a462013-04-27 01:06:52 +0000470
DRC92549de2011-03-15 20:52:02 +0000471<DT><B>Throws:</B>
472<DD><CODE>java.lang.Exception</CODE></DL>
473</DD>
474</DL>
475<HR>
476
DRC1e672742013-10-31 05:04:51 +0000477<A NAME="setSourceImageYUV(byte[], int, int, int)"><!-- --></A><H3>
478setSourceImageYUV</H3>
479<PRE>
480public void <B>setSourceImageYUV</B>(byte[]&nbsp;srcImage,
481 int&nbsp;width,
482 int&nbsp;pad,
483 int&nbsp;height)
484 throws java.lang.Exception</PRE>
485<DL>
486<DD>Associate an uncompressed YUV planar source image with this compressor
487 instance.
488<P>
489<DD><DL>
490<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - image buffer containing a YUV planar image to be
491 compressed. The Y, U (Cb), and V (Cr) image planes should be stored
492 sequentially in the buffer, and the size of each plane is determined by
493 the specified width, height, and padding, as well as the level of
494 chrominance subsampling (specified using <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)"><CODE>setSubsamp(int)</CODE></A>.) If the
495 chrominance components are subsampled along the horizontal dimension, then
496 the width of the luminance plane should be padded to the nearest multiple
497 of 2 (same goes for the height of the luminance plane, if the chrominance
498 components are subsampled along the vertical dimension.) This is
499 irrespective of any additional padding specified in the <code>pad</code>
500 parameter.<DD><CODE>width</CODE> - width (in pixels) of the source image<DD><CODE>pad</CODE> - the line padding used in the source image. For instance, if
501 each line in each plane of the YUV image is padded to the nearest multiple
502 of 4 bytes, then <code>pad</code> should be set to 4.<DD><CODE>height</CODE> - height (in pixels) of the source image
503<DT><B>Throws:</B>
504<DD><CODE>java.lang.Exception</CODE></DL>
505</DD>
506</DL>
507<HR>
508
DRC92549de2011-03-15 20:52:02 +0000509<A NAME="setSubsamp(int)"><!-- --></A><H3>
510setSubsamp</H3>
511<PRE>
512public void <B>setSubsamp</B>(int&nbsp;newSubsamp)
513 throws java.lang.Exception</PRE>
514<DL>
515<DD>Set the level of chrominance subsampling for subsequent compress/encode
DRCb2c47452013-08-23 06:38:59 +0000516 operations. When pixels are converted from RGB to YCbCr (see
517 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><CODE>TJ.CS_YCbCr</CODE></A>) or from CMYK to YCCK (see <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCCK"><CODE>TJ.CS_YCCK</CODE></A>) as part
518 of the JPEG compression process, some of the Cb and Cr (chrominance)
519 components can be discarded or averaged together to produce a smaller
520 image with little perceptible loss of image clarity (the human eye is more
521 sensitive to small changes in brightness than to small changes in color.)
522 This is called "chrominance subsampling".
DRC1e672742013-10-31 05:04:51 +0000523 <p>
524 NOTE: When compressing a YUV planar image into a JPEG image, this method
525 also specifies the level of chrominance subsampling used in the source
526 image.
DRC92549de2011-03-15 20:52:02 +0000527<P>
528<DD><DL>
DRC2c74e512011-03-16 00:02:53 +0000529<DT><B>Parameters:</B><DD><CODE>newSubsamp</CODE> - the new level of chrominance subsampling (one of
530 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.SAMP_*</CODE></A>)
DRC92549de2011-03-15 20:52:02 +0000531<DT><B>Throws:</B>
532<DD><CODE>java.lang.Exception</CODE></DL>
533</DD>
534</DL>
535<HR>
536
537<A NAME="setJPEGQuality(int)"><!-- --></A><H3>
538setJPEGQuality</H3>
539<PRE>
540public void <B>setJPEGQuality</B>(int&nbsp;quality)
541 throws java.lang.Exception</PRE>
542<DL>
543<DD>Set the JPEG image quality level for subsequent compress operations.
544<P>
545<DD><DL>
546<DT><B>Parameters:</B><DD><CODE>quality</CODE> - the new JPEG image quality level (1 to 100, 1 = worst,
547 100 = best)
548<DT><B>Throws:</B>
549<DD><CODE>java.lang.Exception</CODE></DL>
550</DD>
551</DL>
552<HR>
553
554<A NAME="compress(byte[], int)"><!-- --></A><H3>
555compress</H3>
556<PRE>
557public void <B>compress</B>(byte[]&nbsp;dstBuf,
558 int&nbsp;flags)
559 throws java.lang.Exception</PRE>
560<DL>
561<DD>Compress the uncompressed source image associated with this compressor
562 instance and output a JPEG image to the given destination buffer.
563<P>
564<DD><DL>
DRC80803ae2011-12-15 13:12:59 +0000565<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use
DRC9b49f0e2011-07-12 03:17:23 +0000566 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
DRC65d4a462013-04-27 01:06:52 +0000567 the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000568<DT><B>Throws:</B>
569<DD><CODE>java.lang.Exception</CODE></DL>
570</DD>
571</DL>
572<HR>
573
574<A NAME="compress(int)"><!-- --></A><H3>
575compress</H3>
576<PRE>
577public byte[] <B>compress</B>(int&nbsp;flags)
578 throws java.lang.Exception</PRE>
579<DL>
580<DD>Compress the uncompressed source image associated with this compressor
581 instance and return a buffer containing a JPEG image.
582<P>
583<DD><DL>
DRC2c74e512011-03-16 00:02:53 +0000584<DT><B>Parameters:</B><DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000585<DT><B>Returns:</B><DD>a buffer containing a JPEG image. The length of this buffer will
586 not be equal to the size of the JPEG image. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><CODE>getCompressedSize()</CODE></A> to obtain the size of the JPEG image.
587<DT><B>Throws:</B>
588<DD><CODE>java.lang.Exception</CODE></DL>
589</DD>
590</DL>
591<HR>
592
593<A NAME="compress(java.awt.image.BufferedImage, byte[], int)"><!-- --></A><H3>
594compress</H3>
595<PRE>
596public void <B>compress</B>(java.awt.image.BufferedImage&nbsp;srcImage,
597 byte[]&nbsp;dstBuf,
598 int&nbsp;flags)
599 throws java.lang.Exception</PRE>
600<DL>
601<DD>Compress the uncompressed source image stored in <code>srcImage</code>
602 and output a JPEG image to the given destination buffer.
603<P>
604<DD><DL>
605<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
DRC80803ae2011-12-15 13:12:59 +0000606 grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use
DRC9b49f0e2011-07-12 03:17:23 +0000607 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><CODE>TJ.bufSize(int, int, int)</CODE></A> to determine the maximum size for this buffer based on
DRC65d4a462013-04-27 01:06:52 +0000608 the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000609<DT><B>Throws:</B>
610<DD><CODE>java.lang.Exception</CODE></DL>
611</DD>
612</DL>
613<HR>
614
615<A NAME="compress(java.awt.image.BufferedImage, int)"><!-- --></A><H3>
616compress</H3>
617<PRE>
618public byte[] <B>compress</B>(java.awt.image.BufferedImage&nbsp;srcImage,
619 int&nbsp;flags)
620 throws java.lang.Exception</PRE>
621<DL>
622<DD>Compress the uncompressed source image stored in <code>srcImage</code>
623 and return a buffer containing a JPEG image.
624<P>
625<DD><DL>
626<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
DRC2c74e512011-03-16 00:02:53 +0000627 grayscale pixels to be compressed<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000628<DT><B>Returns:</B><DD>a buffer containing a JPEG image. The length of this buffer will
629 not be equal to the size of the JPEG image. Use <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()"><CODE>getCompressedSize()</CODE></A> to obtain the size of the JPEG image.
630<DT><B>Throws:</B>
631<DD><CODE>java.lang.Exception</CODE></DL>
632</DD>
633</DL>
634<HR>
635
DRCfef98522013-04-28 01:32:52 +0000636<A NAME="setYUVPad(int)"><!-- --></A><H3>
637setYUVPad</H3>
638<PRE>
639public void <B>setYUVPad</B>(int&nbsp;pad)
640 throws java.lang.Exception</PRE>
641<DL>
642<DD>Set the plane padding for subsequent YUV encode operations.
643<P>
644<DD><DL>
645<DT><B>Parameters:</B><DD><CODE>pad</CODE> - the width of each line in each plane of the YUV image will be
646 padded to the nearest multiple of this number of bytes (must be a
647 power of 2.) The default padding is 4 bytes, which generates
648 images suitable for direct video display.
649<DT><B>Throws:</B>
650<DD><CODE>java.lang.Exception</CODE></DL>
651</DD>
652</DL>
653<HR>
654
DRC92549de2011-03-15 20:52:02 +0000655<A NAME="encodeYUV(byte[], int)"><!-- --></A><H3>
656encodeYUV</H3>
657<PRE>
658public void <B>encodeYUV</B>(byte[]&nbsp;dstBuf,
659 int&nbsp;flags)
660 throws java.lang.Exception</PRE>
661<DL>
662<DD>Encode the uncompressed source image associated with this compressor
663 instance and output a YUV planar image to the given destination buffer.
DRCfef98522013-04-28 01:32:52 +0000664 This method uses the accelerated color conversion routines in TurboJPEG's
665 underlying codec but does not execute any of the other steps in the JPEG
DRCb2c47452013-08-23 06:38:59 +0000666 compression process. The Y, U (Cb), and V (Cr) image planes are stored
667 sequentially into the destination buffer, and the size of each plane is
668 determined by the width and height of the source image, as well as the
669 specified padding and level of chrominance subsampling. If the
670 chrominance components are subsampled along the horizontal dimension, then
671 the width of the luminance plane is padded to the nearest multiple of 2 in
672 the output image (same goes for the height of the luminance plane, if the
673 chrominance components are subsampled along the vertical dimension.)
674 <p>
675 NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the
676 convention of the digital video community, the TurboJPEG API uses "YUV" to
677 refer to an image format consisting of Y, Cb, and Cr image planes.
DRC92549de2011-03-15 20:52:02 +0000678<P>
679<DD><DL>
DRC80803ae2011-12-15 13:12:59 +0000680<DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
DRCfef98522013-04-28 01:32:52 +0000681 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int, int)</CODE></A> to determine the appropriate size for this buffer
DRC2c74e512011-03-16 00:02:53 +0000682 based on the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000683<DT><B>Throws:</B>
684<DD><CODE>java.lang.Exception</CODE></DL>
685</DD>
686</DL>
687<HR>
688
689<A NAME="encodeYUV(int)"><!-- --></A><H3>
690encodeYUV</H3>
691<PRE>
692public byte[] <B>encodeYUV</B>(int&nbsp;flags)
693 throws java.lang.Exception</PRE>
694<DL>
695<DD>Encode the uncompressed source image associated with this compressor
696 instance and return a buffer containing a YUV planar image. See
697 <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
698<P>
699<DD><DL>
DRC2c74e512011-03-16 00:02:53 +0000700<DT><B>Parameters:</B><DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000701<DT><B>Returns:</B><DD>a buffer containing a YUV planar image
702<DT><B>Throws:</B>
703<DD><CODE>java.lang.Exception</CODE></DL>
704</DD>
705</DL>
706<HR>
707
708<A NAME="encodeYUV(java.awt.image.BufferedImage, byte[], int)"><!-- --></A><H3>
709encodeYUV</H3>
710<PRE>
711public void <B>encodeYUV</B>(java.awt.image.BufferedImage&nbsp;srcImage,
712 byte[]&nbsp;dstBuf,
713 int&nbsp;flags)
714 throws java.lang.Exception</PRE>
715<DL>
716<DD>Encode the uncompressed source image stored in <code>srcImage</code>
717 and output a YUV planar image to the given destination buffer. See
718 <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
719<P>
720<DD><DL>
721<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
DRC80803ae2011-12-15 13:12:59 +0000722 grayscale pixels to be encoded<DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use
DRCfef98522013-04-28 01:32:52 +0000723 <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><CODE>TJ.bufSizeYUV(int, int, int, int)</CODE></A> to determine the appropriate size for this buffer
DRC2c74e512011-03-16 00:02:53 +0000724 based on the image width, height, and level of chrominance subsampling.<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000725<DT><B>Throws:</B>
726<DD><CODE>java.lang.Exception</CODE></DL>
727</DD>
728</DL>
729<HR>
730
731<A NAME="encodeYUV(java.awt.image.BufferedImage, int)"><!-- --></A><H3>
732encodeYUV</H3>
733<PRE>
734public byte[] <B>encodeYUV</B>(java.awt.image.BufferedImage&nbsp;srcImage,
735 int&nbsp;flags)
736 throws java.lang.Exception</PRE>
737<DL>
738<DD>Encode the uncompressed source image stored in <code>srcImage</code>
739 and return a buffer containing a YUV planar image. See
740 <A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><CODE>encodeYUV(byte[], int)</CODE></A> for more detail.
741<P>
742<DD><DL>
743<DT><B>Parameters:</B><DD><CODE>srcImage</CODE> - a <code>BufferedImage</code> instance containing RGB or
DRC2c74e512011-03-16 00:02:53 +0000744 grayscale pixels to be encoded<DD><CODE>flags</CODE> - the bitwise OR of one or more of <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><CODE>TJ.FLAG_*</CODE></A>
DRC92549de2011-03-15 20:52:02 +0000745<DT><B>Returns:</B><DD>a buffer containing a YUV planar image
746<DT><B>Throws:</B>
747<DD><CODE>java.lang.Exception</CODE></DL>
748</DD>
749</DL>
750<HR>
751
752<A NAME="getCompressedSize()"><!-- --></A><H3>
753getCompressedSize</H3>
754<PRE>
755public int <B>getCompressedSize</B>()</PRE>
756<DL>
757<DD>Returns the size of the image (in bytes) generated by the most recent
758 compress/encode operation.
759<P>
760<DD><DL>
761
762<DT><B>Returns:</B><DD>the size of the image (in bytes) generated by the most recent
763 compress/encode operation</DL>
764</DD>
765</DL>
766<HR>
767
768<A NAME="close()"><!-- --></A><H3>
769close</H3>
770<PRE>
771public void <B>close</B>()
772 throws java.lang.Exception</PRE>
773<DL>
774<DD>Free the native structures associated with this compressor instance.
775<P>
776<DD><DL>
777
778<DT><B>Throws:</B>
779<DD><CODE>java.lang.Exception</CODE></DL>
780</DD>
781</DL>
782<HR>
783
784<A NAME="finalize()"><!-- --></A><H3>
785finalize</H3>
786<PRE>
787protected void <B>finalize</B>()
788 throws java.lang.Throwable</PRE>
789<DL>
790<DD><DL>
791<DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL>
792</DD>
793<DD><DL>
794
795<DT><B>Throws:</B>
796<DD><CODE>java.lang.Throwable</CODE></DL>
797</DD>
798</DL>
799<!-- ========= END OF CLASS DATA ========= -->
800<HR>
801
802
803<!-- ======= START OF BOTTOM NAVBAR ====== -->
804<A NAME="navbar_bottom"><!-- --></A>
805<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
806<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
807<TR>
808<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
809<A NAME="navbar_bottom_firstrow"><!-- --></A>
810<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
811 <TR ALIGN="center" VALIGN="top">
812 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../org/libjpegturbo/turbojpeg/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
813 <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
814 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
815 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
816 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
817 <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
818 </TR>
819</TABLE>
820</TD>
821<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
822</EM>
823</TD>
824</TR>
825
826<TR>
827<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
DRCb2f94152011-04-02 02:09:03 +0000828&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A>&nbsp;
DRCf5467112011-09-20 05:02:19 +0000829&nbsp;<A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD>
DRC92549de2011-03-15 20:52:02 +0000830<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
831 <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> &nbsp;
832&nbsp;<A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
833&nbsp;<SCRIPT type="text/javascript">
834 <!--
835 if(window==top) {
836 document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
837 }
838 //-->
839</SCRIPT>
840<NOSCRIPT>
841 <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
842</NOSCRIPT>
843
844
845</FONT></TD>
846</TR>
847<TR>
848<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
849 SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
850<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
851DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
852</TR>
853</TABLE>
854<A NAME="skip-navbar_bottom"></A>
855<!-- ======== END OF BOTTOM NAVBAR ======= -->
856
857<HR>
858
859</BODY>
860</HTML>