DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| 2 | <!--NewPage--> |
| 3 | <HTML> |
| 4 | <HEAD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 5 | <TITLE> |
| 6 | TJCompressor |
| 7 | </TITLE> |
| 8 | |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 9 | |
| 10 | <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> |
| 11 | |
| 12 | <SCRIPT type="text/javascript"> |
| 13 | function 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> </TD> |
| 39 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 40 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 41 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 42 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 43 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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"> |
DRC | b2f9415 | 2011-04-02 02:09:03 +0000 | [diff] [blame] | 54 | <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A> |
DRC | f546711 | 2011-09-20 05:02:19 +0000 | [diff] [blame] | 55 | <A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 56 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 57 | <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> |
| 58 | <A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A> |
| 59 | <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 76 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 77 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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"> |
| 87 | org.libjpegturbo.turbojpeg</FONT> |
| 88 | <BR> |
| 89 | Class TJCompressor</H2> |
| 90 | <PRE> |
| 91 | java.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> |
| 100 | TurboJPEG 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 | Create a TurboJPEG compressor instance.</TD> |
| 121 | </TR> |
| 122 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 123 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">TJCompressor</A></B>(byte[] srcImage, |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 124 | int width, |
| 125 | int pitch, |
| 126 | int height, |
| 127 | int pixelFormat)</CODE> |
| 128 | |
| 129 | <BR> |
| 130 | Create a TurboJPEG compressor instance and associate the uncompressed |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 131 | source image stored in <code>srcImage</code> with the newly-created |
| 132 | instance.</TD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 133 | </TR> |
DRC | fac3bea | 2012-09-24 02:27:55 +0000 | [diff] [blame] | 134 | <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[] srcImage, |
| 136 | int x, |
| 137 | int y, |
| 138 | int width, |
| 139 | int pitch, |
| 140 | int height, |
| 141 | int pixelFormat)</CODE> |
| 142 | |
| 143 | <BR> |
| 144 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 148 | </TABLE> |
| 149 | |
| 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> void</CODE></FONT></TD> |
| 161 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#close()">close</A></B>()</CODE> |
| 162 | |
| 163 | <BR> |
| 164 | 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> 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 srcImage, |
| 170 | byte[] dstBuf, |
| 171 | int flags)</CODE> |
| 172 | |
| 173 | <BR> |
| 174 | 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> 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 srcImage, |
| 181 | int flags)</CODE> |
| 182 | |
| 183 | <BR> |
| 184 | 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> void</CODE></FONT></TD> |
| 190 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)">compress</A></B>(byte[] dstBuf, |
| 191 | int flags)</CODE> |
| 192 | |
| 193 | <BR> |
| 194 | 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> byte[]</CODE></FONT></TD> |
| 200 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)">compress</A></B>(int flags)</CODE> |
| 201 | |
| 202 | <BR> |
| 203 | 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> 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 srcImage, |
| 210 | byte[] dstBuf, |
| 211 | int flags)</CODE> |
| 212 | |
| 213 | <BR> |
| 214 | 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> 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 srcImage, |
| 221 | int flags)</CODE> |
| 222 | |
| 223 | <BR> |
| 224 | 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> void</CODE></FONT></TD> |
| 230 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">encodeYUV</A></B>(byte[] dstBuf, |
| 231 | int flags)</CODE> |
| 232 | |
| 233 | <BR> |
| 234 | 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> byte[]</CODE></FONT></TD> |
| 240 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV</A></B>(int flags)</CODE> |
| 241 | |
| 242 | <BR> |
| 243 | 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 void</CODE></FONT></TD> |
| 249 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize</A></B>()</CODE> |
| 250 | |
| 251 | <BR> |
| 252 | </TD> |
| 253 | </TR> |
| 254 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
| 255 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 256 | <CODE> int</CODE></FONT></TD> |
| 257 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize</A></B>()</CODE> |
| 258 | |
| 259 | <BR> |
| 260 | 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> void</CODE></FONT></TD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 266 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality</A></B>(int quality)</CODE> |
| 267 | |
| 268 | <BR> |
| 269 | 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> void</CODE></FONT></TD> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 274 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">setSourceImage</A></B>(byte[] srcImage, |
| 275 | int width, |
| 276 | int pitch, |
| 277 | int height, |
| 278 | int pixelFormat)</CODE> |
| 279 | |
| 280 | <BR> |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 281 | <B>Deprecated.</B> <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> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 283 | </TR> |
| 284 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
| 285 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 286 | <CODE> void</CODE></FONT></TD> |
DRC | fac3bea | 2012-09-24 02:27:55 +0000 | [diff] [blame] | 287 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage</A></B>(byte[] srcImage, |
| 288 | int x, |
| 289 | int y, |
| 290 | int width, |
| 291 | int pitch, |
| 292 | int height, |
| 293 | int pixelFormat)</CODE> |
| 294 | |
| 295 | <BR> |
| 296 | 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> void</CODE></FONT></TD> |
DRC | 1e67274 | 2013-10-31 05:04:51 +0000 | [diff] [blame] | 301 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImageYUV(byte[], int, int, int)">setSourceImageYUV</A></B>(byte[] srcImage, |
| 302 | int width, |
| 303 | int pad, |
| 304 | int height)</CODE> |
| 305 | |
| 306 | <BR> |
| 307 | 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> void</CODE></FONT></TD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 313 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp</A></B>(int newSubsamp)</CODE> |
| 314 | |
| 315 | <BR> |
| 316 | Set the level of chrominance subsampling for subsequent compress/encode |
| 317 | operations.</TD> |
| 318 | </TR> |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 319 | <TR BGCOLOR="white" CLASS="TableRowColor"> |
| 320 | <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> |
| 321 | <CODE> void</CODE></FONT></TD> |
| 322 | <TD><CODE><B><A HREF="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setYUVPad(int)">setYUVPad</A></B>(int pad)</CODE> |
| 323 | |
| 324 | <BR> |
| 325 | Set the plane padding for subsequent YUV encode operations.</TD> |
| 326 | </TR> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 327 | </TABLE> |
| 328 | <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 | |
| 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> |
| 351 | TJCompressor</H3> |
| 352 | <PRE> |
| 353 | public <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> |
| 366 | TJCompressor</H3> |
| 367 | <PRE> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 368 | public <B>TJCompressor</B>(byte[] srcImage, |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 369 | int width, |
| 370 | int pitch, |
| 371 | int height, |
| 372 | int pixelFormat) |
| 373 | throws java.lang.Exception</PRE> |
| 374 | <DL> |
| 375 | <DD>Create a TurboJPEG compressor instance and associate the uncompressed |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 376 | source image stored in <code>srcImage</code> with the newly-created |
| 377 | instance. |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 378 | <P> |
| 379 | <DL> |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 380 | <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>) |
DRC | fac3bea | 2012-09-24 02:27:55 +0000 | [diff] [blame] | 382 | <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> |
| 388 | TJCompressor</H3> |
| 389 | <PRE> |
| 390 | public <B>TJCompressor</B>(byte[] srcImage, |
| 391 | int x, |
| 392 | int y, |
| 393 | int width, |
| 394 | int pitch, |
| 395 | int height, |
| 396 | int 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> |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 404 | <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>) |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 406 | <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 | |
DRC | fac3bea | 2012-09-24 02:27:55 +0000 | [diff] [blame] | 420 | <A NAME="setSourceImage(byte[], int, int, int, int, int, int)"><!-- --></A><H3> |
| 421 | setSourceImage</H3> |
| 422 | <PRE> |
| 423 | public void <B>setSourceImage</B>(byte[] srcImage, |
| 424 | int x, |
| 425 | int y, |
| 426 | int width, |
| 427 | int pitch, |
| 428 | int height, |
| 429 | int 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> |
DRC | 38cb1ec | 2013-08-23 04:45:43 +0000 | [diff] [blame] | 435 | <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 |
DRC | fac3bea | 2012-09-24 02:27:55 +0000 | [diff] [blame] | 437 | 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 | |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 455 | <A NAME="setSourceImage(byte[], int, int, int, int)"><!-- --></A><H3> |
| 456 | setSourceImage</H3> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 457 | <PRE> |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 458 | <FONT SIZE="-1">@Deprecated |
| 459 | </FONT>public void <B>setSourceImage</B>(byte[] srcImage, |
| 460 | int width, |
| 461 | int pitch, |
| 462 | int height, |
| 463 | int pixelFormat) |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 464 | throws java.lang.Exception</PRE> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 465 | <DL> |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 466 | <DD><B>Deprecated.</B> <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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 468 | <P> |
| 469 | <DD><DL> |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 470 | |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 471 | <DT><B>Throws:</B> |
| 472 | <DD><CODE>java.lang.Exception</CODE></DL> |
| 473 | </DD> |
| 474 | </DL> |
| 475 | <HR> |
| 476 | |
DRC | 1e67274 | 2013-10-31 05:04:51 +0000 | [diff] [blame] | 477 | <A NAME="setSourceImageYUV(byte[], int, int, int)"><!-- --></A><H3> |
| 478 | setSourceImageYUV</H3> |
| 479 | <PRE> |
| 480 | public void <B>setSourceImageYUV</B>(byte[] srcImage, |
| 481 | int width, |
| 482 | int pad, |
| 483 | int 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 | |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 509 | <A NAME="setSubsamp(int)"><!-- --></A><H3> |
| 510 | setSubsamp</H3> |
| 511 | <PRE> |
| 512 | public void <B>setSubsamp</B>(int newSubsamp) |
| 513 | throws java.lang.Exception</PRE> |
| 514 | <DL> |
| 515 | <DD>Set the level of chrominance subsampling for subsequent compress/encode |
DRC | b2c4745 | 2013-08-23 06:38:59 +0000 | [diff] [blame] | 516 | 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". |
DRC | 1e67274 | 2013-10-31 05:04:51 +0000 | [diff] [blame] | 523 | <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. |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 527 | <P> |
| 528 | <DD><DL> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 529 | <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>) |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 531 | <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> |
| 538 | setJPEGQuality</H3> |
| 539 | <PRE> |
| 540 | public void <B>setJPEGQuality</B>(int 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> |
| 555 | compress</H3> |
| 556 | <PRE> |
| 557 | public void <B>compress</B>(byte[] dstBuf, |
| 558 | int 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> |
DRC | 80803ae | 2011-12-15 13:12:59 +0000 | [diff] [blame] | 565 | <DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use |
DRC | 9b49f0e | 2011-07-12 03:17:23 +0000 | [diff] [blame] | 566 | <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 |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 567 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 568 | <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> |
| 575 | compress</H3> |
| 576 | <PRE> |
| 577 | public byte[] <B>compress</B>(int 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> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 584 | <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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 585 | <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> |
| 594 | compress</H3> |
| 595 | <PRE> |
| 596 | public void <B>compress</B>(java.awt.image.BufferedImage srcImage, |
| 597 | byte[] dstBuf, |
| 598 | int 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 |
DRC | 80803ae | 2011-12-15 13:12:59 +0000 | [diff] [blame] | 606 | grayscale pixels to be compressed<DD><CODE>dstBuf</CODE> - buffer that will receive the JPEG image. Use |
DRC | 9b49f0e | 2011-07-12 03:17:23 +0000 | [diff] [blame] | 607 | <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 |
DRC | 65d4a46 | 2013-04-27 01:06:52 +0000 | [diff] [blame] | 608 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 609 | <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> |
| 616 | compress</H3> |
| 617 | <PRE> |
| 618 | public byte[] <B>compress</B>(java.awt.image.BufferedImage srcImage, |
| 619 | int 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 |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 627 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 628 | <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 | |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 636 | <A NAME="setYUVPad(int)"><!-- --></A><H3> |
| 637 | setYUVPad</H3> |
| 638 | <PRE> |
| 639 | public void <B>setYUVPad</B>(int 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 | |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 655 | <A NAME="encodeYUV(byte[], int)"><!-- --></A><H3> |
| 656 | encodeYUV</H3> |
| 657 | <PRE> |
| 658 | public void <B>encodeYUV</B>(byte[] dstBuf, |
| 659 | int 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. |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 664 | 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 |
DRC | b2c4745 | 2013-08-23 06:38:59 +0000 | [diff] [blame] | 666 | 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. |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 678 | <P> |
| 679 | <DD><DL> |
DRC | 80803ae | 2011-12-15 13:12:59 +0000 | [diff] [blame] | 680 | <DT><B>Parameters:</B><DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 681 | <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 |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 682 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 683 | <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> |
| 690 | encodeYUV</H3> |
| 691 | <PRE> |
| 692 | public byte[] <B>encodeYUV</B>(int 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> |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 700 | <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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 701 | <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> |
| 709 | encodeYUV</H3> |
| 710 | <PRE> |
| 711 | public void <B>encodeYUV</B>(java.awt.image.BufferedImage srcImage, |
| 712 | byte[] dstBuf, |
| 713 | int 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 |
DRC | 80803ae | 2011-12-15 13:12:59 +0000 | [diff] [blame] | 722 | grayscale pixels to be encoded<DD><CODE>dstBuf</CODE> - buffer that will receive the YUV planar image. Use |
DRC | fef9852 | 2013-04-28 01:32:52 +0000 | [diff] [blame] | 723 | <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 |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 724 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 725 | <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> |
| 732 | encodeYUV</H3> |
| 733 | <PRE> |
| 734 | public byte[] <B>encodeYUV</B>(java.awt.image.BufferedImage srcImage, |
| 735 | int 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 |
DRC | 2c74e51 | 2011-03-16 00:02:53 +0000 | [diff] [blame] | 744 | 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> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 745 | <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> |
| 753 | getCompressedSize</H3> |
| 754 | <PRE> |
| 755 | public 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> |
| 769 | close</H3> |
| 770 | <PRE> |
| 771 | public 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> |
| 785 | finalize</H3> |
| 786 | <PRE> |
| 787 | protected 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> </TD> |
| 813 | <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> |
| 814 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> |
| 815 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> |
| 816 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> |
| 817 | <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </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"> |
DRC | b2f9415 | 2011-04-02 02:09:03 +0000 | [diff] [blame] | 828 | <A HREF="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><B>PREV CLASS</B></A> |
DRC | f546711 | 2011-09-20 05:02:19 +0000 | [diff] [blame] | 829 | <A HREF="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><B>NEXT CLASS</B></A></FONT></TD> |
DRC | 92549de | 2011-03-15 20:52:02 +0000 | [diff] [blame] | 830 | <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> |
| 831 | <A HREF="../../../index.html?org/libjpegturbo/turbojpeg/TJCompressor.html" target="_top"><B>FRAMES</B></A> |
| 832 | <A HREF="TJCompressor.html" target="_top"><B>NO FRAMES</B></A> |
| 833 | <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: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> |
| 850 | <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> |
| 851 | DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <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> |