Imported Upstream version 3.0.1
[platform/upstream/libjpeg-turbo.git] / doc / html / group___turbo_j_p_e_g.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.8.20"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>TurboJPEG: TurboJPEG</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="search/search.css" rel="stylesheet" type="text/css"/>
13 <script type="text/javascript" src="search/searchdata.js"></script>
14 <script type="text/javascript" src="search/search.js"></script>
15 <link href="doxygen.css" rel="stylesheet" type="text/css" />
16 <link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
17 </head>
18 <body>
19 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
20 <div id="titlearea">
21 <table cellspacing="0" cellpadding="0">
22  <tbody>
23  <tr style="height: 56px;">
24   <td id="projectalign" style="padding-left: 0.5em;">
25    <div id="projectname">TurboJPEG
26    &#160;<span id="projectnumber">3</span>
27    </div>
28   </td>
29  </tr>
30  </tbody>
31 </table>
32 </div>
33 <!-- end header part -->
34 <!-- Generated by Doxygen 1.8.20 -->
35 <script type="text/javascript">
36 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
37 var searchBox = new SearchBox("searchBox", "search",false,'Search');
38 /* @license-end */
39 </script>
40 <script type="text/javascript" src="menudata.js"></script>
41 <script type="text/javascript" src="menu.js"></script>
42 <script type="text/javascript">
43 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
44 $(function() {
45   initMenu('',true,false,'search.php','Search');
46   $(document).ready(function() { init_search(); });
47 });
48 /* @license-end */</script>
49 <div id="main-nav"></div>
50 </div><!-- top -->
51 <!-- window showing the filter options -->
52 <div id="MSearchSelectWindow"
53      onmouseover="return searchBox.OnSearchSelectShow()"
54      onmouseout="return searchBox.OnSearchSelectHide()"
55      onkeydown="return searchBox.OnSearchSelectKey(event)">
56 </div>
57
58 <!-- iframe showing the search results (closed by default) -->
59 <div id="MSearchResultsWindow">
60 <iframe src="javascript:void(0)" frameborder="0" 
61         name="MSearchResults" id="MSearchResults">
62 </iframe>
63 </div>
64
65 <div class="header">
66   <div class="summary">
67 <a href="#nested-classes">Data Structures</a> &#124;
68 <a href="#define-members">Macros</a> &#124;
69 <a href="#typedef-members">Typedefs</a> &#124;
70 <a href="#enum-members">Enumerations</a> &#124;
71 <a href="#func-members">Functions</a> &#124;
72 <a href="#var-members">Variables</a>  </div>
73   <div class="headertitle">
74 <div class="title">TurboJPEG</div>  </div>
75 </div><!--header-->
76 <div class="contents">
77
78 <p>TurboJPEG API.  
79 <a href="#details">More...</a></p>
80 <table class="memberdecls">
81 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
82 Data Structures</h2></td></tr>
83 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a></td></tr>
84 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Scaling factor.  <a href="structtjscalingfactor.html#details">More...</a><br /></td></tr>
85 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
86 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjregion.html">tjregion</a></td></tr>
87 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cropping region.  <a href="structtjregion.html#details">More...</a><br /></td></tr>
88 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
89 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtjtransform.html">tjtransform</a></td></tr>
90 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lossless transform.  <a href="structtjtransform.html#details">More...</a><br /></td></tr>
91 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
92 </table><table class="memberdecls">
93 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
94 Macros</h2></td></tr>
95 <tr class="memitem:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5e0e8c784295c636f0bf8dab93c4bddf">TJ_NUMINIT</a></td></tr>
96 <tr class="memdesc:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of initialization options.  <a href="group___turbo_j_p_e_g.html#ga5e0e8c784295c636f0bf8dab93c4bddf">More...</a><br /></td></tr>
97 <tr class="separator:ga5e0e8c784295c636f0bf8dab93c4bddf"><td class="memSeparator" colspan="2">&#160;</td></tr>
98 <tr class="memitem:ga5ef3d169162ce77ce348e292a0b7477c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a></td></tr>
99 <tr class="memdesc:ga5ef3d169162ce77ce348e292a0b7477c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of chrominance subsampling options.  <a href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">More...</a><br /></td></tr>
100 <tr class="separator:ga5ef3d169162ce77ce348e292a0b7477c"><td class="memSeparator" colspan="2">&#160;</td></tr>
101 <tr class="memitem:ga7010a4402f54a45ba822ad8675a4655e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a></td></tr>
102 <tr class="memdesc:ga7010a4402f54a45ba822ad8675a4655e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of pixel formats.  <a href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">More...</a><br /></td></tr>
103 <tr class="separator:ga7010a4402f54a45ba822ad8675a4655e"><td class="memSeparator" colspan="2">&#160;</td></tr>
104 <tr class="memitem:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71">TJ_NUMCS</a></td></tr>
105 <tr class="memdesc:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of JPEG colorspaces.  <a href="group___turbo_j_p_e_g.html#ga39f57a6fb02d9cf32e7b6890099b5a71">More...</a><br /></td></tr>
106 <tr class="separator:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
107 <tr class="memitem:gaa628be5db276fc3676dfba205d45d780"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa628be5db276fc3676dfba205d45d780">TJ_NUMPARAM</a></td></tr>
108 <tr class="memdesc:gaa628be5db276fc3676dfba205d45d780"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of parameters.  <a href="group___turbo_j_p_e_g.html#gaa628be5db276fc3676dfba205d45d780">More...</a><br /></td></tr>
109 <tr class="separator:gaa628be5db276fc3676dfba205d45d780"><td class="memSeparator" colspan="2">&#160;</td></tr>
110 <tr class="memitem:ga79bde1b4a3e2351e00887e47781b966e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga79bde1b4a3e2351e00887e47781b966e">TJ_NUMERR</a></td></tr>
111 <tr class="memdesc:ga79bde1b4a3e2351e00887e47781b966e"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of error codes.  <a href="group___turbo_j_p_e_g.html#ga79bde1b4a3e2351e00887e47781b966e">More...</a><br /></td></tr>
112 <tr class="separator:ga79bde1b4a3e2351e00887e47781b966e"><td class="memSeparator" colspan="2">&#160;</td></tr>
113 <tr class="memitem:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">TJ_NUMXOP</a></td></tr>
114 <tr class="memdesc:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of transform operations.  <a href="group___turbo_j_p_e_g.html#ga0f6dbd18adf38b7d46ac547f0f4d562c">More...</a><br /></td></tr>
115 <tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2">&#160;</td></tr>
116 <tr class="memitem:ga50e03cb5ed115330e212417429600b00"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">TJXOPT_PERFECT</a></td></tr>
117 <tr class="memdesc:ga50e03cb5ed115330e212417429600b00"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect.  <a href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00">More...</a><br /></td></tr>
118 <tr class="separator:ga50e03cb5ed115330e212417429600b00"><td class="memSeparator" colspan="2">&#160;</td></tr>
119 <tr class="memitem:ga319826b7eb1583c0595bbe7b95428709"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">TJXOPT_TRIM</a></td></tr>
120 <tr class="memdesc:ga319826b7eb1583c0595bbe7b95428709"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed.  <a href="group___turbo_j_p_e_g.html#ga319826b7eb1583c0595bbe7b95428709">More...</a><br /></td></tr>
121 <tr class="separator:ga319826b7eb1583c0595bbe7b95428709"><td class="memSeparator" colspan="2">&#160;</td></tr>
122 <tr class="memitem:ga9c771a757fc1294add611906b89ab2d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">TJXOPT_CROP</a></td></tr>
123 <tr class="memdesc:ga9c771a757fc1294add611906b89ab2d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable lossless cropping.  <a href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2">More...</a><br /></td></tr>
124 <tr class="separator:ga9c771a757fc1294add611906b89ab2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
125 <tr class="memitem:ga3acee7b48ade1b99e5588736007c2589"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">TJXOPT_GRAY</a></td></tr>
126 <tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will discard the color data in the source image and produce a grayscale destination image.  <a href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">More...</a><br /></td></tr>
127 <tr class="separator:ga3acee7b48ade1b99e5588736007c2589"><td class="memSeparator" colspan="2">&#160;</td></tr>
128 <tr class="memitem:gafbf992bbf6e006705886333703ffab31"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">TJXOPT_NOOUTPUT</a></td></tr>
129 <tr class="memdesc:gafbf992bbf6e006705886333703ffab31"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform.  <a href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">More...</a><br /></td></tr>
130 <tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2">&#160;</td></tr>
131 <tr class="memitem:gad2371c80674584ecc1a7d75e564cf026"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">TJXOPT_PROGRESSIVE</a></td></tr>
132 <tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable progressive entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">More...</a><br /></td></tr>
133 <tr class="separator:gad2371c80674584ecc1a7d75e564cf026"><td class="memSeparator" colspan="2">&#160;</td></tr>
134 <tr class="memitem:ga153b468cfb905d0de61706c838986fe8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">TJXOPT_COPYNONE</a></td></tr>
135 <tr class="memdesc:ga153b468cfb905d0de61706c838986fe8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image.  <a href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">More...</a><br /></td></tr>
136 <tr class="separator:ga153b468cfb905d0de61706c838986fe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
137 <tr class="memitem:gaecaaa3b7e2af812592c015d83207f010"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010">TJXOPT_ARITHMETIC</a></td></tr>
138 <tr class="memdesc:gaecaaa3b7e2af812592c015d83207f010"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010">More...</a><br /></td></tr>
139 <tr class="separator:gaecaaa3b7e2af812592c015d83207f010"><td class="memSeparator" colspan="2">&#160;</td></tr>
140 <tr class="memitem:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117">TJXOPT_OPTIMIZE</a></td></tr>
141 <tr class="memdesc:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117">More...</a><br /></td></tr>
142 <tr class="separator:ga6bedf37aa9e1122f3ec9f7302ca59117"><td class="memSeparator" colspan="2">&#160;</td></tr>
143 <tr class="memitem:ga84878bb65404204743aa18cac02781df"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df">TJSCALED</a>(dimension,  scalingFactor)</td></tr>
144 <tr class="memdesc:ga84878bb65404204743aa18cac02781df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the scaled value of <code>dimension</code> using the given scaling factor.  <a href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df">More...</a><br /></td></tr>
145 <tr class="separator:ga84878bb65404204743aa18cac02781df"><td class="memSeparator" colspan="2">&#160;</td></tr>
146 </table><table class="memberdecls">
147 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
148 Typedefs</h2></td></tr>
149 <tr class="memitem:ga504805ec0161f1b505397ca0118bf8fd"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structtjtransform.html">tjtransform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd">tjtransform</a></td></tr>
150 <tr class="memdesc:ga504805ec0161f1b505397ca0118bf8fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Lossless transform.  <a href="group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd">More...</a><br /></td></tr>
151 <tr class="separator:ga504805ec0161f1b505397ca0118bf8fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
152 <tr class="memitem:ga758d2634ecb4949de7815cba621f5763"><td class="memItemLeft" align="right" valign="top">typedef void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a></td></tr>
153 <tr class="memdesc:ga758d2634ecb4949de7815cba621f5763"><td class="mdescLeft">&#160;</td><td class="mdescRight">TurboJPEG instance handle.  <a href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">More...</a><br /></td></tr>
154 <tr class="separator:ga758d2634ecb4949de7815cba621f5763"><td class="memSeparator" colspan="2">&#160;</td></tr>
155 </table><table class="memberdecls">
156 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
157 Enumerations</h2></td></tr>
158 <tr class="memitem:ga3850bbee1313e752e667b4eb08b1e086"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">TJINIT</a> { <a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796">TJINIT_COMPRESS</a>, 
159 <a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167">TJINIT_DECOMPRESS</a>, 
160 <a class="el" href="group___turbo_j_p_e_g.html#gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2">TJINIT_TRANSFORM</a>
161  }</td></tr>
162 <tr class="memdesc:ga3850bbee1313e752e667b4eb08b1e086"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialization options.  <a href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">More...</a><br /></td></tr>
163 <tr class="separator:ga3850bbee1313e752e667b4eb08b1e086"><td class="memSeparator" colspan="2">&#160;</td></tr>
164 <tr class="memitem:ga1d047060ea80bb9820d540bb928e9074"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">TJSAMP</a> { <br />
165 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3">TJSAMP_444</a>, 
166 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404">TJSAMP_422</a>, 
167 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>, 
168 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248">TJSAMP_GRAY</a>, 
169 <br />
170 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974">TJSAMP_440</a>, 
171 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2">TJSAMP_411</a>, 
172 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d">TJSAMP_441</a>, 
173 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173">TJSAMP_UNKNOWN</a>
174 <br />
175  }</td></tr>
176 <tr class="memdesc:ga1d047060ea80bb9820d540bb928e9074"><td class="mdescLeft">&#160;</td><td class="mdescRight">Chrominance subsampling options.  <a href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">More...</a><br /></td></tr>
177 <tr class="separator:ga1d047060ea80bb9820d540bb928e9074"><td class="memSeparator" colspan="2">&#160;</td></tr>
178 <tr class="memitem:gac916144e26c3817ac514e64ae5d12e2a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">TJPF</a> { <br />
179 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c">TJPF_RGB</a>, 
180 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839">TJPF_BGR</a>, 
181 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, 
182 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, 
183 <br />
184 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, 
185 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, 
186 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, 
187 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12">TJPF_RGBA</a>, 
188 <br />
189 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4">TJPF_BGRA</a>, 
190 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081">TJPF_ABGR</a>, 
191 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c">TJPF_ARGB</a>, 
192 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, 
193 <br />
194 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a>
195 <br />
196  }</td></tr>
197 <tr class="memdesc:gac916144e26c3817ac514e64ae5d12e2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel formats.  <a href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">More...</a><br /></td></tr>
198 <tr class="separator:gac916144e26c3817ac514e64ae5d12e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
199 <tr class="memitem:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">TJCS</a> { <br />
200 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555">TJCS_RGB</a>, 
201 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75">TJCS_YCbCr</a>, 
202 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a">TJCS_GRAY</a>, 
203 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53">TJCS_CMYK</a>, 
204 <br />
205 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e">TJCS_YCCK</a>
206 <br />
207  }</td></tr>
208 <tr class="memdesc:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="mdescLeft">&#160;</td><td class="mdescRight">JPEG colorspaces.  <a href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">More...</a><br /></td></tr>
209 <tr class="separator:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="memSeparator" colspan="2">&#160;</td></tr>
210 <tr class="memitem:gaa0f6be63ba78278299c9f5c12031fe82"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">TJPARAM</a> { <br />
211 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb">TJPARAM_STOPONWARNING</a>, 
212 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce">TJPARAM_BOTTOMUP</a>, 
213 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b">TJPARAM_NOREALLOC</a>, 
214 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c">TJPARAM_QUALITY</a>, 
215 <br />
216 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a">TJPARAM_SUBSAMP</a>, 
217 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8">TJPARAM_JPEGWIDTH</a>, 
218 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f">TJPARAM_JPEGHEIGHT</a>, 
219 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8">TJPARAM_PRECISION</a>, 
220 <br />
221 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c">TJPARAM_COLORSPACE</a>, 
222 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0">TJPARAM_FASTUPSAMPLE</a>, 
223 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627">TJPARAM_FASTDCT</a>, 
224 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6">TJPARAM_OPTIMIZE</a>, 
225 <br />
226 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f">TJPARAM_PROGRESSIVE</a>, 
227 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167">TJPARAM_SCANLIMIT</a>, 
228 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7">TJPARAM_ARITHMETIC</a>, 
229 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f">TJPARAM_LOSSLESS</a>, 
230 <br />
231 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159">TJPARAM_LOSSLESSPSV</a>, 
232 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a">TJPARAM_LOSSLESSPT</a>, 
233 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec">TJPARAM_RESTARTBLOCKS</a>, 
234 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c">TJPARAM_RESTARTROWS</a>, 
235 <br />
236 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877">TJPARAM_XDENSITY</a>, 
237 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba">TJPARAM_YDENSITY</a>, 
238 <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208">TJPARAM_DENSITYUNITS</a>
239 <br />
240  }</td></tr>
241 <tr class="memdesc:gaa0f6be63ba78278299c9f5c12031fe82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parameters.  <a href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">More...</a><br /></td></tr>
242 <tr class="separator:gaa0f6be63ba78278299c9f5c12031fe82"><td class="memSeparator" colspan="2">&#160;</td></tr>
243 <tr class="memitem:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">TJERR</a> { <a class="el" href="group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59">TJERR_WARNING</a>, 
244 <a class="el" href="group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a">TJERR_FATAL</a>
245  }</td></tr>
246 <tr class="memdesc:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Error codes.  <a href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">More...</a><br /></td></tr>
247 <tr class="separator:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
248 <tr class="memitem:ga2de531af4e7e6c4f124908376b354866"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">TJXOP</a> { <br />
249 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27">TJXOP_NONE</a>, 
250 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce">TJXOP_HFLIP</a>, 
251 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d">TJXOP_VFLIP</a>, 
252 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d">TJXOP_TRANSPOSE</a>, 
253 <br />
254 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4">TJXOP_TRANSVERSE</a>, 
255 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128">TJXOP_ROT90</a>, 
256 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692">TJXOP_ROT180</a>, 
257 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08">TJXOP_ROT270</a>
258 <br />
259  }</td></tr>
260 <tr class="memdesc:ga2de531af4e7e6c4f124908376b354866"><td class="mdescLeft">&#160;</td><td class="mdescRight">Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a>  <a href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">More...</a><br /></td></tr>
261 <tr class="separator:ga2de531af4e7e6c4f124908376b354866"><td class="memSeparator" colspan="2">&#160;</td></tr>
262 </table><table class="memberdecls">
263 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
264 Functions</h2></td></tr>
265 <tr class="memitem:ga69c09d39f97ec30250ad3605ace7e5df"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df">tj3Init</a> (int initType)</td></tr>
266 <tr class="memdesc:ga69c09d39f97ec30250ad3605ace7e5df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TurboJPEG instance.  <a href="group___turbo_j_p_e_g.html#ga69c09d39f97ec30250ad3605ace7e5df">More...</a><br /></td></tr>
267 <tr class="separator:ga69c09d39f97ec30250ad3605ace7e5df"><td class="memSeparator" colspan="2">&#160;</td></tr>
268 <tr class="memitem:gaddf92640bfee3e8622218c713e77e7db"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db">tj3Set</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, int param, int value)</td></tr>
269 <tr class="memdesc:gaddf92640bfee3e8622218c713e77e7db"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value of a parameter.  <a href="group___turbo_j_p_e_g.html#gaddf92640bfee3e8622218c713e77e7db">More...</a><br /></td></tr>
270 <tr class="separator:gaddf92640bfee3e8622218c713e77e7db"><td class="memSeparator" colspan="2">&#160;</td></tr>
271 <tr class="memitem:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">tj3Get</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, int param)</td></tr>
272 <tr class="memdesc:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the value of a parameter.  <a href="group___turbo_j_p_e_g.html#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">More...</a><br /></td></tr>
273 <tr class="separator:ga34af9ba3183bdf0ec7c8f47bb9a4c84f"><td class="memSeparator" colspan="2">&#160;</td></tr>
274 <tr class="memitem:ga2cc418a2dab709ad7f30f5b25905f138"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138">tj3Compress8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
275 <tr class="memdesc:ga2cc418a2dab709ad7f30f5b25905f138"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga2cc418a2dab709ad7f30f5b25905f138">More...</a><br /></td></tr>
276 <tr class="separator:ga2cc418a2dab709ad7f30f5b25905f138"><td class="memSeparator" colspan="2">&#160;</td></tr>
277 <tr class="memitem:ga9a1968c384ec7abb6122830253ebf570"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570">tj3Compress12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const short *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
278 <tr class="memdesc:ga9a1968c384ec7abb6122830253ebf570"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 12-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga9a1968c384ec7abb6122830253ebf570">More...</a><br /></td></tr>
279 <tr class="separator:ga9a1968c384ec7abb6122830253ebf570"><td class="memSeparator" colspan="2">&#160;</td></tr>
280 <tr class="memitem:ga77901b71d0471784f318ada31ff4e7bd"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd">tj3Compress16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned short *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
281 <tr class="memdesc:ga77901b71d0471784f318ada31ff4e7bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 16-bit-per-sample lossless JPEG image.  <a href="group___turbo_j_p_e_g.html#ga77901b71d0471784f318ada31ff4e7bd">More...</a><br /></td></tr>
282 <tr class="separator:ga77901b71d0471784f318ada31ff4e7bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
283 <tr class="memitem:ga041c870d9c669eb3f385c78f4346c43f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f">tj3CompressFromYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int align, int height, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
284 <tr class="memdesc:ga041c870d9c669eb3f385c78f4346c43f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#ga041c870d9c669eb3f385c78f4346c43f">More...</a><br /></td></tr>
285 <tr class="separator:ga041c870d9c669eb3f385c78f4346c43f"><td class="memSeparator" colspan="2">&#160;</td></tr>
286 <tr class="memitem:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0">tj3CompressFromYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *const *srcPlanes, int width, const int *strides, int height, unsigned char **jpegBuf, size_t *jpegSize)</td></tr>
287 <tr class="memdesc:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample JPEG image.  <a href="group___turbo_j_p_e_g.html#gac9f5ace3e73805b476c95dda9f8d0cd0">More...</a><br /></td></tr>
288 <tr class="separator:gac9f5ace3e73805b476c95dda9f8d0cd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
289 <tr class="memitem:gac6285e58e35a35d871d7162ec5a929c4"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4">tj3JPEGBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
290 <tr class="memdesc:gac6285e58e35a35d871d7162ec5a929c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.  <a href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4">More...</a><br /></td></tr>
291 <tr class="separator:gac6285e58e35a35d871d7162ec5a929c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
292 <tr class="memitem:gaaebaa16973a0f550a66eca5765ed0546"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546">tj3YUVBufSize</a> (int width, int align, int height, int subsamp)</td></tr>
293 <tr class="memdesc:gaaebaa16973a0f550a66eca5765ed0546"><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the buffer (in bytes) required to hold a unified planar YUV image with the given parameters.  <a href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546">More...</a><br /></td></tr>
294 <tr class="separator:gaaebaa16973a0f550a66eca5765ed0546"><td class="memSeparator" colspan="2">&#160;</td></tr>
295 <tr class="memitem:gacc19d265edce76b46146f59579f9438d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d">tj3YUVPlaneSize</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>
296 <tr class="memdesc:gacc19d265edce76b46146f59579f9438d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d">More...</a><br /></td></tr>
297 <tr class="separator:gacc19d265edce76b46146f59579f9438d"><td class="memSeparator" colspan="2">&#160;</td></tr>
298 <tr class="memitem:gac99d1933ede1d59fcada9a826e88eb2d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d">tj3YUVPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>
299 <tr class="memdesc:gac99d1933ede1d59fcada9a826e88eb2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">The plane width of a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#gac99d1933ede1d59fcada9a826e88eb2d">More...</a><br /></td></tr>
300 <tr class="separator:gac99d1933ede1d59fcada9a826e88eb2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
301 <tr class="memitem:ga969767ec8180cc3edd99cf507f87299b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b">tj3YUVPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>
302 <tr class="memdesc:ga969767ec8180cc3edd99cf507f87299b"><td class="mdescLeft">&#160;</td><td class="mdescRight">The plane height of a YUV image plane with the given parameters.  <a href="group___turbo_j_p_e_g.html#ga969767ec8180cc3edd99cf507f87299b">More...</a><br /></td></tr>
303 <tr class="separator:ga969767ec8180cc3edd99cf507f87299b"><td class="memSeparator" colspan="2">&#160;</td></tr>
304 <tr class="memitem:ga2a8d50f130bde10f0a04030f8cc59936"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936">tj3EncodeYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int align)</td></tr>
305 <tr class="memdesc:ga2a8d50f130bde10f0a04030f8cc59936"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into an 8-bit-per-sample unified planar YUV image.  <a href="group___turbo_j_p_e_g.html#ga2a8d50f130bde10f0a04030f8cc59936">More...</a><br /></td></tr>
306 <tr class="separator:ga2a8d50f130bde10f0a04030f8cc59936"><td class="memSeparator" colspan="2">&#160;</td></tr>
307 <tr class="memitem:gae2e9df38790e9bddc249d04cb158a4cf"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf">tj3EncodeYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides)</td></tr>
308 <tr class="memdesc:gae2e9df38790e9bddc249d04cb158a4cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#gae2e9df38790e9bddc249d04cb158a4cf">More...</a><br /></td></tr>
309 <tr class="separator:gae2e9df38790e9bddc249d04cb158a4cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
310 <tr class="memitem:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1">tj3DecompressHeader</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize)</td></tr>
311 <tr class="memdesc:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables.  <a href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1">More...</a><br /></td></tr>
312 <tr class="separator:ga96d2c4b3432f9d88ad14758ae240b8d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
313 <tr class="memitem:ga74397f8e0587d4233182c72f085aaf04"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04">tj3GetScalingFactors</a> (int *numScalingFactors)</td></tr>
314 <tr class="memdesc:ga74397f8e0587d4233182c72f085aaf04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of fractional scaling factors that the JPEG decompressor supports.  <a href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04">More...</a><br /></td></tr>
315 <tr class="separator:ga74397f8e0587d4233182c72f085aaf04"><td class="memSeparator" colspan="2">&#160;</td></tr>
316 <tr class="memitem:ga89da17ee1e43ff423382cbc145803c75"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75">tj3SetScalingFactor</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> scalingFactor)</td></tr>
317 <tr class="memdesc:ga89da17ee1e43ff423382cbc145803c75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the scaling factor for subsequent lossy decompression operations.  <a href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75">More...</a><br /></td></tr>
318 <tr class="separator:ga89da17ee1e43ff423382cbc145803c75"><td class="memSeparator" colspan="2">&#160;</td></tr>
319 <tr class="memitem:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c">tj3SetCroppingRegion</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, <a class="el" href="structtjregion.html">tjregion</a> croppingRegion)</td></tr>
320 <tr class="memdesc:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.  <a href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c">More...</a><br /></td></tr>
321 <tr class="separator:gaa49c7bd4c9431667a043cfc93388ba1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
322 <tr class="memitem:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013">tj3Decompress8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char *dstBuf, int pitch, int pixelFormat)</td></tr>
323 <tr class="memdesc:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#ga1169c7c1a26ec18c9e6122cb8ae64013">More...</a><br /></td></tr>
324 <tr class="separator:ga1169c7c1a26ec18c9e6122cb8ae64013"><td class="memSeparator" colspan="2">&#160;</td></tr>
325 <tr class="memitem:ga39b848f01781ad74a5b3941c012b6199"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199">tj3Decompress12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, short *dstBuf, int pitch, int pixelFormat)</td></tr>
326 <tr class="memdesc:ga39b848f01781ad74a5b3941c012b6199"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a 12-bit-per-sample JPEG image into a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#ga39b848f01781ad74a5b3941c012b6199">More...</a><br /></td></tr>
327 <tr class="separator:ga39b848f01781ad74a5b3941c012b6199"><td class="memSeparator" colspan="2">&#160;</td></tr>
328 <tr class="memitem:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e">tj3Decompress16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned short *dstBuf, int pitch, int pixelFormat)</td></tr>
329 <tr class="memdesc:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a 16-bit-per-sample lossless JPEG image into a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#gaa074e63f9beb0b3ff42b833a4049df6e">More...</a><br /></td></tr>
330 <tr class="separator:gaa074e63f9beb0b3ff42b833a4049df6e"><td class="memSeparator" colspan="2">&#160;</td></tr>
331 <tr class="memitem:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320">tj3DecompressToYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char *dstBuf, int align)</td></tr>
332 <tr class="memdesc:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample unified planar YUV image.  <a href="group___turbo_j_p_e_g.html#ga1e6bf6a19fec3f9fa7534348879d8320">More...</a><br /></td></tr>
333 <tr class="separator:ga1e6bf6a19fec3f9fa7534348879d8320"><td class="memSeparator" colspan="2">&#160;</td></tr>
334 <tr class="memitem:ga934373482dbbf257f2280505b6ff4fb5"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5">tj3DecompressToYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, unsigned char **dstPlanes, int *strides)</td></tr>
335 <tr class="memdesc:ga934373482dbbf257f2280505b6ff4fb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress an 8-bit-per-sample JPEG image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#ga934373482dbbf257f2280505b6ff4fb5">More...</a><br /></td></tr>
336 <tr class="separator:ga934373482dbbf257f2280505b6ff4fb5"><td class="memSeparator" colspan="2">&#160;</td></tr>
337 <tr class="memitem:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c">tj3DecodeYUV8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int align, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat)</td></tr>
338 <tr class="memdesc:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample packed-pixel RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#gaa1eb574f38b1c1de43a6c7aafcf68d8c">More...</a><br /></td></tr>
339 <tr class="separator:gaa1eb574f38b1c1de43a6c7aafcf68d8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
340 <tr class="memitem:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89">tj3DecodeYUVPlanes8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *const *srcPlanes, const int *strides, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat)</td></tr>
341 <tr class="memdesc:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample packed-pixel RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#gad366f1915f82c1ad4e7e37ebe073ca89">More...</a><br /></td></tr>
342 <tr class="separator:gad366f1915f82c1ad4e7e37ebe073ca89"><td class="memSeparator" colspan="2">&#160;</td></tr>
343 <tr class="memitem:gaff23ba1dcabed456794b844791613920"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920">tj3Transform</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, size_t jpegSize, int n, unsigned char **dstBufs, size_t *dstSizes, const <a class="el" href="structtjtransform.html">tjtransform</a> *transforms)</td></tr>
344 <tr class="memdesc:gaff23ba1dcabed456794b844791613920"><td class="mdescLeft">&#160;</td><td class="mdescRight">Losslessly transform a JPEG image into another JPEG image.  <a href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920">More...</a><br /></td></tr>
345 <tr class="separator:gaff23ba1dcabed456794b844791613920"><td class="memSeparator" colspan="2">&#160;</td></tr>
346 <tr class="memitem:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82">tj3Destroy</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
347 <tr class="memdesc:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a TurboJPEG instance.  <a href="group___turbo_j_p_e_g.html#ga53fbadf4560e95a65b8f5ab81703fe82">More...</a><br /></td></tr>
348 <tr class="separator:ga53fbadf4560e95a65b8f5ab81703fe82"><td class="memSeparator" colspan="2">&#160;</td></tr>
349 <tr class="memitem:gab40a0b231122f536e503e3394569a68d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d">tj3Alloc</a> (size_t bytes)</td></tr>
350 <tr class="memdesc:gab40a0b231122f536e503e3394569a68d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a byte buffer for use with TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d">More...</a><br /></td></tr>
351 <tr class="separator:gab40a0b231122f536e503e3394569a68d"><td class="memSeparator" colspan="2">&#160;</td></tr>
352 <tr class="memitem:ga565aaae7be3f8ca9099b56655c893251"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251">tj3LoadImage8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
353 <tr class="memdesc:ga565aaae7be3f8ca9099b56655c893251"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load an 8-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251">More...</a><br /></td></tr>
354 <tr class="separator:ga565aaae7be3f8ca9099b56655c893251"><td class="memSeparator" colspan="2">&#160;</td></tr>
355 <tr class="memitem:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT short *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f">tj3LoadImage12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
356 <tr class="memdesc:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a 12-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f">More...</a><br /></td></tr>
357 <tr class="separator:ga1f03c26892a26d4ce077ed6a4ac40e8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
358 <tr class="memitem:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned short *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc">tj3LoadImage16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, int *width, int align, int *height, int *pixelFormat)</td></tr>
359 <tr class="memdesc:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load a 16-bit-per-sample packed-pixel image from disk into memory.  <a href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc">More...</a><br /></td></tr>
360 <tr class="separator:ga638aeba63e0ccb89d472fdbf34224cfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
361 <tr class="memitem:gaa4ec838988e469cc15618e4690cc8722"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722">tj3SaveImage8</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const unsigned char *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
362 <tr class="memdesc:gaa4ec838988e469cc15618e4690cc8722"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save an 8-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722">More...</a><br /></td></tr>
363 <tr class="separator:gaa4ec838988e469cc15618e4690cc8722"><td class="memSeparator" colspan="2">&#160;</td></tr>
364 <tr class="memitem:ga7c64b5106d04267a46aad85f9714ad90"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90">tj3SaveImage12</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const short *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
365 <tr class="memdesc:ga7c64b5106d04267a46aad85f9714ad90"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save a 12-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#ga7c64b5106d04267a46aad85f9714ad90">More...</a><br /></td></tr>
366 <tr class="separator:ga7c64b5106d04267a46aad85f9714ad90"><td class="memSeparator" colspan="2">&#160;</td></tr>
367 <tr class="memitem:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71">tj3SaveImage16</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const char *filename, const unsigned short *buffer, int width, int pitch, int height, int pixelFormat)</td></tr>
368 <tr class="memdesc:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save a 16-bit-per-sample packed-pixel image from memory to disk.  <a href="group___turbo_j_p_e_g.html#ga0fd87851f4266aca24bf4594dd0c0e71">More...</a><br /></td></tr>
369 <tr class="separator:ga0fd87851f4266aca24bf4594dd0c0e71"><td class="memSeparator" colspan="2">&#160;</td></tr>
370 <tr class="memitem:gaddb84fb6c81769e9faa0f5a63b296606"><td class="memItemLeft" align="right" valign="top">DLLEXPORT void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606">tj3Free</a> (void *buffer)</td></tr>
371 <tr class="memdesc:gaddb84fb6c81769e9faa0f5a63b296606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free a byte buffer previously allocated by TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606">More...</a><br /></td></tr>
372 <tr class="separator:gaddb84fb6c81769e9faa0f5a63b296606"><td class="memSeparator" colspan="2">&#160;</td></tr>
373 <tr class="memitem:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2">tj3GetErrorStr</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
374 <tr class="memdesc:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a descriptive error message explaining why the last command failed.  <a href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2">More...</a><br /></td></tr>
375 <tr class="separator:gaf2aab0e6dbb3edc57646b0fec25e8bb2"><td class="memSeparator" colspan="2">&#160;</td></tr>
376 <tr class="memitem:gab8c8279f1415fe425ff30dbbc56013bd"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd">tj3GetErrorCode</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
377 <tr class="memdesc:gab8c8279f1415fe425ff30dbbc56013bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a code indicating the severity of the last error.  <a href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd">More...</a><br /></td></tr>
378 <tr class="separator:gab8c8279f1415fe425ff30dbbc56013bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
379 </table><table class="memberdecls">
380 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
381 Variables</h2></td></tr>
382 <tr class="memitem:ga9e61e7cd47a15a173283ba94e781308c"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c">tjMCUWidth</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td></tr>
383 <tr class="memdesc:ga9e61e7cd47a15a173283ba94e781308c"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCU block width (in pixels) for a given level of chrominance subsampling.  <a href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c">More...</a><br /></td></tr>
384 <tr class="separator:ga9e61e7cd47a15a173283ba94e781308c"><td class="memSeparator" colspan="2">&#160;</td></tr>
385 <tr class="memitem:gabd247bb9fecb393eca57366feb8327bf"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf">tjMCUHeight</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td></tr>
386 <tr class="memdesc:gabd247bb9fecb393eca57366feb8327bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">MCU block height (in pixels) for a given level of chrominance subsampling.  <a href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf">More...</a><br /></td></tr>
387 <tr class="separator:gabd247bb9fecb393eca57366feb8327bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
388 <tr class="memitem:gadd9b446742ac8a3923f7992c7988fea8"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8">tjRedOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
389 <tr class="memdesc:gadd9b446742ac8a3923f7992c7988fea8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Red offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8">More...</a><br /></td></tr>
390 <tr class="separator:gadd9b446742ac8a3923f7992c7988fea8"><td class="memSeparator" colspan="2">&#160;</td></tr>
391 <tr class="memitem:ga82d6e35da441112a411da41923c0ba2f"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f">tjGreenOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
392 <tr class="memdesc:ga82d6e35da441112a411da41923c0ba2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Green offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f">More...</a><br /></td></tr>
393 <tr class="separator:ga82d6e35da441112a411da41923c0ba2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
394 <tr class="memitem:ga84e2e35d3f08025f976ec1ec53693dea"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea">tjBlueOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
395 <tr class="memdesc:ga84e2e35d3f08025f976ec1ec53693dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blue offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea">More...</a><br /></td></tr>
396 <tr class="separator:ga84e2e35d3f08025f976ec1ec53693dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
397 <tr class="memitem:ga5af0ab065feefd526debf1e20c43e837"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837">tjAlphaOffset</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
398 <tr class="memdesc:ga5af0ab065feefd526debf1e20c43e837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alpha offset (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837">More...</a><br /></td></tr>
399 <tr class="separator:ga5af0ab065feefd526debf1e20c43e837"><td class="memSeparator" colspan="2">&#160;</td></tr>
400 <tr class="memitem:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="memItemLeft" align="right" valign="top">static const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c">tjPixelSize</a> [<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td></tr>
401 <tr class="memdesc:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel size (in samples) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c">More...</a><br /></td></tr>
402 <tr class="separator:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
403 <tr class="memitem:ga6f192ad58a5a5802e145149d83c643bf"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="structtjregion.html">tjregion</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf">TJUNCROPPED</a></td></tr>
404 <tr class="memdesc:ga6f192ad58a5a5802e145149d83c643bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies no cropping.  <a href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf">More...</a><br /></td></tr>
405 <tr class="separator:ga6f192ad58a5a5802e145149d83c643bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
406 <tr class="memitem:ga7880644a0849161ad20933536169ee19"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19">TJUNSCALED</a></td></tr>
407 <tr class="memdesc:ga7880644a0849161ad20933536169ee19"><td class="mdescLeft">&#160;</td><td class="mdescRight">A <a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a scaling factor of 1/1 (no scaling)  <a href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19">More...</a><br /></td></tr>
408 <tr class="separator:ga7880644a0849161ad20933536169ee19"><td class="memSeparator" colspan="2">&#160;</td></tr>
409 </table>
410 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
411 <p>TurboJPEG API. </p>
412 <p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>
413 <p><a class="anchor" id="YUVnotes"></a></p>
414 <h2><a class="anchor" id="autotoc_md0"></a>
415 YUV Image Format Notes</h2>
416 <p>Technically, the JPEG format uses the YCbCr colorspace (which is technically not a colorspace but a color transform), but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
417 <p>Each plane is simply a 2D array of bytes, each byte representing the value of one of the components (Y, Cb, or Cr) at a particular location in the image. The width and height of each plane are determined by the image width, height, and level of chrominance subsampling. The luminance plane width is the image width padded to the nearest multiple of the horizontal subsampling factor (1 in the case of 4:4:4, grayscale, 4:4:0, or 4:4:1; 2 in the case of 4:2:2 or 4:2:0; 4 in the case of 4:1:1.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (1 in the case of 4:4:4, 4:2:2, grayscale, or 4:1:1; 2 in the case of 4:2:0 or 4:4:0; 4 in the case of 4:4:1.) This is irrespective of any additional padding that may be specified as an argument to the various YUV functions. The chrominance plane width is equal to the luminance plane width divided by the horizontal subsampling factor, and the chrominance plane height is equal to the luminance plane height divided by the vertical subsampling factor.</p>
418 <p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 18 x 35 bytes. If you specify a row alignment of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 20 x 35 bytes. </p>
419 <h2 class="groupheader">Macro Definition Documentation</h2>
420 <a id="ga39f57a6fb02d9cf32e7b6890099b5a71"></a>
421 <h2 class="memtitle"><span class="permalink"><a href="#ga39f57a6fb02d9cf32e7b6890099b5a71">&#9670;&nbsp;</a></span>TJ_NUMCS</h2>
422
423 <div class="memitem">
424 <div class="memproto">
425       <table class="memname">
426         <tr>
427           <td class="memname">#define TJ_NUMCS</td>
428         </tr>
429       </table>
430 </div><div class="memdoc">
431
432 <p>The number of JPEG colorspaces. </p>
433
434 </div>
435 </div>
436 <a id="ga79bde1b4a3e2351e00887e47781b966e"></a>
437 <h2 class="memtitle"><span class="permalink"><a href="#ga79bde1b4a3e2351e00887e47781b966e">&#9670;&nbsp;</a></span>TJ_NUMERR</h2>
438
439 <div class="memitem">
440 <div class="memproto">
441       <table class="memname">
442         <tr>
443           <td class="memname">#define TJ_NUMERR</td>
444         </tr>
445       </table>
446 </div><div class="memdoc">
447
448 <p>The number of error codes. </p>
449
450 </div>
451 </div>
452 <a id="ga5e0e8c784295c636f0bf8dab93c4bddf"></a>
453 <h2 class="memtitle"><span class="permalink"><a href="#ga5e0e8c784295c636f0bf8dab93c4bddf">&#9670;&nbsp;</a></span>TJ_NUMINIT</h2>
454
455 <div class="memitem">
456 <div class="memproto">
457       <table class="memname">
458         <tr>
459           <td class="memname">#define TJ_NUMINIT</td>
460         </tr>
461       </table>
462 </div><div class="memdoc">
463
464 <p>The number of initialization options. </p>
465
466 </div>
467 </div>
468 <a id="gaa628be5db276fc3676dfba205d45d780"></a>
469 <h2 class="memtitle"><span class="permalink"><a href="#gaa628be5db276fc3676dfba205d45d780">&#9670;&nbsp;</a></span>TJ_NUMPARAM</h2>
470
471 <div class="memitem">
472 <div class="memproto">
473       <table class="memname">
474         <tr>
475           <td class="memname">#define TJ_NUMPARAM</td>
476         </tr>
477       </table>
478 </div><div class="memdoc">
479
480 <p>The number of parameters. </p>
481
482 </div>
483 </div>
484 <a id="ga7010a4402f54a45ba822ad8675a4655e"></a>
485 <h2 class="memtitle"><span class="permalink"><a href="#ga7010a4402f54a45ba822ad8675a4655e">&#9670;&nbsp;</a></span>TJ_NUMPF</h2>
486
487 <div class="memitem">
488 <div class="memproto">
489       <table class="memname">
490         <tr>
491           <td class="memname">#define TJ_NUMPF</td>
492         </tr>
493       </table>
494 </div><div class="memdoc">
495
496 <p>The number of pixel formats. </p>
497
498 </div>
499 </div>
500 <a id="ga5ef3d169162ce77ce348e292a0b7477c"></a>
501 <h2 class="memtitle"><span class="permalink"><a href="#ga5ef3d169162ce77ce348e292a0b7477c">&#9670;&nbsp;</a></span>TJ_NUMSAMP</h2>
502
503 <div class="memitem">
504 <div class="memproto">
505       <table class="memname">
506         <tr>
507           <td class="memname">#define TJ_NUMSAMP</td>
508         </tr>
509       </table>
510 </div><div class="memdoc">
511
512 <p>The number of chrominance subsampling options. </p>
513
514 </div>
515 </div>
516 <a id="ga0f6dbd18adf38b7d46ac547f0f4d562c"></a>
517 <h2 class="memtitle"><span class="permalink"><a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c">&#9670;&nbsp;</a></span>TJ_NUMXOP</h2>
518
519 <div class="memitem">
520 <div class="memproto">
521       <table class="memname">
522         <tr>
523           <td class="memname">#define TJ_NUMXOP</td>
524         </tr>
525       </table>
526 </div><div class="memdoc">
527
528 <p>The number of transform operations. </p>
529
530 </div>
531 </div>
532 <a id="ga84878bb65404204743aa18cac02781df"></a>
533 <h2 class="memtitle"><span class="permalink"><a href="#ga84878bb65404204743aa18cac02781df">&#9670;&nbsp;</a></span>TJSCALED</h2>
534
535 <div class="memitem">
536 <div class="memproto">
537       <table class="memname">
538         <tr>
539           <td class="memname">#define TJSCALED</td>
540           <td>(</td>
541           <td class="paramtype">&#160;</td>
542           <td class="paramname">dimension, </td>
543         </tr>
544         <tr>
545           <td class="paramkey"></td>
546           <td></td>
547           <td class="paramtype">&#160;</td>
548           <td class="paramname">scalingFactor&#160;</td>
549         </tr>
550         <tr>
551           <td></td>
552           <td>)</td>
553           <td></td><td></td>
554         </tr>
555       </table>
556 </div><div class="memdoc">
557
558 <p>Compute the scaled value of <code>dimension</code> using the given scaling factor. </p>
559 <p>This macro performs the integer equivalent of <code>ceil(dimension * scalingFactor)</code>. </p>
560
561 </div>
562 </div>
563 <a id="gaecaaa3b7e2af812592c015d83207f010"></a>
564 <h2 class="memtitle"><span class="permalink"><a href="#gaecaaa3b7e2af812592c015d83207f010">&#9670;&nbsp;</a></span>TJXOPT_ARITHMETIC</h2>
565
566 <div class="memitem">
567 <div class="memproto">
568       <table class="memname">
569         <tr>
570           <td class="memname">#define TJXOPT_ARITHMETIC</td>
571         </tr>
572       </table>
573 </div><div class="memdoc">
574
575 <p>This option will enable arithmetic entropy coding in the JPEG image generated by this particular transform. </p>
576 <p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>. </p>
577
578 </div>
579 </div>
580 <a id="ga153b468cfb905d0de61706c838986fe8"></a>
581 <h2 class="memtitle"><span class="permalink"><a href="#ga153b468cfb905d0de61706c838986fe8">&#9670;&nbsp;</a></span>TJXOPT_COPYNONE</h2>
582
583 <div class="memitem">
584 <div class="memproto">
585       <table class="memname">
586         <tr>
587           <td class="memname">#define TJXOPT_COPYNONE</td>
588         </tr>
589       </table>
590 </div><div class="memdoc">
591
592 <p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the destination image. </p>
593
594 </div>
595 </div>
596 <a id="ga9c771a757fc1294add611906b89ab2d2"></a>
597 <h2 class="memtitle"><span class="permalink"><a href="#ga9c771a757fc1294add611906b89ab2d2">&#9670;&nbsp;</a></span>TJXOPT_CROP</h2>
598
599 <div class="memitem">
600 <div class="memproto">
601       <table class="memname">
602         <tr>
603           <td class="memname">#define TJXOPT_CROP</td>
604         </tr>
605       </table>
606 </div><div class="memdoc">
607
608 <p>This option will enable lossless cropping. </p>
609 <p>See <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> for more information. </p>
610
611 </div>
612 </div>
613 <a id="ga3acee7b48ade1b99e5588736007c2589"></a>
614 <h2 class="memtitle"><span class="permalink"><a href="#ga3acee7b48ade1b99e5588736007c2589">&#9670;&nbsp;</a></span>TJXOPT_GRAY</h2>
615
616 <div class="memitem">
617 <div class="memproto">
618       <table class="memname">
619         <tr>
620           <td class="memname">#define TJXOPT_GRAY</td>
621         </tr>
622       </table>
623 </div><div class="memdoc">
624
625 <p>This option will discard the color data in the source image and produce a grayscale destination image. </p>
626
627 </div>
628 </div>
629 <a id="gafbf992bbf6e006705886333703ffab31"></a>
630 <h2 class="memtitle"><span class="permalink"><a href="#gafbf992bbf6e006705886333703ffab31">&#9670;&nbsp;</a></span>TJXOPT_NOOUTPUT</h2>
631
632 <div class="memitem">
633 <div class="memproto">
634       <table class="memname">
635         <tr>
636           <td class="memname">#define TJXOPT_NOOUTPUT</td>
637         </tr>
638       </table>
639 </div><div class="memdoc">
640
641 <p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> from outputting a JPEG image for this particular transform. </p>
642 <p>(This can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>
643
644 </div>
645 </div>
646 <a id="ga6bedf37aa9e1122f3ec9f7302ca59117"></a>
647 <h2 class="memtitle"><span class="permalink"><a href="#ga6bedf37aa9e1122f3ec9f7302ca59117">&#9670;&nbsp;</a></span>TJXOPT_OPTIMIZE</h2>
648
649 <div class="memitem">
650 <div class="memproto">
651       <table class="memname">
652         <tr>
653           <td class="memname">#define TJXOPT_OPTIMIZE</td>
654         </tr>
655       </table>
656 </div><div class="memdoc">
657
658 <p>This option will enable optimized baseline entropy coding in the JPEG image generated by this particular transform. </p>
659 <p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less.) </p>
660
661 </div>
662 </div>
663 <a id="ga50e03cb5ed115330e212417429600b00"></a>
664 <h2 class="memtitle"><span class="permalink"><a href="#ga50e03cb5ed115330e212417429600b00">&#9670;&nbsp;</a></span>TJXOPT_PERFECT</h2>
665
666 <div class="memitem">
667 <div class="memproto">
668       <table class="memname">
669         <tr>
670           <td class="memname">#define TJXOPT_PERFECT</td>
671         </tr>
672       </table>
673 </div><div class="memdoc">
674
675 <p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to return an error if the transform is not perfect. </p>
676 <p>Lossless transforms operate on MCU blocks, whose size depends on the level of chrominance subsampling used (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) If the image's width or height is not evenly divisible by the MCU block size, then there will be partial MCU blocks on the right and/or bottom edges. It is not possible to move these partial MCU blocks to the top or left of the image, so any transform that would require that is "imperfect." If this option is not specified, then any partial MCU blocks that cannot be transformed will be left in place, which will create odd-looking strips on the right or bottom edge of the image. </p>
677
678 </div>
679 </div>
680 <a id="gad2371c80674584ecc1a7d75e564cf026"></a>
681 <h2 class="memtitle"><span class="permalink"><a href="#gad2371c80674584ecc1a7d75e564cf026">&#9670;&nbsp;</a></span>TJXOPT_PROGRESSIVE</h2>
682
683 <div class="memitem">
684 <div class="memproto">
685       <table class="memname">
686         <tr>
687           <td class="memname">#define TJXOPT_PROGRESSIVE</td>
688         </tr>
689       </table>
690 </div><div class="memdoc">
691
692 <p>This option will enable progressive entropy coding in the JPEG image generated by this particular transform. </p>
693 <p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a> is also specified. </p>
694
695 </div>
696 </div>
697 <a id="ga319826b7eb1583c0595bbe7b95428709"></a>
698 <h2 class="memtitle"><span class="permalink"><a href="#ga319826b7eb1583c0595bbe7b95428709">&#9670;&nbsp;</a></span>TJXOPT_TRIM</h2>
699
700 <div class="memitem">
701 <div class="memproto">
702       <table class="memname">
703         <tr>
704           <td class="memname">#define TJXOPT_TRIM</td>
705         </tr>
706       </table>
707 </div><div class="memdoc">
708
709 <p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> to discard any partial MCU blocks that cannot be transformed. </p>
710
711 </div>
712 </div>
713 <h2 class="groupheader">Typedef Documentation</h2>
714 <a id="ga758d2634ecb4949de7815cba621f5763"></a>
715 <h2 class="memtitle"><span class="permalink"><a href="#ga758d2634ecb4949de7815cba621f5763">&#9670;&nbsp;</a></span>tjhandle</h2>
716
717 <div class="memitem">
718 <div class="memproto">
719       <table class="memname">
720         <tr>
721           <td class="memname">typedef void* <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a></td>
722         </tr>
723       </table>
724 </div><div class="memdoc">
725
726 <p>TurboJPEG instance handle. </p>
727
728 </div>
729 </div>
730 <a id="ga504805ec0161f1b505397ca0118bf8fd"></a>
731 <h2 class="memtitle"><span class="permalink"><a href="#ga504805ec0161f1b505397ca0118bf8fd">&#9670;&nbsp;</a></span>tjtransform</h2>
732
733 <div class="memitem">
734 <div class="memproto">
735       <table class="memname">
736         <tr>
737           <td class="memname">typedef struct <a class="el" href="structtjtransform.html">tjtransform</a> <a class="el" href="structtjtransform.html">tjtransform</a></td>
738         </tr>
739       </table>
740 </div><div class="memdoc">
741
742 <p>Lossless transform. </p>
743
744 </div>
745 </div>
746 <h2 class="groupheader">Enumeration Type Documentation</h2>
747 <a id="ga4f83ad3368e0e29d1957be0efa7c3720"></a>
748 <h2 class="memtitle"><span class="permalink"><a href="#ga4f83ad3368e0e29d1957be0efa7c3720">&#9670;&nbsp;</a></span>TJCS</h2>
749
750 <div class="memitem">
751 <div class="memproto">
752       <table class="memname">
753         <tr>
754           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">TJCS</a></td>
755         </tr>
756       </table>
757 </div><div class="memdoc">
758
759 <p>JPEG colorspaces. </p>
760 <table class="fieldtable">
761 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555"></a>TJCS_RGB&#160;</td><td class="fielddoc"><p>RGB colorspace. </p>
762 <p>When compressing the JPEG image, the R, G, and B components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. RGB JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, but they cannot be compressed from or decompressed to planar YUV images. </p>
763 </td></tr>
764 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75"></a>TJCS_YCbCr&#160;</td><td class="fielddoc"><p>YCbCr colorspace. </p>
765 <p>YCbCr is not an absolute colorspace but rather a mathematical transformation of RGB designed solely for storage and transmission. YCbCr images must be converted to RGB before they can actually be displayed. In the YCbCr colorspace, the Y (luminance) component represents the black &amp; white portion of the original image, and the Cb and Cr (chrominance) components represent the color portion of the original image. Originally, the analog equivalent of this transformation allowed the same signal to drive both black &amp; white and color televisions, but JPEG images use YCbCr primarily because it allows the color data to be optionally subsampled for the purposes of reducing network or disk usage. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats. YCbCr JPEG images can also be compressed from and decompressed to planar YUV images. </p>
766 </td></tr>
767 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a"></a>TJCS_GRAY&#160;</td><td class="fielddoc"><p>Grayscale colorspace. </p>
768 <p>The JPEG image retains only the luminance data (Y component), and any color data from the source image is discarded. Grayscale JPEG images can be compressed from and decompressed to packed-pixel images with any of the extended RGB or grayscale pixel formats, or they can be compressed from and decompressed to planar YUV images. </p>
769 </td></tr>
770 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53"></a>TJCS_CMYK&#160;</td><td class="fielddoc"><p>CMYK colorspace. </p>
771 <p>When compressing the JPEG image, the C, M, Y, and K components in the source image are reordered into image planes, but no colorspace conversion or subsampling is performed. CMYK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
772 </td></tr>
773 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e"></a>TJCS_YCCK&#160;</td><td class="fielddoc"><p>YCCK colorspace. </p>
774 <p>YCCK (AKA "YCbCrK") is not an absolute colorspace but rather a mathematical transformation of CMYK designed solely for storage and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be reversibly transformed into YCCK, and as with YCbCr, the chrominance components in the YCCK pixels can be subsampled without incurring major perceptual loss. YCCK JPEG images can only be compressed from and decompressed to packed-pixel images with the CMYK pixel format. </p>
775 </td></tr>
776 </table>
777
778 </div>
779 </div>
780 <a id="gafbc17cfa57d0d5d11fea35ac025950fe"></a>
781 <h2 class="memtitle"><span class="permalink"><a href="#gafbc17cfa57d0d5d11fea35ac025950fe">&#9670;&nbsp;</a></span>TJERR</h2>
782
783 <div class="memitem">
784 <div class="memproto">
785       <table class="memname">
786         <tr>
787           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">TJERR</a></td>
788         </tr>
789       </table>
790 </div><div class="memdoc">
791
792 <p>Error codes. </p>
793 <table class="fieldtable">
794 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggafbc17cfa57d0d5d11fea35ac025950fea342dd6e2aedb47bb257b4e7568329b59"></a>TJERR_WARNING&#160;</td><td class="fielddoc"><p>The error was non-fatal and recoverable, but the destination image may still be corrupt. </p>
795 </td></tr>
796 <tr><td class="fieldname"><a id="ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a"></a>TJERR_FATAL&#160;</td><td class="fielddoc"><p>The error was fatal and non-recoverable. </p>
797 </td></tr>
798 </table>
799
800 </div>
801 </div>
802 <a id="ga3850bbee1313e752e667b4eb08b1e086"></a>
803 <h2 class="memtitle"><span class="permalink"><a href="#ga3850bbee1313e752e667b4eb08b1e086">&#9670;&nbsp;</a></span>TJINIT</h2>
804
805 <div class="memitem">
806 <div class="memproto">
807       <table class="memname">
808         <tr>
809           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">TJINIT</a></td>
810         </tr>
811       </table>
812 </div><div class="memdoc">
813
814 <p>Initialization options. </p>
815 <table class="fieldtable">
816 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086aa45ac279e3dc6ffabc4b0f45864da796"></a>TJINIT_COMPRESS&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for compression. </p>
817 </td></tr>
818 <tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086a4b8ca1ef700699b71350700bf95c2167"></a>TJINIT_DECOMPRESS&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for decompression. </p>
819 </td></tr>
820 <tr><td class="fieldname"><a id="gga3850bbee1313e752e667b4eb08b1e086a8d58a2a4c45b3e0cd349746544a6e0c2"></a>TJINIT_TRANSFORM&#160;</td><td class="fielddoc"><p>Initialize the TurboJPEG instance for lossless transformation (both compression and decompression.) </p>
821 </td></tr>
822 </table>
823
824 </div>
825 </div>
826 <a id="gaa0f6be63ba78278299c9f5c12031fe82"></a>
827 <h2 class="memtitle"><span class="permalink"><a href="#gaa0f6be63ba78278299c9f5c12031fe82">&#9670;&nbsp;</a></span>TJPARAM</h2>
828
829 <div class="memitem">
830 <div class="memproto">
831       <table class="memname">
832         <tr>
833           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">TJPARAM</a></td>
834         </tr>
835       </table>
836 </div><div class="memdoc">
837
838 <p>Parameters. </p>
839 <table class="fieldtable">
840 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a555e2212079fa49b30bcd2879c6c8ddb"></a>TJPARAM_STOPONWARNING&#160;</td><td class="fielddoc"><p>Error handling behavior. </p>
841 <p><b>Value</b></p><ul>
842 <li><code>0</code> <em>[default]</em> Allow the current compression/decompression/transform operation to complete unless a fatal error is encountered.</li>
843 <li><code>1</code> Immediately discontinue the current compression/decompression/transform operation if a warning (non-fatal error) occurs. </li>
844 </ul>
845 </td></tr>
846 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a924657172695ed6cb0b128219546fcce"></a>TJPARAM_BOTTOMUP&#160;</td><td class="fielddoc"><p>Row order in packed-pixel source/destination images. </p>
847 <p><b>Value</b></p><ul>
848 <li><code>0</code> <em>[default]</em> top-down (X11) order</li>
849 <li><code>1</code> bottom-up (Windows, OpenGL) order </li>
850 </ul>
851 </td></tr>
852 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b"></a>TJPARAM_NOREALLOC&#160;</td><td class="fielddoc"><p>JPEG destination buffer (re)allocation [compression, lossless transformation]. </p>
853 <p><b>Value</b></p><ul>
854 <li><code>0</code> <em>[default]</em> Attempt to allocate or reallocate the JPEG destination buffer as needed.</li>
855 <li><code>1</code> Generate an error if the JPEG destination buffer is invalid or too small. </li>
856 </ul>
857 </td></tr>
858 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0467e8792621f2d817dc2af563d3186c"></a>TJPARAM_QUALITY&#160;</td><td class="fielddoc"><p>Perceptual quality of lossy JPEG images [compression only]. </p>
859 <p><b>Value</b></p><ul>
860 <li><code>1</code>-<code>100</code> (<code>1</code> = worst quality but best compression, <code>100</code> = best quality but worst compression) <em>[no default; must be explicitly specified]</em> </li>
861 </ul>
862 </td></tr>
863 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a"></a>TJPARAM_SUBSAMP&#160;</td><td class="fielddoc"><p>Chrominance subsampling level. </p>
864 <p>The JPEG or YUV image uses (decompression, decoding) or will use (lossy compression, encoding) the specified level of chrominance subsampling.</p>
865 <p><b>Value</b></p><ul>
866 <li>One of the <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">chrominance subsampling options</a> <em>[no default; must be explicitly specified for lossy compression, encoding, and decoding]</em> </li>
867 </ul>
868 </td></tr>
869 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8"></a>TJPARAM_JPEGWIDTH&#160;</td><td class="fielddoc"><p>JPEG width (in pixels) [decompression only, read-only]. </p>
870 </td></tr>
871 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f"></a>TJPARAM_JPEGHEIGHT&#160;</td><td class="fielddoc"><p>JPEG height (in pixels) [decompression only, read-only]. </p>
872 </td></tr>
873 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8"></a>TJPARAM_PRECISION&#160;</td><td class="fielddoc"><p>JPEG data precision (bits per sample) [decompression only, read-only]. </p>
874 <p>The JPEG image uses the specified number of bits per sample.</p>
875 <p><b>Value</b></p><ul>
876 <li><code>8</code>, <code>12</code>, or <code>16</code></li>
877 </ul>
878 <p>12-bit data precision implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is set. </p>
879 </td></tr>
880 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a46a10d46309514907d0c39fcd86c324c"></a>TJPARAM_COLORSPACE&#160;</td><td class="fielddoc"><p>JPEG colorspace. </p>
881 <p>The JPEG image uses (decompression) or will use (lossy compression) the specified colorspace.</p>
882 <p><b>Value</b></p><ul>
883 <li>One of the <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a> <em>[default for lossy compression: automatically selected based on the subsampling level and pixel format]</em> </li>
884 </ul>
885 </td></tr>
886 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a0e051ac106f7b7402b690a5daf4869c0"></a>TJPARAM_FASTUPSAMPLE&#160;</td><td class="fielddoc"><p>Chrominance upsampling algorithm [lossy decompression only]. </p>
887 <p><b>Value</b></p><ul>
888 <li><code>0</code> <em>[default]</em> Use smooth upsampling when decompressing a JPEG image that was compressed using chrominance subsampling. This creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image.</li>
889 <li><code>1</code> Use the fastest chrominance upsampling algorithm available, which may combine upsampling with color conversion. </li>
890 </ul>
891 </td></tr>
892 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627"></a>TJPARAM_FASTDCT&#160;</td><td class="fielddoc"><p>DCT/IDCT algorithm [lossy compression and decompression]. </p>
893 <p><b>Value</b></p><ul>
894 <li><code>0</code> <em>[default]</em> Use the most accurate DCT/IDCT algorithm available.</li>
895 <li><code>1</code> Use the fastest DCT/IDCT algorithm available.</li>
896 </ul>
897 <p>This parameter is provided mainly for backward compatibility with libjpeg, which historically implemented several different DCT/IDCT algorithms because of performance limitations with 1990s CPUs. In the libjpeg-turbo implementation of the TurboJPEG API:</p><ul>
898 <li>The "fast" and "accurate" DCT/IDCT algorithms perform similarly on modern x86/x86-64 CPUs that support AVX2 instructions.</li>
899 <li>The "fast" algorithm is generally only about 5-15% faster than the "accurate" algorithm on other types of CPUs.</li>
900 <li>The difference in accuracy between the "fast" and "accurate" algorithms is the most pronounced at JPEG quality levels above 90 and tends to be more pronounced with decompression than with compression.</li>
901 <li>The "fast" algorithm degrades and is not fully accelerated for JPEG quality levels above 97, so it will be slower than the "accurate" algorithm. </li>
902 </ul>
903 </td></tr>
904 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6"></a>TJPARAM_OPTIMIZE&#160;</td><td class="fielddoc"><p>Optimized baseline entropy coding [lossy compression only]. </p>
905 <p><b>Value</b></p><ul>
906 <li><code>0</code> <em>[default]</em> The JPEG image will use the default Huffman tables.</li>
907 <li><code>1</code> Optimal Huffman tables will be computed for the JPEG image. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#ga6bedf37aa9e1122f3ec9f7302ca59117" title="This option will enable optimized baseline entropy coding in the JPEG image generated by this particu...">TJXOPT_OPTIMIZE</a>.</li>
908 </ul>
909 <p>Optimized baseline entropy coding will improve compression slightly (generally 5% or less), but it will reduce compression performance considerably. </p>
910 </td></tr>
911 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f"></a>TJPARAM_PROGRESSIVE&#160;</td><td class="fielddoc"><p>Progressive entropy coding. </p>
912 <p><b>Value</b></p><ul>
913 <li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) baseline entropy coding.</li>
914 <li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) progressive entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026" title="This option will enable progressive entropy coding in the JPEG image generated by this particular tra...">TJXOPT_PROGRESSIVE</a>.</li>
915 </ul>
916 <p>Progressive entropy coding will generally improve compression relative to baseline entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a>. Implies <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f0af9afc0b36443751f9ee82b760aa6" title="Optimized baseline entropy coding [lossy compression only].">TJPARAM_OPTIMIZE</a> unless <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7" title="Arithmetic entropy coding.">TJPARAM_ARITHMETIC</a> is also set. </p>
917 </td></tr>
918 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82ac478910e20ecf61b914f9824d80f8167"></a>TJPARAM_SCANLIMIT&#160;</td><td class="fielddoc"><p>Progressive JPEG scan limit for lossy JPEG images [decompression, lossless transformation]. </p>
919 <p>Setting this parameter will cause the decompression and transform functions to return an error if the number of scans in a progressive JPEG image exceeds the specified limit. The primary purpose of this is to allow security-critical applications to guard against an exploit of the progressive JPEG format described in <a href="https://libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf" target="_blank">this report</a>.</p>
920 <p><b>Value</b></p><ul>
921 <li>maximum number of progressive JPEG scans that the decompression and transform functions will process <em>[default: <code>0</code> (no limit)]</em></li>
922 </ul>
923 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a> </dd></dl>
924 </td></tr>
925 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a1c756757384308145602c040524aebf7"></a>TJPARAM_ARITHMETIC&#160;</td><td class="fielddoc"><p>Arithmetic entropy coding. </p>
926 <p><b>Value</b></p><ul>
927 <li><code>0</code> <em>[default for compression, lossless transformation]</em> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) Huffman entropy coding.</li>
928 <li><code>1</code> The lossy JPEG image uses (decompression) or will use (compression, lossless transformation) arithmetic entropy coding. For lossless transformation, this can also be specified using <a class="el" href="group___turbo_j_p_e_g.html#gaecaaa3b7e2af812592c015d83207f010" title="This option will enable arithmetic entropy coding in the JPEG image generated by this particular tran...">TJXOPT_ARITHMETIC</a>.</li>
929 </ul>
930 <p>Arithmetic entropy coding will generally improve compression relative to Huffman entropy coding, but it will reduce compression and decompression performance considerably. Can be combined with <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a1716f242b3859905b4a317dae8cfb75f" title="Progressive entropy coding.">TJPARAM_PROGRESSIVE</a>. </p>
931 </td></tr>
932 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f"></a>TJPARAM_LOSSLESS&#160;</td><td class="fielddoc"><p>Lossless JPEG. </p>
933 <p><b>Value</b></p><ul>
934 <li><code>0</code> <em>[default for compression]</em> The JPEG image is (decompression) or will be (compression) lossy/DCT-based.</li>
935 <li><code>1</code> The JPEG image is (decompression) or will be (compression) lossless/predictive.</li>
936 </ul>
937 <p>In most cases, compressing and decompressing lossless JPEG images is considerably slower than compressing and decompressing lossy JPEG images. Also note that the following features are not available with lossless JPEG images:</p><ul>
938 <li>Colorspace conversion (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555" title="RGB colorspace.">TJCS_RGB</a>, <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a" title="Grayscale colorspace.">TJCS_GRAY</a>, or <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53" title="CMYK colorspace.">TJCS_CMYK</a>, depending on the pixel format of the source image)</li>
939 <li>Chrominance subsampling (lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>)</li>
940 <li>JPEG quality selection</li>
941 <li>DCT/IDCT algorithm selection</li>
942 <li>Progressive entropy coding</li>
943 <li>Arithmetic entropy coding</li>
944 <li>Compression from/decompression to planar YUV images</li>
945 <li>Decompression scaling</li>
946 <li>Lossless transformation</li>
947 </ul>
948 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159" title="Lossless JPEG predictor selection value (PSV)">TJPARAM_LOSSLESSPSV</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a" title="Lossless JPEG point transform (Pt)">TJPARAM_LOSSLESSPT</a> </dd></dl>
949 </td></tr>
950 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82abcc997d40e5bec84817c12b76ef84159"></a>TJPARAM_LOSSLESSPSV&#160;</td><td class="fielddoc"><p>Lossless JPEG predictor selection value (PSV) </p>
951 <p><b>Value</b></p><ul>
952 <li><code>1</code>-<code>7</code> <em>[default for compression: <code>1</code>]</em></li>
953 </ul>
954 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a> </dd></dl>
955 </td></tr>
956 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4a6c6f25764ecaf4231a36bff844e46a"></a>TJPARAM_LOSSLESSPT&#160;</td><td class="fielddoc"><p>Lossless JPEG point transform (Pt) </p>
957 <p><b>Value</b></p><ul>
958 <li><code>0</code> through <em><b>precision</b></em> <em>- 1</em>, where <em><b>precision</b></em> is the JPEG data precision in bits <em>[default for compression: <code>0</code>]</em></li>
959 </ul>
960 <p>A point transform value of <code>0</code> is necessary in order to generate a fully lossless JPEG image. (A non-zero point transform value right-shifts the input samples by the specified number of bits, which is effectively a form of lossy color quantization.)</p>
961 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a781db82741934e8cd008d308597c59d8" title="JPEG data precision (bits per sample) [decompression only, read-only].">TJPARAM_PRECISION</a> </dd></dl>
962 </td></tr>
963 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec"></a>TJPARAM_RESTARTBLOCKS&#160;</td><td class="fielddoc"><p>JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only]. </p>
964 <p>The nature of entropy coding is such that a corrupt JPEG image cannot be decompressed beyond the point of corruption unless it contains restart markers. A restart marker stops and restarts the entropy coding algorithm so that, if a JPEG image is corrupted, decompression can resume at the next marker. Thus, adding more restart markers improves the fault tolerance of the JPEG image, but adding too many restart markers can adversely affect the compression ratio and performance.</p>
965 <p><b>Value</b></p><ul>
966 <li>the number of MCU blocks or samples between each restart marker <em>[default: <code>0</code> (no restart markers)]</em></li>
967 </ul>
968 <p>Setting this parameter to a non-zero value sets <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c" title="JPEG restart marker interval in MCU rows (lossy) or sample rows (lossless) [compression only].">TJPARAM_RESTARTROWS</a> to 0. </p>
969 </td></tr>
970 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a714367585952fe5c863f0dba5bd37e5c"></a>TJPARAM_RESTARTROWS&#160;</td><td class="fielddoc"><p>JPEG restart marker interval in MCU rows (lossy) or sample rows (lossless) [compression only]. </p>
971 <p>See <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec" title="JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only].">TJPARAM_RESTARTBLOCKS</a> for a description of restart markers.</p>
972 <p><b>Value</b></p><ul>
973 <li>the number of MCU rows or sample rows between each restart marker <em>[default: <code>0</code> (no restart markers)]</em></li>
974 </ul>
975 <p>Setting this parameter to a non-zero value sets <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a343c72883b7160f23f3ef46fc548a0ec" title="JPEG restart marker interval in MCU blocks (lossy) or samples (lossless) [compression only].">TJPARAM_RESTARTBLOCKS</a> to 0. </p>
976 </td></tr>
977 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877"></a>TJPARAM_XDENSITY&#160;</td><td class="fielddoc"><p>JPEG horizontal pixel density. </p>
978 <p><b>Value</b></p><ul>
979 <li>The JPEG image has (decompression) or will have (compression) the specified horizontal pixel density <em>[default for compression: <code>1</code>]</em>.</li>
980 </ul>
981 <p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value of #TJPARAM_DENSITYUNIT is <code>2</code>.</p>
982 <dl class="section see"><dt>See also</dt><dd>TJPARAM_DENSITYUNIT </dd></dl>
983 </td></tr>
984 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba"></a>TJPARAM_YDENSITY&#160;</td><td class="fielddoc"><p>JPEG vertical pixel density. </p>
985 <p><b>Value</b></p><ul>
986 <li>The JPEG image has (decompression) or will have (compression) the specified vertical pixel density <em>[default for compression: <code>1</code>]</em>.</li>
987 </ul>
988 <p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value of #TJPARAM_DENSITYUNIT is <code>2</code>.</p>
989 <dl class="section see"><dt>See also</dt><dd>TJPARAM_DENSITYUNIT </dd></dl>
990 </td></tr>
991 <tr><td class="fieldname"><a id="ggaa0f6be63ba78278299c9f5c12031fe82a4c045981bd8a303521a401dbbe1df208"></a>TJPARAM_DENSITYUNITS&#160;</td><td class="fielddoc"><p>JPEG pixel density units. </p>
992 <p><b>Value</b></p><ul>
993 <li><code>0</code> <em>[default for compression]</em> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in unknown units.</li>
994 <li><code>1</code> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in units of pixels/inch.</li>
995 <li><code>2</code> The pixel density of the JPEG image is expressed (decompression) or will be expressed (compression) in units of pixels/cm.</li>
996 </ul>
997 <p>This value is stored in or read from the JPEG header. It does not affect the contents of the JPEG image. Note that this parameter is set by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a> when loading a Windows BMP file that contains pixel density information, and the value of this parameter is stored to a Windows BMP file by <a class="el" href="group___turbo_j_p_e_g.html#gaa4ec838988e469cc15618e4690cc8722" title="Save an 8-bit-per-sample packed-pixel image from memory to disk.">tj3SaveImage8()</a> if the value is <code>2</code>.</p>
998 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a4de5c9d7cab5be806143a43c3b0e0877" title="JPEG horizontal pixel density.">TJPARAM_XDENSITY</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82abda48f2df7eb9b88e2b7621efb017eba" title="JPEG vertical pixel density.">TJPARAM_YDENSITY</a> </dd></dl>
999 </td></tr>
1000 </table>
1001
1002 </div>
1003 </div>
1004 <a id="gac916144e26c3817ac514e64ae5d12e2a"></a>
1005 <h2 class="memtitle"><span class="permalink"><a href="#gac916144e26c3817ac514e64ae5d12e2a">&#9670;&nbsp;</a></span>TJPF</h2>
1006
1007 <div class="memitem">
1008 <div class="memproto">
1009       <table class="memname">
1010         <tr>
1011           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">TJPF</a></td>
1012         </tr>
1013       </table>
1014 </div><div class="memdoc">
1015
1016 <p>Pixel formats. </p>
1017 <table class="fieldtable">
1018 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c"></a>TJPF_RGB&#160;</td><td class="fielddoc"><p>RGB pixel format. </p>
1019 <p>The red, green, and blue components in the image are stored in 3-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. </p>
1020 </td></tr>
1021 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839"></a>TJPF_BGR&#160;</td><td class="fielddoc"><p>BGR pixel format. </p>
1022 <p>The red, green, and blue components in the image are stored in 3-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. </p>
1023 </td></tr>
1024 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a>TJPF_RGBX&#160;</td><td class="fielddoc"><p>RGBX pixel format. </p>
1025 <p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
1026 </td></tr>
1027 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a>TJPF_BGRX&#160;</td><td class="fielddoc"><p>BGRX pixel format. </p>
1028 <p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from lowest to highest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
1029 </td></tr>
1030 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a>TJPF_XBGR&#160;</td><td class="fielddoc"><p>XBGR pixel format. </p>
1031 <p>The red, green, and blue components in the image are stored in 4-sample pixels in the order R, G, B from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
1032 </td></tr>
1033 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a>TJPF_XRGB&#160;</td><td class="fielddoc"><p>XRGB pixel format. </p>
1034 <p>The red, green, and blue components in the image are stored in 4-sample pixels in the order B, G, R from highest to lowest memory address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
1035 </td></tr>
1036 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a>TJPF_GRAY&#160;</td><td class="fielddoc"><p>Grayscale pixel format. </p>
1037 <p>Each 1-sample pixel represents a luminance (brightness) level from 0 to the maximum sample value (255 for 8-bit samples, 4095 for 12-bit samples, and 65535 for 16-bit samples.) </p>
1038 </td></tr>
1039 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a>TJPF_RGBA&#160;</td><td class="fielddoc"><p>RGBA pixel format. </p>
1040 <p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
1041 </td></tr>
1042 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a>TJPF_BGRA&#160;</td><td class="fielddoc"><p>BGRA pixel format. </p>
1043 <p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
1044 </td></tr>
1045 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a>TJPF_ABGR&#160;</td><td class="fielddoc"><p>ABGR pixel format. </p>
1046 <p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
1047 </td></tr>
1048 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a>TJPF_ARGB&#160;</td><td class="fielddoc"><p>ARGB pixel format. </p>
1049 <p>This is the same as <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, except that when decompressing, the X component is guaranteed to be equal to the maximum sample value, which can be interpreted as an opaque alpha channel. </p>
1050 </td></tr>
1051 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK&#160;</td><td class="fielddoc"><p>CMYK pixel format. </p>
1052 <p>Unlike RGB, which is an additive color model used primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive color model used primarily for printing. In the CMYK color model, the value of each color component typically corresponds to an amount of cyan, magenta, yellow, or black ink that is applied to a white background. In order to convert between CMYK and RGB, it is necessary to use a color management system (CMS.) A CMS will attempt to map colors within the printer's gamut to perceptually similar colors in the display's gamut and vice versa, but the mapping is typically not 1:1 or reversible, nor can it be defined with a simple formula. Thus, such a conversion is out of scope for a codec library. However, the TurboJPEG API allows for compressing packed-pixel CMYK images into YCCK JPEG images (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) and decompressing YCCK JPEG images into packed-pixel CMYK images. </p>
1053 </td></tr>
1054 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed"></a>TJPF_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown pixel format. </p>
1055 <p>Currently this is only used by <a class="el" href="group___turbo_j_p_e_g.html#ga565aaae7be3f8ca9099b56655c893251" title="Load an 8-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage8()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ga1f03c26892a26d4ce077ed6a4ac40e8f" title="Load a 12-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage12()</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga638aeba63e0ccb89d472fdbf34224cfc" title="Load a 16-bit-per-sample packed-pixel image from disk into memory.">tj3LoadImage16()</a>. </p>
1056 </td></tr>
1057 </table>
1058
1059 </div>
1060 </div>
1061 <a id="ga1d047060ea80bb9820d540bb928e9074"></a>
1062 <h2 class="memtitle"><span class="permalink"><a href="#ga1d047060ea80bb9820d540bb928e9074">&#9670;&nbsp;</a></span>TJSAMP</h2>
1063
1064 <div class="memitem">
1065 <div class="memproto">
1066       <table class="memname">
1067         <tr>
1068           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">TJSAMP</a></td>
1069         </tr>
1070       </table>
1071 </div><div class="memdoc">
1072
1073 <p>Chrominance subsampling options. </p>
1074 <p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity. (The human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
1075 <table class="fieldtable">
1076 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444&#160;</td><td class="fielddoc"><p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
1077 <p>The JPEG or YUV image will contain one chrominance component for every pixel in the source image. </p>
1078 </td></tr>
1079 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422&#160;</td><td class="fielddoc"><p>4:2:2 chrominance subsampling. </p>
1080 <p>The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image. </p>
1081 </td></tr>
1082 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420&#160;</td><td class="fielddoc"><p>4:2:0 chrominance subsampling. </p>
1083 <p>The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image. </p>
1084 </td></tr>
1085 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248"></a>TJSAMP_GRAY&#160;</td><td class="fielddoc"><p>Grayscale. </p>
1086 <p>The JPEG or YUV image will contain no chrominance components. </p>
1087 </td></tr>
1088 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440&#160;</td><td class="fielddoc"><p>4:4:0 chrominance subsampling. </p>
1089 <p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
1090 <dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
1091 </td></tr>
1092 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411&#160;</td><td class="fielddoc"><p>4:1:1 chrominance subsampling. </p>
1093 <p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
1094 <dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
1095 </td></tr>
1096 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3351696e1dd34a083a35b6be8b90122d"></a>TJSAMP_441&#160;</td><td class="fielddoc"><p>4:4:1 chrominance subsampling. </p>
1097 <p>The JPEG or YUV image will contain one chrominance component for every 1x4 block of pixels in the source image. JPEG images compressed with 4:4:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:4:1 is better able to reproduce sharp vertical features.</p>
1098 <dl class="section note"><dt>Note</dt><dd>4:4:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
1099 </td></tr>
1100 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173"></a>TJSAMP_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown subsampling. </p>
1101 <p>The JPEG image uses an unusual type of chrominance subsampling. Such images can be decompressed into packed-pixel images, but they cannot be</p><ul>
1102 <li>decompressed into planar YUV images,</li>
1103 <li>losslessly transformed if <a class="el" href="group___turbo_j_p_e_g.html#ga9c771a757fc1294add611906b89ab2d2" title="This option will enable lossless cropping.">TJXOPT_CROP</a> is specified, or</li>
1104 <li>partially decompressed using a cropping region. </li>
1105 </ul>
1106 </td></tr>
1107 </table>
1108
1109 </div>
1110 </div>
1111 <a id="ga2de531af4e7e6c4f124908376b354866"></a>
1112 <h2 class="memtitle"><span class="permalink"><a href="#ga2de531af4e7e6c4f124908376b354866">&#9670;&nbsp;</a></span>TJXOP</h2>
1113
1114 <div class="memitem">
1115 <div class="memproto">
1116       <table class="memname">
1117         <tr>
1118           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">TJXOP</a></td>
1119         </tr>
1120       </table>
1121 </div><div class="memdoc">
1122
1123 <p>Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#gaff23ba1dcabed456794b844791613920" title="Losslessly transform a JPEG image into another JPEG image.">tj3Transform()</a> </p>
1124 <table class="fieldtable">
1125 <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27"></a>TJXOP_NONE&#160;</td><td class="fielddoc"><p>Do not transform the position of the image pixels. </p>
1126 </td></tr>
1127 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce"></a>TJXOP_HFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image horizontally. </p>
1128 <p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1129 </td></tr>
1130 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d"></a>TJXOP_VFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image vertically. </p>
1131 <p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1132 </td></tr>
1133 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d"></a>TJXOP_TRANSPOSE&#160;</td><td class="fielddoc"><p>Transpose image (flip/mirror along upper left to lower right axis.) This transform is always perfect. </p>
1134 </td></tr>
1135 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4"></a>TJXOP_TRANSVERSE&#160;</td><td class="fielddoc"><p>Transverse transpose image (flip/mirror along upper right to lower left axis.) This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1136 </td></tr>
1137 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128"></a>TJXOP_ROT90&#160;</td><td class="fielddoc"><p>Rotate image clockwise by 90 degrees. </p>
1138 <p>This transform is imperfect if there are any partial MCU blocks on the bottom edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1139 </td></tr>
1140 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692"></a>TJXOP_ROT180&#160;</td><td class="fielddoc"><p>Rotate image 180 degrees. </p>
1141 <p>This transform is imperfect if there are any partial MCU blocks in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1142 </td></tr>
1143 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08"></a>TJXOP_ROT270&#160;</td><td class="fielddoc"><p>Rotate image counter-clockwise by 90 degrees. </p>
1144 <p>This transform is imperfect if there are any partial MCU blocks on the right edge (see <a class="el" href="group___turbo_j_p_e_g.html#ga50e03cb5ed115330e212417429600b00" title="This option will cause tj3Transform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
1145 </td></tr>
1146 </table>
1147
1148 </div>
1149 </div>
1150 <h2 class="groupheader">Function Documentation</h2>
1151 <a id="gab40a0b231122f536e503e3394569a68d"></a>
1152 <h2 class="memtitle"><span class="permalink"><a href="#gab40a0b231122f536e503e3394569a68d">&#9670;&nbsp;</a></span>tj3Alloc()</h2>
1153
1154 <div class="memitem">
1155 <div class="memproto">
1156       <table class="memname">
1157         <tr>
1158           <td class="memname">DLLEXPORT void* tj3Alloc </td>
1159           <td>(</td>
1160           <td class="paramtype">size_t&#160;</td>
1161           <td class="paramname"><em>bytes</em></td><td>)</td>
1162           <td></td>
1163         </tr>
1164       </table>
1165 </div><div class="memdoc">
1166
1167 <p>Allocate a byte buffer for use with TurboJPEG. </p>
1168 <p>You should always use this function to allocate the JPEG destination buffer(s) for the compression and transform functions unless you are disabling automatic buffer (re)allocation (by setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>.)</p>
1169 <dl class="params"><dt>Parameters</dt><dd>
1170   <table class="params">
1171     <tr><td class="paramname">bytes</td><td>the number of bytes to allocate</td></tr>
1172   </table>
1173   </dd>
1174 </dl>
1175 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>
1176 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a> </dd></dl>
1177
1178 </div>
1179 </div>
1180 <a id="ga9a1968c384ec7abb6122830253ebf570"></a>
1181 <h2 class="memtitle"><span class="permalink"><a href="#ga9a1968c384ec7abb6122830253ebf570">&#9670;&nbsp;</a></span>tj3Compress12()</h2>
1182
1183 <div class="memitem">
1184 <div class="memproto">
1185       <table class="memname">
1186         <tr>
1187           <td class="memname">DLLEXPORT int tj3Compress12 </td>
1188           <td>(</td>
1189           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1190           <td class="paramname"><em>handle</em>, </td>
1191         </tr>
1192         <tr>
1193           <td class="paramkey"></td>
1194           <td></td>
1195           <td class="paramtype">const short *&#160;</td>
1196           <td class="paramname"><em>srcBuf</em>, </td>
1197         </tr>
1198         <tr>
1199           <td class="paramkey"></td>
1200           <td></td>
1201           <td class="paramtype">int&#160;</td>
1202           <td class="paramname"><em>width</em>, </td>
1203         </tr>
1204         <tr>
1205           <td class="paramkey"></td>
1206           <td></td>
1207           <td class="paramtype">int&#160;</td>
1208           <td class="paramname"><em>pitch</em>, </td>
1209         </tr>
1210         <tr>
1211           <td class="paramkey"></td>
1212           <td></td>
1213           <td class="paramtype">int&#160;</td>
1214           <td class="paramname"><em>height</em>, </td>
1215         </tr>
1216         <tr>
1217           <td class="paramkey"></td>
1218           <td></td>
1219           <td class="paramtype">int&#160;</td>
1220           <td class="paramname"><em>pixelFormat</em>, </td>
1221         </tr>
1222         <tr>
1223           <td class="paramkey"></td>
1224           <td></td>
1225           <td class="paramtype">unsigned char **&#160;</td>
1226           <td class="paramname"><em>jpegBuf</em>, </td>
1227         </tr>
1228         <tr>
1229           <td class="paramkey"></td>
1230           <td></td>
1231           <td class="paramtype">size_t *&#160;</td>
1232           <td class="paramname"><em>jpegSize</em>&#160;</td>
1233         </tr>
1234         <tr>
1235           <td></td>
1236           <td>)</td>
1237           <td></td><td></td>
1238         </tr>
1239       </table>
1240 </div><div class="memdoc">
1241
1242 <p>Compress a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 12-bit-per-sample JPEG image. </p>
1243 <dl class="params"><dt>Parameters</dt><dd>
1244   <table class="params">
1245     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
1246     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
1247     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
1248     <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
1249     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
1250     <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1251     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
1252 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1253 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1254 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
1255 </ol>
1256 If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1257     <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1258   </table>
1259   </dd>
1260 </dl>
1261 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1262
1263 </div>
1264 </div>
1265 <a id="ga77901b71d0471784f318ada31ff4e7bd"></a>
1266 <h2 class="memtitle"><span class="permalink"><a href="#ga77901b71d0471784f318ada31ff4e7bd">&#9670;&nbsp;</a></span>tj3Compress16()</h2>
1267
1268 <div class="memitem">
1269 <div class="memproto">
1270       <table class="memname">
1271         <tr>
1272           <td class="memname">DLLEXPORT int tj3Compress16 </td>
1273           <td>(</td>
1274           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1275           <td class="paramname"><em>handle</em>, </td>
1276         </tr>
1277         <tr>
1278           <td class="paramkey"></td>
1279           <td></td>
1280           <td class="paramtype">const unsigned short *&#160;</td>
1281           <td class="paramname"><em>srcBuf</em>, </td>
1282         </tr>
1283         <tr>
1284           <td class="paramkey"></td>
1285           <td></td>
1286           <td class="paramtype">int&#160;</td>
1287           <td class="paramname"><em>width</em>, </td>
1288         </tr>
1289         <tr>
1290           <td class="paramkey"></td>
1291           <td></td>
1292           <td class="paramtype">int&#160;</td>
1293           <td class="paramname"><em>pitch</em>, </td>
1294         </tr>
1295         <tr>
1296           <td class="paramkey"></td>
1297           <td></td>
1298           <td class="paramtype">int&#160;</td>
1299           <td class="paramname"><em>height</em>, </td>
1300         </tr>
1301         <tr>
1302           <td class="paramkey"></td>
1303           <td></td>
1304           <td class="paramtype">int&#160;</td>
1305           <td class="paramname"><em>pixelFormat</em>, </td>
1306         </tr>
1307         <tr>
1308           <td class="paramkey"></td>
1309           <td></td>
1310           <td class="paramtype">unsigned char **&#160;</td>
1311           <td class="paramname"><em>jpegBuf</em>, </td>
1312         </tr>
1313         <tr>
1314           <td class="paramkey"></td>
1315           <td></td>
1316           <td class="paramtype">size_t *&#160;</td>
1317           <td class="paramname"><em>jpegSize</em>&#160;</td>
1318         </tr>
1319         <tr>
1320           <td></td>
1321           <td>)</td>
1322           <td></td><td></td>
1323         </tr>
1324       </table>
1325 </div><div class="memdoc">
1326
1327 <p>Compress a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into a 16-bit-per-sample lossless JPEG image. </p>
1328 <dl class="params"><dt>Parameters</dt><dd>
1329   <table class="params">
1330     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
1331     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
1332     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
1333     <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
1334     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
1335     <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1336     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
1337 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1338 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1339 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
1340 </ol>
1341 If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1342     <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1343   </table>
1344   </dd>
1345 </dl>
1346 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1347
1348 </div>
1349 </div>
1350 <a id="ga2cc418a2dab709ad7f30f5b25905f138"></a>
1351 <h2 class="memtitle"><span class="permalink"><a href="#ga2cc418a2dab709ad7f30f5b25905f138">&#9670;&nbsp;</a></span>tj3Compress8()</h2>
1352
1353 <div class="memitem">
1354 <div class="memproto">
1355       <table class="memname">
1356         <tr>
1357           <td class="memname">DLLEXPORT int tj3Compress8 </td>
1358           <td>(</td>
1359           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1360           <td class="paramname"><em>handle</em>, </td>
1361         </tr>
1362         <tr>
1363           <td class="paramkey"></td>
1364           <td></td>
1365           <td class="paramtype">const unsigned char *&#160;</td>
1366           <td class="paramname"><em>srcBuf</em>, </td>
1367         </tr>
1368         <tr>
1369           <td class="paramkey"></td>
1370           <td></td>
1371           <td class="paramtype">int&#160;</td>
1372           <td class="paramname"><em>width</em>, </td>
1373         </tr>
1374         <tr>
1375           <td class="paramkey"></td>
1376           <td></td>
1377           <td class="paramtype">int&#160;</td>
1378           <td class="paramname"><em>pitch</em>, </td>
1379         </tr>
1380         <tr>
1381           <td class="paramkey"></td>
1382           <td></td>
1383           <td class="paramtype">int&#160;</td>
1384           <td class="paramname"><em>height</em>, </td>
1385         </tr>
1386         <tr>
1387           <td class="paramkey"></td>
1388           <td></td>
1389           <td class="paramtype">int&#160;</td>
1390           <td class="paramname"><em>pixelFormat</em>, </td>
1391         </tr>
1392         <tr>
1393           <td class="paramkey"></td>
1394           <td></td>
1395           <td class="paramtype">unsigned char **&#160;</td>
1396           <td class="paramname"><em>jpegBuf</em>, </td>
1397         </tr>
1398         <tr>
1399           <td class="paramkey"></td>
1400           <td></td>
1401           <td class="paramtype">size_t *&#160;</td>
1402           <td class="paramname"><em>jpegSize</em>&#160;</td>
1403         </tr>
1404         <tr>
1405           <td></td>
1406           <td>)</td>
1407           <td></td><td></td>
1408         </tr>
1409       </table>
1410 </div><div class="memdoc">
1411
1412 <p>Compress an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image into an 8-bit-per-sample JPEG image. </p>
1413 <dl class="params"><dt>Parameters</dt><dd>
1414   <table class="params">
1415     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
1416     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK source image to be compressed. This buffer should normally be <code>pitch * height</code> samples in size. However, you can also use this parameter to compress from a specific region of a larger buffer.</td></tr>
1417     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
1418     <tr><td class="paramname">pitch</td><td>samples per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to compress from a specific region of a larger buffer.</td></tr>
1419     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
1420     <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1421     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
1422 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1423 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1424 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
1425 </ol>
1426 If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1427     <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1428   </table>
1429   </dd>
1430 </dl>
1431 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1432
1433 </div>
1434 </div>
1435 <a id="ga041c870d9c669eb3f385c78f4346c43f"></a>
1436 <h2 class="memtitle"><span class="permalink"><a href="#ga041c870d9c669eb3f385c78f4346c43f">&#9670;&nbsp;</a></span>tj3CompressFromYUV8()</h2>
1437
1438 <div class="memitem">
1439 <div class="memproto">
1440       <table class="memname">
1441         <tr>
1442           <td class="memname">DLLEXPORT int tj3CompressFromYUV8 </td>
1443           <td>(</td>
1444           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1445           <td class="paramname"><em>handle</em>, </td>
1446         </tr>
1447         <tr>
1448           <td class="paramkey"></td>
1449           <td></td>
1450           <td class="paramtype">const unsigned char *&#160;</td>
1451           <td class="paramname"><em>srcBuf</em>, </td>
1452         </tr>
1453         <tr>
1454           <td class="paramkey"></td>
1455           <td></td>
1456           <td class="paramtype">int&#160;</td>
1457           <td class="paramname"><em>width</em>, </td>
1458         </tr>
1459         <tr>
1460           <td class="paramkey"></td>
1461           <td></td>
1462           <td class="paramtype">int&#160;</td>
1463           <td class="paramname"><em>align</em>, </td>
1464         </tr>
1465         <tr>
1466           <td class="paramkey"></td>
1467           <td></td>
1468           <td class="paramtype">int&#160;</td>
1469           <td class="paramname"><em>height</em>, </td>
1470         </tr>
1471         <tr>
1472           <td class="paramkey"></td>
1473           <td></td>
1474           <td class="paramtype">unsigned char **&#160;</td>
1475           <td class="paramname"><em>jpegBuf</em>, </td>
1476         </tr>
1477         <tr>
1478           <td class="paramkey"></td>
1479           <td></td>
1480           <td class="paramtype">size_t *&#160;</td>
1481           <td class="paramname"><em>jpegSize</em>&#160;</td>
1482         </tr>
1483         <tr>
1484           <td></td>
1485           <td>)</td>
1486           <td></td><td></td>
1487         </tr>
1488       </table>
1489 </div><div class="memdoc">
1490
1491 <p>Compress an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample JPEG image. </p>
1492 <dl class="params"><dt>Parameters</dt><dd>
1493   <table class="params">
1494     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
1495     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a unified planar YUV source image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> for the given image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
1496     <tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed.</td></tr>
1497     <tr><td class="paramname">align</td><td>row alignment (in bytes) of the source image (must be a power of 2.) Setting this parameter to n indicates that each row in each plane of the source image is padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
1498     <tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed.</td></tr>
1499     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
1500 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1501 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1502 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
1503 </ol>
1504 If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1505     <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1506   </table>
1507   </dd>
1508 </dl>
1509 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1510
1511 </div>
1512 </div>
1513 <a id="gac9f5ace3e73805b476c95dda9f8d0cd0"></a>
1514 <h2 class="memtitle"><span class="permalink"><a href="#gac9f5ace3e73805b476c95dda9f8d0cd0">&#9670;&nbsp;</a></span>tj3CompressFromYUVPlanes8()</h2>
1515
1516 <div class="memitem">
1517 <div class="memproto">
1518       <table class="memname">
1519         <tr>
1520           <td class="memname">DLLEXPORT int tj3CompressFromYUVPlanes8 </td>
1521           <td>(</td>
1522           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1523           <td class="paramname"><em>handle</em>, </td>
1524         </tr>
1525         <tr>
1526           <td class="paramkey"></td>
1527           <td></td>
1528           <td class="paramtype">const unsigned char *const *&#160;</td>
1529           <td class="paramname"><em>srcPlanes</em>, </td>
1530         </tr>
1531         <tr>
1532           <td class="paramkey"></td>
1533           <td></td>
1534           <td class="paramtype">int&#160;</td>
1535           <td class="paramname"><em>width</em>, </td>
1536         </tr>
1537         <tr>
1538           <td class="paramkey"></td>
1539           <td></td>
1540           <td class="paramtype">const int *&#160;</td>
1541           <td class="paramname"><em>strides</em>, </td>
1542         </tr>
1543         <tr>
1544           <td class="paramkey"></td>
1545           <td></td>
1546           <td class="paramtype">int&#160;</td>
1547           <td class="paramname"><em>height</em>, </td>
1548         </tr>
1549         <tr>
1550           <td class="paramkey"></td>
1551           <td></td>
1552           <td class="paramtype">unsigned char **&#160;</td>
1553           <td class="paramname"><em>jpegBuf</em>, </td>
1554         </tr>
1555         <tr>
1556           <td class="paramkey"></td>
1557           <td></td>
1558           <td class="paramtype">size_t *&#160;</td>
1559           <td class="paramname"><em>jpegSize</em>&#160;</td>
1560         </tr>
1561         <tr>
1562           <td></td>
1563           <td>)</td>
1564           <td></td><td></td>
1565         </tr>
1566       </table>
1567 </div><div class="memdoc">
1568
1569 <p>Compress a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample JPEG image. </p>
1570 <dl class="params"><dt>Parameters</dt><dd>
1571   <table class="params">
1572     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
1573     <tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV source image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> for the given image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
1574     <tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed.</td></tr>
1575     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of row padding in each plane or to create a JPEG image from a subregion of a larger planar YUV image.</td></tr>
1576     <tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed.</td></tr>
1577     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to a byte buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
1578 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1579 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1580 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a>. This should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.)</li>
1581 </ol>
1582 If you choose option 1, then <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1583     <tr><td class="paramname">jpegSize</td><td>pointer to a size_t variable that holds the size of the JPEG buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1584   </table>
1585   </dd>
1586 </dl>
1587 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1588
1589 </div>
1590 </div>
1591 <a id="gaa1eb574f38b1c1de43a6c7aafcf68d8c"></a>
1592 <h2 class="memtitle"><span class="permalink"><a href="#gaa1eb574f38b1c1de43a6c7aafcf68d8c">&#9670;&nbsp;</a></span>tj3DecodeYUV8()</h2>
1593
1594 <div class="memitem">
1595 <div class="memproto">
1596       <table class="memname">
1597         <tr>
1598           <td class="memname">DLLEXPORT int tj3DecodeYUV8 </td>
1599           <td>(</td>
1600           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1601           <td class="paramname"><em>handle</em>, </td>
1602         </tr>
1603         <tr>
1604           <td class="paramkey"></td>
1605           <td></td>
1606           <td class="paramtype">const unsigned char *&#160;</td>
1607           <td class="paramname"><em>srcBuf</em>, </td>
1608         </tr>
1609         <tr>
1610           <td class="paramkey"></td>
1611           <td></td>
1612           <td class="paramtype">int&#160;</td>
1613           <td class="paramname"><em>align</em>, </td>
1614         </tr>
1615         <tr>
1616           <td class="paramkey"></td>
1617           <td></td>
1618           <td class="paramtype">unsigned char *&#160;</td>
1619           <td class="paramname"><em>dstBuf</em>, </td>
1620         </tr>
1621         <tr>
1622           <td class="paramkey"></td>
1623           <td></td>
1624           <td class="paramtype">int&#160;</td>
1625           <td class="paramname"><em>width</em>, </td>
1626         </tr>
1627         <tr>
1628           <td class="paramkey"></td>
1629           <td></td>
1630           <td class="paramtype">int&#160;</td>
1631           <td class="paramname"><em>pitch</em>, </td>
1632         </tr>
1633         <tr>
1634           <td class="paramkey"></td>
1635           <td></td>
1636           <td class="paramtype">int&#160;</td>
1637           <td class="paramname"><em>height</em>, </td>
1638         </tr>
1639         <tr>
1640           <td class="paramkey"></td>
1641           <td></td>
1642           <td class="paramtype">int&#160;</td>
1643           <td class="paramname"><em>pixelFormat</em>&#160;</td>
1644         </tr>
1645         <tr>
1646           <td></td>
1647           <td>)</td>
1648           <td></td><td></td>
1649         </tr>
1650       </table>
1651 </div><div class="memdoc">
1652
1653 <p>Decode an 8-bit-per-sample unified planar YUV image into an 8-bit-per-sample packed-pixel RGB or grayscale image. </p>
1654 <p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.</p>
1655 <dl class="params"><dt>Parameters</dt><dd>
1656   <table class="params">
1657     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1658     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a unified planar YUV source image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> for the given image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
1659     <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV source image (must be a power of 2.) Setting this parameter to n indicates that each row in each plane of the YUV source image is padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
1660     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decoded image. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to decode into a specific region of a larger buffer.</td></tr>
1661     <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
1662     <tr><td class="paramname">pitch</td><td>bytes per row in the destination image. Normally this should be set to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decode into a specific region of a larger buffer.</td></tr>
1663     <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
1664     <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1665   </table>
1666   </dd>
1667 </dl>
1668 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1669
1670 </div>
1671 </div>
1672 <a id="gad366f1915f82c1ad4e7e37ebe073ca89"></a>
1673 <h2 class="memtitle"><span class="permalink"><a href="#gad366f1915f82c1ad4e7e37ebe073ca89">&#9670;&nbsp;</a></span>tj3DecodeYUVPlanes8()</h2>
1674
1675 <div class="memitem">
1676 <div class="memproto">
1677       <table class="memname">
1678         <tr>
1679           <td class="memname">DLLEXPORT int tj3DecodeYUVPlanes8 </td>
1680           <td>(</td>
1681           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1682           <td class="paramname"><em>handle</em>, </td>
1683         </tr>
1684         <tr>
1685           <td class="paramkey"></td>
1686           <td></td>
1687           <td class="paramtype">const unsigned char *const *&#160;</td>
1688           <td class="paramname"><em>srcPlanes</em>, </td>
1689         </tr>
1690         <tr>
1691           <td class="paramkey"></td>
1692           <td></td>
1693           <td class="paramtype">const int *&#160;</td>
1694           <td class="paramname"><em>strides</em>, </td>
1695         </tr>
1696         <tr>
1697           <td class="paramkey"></td>
1698           <td></td>
1699           <td class="paramtype">unsigned char *&#160;</td>
1700           <td class="paramname"><em>dstBuf</em>, </td>
1701         </tr>
1702         <tr>
1703           <td class="paramkey"></td>
1704           <td></td>
1705           <td class="paramtype">int&#160;</td>
1706           <td class="paramname"><em>width</em>, </td>
1707         </tr>
1708         <tr>
1709           <td class="paramkey"></td>
1710           <td></td>
1711           <td class="paramtype">int&#160;</td>
1712           <td class="paramname"><em>pitch</em>, </td>
1713         </tr>
1714         <tr>
1715           <td class="paramkey"></td>
1716           <td></td>
1717           <td class="paramtype">int&#160;</td>
1718           <td class="paramname"><em>height</em>, </td>
1719         </tr>
1720         <tr>
1721           <td class="paramkey"></td>
1722           <td></td>
1723           <td class="paramtype">int&#160;</td>
1724           <td class="paramname"><em>pixelFormat</em>&#160;</td>
1725         </tr>
1726         <tr>
1727           <td></td>
1728           <td>)</td>
1729           <td></td><td></td>
1730         </tr>
1731       </table>
1732 </div><div class="memdoc">
1733
1734 <p>Decode a set of 8-bit-per-sample Y, U (Cb), and V (Cr) image planes into an 8-bit-per-sample packed-pixel RGB or grayscale image. </p>
1735 <p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG decompression process.</p>
1736 <dl class="params"><dt>Parameters</dt><dd>
1737   <table class="params">
1738     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1739     <tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> for the given image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
1740     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of row padding in each plane or to decode a subregion of a larger planar YUV image.</td></tr>
1741     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decoded image. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to decode into a specific region of a larger buffer.</td></tr>
1742     <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
1743     <tr><td class="paramname">pitch</td><td>bytes per row in the destination image. Normally this should be set to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decode into a specific region of a larger buffer.</td></tr>
1744     <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
1745     <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1746   </table>
1747   </dd>
1748 </dl>
1749 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1750
1751 </div>
1752 </div>
1753 <a id="ga39b848f01781ad74a5b3941c012b6199"></a>
1754 <h2 class="memtitle"><span class="permalink"><a href="#ga39b848f01781ad74a5b3941c012b6199">&#9670;&nbsp;</a></span>tj3Decompress12()</h2>
1755
1756 <div class="memitem">
1757 <div class="memproto">
1758       <table class="memname">
1759         <tr>
1760           <td class="memname">DLLEXPORT int tj3Decompress12 </td>
1761           <td>(</td>
1762           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1763           <td class="paramname"><em>handle</em>, </td>
1764         </tr>
1765         <tr>
1766           <td class="paramkey"></td>
1767           <td></td>
1768           <td class="paramtype">const unsigned char *&#160;</td>
1769           <td class="paramname"><em>jpegBuf</em>, </td>
1770         </tr>
1771         <tr>
1772           <td class="paramkey"></td>
1773           <td></td>
1774           <td class="paramtype">size_t&#160;</td>
1775           <td class="paramname"><em>jpegSize</em>, </td>
1776         </tr>
1777         <tr>
1778           <td class="paramkey"></td>
1779           <td></td>
1780           <td class="paramtype">short *&#160;</td>
1781           <td class="paramname"><em>dstBuf</em>, </td>
1782         </tr>
1783         <tr>
1784           <td class="paramkey"></td>
1785           <td></td>
1786           <td class="paramtype">int&#160;</td>
1787           <td class="paramname"><em>pitch</em>, </td>
1788         </tr>
1789         <tr>
1790           <td class="paramkey"></td>
1791           <td></td>
1792           <td class="paramtype">int&#160;</td>
1793           <td class="paramname"><em>pixelFormat</em>&#160;</td>
1794         </tr>
1795         <tr>
1796           <td></td>
1797           <td>)</td>
1798           <td></td><td></td>
1799         </tr>
1800       </table>
1801 </div><div class="memdoc">
1802
1803 <p>Decompress a 12-bit-per-sample JPEG image into a 12-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
1804 <p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
1805 <dl class="params"><dt>Parameters</dt><dd>
1806   <table class="params">
1807     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1808     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
1809     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1810     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
1811     <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
1812     <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1813   </table>
1814   </dd>
1815 </dl>
1816 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1817
1818 </div>
1819 </div>
1820 <a id="gaa074e63f9beb0b3ff42b833a4049df6e"></a>
1821 <h2 class="memtitle"><span class="permalink"><a href="#gaa074e63f9beb0b3ff42b833a4049df6e">&#9670;&nbsp;</a></span>tj3Decompress16()</h2>
1822
1823 <div class="memitem">
1824 <div class="memproto">
1825       <table class="memname">
1826         <tr>
1827           <td class="memname">DLLEXPORT int tj3Decompress16 </td>
1828           <td>(</td>
1829           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1830           <td class="paramname"><em>handle</em>, </td>
1831         </tr>
1832         <tr>
1833           <td class="paramkey"></td>
1834           <td></td>
1835           <td class="paramtype">const unsigned char *&#160;</td>
1836           <td class="paramname"><em>jpegBuf</em>, </td>
1837         </tr>
1838         <tr>
1839           <td class="paramkey"></td>
1840           <td></td>
1841           <td class="paramtype">size_t&#160;</td>
1842           <td class="paramname"><em>jpegSize</em>, </td>
1843         </tr>
1844         <tr>
1845           <td class="paramkey"></td>
1846           <td></td>
1847           <td class="paramtype">unsigned short *&#160;</td>
1848           <td class="paramname"><em>dstBuf</em>, </td>
1849         </tr>
1850         <tr>
1851           <td class="paramkey"></td>
1852           <td></td>
1853           <td class="paramtype">int&#160;</td>
1854           <td class="paramname"><em>pitch</em>, </td>
1855         </tr>
1856         <tr>
1857           <td class="paramkey"></td>
1858           <td></td>
1859           <td class="paramtype">int&#160;</td>
1860           <td class="paramname"><em>pixelFormat</em>&#160;</td>
1861         </tr>
1862         <tr>
1863           <td></td>
1864           <td>)</td>
1865           <td></td><td></td>
1866         </tr>
1867       </table>
1868 </div><div class="memdoc">
1869
1870 <p>Decompress a 16-bit-per-sample lossless JPEG image into a 16-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
1871 <p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
1872 <dl class="params"><dt>Parameters</dt><dd>
1873   <table class="params">
1874     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1875     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
1876     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1877     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
1878     <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
1879     <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1880   </table>
1881   </dd>
1882 </dl>
1883 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1884
1885 </div>
1886 </div>
1887 <a id="ga1169c7c1a26ec18c9e6122cb8ae64013"></a>
1888 <h2 class="memtitle"><span class="permalink"><a href="#ga1169c7c1a26ec18c9e6122cb8ae64013">&#9670;&nbsp;</a></span>tj3Decompress8()</h2>
1889
1890 <div class="memitem">
1891 <div class="memproto">
1892       <table class="memname">
1893         <tr>
1894           <td class="memname">DLLEXPORT int tj3Decompress8 </td>
1895           <td>(</td>
1896           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1897           <td class="paramname"><em>handle</em>, </td>
1898         </tr>
1899         <tr>
1900           <td class="paramkey"></td>
1901           <td></td>
1902           <td class="paramtype">const unsigned char *&#160;</td>
1903           <td class="paramname"><em>jpegBuf</em>, </td>
1904         </tr>
1905         <tr>
1906           <td class="paramkey"></td>
1907           <td></td>
1908           <td class="paramtype">size_t&#160;</td>
1909           <td class="paramname"><em>jpegSize</em>, </td>
1910         </tr>
1911         <tr>
1912           <td class="paramkey"></td>
1913           <td></td>
1914           <td class="paramtype">unsigned char *&#160;</td>
1915           <td class="paramname"><em>dstBuf</em>, </td>
1916         </tr>
1917         <tr>
1918           <td class="paramkey"></td>
1919           <td></td>
1920           <td class="paramtype">int&#160;</td>
1921           <td class="paramname"><em>pitch</em>, </td>
1922         </tr>
1923         <tr>
1924           <td class="paramkey"></td>
1925           <td></td>
1926           <td class="paramtype">int&#160;</td>
1927           <td class="paramname"><em>pixelFormat</em>&#160;</td>
1928         </tr>
1929         <tr>
1930           <td></td>
1931           <td>)</td>
1932           <td></td><td></td>
1933         </tr>
1934       </table>
1935 </div><div class="memdoc">
1936
1937 <p>Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample packed-pixel RGB, grayscale, or CMYK image. </p>
1938 <p>The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
1939 <dl class="params"><dt>Parameters</dt><dd>
1940   <table class="params">
1941     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1942     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
1943     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1944     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the packed-pixel decompressed image. This buffer should normally be <code>pitch * destinationHeight</code> samples in size. However, you can also use this parameter to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationHeight</code> is either the scaled JPEG height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the height of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationHeight</code> is the JPEG height.</td></tr>
1945     <tr><td class="paramname">pitch</td><td>samples per row in the destination image. Normally this should be set to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the destination image should be unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>destinationWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the destination image, to skip rows, or to decompress into a specific region of a larger buffer. NOTE: If the JPEG image is lossy, then <code>destinationWidth</code> is either the scaled JPEG width (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>) or the width of the cropping region (see <a class="el" href="group___turbo_j_p_e_g.html#gaa49c7bd4c9431667a043cfc93388ba1c" title="Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image.">tj3SetCroppingRegion()</a>.) If the JPEG image is lossless, then <code>destinationWidth</code> is the JPEG width.</td></tr>
1946     <tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
1947   </table>
1948   </dd>
1949 </dl>
1950 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1951
1952 </div>
1953 </div>
1954 <a id="ga96d2c4b3432f9d88ad14758ae240b8d1"></a>
1955 <h2 class="memtitle"><span class="permalink"><a href="#ga96d2c4b3432f9d88ad14758ae240b8d1">&#9670;&nbsp;</a></span>tj3DecompressHeader()</h2>
1956
1957 <div class="memitem">
1958 <div class="memproto">
1959       <table class="memname">
1960         <tr>
1961           <td class="memname">DLLEXPORT int tj3DecompressHeader </td>
1962           <td>(</td>
1963           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1964           <td class="paramname"><em>handle</em>, </td>
1965         </tr>
1966         <tr>
1967           <td class="paramkey"></td>
1968           <td></td>
1969           <td class="paramtype">const unsigned char *&#160;</td>
1970           <td class="paramname"><em>jpegBuf</em>, </td>
1971         </tr>
1972         <tr>
1973           <td class="paramkey"></td>
1974           <td></td>
1975           <td class="paramtype">size_t&#160;</td>
1976           <td class="paramname"><em>jpegSize</em>&#160;</td>
1977         </tr>
1978         <tr>
1979           <td></td>
1980           <td>)</td>
1981           <td></td><td></td>
1982         </tr>
1983       </table>
1984 </div><div class="memdoc">
1985
1986 <p>Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables. </p>
1987 <p>If a JPEG image is passed to this function, then the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when the function returns.</p>
1988 <dl class="params"><dt>Parameters</dt><dd>
1989   <table class="params">
1990     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
1991     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing a JPEG image or an "abbreviated table specification" (AKA "tables-only") datastream. Passing a tables-only datastream to this function primes the decompressor with quantization and Huffman tables that can be used when decompressing subsequent "abbreviated image" datastreams. This is useful, for instance, when decompressing video streams in which all frames share the same quantization and Huffman tables.</td></tr>
1992     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image or tables-only datastream (in bytes)</td></tr>
1993   </table>
1994   </dd>
1995 </dl>
1996 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
1997
1998 </div>
1999 </div>
2000 <a id="ga1e6bf6a19fec3f9fa7534348879d8320"></a>
2001 <h2 class="memtitle"><span class="permalink"><a href="#ga1e6bf6a19fec3f9fa7534348879d8320">&#9670;&nbsp;</a></span>tj3DecompressToYUV8()</h2>
2002
2003 <div class="memitem">
2004 <div class="memproto">
2005       <table class="memname">
2006         <tr>
2007           <td class="memname">DLLEXPORT int tj3DecompressToYUV8 </td>
2008           <td>(</td>
2009           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2010           <td class="paramname"><em>handle</em>, </td>
2011         </tr>
2012         <tr>
2013           <td class="paramkey"></td>
2014           <td></td>
2015           <td class="paramtype">const unsigned char *&#160;</td>
2016           <td class="paramname"><em>jpegBuf</em>, </td>
2017         </tr>
2018         <tr>
2019           <td class="paramkey"></td>
2020           <td></td>
2021           <td class="paramtype">size_t&#160;</td>
2022           <td class="paramname"><em>jpegSize</em>, </td>
2023         </tr>
2024         <tr>
2025           <td class="paramkey"></td>
2026           <td></td>
2027           <td class="paramtype">unsigned char *&#160;</td>
2028           <td class="paramname"><em>dstBuf</em>, </td>
2029         </tr>
2030         <tr>
2031           <td class="paramkey"></td>
2032           <td></td>
2033           <td class="paramtype">int&#160;</td>
2034           <td class="paramname"><em>align</em>&#160;</td>
2035         </tr>
2036         <tr>
2037           <td></td>
2038           <td>)</td>
2039           <td></td><td></td>
2040         </tr>
2041       </table>
2042 </div><div class="memdoc">
2043
2044 <p>Decompress an 8-bit-per-sample JPEG image into an 8-bit-per-sample unified planar YUV image. </p>
2045 <p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
2046 <dl class="params"><dt>Parameters</dt><dd>
2047   <table class="params">
2048     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
2049     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
2050     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
2051     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the unified planar YUV decompressed image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> to determine the appropriate size for this buffer based on the scaled JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>), row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
2052     <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV image (must be a power of 2.) Setting this parameter to n will cause each row in each plane of the YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.) To generate images suitable for X Video, <code>align</code> should be set to 4.</td></tr>
2053   </table>
2054   </dd>
2055 </dl>
2056 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
2057
2058 </div>
2059 </div>
2060 <a id="ga934373482dbbf257f2280505b6ff4fb5"></a>
2061 <h2 class="memtitle"><span class="permalink"><a href="#ga934373482dbbf257f2280505b6ff4fb5">&#9670;&nbsp;</a></span>tj3DecompressToYUVPlanes8()</h2>
2062
2063 <div class="memitem">
2064 <div class="memproto">
2065       <table class="memname">
2066         <tr>
2067           <td class="memname">DLLEXPORT int tj3DecompressToYUVPlanes8 </td>
2068           <td>(</td>
2069           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2070           <td class="paramname"><em>handle</em>, </td>
2071         </tr>
2072         <tr>
2073           <td class="paramkey"></td>
2074           <td></td>
2075           <td class="paramtype">const unsigned char *&#160;</td>
2076           <td class="paramname"><em>jpegBuf</em>, </td>
2077         </tr>
2078         <tr>
2079           <td class="paramkey"></td>
2080           <td></td>
2081           <td class="paramtype">size_t&#160;</td>
2082           <td class="paramname"><em>jpegSize</em>, </td>
2083         </tr>
2084         <tr>
2085           <td class="paramkey"></td>
2086           <td></td>
2087           <td class="paramtype">unsigned char **&#160;</td>
2088           <td class="paramname"><em>dstPlanes</em>, </td>
2089         </tr>
2090         <tr>
2091           <td class="paramkey"></td>
2092           <td></td>
2093           <td class="paramtype">int *&#160;</td>
2094           <td class="paramname"><em>strides</em>&#160;</td>
2095         </tr>
2096         <tr>
2097           <td></td>
2098           <td>)</td>
2099           <td></td><td></td>
2100         </tr>
2101       </table>
2102 </div><div class="memdoc">
2103
2104 <p>Decompress an 8-bit-per-sample JPEG image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. </p>
2105 <p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of a packed-pixel image. The <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a> that describe the JPEG image will be set when this function returns.</p>
2106 <dl class="params"><dt>Parameters</dt><dd>
2107   <table class="params">
2108     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
2109     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG image to decompress</td></tr>
2110     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
2111     <tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the decompressed image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> to determine the appropriate size for each plane based on the scaled JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a>, <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>, and <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>), strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
2112     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of row padding to each plane or to decompress the JPEG image into a subregion of a larger planar YUV image.</td></tr>
2113   </table>
2114   </dd>
2115 </dl>
2116 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
2117
2118 </div>
2119 </div>
2120 <a id="ga53fbadf4560e95a65b8f5ab81703fe82"></a>
2121 <h2 class="memtitle"><span class="permalink"><a href="#ga53fbadf4560e95a65b8f5ab81703fe82">&#9670;&nbsp;</a></span>tj3Destroy()</h2>
2122
2123 <div class="memitem">
2124 <div class="memproto">
2125       <table class="memname">
2126         <tr>
2127           <td class="memname">DLLEXPORT void tj3Destroy </td>
2128           <td>(</td>
2129           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2130           <td class="paramname"><em>handle</em></td><td>)</td>
2131           <td></td>
2132         </tr>
2133       </table>
2134 </div><div class="memdoc">
2135
2136 <p>Destroy a TurboJPEG instance. </p>
2137 <dl class="params"><dt>Parameters</dt><dd>
2138   <table class="params">
2139     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance. If the handle is NULL, then this function has no effect. </td></tr>
2140   </table>
2141   </dd>
2142 </dl>
2143
2144 </div>
2145 </div>
2146 <a id="ga2a8d50f130bde10f0a04030f8cc59936"></a>
2147 <h2 class="memtitle"><span class="permalink"><a href="#ga2a8d50f130bde10f0a04030f8cc59936">&#9670;&nbsp;</a></span>tj3EncodeYUV8()</h2>
2148
2149 <div class="memitem">
2150 <div class="memproto">
2151       <table class="memname">
2152         <tr>
2153           <td class="memname">DLLEXPORT int tj3EncodeYUV8 </td>
2154           <td>(</td>
2155           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2156           <td class="paramname"><em>handle</em>, </td>
2157         </tr>
2158         <tr>
2159           <td class="paramkey"></td>
2160           <td></td>
2161           <td class="paramtype">const unsigned char *&#160;</td>
2162           <td class="paramname"><em>srcBuf</em>, </td>
2163         </tr>
2164         <tr>
2165           <td class="paramkey"></td>
2166           <td></td>
2167           <td class="paramtype">int&#160;</td>
2168           <td class="paramname"><em>width</em>, </td>
2169         </tr>
2170         <tr>
2171           <td class="paramkey"></td>
2172           <td></td>
2173           <td class="paramtype">int&#160;</td>
2174           <td class="paramname"><em>pitch</em>, </td>
2175         </tr>
2176         <tr>
2177           <td class="paramkey"></td>
2178           <td></td>
2179           <td class="paramtype">int&#160;</td>
2180           <td class="paramname"><em>height</em>, </td>
2181         </tr>
2182         <tr>
2183           <td class="paramkey"></td>
2184           <td></td>
2185           <td class="paramtype">int&#160;</td>
2186           <td class="paramname"><em>pixelFormat</em>, </td>
2187         </tr>
2188         <tr>
2189           <td class="paramkey"></td>
2190           <td></td>
2191           <td class="paramtype">unsigned char *&#160;</td>
2192           <td class="paramname"><em>dstBuf</em>, </td>
2193         </tr>
2194         <tr>
2195           <td class="paramkey"></td>
2196           <td></td>
2197           <td class="paramtype">int&#160;</td>
2198           <td class="paramname"><em>align</em>&#160;</td>
2199         </tr>
2200         <tr>
2201           <td></td>
2202           <td>)</td>
2203           <td></td><td></td>
2204         </tr>
2205       </table>
2206 </div><div class="memdoc">
2207
2208 <p>Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into an 8-bit-per-sample unified planar YUV image. </p>
2209 <p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.</p>
2210 <dl class="params"><dt>Parameters</dt><dd>
2211   <table class="params">
2212     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
2213     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB or grayscale source image to be encoded. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to encode from a specific region of a larger buffer.</td></tr>
2214     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
2215     <tr><td class="paramname">pitch</td><td>bytes per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to encode from a specific region of a larger packed-pixel image.</td></tr>
2216     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
2217     <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
2218     <tr><td class="paramname">dstBuf</td><td>pointer to a buffer that will receive the unified planar YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaaebaa16973a0f550a66eca5765ed0546" title="The size of the buffer (in bytes) required to hold a unified planar YUV image with the given paramete...">tj3YUVBufSize()</a> to determine the appropriate size for this buffer based on the image width, height, row alignment, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer. (Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
2219     <tr><td class="paramname">align</td><td>row alignment (in bytes) of the YUV image (must be a power of 2.) Setting this parameter to n will cause each row in each plane of the YUV image to be padded to the nearest multiple of n bytes (1 = unpadded.) To generate images suitable for X Video, <code>align</code> should be set to 4.</td></tr>
2220   </table>
2221   </dd>
2222 </dl>
2223 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
2224
2225 </div>
2226 </div>
2227 <a id="gae2e9df38790e9bddc249d04cb158a4cf"></a>
2228 <h2 class="memtitle"><span class="permalink"><a href="#gae2e9df38790e9bddc249d04cb158a4cf">&#9670;&nbsp;</a></span>tj3EncodeYUVPlanes8()</h2>
2229
2230 <div class="memitem">
2231 <div class="memproto">
2232       <table class="memname">
2233         <tr>
2234           <td class="memname">DLLEXPORT int tj3EncodeYUVPlanes8 </td>
2235           <td>(</td>
2236           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2237           <td class="paramname"><em>handle</em>, </td>
2238         </tr>
2239         <tr>
2240           <td class="paramkey"></td>
2241           <td></td>
2242           <td class="paramtype">const unsigned char *&#160;</td>
2243           <td class="paramname"><em>srcBuf</em>, </td>
2244         </tr>
2245         <tr>
2246           <td class="paramkey"></td>
2247           <td></td>
2248           <td class="paramtype">int&#160;</td>
2249           <td class="paramname"><em>width</em>, </td>
2250         </tr>
2251         <tr>
2252           <td class="paramkey"></td>
2253           <td></td>
2254           <td class="paramtype">int&#160;</td>
2255           <td class="paramname"><em>pitch</em>, </td>
2256         </tr>
2257         <tr>
2258           <td class="paramkey"></td>
2259           <td></td>
2260           <td class="paramtype">int&#160;</td>
2261           <td class="paramname"><em>height</em>, </td>
2262         </tr>
2263         <tr>
2264           <td class="paramkey"></td>
2265           <td></td>
2266           <td class="paramtype">int&#160;</td>
2267           <td class="paramname"><em>pixelFormat</em>, </td>
2268         </tr>
2269         <tr>
2270           <td class="paramkey"></td>
2271           <td></td>
2272           <td class="paramtype">unsigned char **&#160;</td>
2273           <td class="paramname"><em>dstPlanes</em>, </td>
2274         </tr>
2275         <tr>
2276           <td class="paramkey"></td>
2277           <td></td>
2278           <td class="paramtype">int *&#160;</td>
2279           <td class="paramname"><em>strides</em>&#160;</td>
2280         </tr>
2281         <tr>
2282           <td></td>
2283           <td>)</td>
2284           <td></td><td></td>
2285         </tr>
2286       </table>
2287 </div><div class="memdoc">
2288
2289 <p>Encode an 8-bit-per-sample packed-pixel RGB or grayscale image into separate 8-bit-per-sample Y, U (Cb), and V (Cr) image planes. </p>
2290 <p>This function performs color conversion (which is accelerated in the libjpeg-turbo implementation) but does not execute any of the other steps in the JPEG compression process.</p>
2291 <dl class="params"><dt>Parameters</dt><dd>
2292   <table class="params">
2293     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for compression</td></tr>
2294     <tr><td class="paramname">srcBuf</td><td>pointer to a buffer containing a packed-pixel RGB or grayscale source image to be encoded. This buffer should normally be <code>pitch * height</code> bytes in size. However, you can also use this parameter to encode from a specific region of a larger buffer.</td></tr>
2295     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
2296     <tr><td class="paramname">pitch</td><td>bytes per row in the source image. Normally this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>, if the image is unpadded. (Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.) However, you can also use this parameter to specify the row alignment/padding of the source image, to skip rows, or to encode from a specific region of a larger packed-pixel image.</td></tr>
2297     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
2298     <tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
2299     <tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#gacc19d265edce76b46146f59579f9438d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tj3YUVPlaneSize()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>.) Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
2300     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per row in the corresponding plane of the YUV image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of row padding to each plane or to encode an RGB or grayscale image into a subregion of a larger planar YUV image.</td></tr>
2301   </table>
2302   </dd>
2303 </dl>
2304 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
2305
2306 </div>
2307 </div>
2308 <a id="gaddb84fb6c81769e9faa0f5a63b296606"></a>
2309 <h2 class="memtitle"><span class="permalink"><a href="#gaddb84fb6c81769e9faa0f5a63b296606">&#9670;&nbsp;</a></span>tj3Free()</h2>
2310
2311 <div class="memitem">
2312 <div class="memproto">
2313       <table class="memname">
2314         <tr>
2315           <td class="memname">DLLEXPORT void tj3Free </td>
2316           <td>(</td>
2317           <td class="paramtype">void *&#160;</td>
2318           <td class="paramname"><em>buffer</em></td><td>)</td>
2319           <td></td>
2320         </tr>
2321       </table>
2322 </div><div class="memdoc">
2323
2324 <p>Free a byte buffer previously allocated by TurboJPEG. </p>
2325 <p>You should always use this function to free JPEG destination buffer(s) that were automatically (re)allocated by the compression and transform functions or that were manually allocated using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a>.</p>
2326 <dl class="params"><dt>Parameters</dt><dd>
2327   <table class="params">
2328     <tr><td class="paramname">buffer</td><td>address of the buffer to free. If the address is NULL, then this function has no effect.</td></tr>
2329   </table>
2330   </dd>
2331 </dl>
2332 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> </dd></dl>
2333
2334 </div>
2335 </div>
2336 <a id="ga34af9ba3183bdf0ec7c8f47bb9a4c84f"></a>
2337 <h2 class="memtitle"><span class="permalink"><a href="#ga34af9ba3183bdf0ec7c8f47bb9a4c84f">&#9670;&nbsp;</a></span>tj3Get()</h2>
2338
2339 <div class="memitem">
2340 <div class="memproto">
2341       <table class="memname">
2342         <tr>
2343           <td class="memname">DLLEXPORT int tj3Get </td>
2344           <td>(</td>
2345           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2346           <td class="paramname"><em>handle</em>, </td>
2347         </tr>
2348         <tr>
2349           <td class="paramkey"></td>
2350           <td></td>
2351           <td class="paramtype">int&#160;</td>
2352           <td class="paramname"><em>param</em>&#160;</td>
2353         </tr>
2354         <tr>
2355           <td></td>
2356           <td>)</td>
2357           <td></td><td></td>
2358         </tr>
2359       </table>
2360 </div><div class="memdoc">
2361
2362 <p>Get the value of a parameter. </p>
2363 <dl class="params"><dt>Parameters</dt><dd>
2364   <table class="params">
2365     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2366     <tr><td class="paramname">param</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a></td></tr>
2367   </table>
2368   </dd>
2369 </dl>
2370 <dl class="section return"><dt>Returns</dt><dd>the value of the specified parameter, or -1 if the value is unknown. </dd></dl>
2371
2372 </div>
2373 </div>
2374 <a id="gab8c8279f1415fe425ff30dbbc56013bd"></a>
2375 <h2 class="memtitle"><span class="permalink"><a href="#gab8c8279f1415fe425ff30dbbc56013bd">&#9670;&nbsp;</a></span>tj3GetErrorCode()</h2>
2376
2377 <div class="memitem">
2378 <div class="memproto">
2379       <table class="memname">
2380         <tr>
2381           <td class="memname">DLLEXPORT int tj3GetErrorCode </td>
2382           <td>(</td>
2383           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2384           <td class="paramname"><em>handle</em></td><td>)</td>
2385           <td></td>
2386         </tr>
2387       </table>
2388 </div><div class="memdoc">
2389
2390 <p>Returns a code indicating the severity of the last error. </p>
2391 <p>See <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">Error codes</a>.</p>
2392 <dl class="params"><dt>Parameters</dt><dd>
2393   <table class="params">
2394     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2395   </table>
2396   </dd>
2397 </dl>
2398 <dl class="section return"><dt>Returns</dt><dd>a code indicating the severity of the last error. See <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">Error codes</a>. </dd></dl>
2399
2400 </div>
2401 </div>
2402 <a id="gaf2aab0e6dbb3edc57646b0fec25e8bb2"></a>
2403 <h2 class="memtitle"><span class="permalink"><a href="#gaf2aab0e6dbb3edc57646b0fec25e8bb2">&#9670;&nbsp;</a></span>tj3GetErrorStr()</h2>
2404
2405 <div class="memitem">
2406 <div class="memproto">
2407       <table class="memname">
2408         <tr>
2409           <td class="memname">DLLEXPORT char* tj3GetErrorStr </td>
2410           <td>(</td>
2411           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2412           <td class="paramname"><em>handle</em></td><td>)</td>
2413           <td></td>
2414         </tr>
2415       </table>
2416 </div><div class="memdoc">
2417
2418 <p>Returns a descriptive error message explaining why the last command failed. </p>
2419 <dl class="params"><dt>Parameters</dt><dd>
2420   <table class="params">
2421     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance, or NULL if the error was generated by a global function (but note that retrieving the error message for a global function is thread-safe only on platforms that support thread-local storage.)</td></tr>
2422   </table>
2423   </dd>
2424 </dl>
2425 <dl class="section return"><dt>Returns</dt><dd>a descriptive error message explaining why the last command failed. </dd></dl>
2426
2427 </div>
2428 </div>
2429 <a id="ga74397f8e0587d4233182c72f085aaf04"></a>
2430 <h2 class="memtitle"><span class="permalink"><a href="#ga74397f8e0587d4233182c72f085aaf04">&#9670;&nbsp;</a></span>tj3GetScalingFactors()</h2>
2431
2432 <div class="memitem">
2433 <div class="memproto">
2434       <table class="memname">
2435         <tr>
2436           <td class="memname">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>* tj3GetScalingFactors </td>
2437           <td>(</td>
2438           <td class="paramtype">int *&#160;</td>
2439           <td class="paramname"><em>numScalingFactors</em></td><td>)</td>
2440           <td></td>
2441         </tr>
2442       </table>
2443 </div><div class="memdoc">
2444
2445 <p>Returns a list of fractional scaling factors that the JPEG decompressor supports. </p>
2446 <dl class="params"><dt>Parameters</dt><dd>
2447   <table class="params">
2448     <tr><td class="paramname">numScalingFactors</td><td>pointer to an integer variable that will receive the number of elements in the list</td></tr>
2449   </table>
2450   </dd>
2451 </dl>
2452 <dl class="section return"><dt>Returns</dt><dd>a pointer to a list of fractional scaling factors, or NULL if an error is encountered (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
2453
2454 </div>
2455 </div>
2456 <a id="ga69c09d39f97ec30250ad3605ace7e5df"></a>
2457 <h2 class="memtitle"><span class="permalink"><a href="#ga69c09d39f97ec30250ad3605ace7e5df">&#9670;&nbsp;</a></span>tj3Init()</h2>
2458
2459 <div class="memitem">
2460 <div class="memproto">
2461       <table class="memname">
2462         <tr>
2463           <td class="memname">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> tj3Init </td>
2464           <td>(</td>
2465           <td class="paramtype">int&#160;</td>
2466           <td class="paramname"><em>initType</em></td><td>)</td>
2467           <td></td>
2468         </tr>
2469       </table>
2470 </div><div class="memdoc">
2471
2472 <p>Create a new TurboJPEG instance. </p>
2473 <dl class="params"><dt>Parameters</dt><dd>
2474   <table class="params">
2475     <tr><td class="paramname">initType</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086">initialization options</a></td></tr>
2476   </table>
2477   </dd>
2478 </dl>
2479 <dl class="section return"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
2480
2481 </div>
2482 </div>
2483 <a id="gac6285e58e35a35d871d7162ec5a929c4"></a>
2484 <h2 class="memtitle"><span class="permalink"><a href="#gac6285e58e35a35d871d7162ec5a929c4">&#9670;&nbsp;</a></span>tj3JPEGBufSize()</h2>
2485
2486 <div class="memitem">
2487 <div class="memproto">
2488       <table class="memname">
2489         <tr>
2490           <td class="memname">DLLEXPORT size_t tj3JPEGBufSize </td>
2491           <td>(</td>
2492           <td class="paramtype">int&#160;</td>
2493           <td class="paramname"><em>width</em>, </td>
2494         </tr>
2495         <tr>
2496           <td class="paramkey"></td>
2497           <td></td>
2498           <td class="paramtype">int&#160;</td>
2499           <td class="paramname"><em>height</em>, </td>
2500         </tr>
2501         <tr>
2502           <td class="paramkey"></td>
2503           <td></td>
2504           <td class="paramtype">int&#160;</td>
2505           <td class="paramname"><em>jpegSubsamp</em>&#160;</td>
2506         </tr>
2507         <tr>
2508           <td></td>
2509           <td>)</td>
2510           <td></td><td></td>
2511         </tr>
2512       </table>
2513 </div><div class="memdoc">
2514
2515 <p>The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. </p>
2516 <p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, so it is possible for a very high-quality source image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent very rare corner cases, but since there is no way to predict the size of a JPEG image prior to compression, the corner cases have to be handled.</p>
2517 <dl class="params"><dt>Parameters</dt><dd>
2518   <table class="params">
2519     <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
2520     <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
2521     <tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074ac124fa8f6cb41147e3d670dfbdfb7173" title="Unknown subsampling.">TJSAMP_UNKNOWN</a> is treated like <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>, since a buffer large enough to hold a JPEG image with no subsampling should also be large enough to hold a JPEG image with an arbitrary level of subsampling. Note that lossless JPEG images always use <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3" title="4:4:4 chrominance subsampling (no chrominance subsampling).">TJSAMP_444</a>.</td></tr>
2522   </table>
2523   </dd>
2524 </dl>
2525 <dl class="section return"><dt>Returns</dt><dd>the maximum size of the buffer (in bytes) required to hold the image, or 0 if the arguments are out of bounds. </dd></dl>
2526
2527 </div>
2528 </div>
2529 <a id="ga1f03c26892a26d4ce077ed6a4ac40e8f"></a>
2530 <h2 class="memtitle"><span class="permalink"><a href="#ga1f03c26892a26d4ce077ed6a4ac40e8f">&#9670;&nbsp;</a></span>tj3LoadImage12()</h2>
2531
2532 <div class="memitem">
2533 <div class="memproto">
2534       <table class="memname">
2535         <tr>
2536           <td class="memname">DLLEXPORT short* tj3LoadImage12 </td>
2537           <td>(</td>
2538           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2539           <td class="paramname"><em>handle</em>, </td>
2540         </tr>
2541         <tr>
2542           <td class="paramkey"></td>
2543           <td></td>
2544           <td class="paramtype">const char *&#160;</td>
2545           <td class="paramname"><em>filename</em>, </td>
2546         </tr>
2547         <tr>
2548           <td class="paramkey"></td>
2549           <td></td>
2550           <td class="paramtype">int *&#160;</td>
2551           <td class="paramname"><em>width</em>, </td>
2552         </tr>
2553         <tr>
2554           <td class="paramkey"></td>
2555           <td></td>
2556           <td class="paramtype">int&#160;</td>
2557           <td class="paramname"><em>align</em>, </td>
2558         </tr>
2559         <tr>
2560           <td class="paramkey"></td>
2561           <td></td>
2562           <td class="paramtype">int *&#160;</td>
2563           <td class="paramname"><em>height</em>, </td>
2564         </tr>
2565         <tr>
2566           <td class="paramkey"></td>
2567           <td></td>
2568           <td class="paramtype">int *&#160;</td>
2569           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2570         </tr>
2571         <tr>
2572           <td></td>
2573           <td>)</td>
2574           <td></td><td></td>
2575         </tr>
2576       </table>
2577 </div><div class="memdoc">
2578
2579 <p>Load a 12-bit-per-sample packed-pixel image from disk into memory. </p>
2580 <dl class="params"><dt>Parameters</dt><dd>
2581   <table class="params">
2582     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2583     <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
2584     <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
2585     <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
2586     <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
2587     <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
2588 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
2589 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
2590 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
2591 <li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
2592 </ul>
2593 </td></tr>
2594   </table>
2595   </dd>
2596 </dl>
2597 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>
2598
2599 </div>
2600 </div>
2601 <a id="ga638aeba63e0ccb89d472fdbf34224cfc"></a>
2602 <h2 class="memtitle"><span class="permalink"><a href="#ga638aeba63e0ccb89d472fdbf34224cfc">&#9670;&nbsp;</a></span>tj3LoadImage16()</h2>
2603
2604 <div class="memitem">
2605 <div class="memproto">
2606       <table class="memname">
2607         <tr>
2608           <td class="memname">DLLEXPORT unsigned short* tj3LoadImage16 </td>
2609           <td>(</td>
2610           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2611           <td class="paramname"><em>handle</em>, </td>
2612         </tr>
2613         <tr>
2614           <td class="paramkey"></td>
2615           <td></td>
2616           <td class="paramtype">const char *&#160;</td>
2617           <td class="paramname"><em>filename</em>, </td>
2618         </tr>
2619         <tr>
2620           <td class="paramkey"></td>
2621           <td></td>
2622           <td class="paramtype">int *&#160;</td>
2623           <td class="paramname"><em>width</em>, </td>
2624         </tr>
2625         <tr>
2626           <td class="paramkey"></td>
2627           <td></td>
2628           <td class="paramtype">int&#160;</td>
2629           <td class="paramname"><em>align</em>, </td>
2630         </tr>
2631         <tr>
2632           <td class="paramkey"></td>
2633           <td></td>
2634           <td class="paramtype">int *&#160;</td>
2635           <td class="paramname"><em>height</em>, </td>
2636         </tr>
2637         <tr>
2638           <td class="paramkey"></td>
2639           <td></td>
2640           <td class="paramtype">int *&#160;</td>
2641           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2642         </tr>
2643         <tr>
2644           <td></td>
2645           <td>)</td>
2646           <td></td><td></td>
2647         </tr>
2648       </table>
2649 </div><div class="memdoc">
2650
2651 <p>Load a 16-bit-per-sample packed-pixel image from disk into memory. </p>
2652 <dl class="params"><dt>Parameters</dt><dd>
2653   <table class="params">
2654     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2655     <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
2656     <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
2657     <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
2658     <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
2659     <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
2660 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
2661 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
2662 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
2663 <li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
2664 </ul>
2665 </td></tr>
2666   </table>
2667   </dd>
2668 </dl>
2669 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>
2670
2671 </div>
2672 </div>
2673 <a id="ga565aaae7be3f8ca9099b56655c893251"></a>
2674 <h2 class="memtitle"><span class="permalink"><a href="#ga565aaae7be3f8ca9099b56655c893251">&#9670;&nbsp;</a></span>tj3LoadImage8()</h2>
2675
2676 <div class="memitem">
2677 <div class="memproto">
2678       <table class="memname">
2679         <tr>
2680           <td class="memname">DLLEXPORT unsigned char* tj3LoadImage8 </td>
2681           <td>(</td>
2682           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2683           <td class="paramname"><em>handle</em>, </td>
2684         </tr>
2685         <tr>
2686           <td class="paramkey"></td>
2687           <td></td>
2688           <td class="paramtype">const char *&#160;</td>
2689           <td class="paramname"><em>filename</em>, </td>
2690         </tr>
2691         <tr>
2692           <td class="paramkey"></td>
2693           <td></td>
2694           <td class="paramtype">int *&#160;</td>
2695           <td class="paramname"><em>width</em>, </td>
2696         </tr>
2697         <tr>
2698           <td class="paramkey"></td>
2699           <td></td>
2700           <td class="paramtype">int&#160;</td>
2701           <td class="paramname"><em>align</em>, </td>
2702         </tr>
2703         <tr>
2704           <td class="paramkey"></td>
2705           <td></td>
2706           <td class="paramtype">int *&#160;</td>
2707           <td class="paramname"><em>height</em>, </td>
2708         </tr>
2709         <tr>
2710           <td class="paramkey"></td>
2711           <td></td>
2712           <td class="paramtype">int *&#160;</td>
2713           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2714         </tr>
2715         <tr>
2716           <td></td>
2717           <td>)</td>
2718           <td></td><td></td>
2719         </tr>
2720       </table>
2721 </div><div class="memdoc">
2722
2723 <p>Load an 8-bit-per-sample packed-pixel image from disk into memory. </p>
2724 <dl class="params"><dt>Parameters</dt><dd>
2725   <table class="params">
2726     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2727     <tr><td class="paramname">filename</td><td>name of a file containing a packed-pixel image in Windows BMP or PBMPLUS (PPM/PGM) format. Windows BMP files require 8-bit-per-sample data precision. If the data precision of the PBMPLUS file does not match the target data precision, then upconverting or downconverting will be performed.</td></tr>
2728     <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the packed-pixel image</td></tr>
2729     <tr><td class="paramname">align</td><td>row alignment (in samples) of the packed-pixel buffer to be returned (must be a power of 2.) Setting this parameter to n will cause all rows in the buffer to be padded to the nearest multiple of n samples (1 = unpadded.)</td></tr>
2730     <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the packed-pixel image</td></tr>
2731     <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the packed-pixel buffer. The behavior of this function will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
2732 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The packed-pixel buffer returned by this function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of that pixel format upon successful return from this function.</li>
2733 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit-per-pixel BMP files with a grayscale colormap can be loaded.</li>
2734 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a> : The RGB or grayscale pixels stored in the file will be converted using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</li>
2735 <li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The packed-pixel buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
2736 </ul>
2737 </td></tr>
2738   </table>
2739   </dd>
2740 </dl>
2741 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the packed-pixel image, converted to the chosen pixel format and with the chosen row alignment, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaddb84fb6c81769e9faa0f5a63b296606" title="Free a byte buffer previously allocated by TurboJPEG.">tj3Free()</a>. </dd></dl>
2742
2743 </div>
2744 </div>
2745 <a id="ga7c64b5106d04267a46aad85f9714ad90"></a>
2746 <h2 class="memtitle"><span class="permalink"><a href="#ga7c64b5106d04267a46aad85f9714ad90">&#9670;&nbsp;</a></span>tj3SaveImage12()</h2>
2747
2748 <div class="memitem">
2749 <div class="memproto">
2750       <table class="memname">
2751         <tr>
2752           <td class="memname">DLLEXPORT int tj3SaveImage12 </td>
2753           <td>(</td>
2754           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2755           <td class="paramname"><em>handle</em>, </td>
2756         </tr>
2757         <tr>
2758           <td class="paramkey"></td>
2759           <td></td>
2760           <td class="paramtype">const char *&#160;</td>
2761           <td class="paramname"><em>filename</em>, </td>
2762         </tr>
2763         <tr>
2764           <td class="paramkey"></td>
2765           <td></td>
2766           <td class="paramtype">const short *&#160;</td>
2767           <td class="paramname"><em>buffer</em>, </td>
2768         </tr>
2769         <tr>
2770           <td class="paramkey"></td>
2771           <td></td>
2772           <td class="paramtype">int&#160;</td>
2773           <td class="paramname"><em>width</em>, </td>
2774         </tr>
2775         <tr>
2776           <td class="paramkey"></td>
2777           <td></td>
2778           <td class="paramtype">int&#160;</td>
2779           <td class="paramname"><em>pitch</em>, </td>
2780         </tr>
2781         <tr>
2782           <td class="paramkey"></td>
2783           <td></td>
2784           <td class="paramtype">int&#160;</td>
2785           <td class="paramname"><em>height</em>, </td>
2786         </tr>
2787         <tr>
2788           <td class="paramkey"></td>
2789           <td></td>
2790           <td class="paramtype">int&#160;</td>
2791           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2792         </tr>
2793         <tr>
2794           <td></td>
2795           <td>)</td>
2796           <td></td><td></td>
2797         </tr>
2798       </table>
2799 </div><div class="memdoc">
2800
2801 <p>Save a 12-bit-per-sample packed-pixel image from memory to disk. </p>
2802 <dl class="params"><dt>Parameters</dt><dd>
2803   <table class="params">
2804     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2805     <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
2806     <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
2807     <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
2808     <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2809     <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
2810     <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
2811   </table>
2812   </dd>
2813 </dl>
2814 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
2815
2816 </div>
2817 </div>
2818 <a id="ga0fd87851f4266aca24bf4594dd0c0e71"></a>
2819 <h2 class="memtitle"><span class="permalink"><a href="#ga0fd87851f4266aca24bf4594dd0c0e71">&#9670;&nbsp;</a></span>tj3SaveImage16()</h2>
2820
2821 <div class="memitem">
2822 <div class="memproto">
2823       <table class="memname">
2824         <tr>
2825           <td class="memname">DLLEXPORT int tj3SaveImage16 </td>
2826           <td>(</td>
2827           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2828           <td class="paramname"><em>handle</em>, </td>
2829         </tr>
2830         <tr>
2831           <td class="paramkey"></td>
2832           <td></td>
2833           <td class="paramtype">const char *&#160;</td>
2834           <td class="paramname"><em>filename</em>, </td>
2835         </tr>
2836         <tr>
2837           <td class="paramkey"></td>
2838           <td></td>
2839           <td class="paramtype">const unsigned short *&#160;</td>
2840           <td class="paramname"><em>buffer</em>, </td>
2841         </tr>
2842         <tr>
2843           <td class="paramkey"></td>
2844           <td></td>
2845           <td class="paramtype">int&#160;</td>
2846           <td class="paramname"><em>width</em>, </td>
2847         </tr>
2848         <tr>
2849           <td class="paramkey"></td>
2850           <td></td>
2851           <td class="paramtype">int&#160;</td>
2852           <td class="paramname"><em>pitch</em>, </td>
2853         </tr>
2854         <tr>
2855           <td class="paramkey"></td>
2856           <td></td>
2857           <td class="paramtype">int&#160;</td>
2858           <td class="paramname"><em>height</em>, </td>
2859         </tr>
2860         <tr>
2861           <td class="paramkey"></td>
2862           <td></td>
2863           <td class="paramtype">int&#160;</td>
2864           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2865         </tr>
2866         <tr>
2867           <td></td>
2868           <td>)</td>
2869           <td></td><td></td>
2870         </tr>
2871       </table>
2872 </div><div class="memdoc">
2873
2874 <p>Save a 16-bit-per-sample packed-pixel image from memory to disk. </p>
2875 <dl class="params"><dt>Parameters</dt><dd>
2876   <table class="params">
2877     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2878     <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
2879     <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
2880     <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
2881     <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2882     <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
2883     <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
2884   </table>
2885   </dd>
2886 </dl>
2887 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
2888
2889 </div>
2890 </div>
2891 <a id="gaa4ec838988e469cc15618e4690cc8722"></a>
2892 <h2 class="memtitle"><span class="permalink"><a href="#gaa4ec838988e469cc15618e4690cc8722">&#9670;&nbsp;</a></span>tj3SaveImage8()</h2>
2893
2894 <div class="memitem">
2895 <div class="memproto">
2896       <table class="memname">
2897         <tr>
2898           <td class="memname">DLLEXPORT int tj3SaveImage8 </td>
2899           <td>(</td>
2900           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2901           <td class="paramname"><em>handle</em>, </td>
2902         </tr>
2903         <tr>
2904           <td class="paramkey"></td>
2905           <td></td>
2906           <td class="paramtype">const char *&#160;</td>
2907           <td class="paramname"><em>filename</em>, </td>
2908         </tr>
2909         <tr>
2910           <td class="paramkey"></td>
2911           <td></td>
2912           <td class="paramtype">const unsigned char *&#160;</td>
2913           <td class="paramname"><em>buffer</em>, </td>
2914         </tr>
2915         <tr>
2916           <td class="paramkey"></td>
2917           <td></td>
2918           <td class="paramtype">int&#160;</td>
2919           <td class="paramname"><em>width</em>, </td>
2920         </tr>
2921         <tr>
2922           <td class="paramkey"></td>
2923           <td></td>
2924           <td class="paramtype">int&#160;</td>
2925           <td class="paramname"><em>pitch</em>, </td>
2926         </tr>
2927         <tr>
2928           <td class="paramkey"></td>
2929           <td></td>
2930           <td class="paramtype">int&#160;</td>
2931           <td class="paramname"><em>height</em>, </td>
2932         </tr>
2933         <tr>
2934           <td class="paramkey"></td>
2935           <td></td>
2936           <td class="paramtype">int&#160;</td>
2937           <td class="paramname"><em>pixelFormat</em>&#160;</td>
2938         </tr>
2939         <tr>
2940           <td></td>
2941           <td>)</td>
2942           <td></td><td></td>
2943         </tr>
2944       </table>
2945 </div><div class="memdoc">
2946
2947 <p>Save an 8-bit-per-sample packed-pixel image from memory to disk. </p>
2948 <dl class="params"><dt>Parameters</dt><dd>
2949   <table class="params">
2950     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
2951     <tr><td class="paramname">filename</td><td>name of a file to which to save the packed-pixel image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension. Windows BMP files require 8-bit-per-sample data precision.</td></tr>
2952     <tr><td class="paramname">buffer</td><td>pointer to a buffer containing a packed-pixel RGB, grayscale, or CMYK image to be saved</td></tr>
2953     <tr><td class="paramname">width</td><td>width (in pixels) of the packed-pixel image</td></tr>
2954     <tr><td class="paramname">pitch</td><td>samples per row in the packed-pixel image. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in samples) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2955     <tr><td class="paramname">height</td><td>height (in pixels) of the packed-pixel image</td></tr>
2956     <tr><td class="paramname">pixelFormat</td><td>pixel format of the packed-pixel image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.) If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, then the image will be stored in PGM or 8-bit-per-pixel (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit-per-pixel BMP format. If this parameter is set to <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, then the CMYK pixels will be converted to RGB using a quick &amp; dirty algorithm that is suitable only for testing purposes. (Proper conversion between CMYK and other formats requires a color management system.)</td></tr>
2957   </table>
2958   </dd>
2959 </dl>
2960 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
2961
2962 </div>
2963 </div>
2964 <a id="gaddf92640bfee3e8622218c713e77e7db"></a>
2965 <h2 class="memtitle"><span class="permalink"><a href="#gaddf92640bfee3e8622218c713e77e7db">&#9670;&nbsp;</a></span>tj3Set()</h2>
2966
2967 <div class="memitem">
2968 <div class="memproto">
2969       <table class="memname">
2970         <tr>
2971           <td class="memname">DLLEXPORT int tj3Set </td>
2972           <td>(</td>
2973           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2974           <td class="paramname"><em>handle</em>, </td>
2975         </tr>
2976         <tr>
2977           <td class="paramkey"></td>
2978           <td></td>
2979           <td class="paramtype">int&#160;</td>
2980           <td class="paramname"><em>param</em>, </td>
2981         </tr>
2982         <tr>
2983           <td class="paramkey"></td>
2984           <td></td>
2985           <td class="paramtype">int&#160;</td>
2986           <td class="paramname"><em>value</em>&#160;</td>
2987         </tr>
2988         <tr>
2989           <td></td>
2990           <td>)</td>
2991           <td></td><td></td>
2992         </tr>
2993       </table>
2994 </div><div class="memdoc">
2995
2996 <p>Set the value of a parameter. </p>
2997 <dl class="params"><dt>Parameters</dt><dd>
2998   <table class="params">
2999     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance</td></tr>
3000     <tr><td class="paramname">param</td><td>one of the <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameters</a></td></tr>
3001     <tr><td class="paramname">value</td><td>value of the parameter (refer to <a class="el" href="group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82">parameter documentation</a>)</td></tr>
3002   </table>
3003   </dd>
3004 </dl>
3005 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
3006
3007 </div>
3008 </div>
3009 <a id="gaa49c7bd4c9431667a043cfc93388ba1c"></a>
3010 <h2 class="memtitle"><span class="permalink"><a href="#gaa49c7bd4c9431667a043cfc93388ba1c">&#9670;&nbsp;</a></span>tj3SetCroppingRegion()</h2>
3011
3012 <div class="memitem">
3013 <div class="memproto">
3014       <table class="memname">
3015         <tr>
3016           <td class="memname">DLLEXPORT int tj3SetCroppingRegion </td>
3017           <td>(</td>
3018           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
3019           <td class="paramname"><em>handle</em>, </td>
3020         </tr>
3021         <tr>
3022           <td class="paramkey"></td>
3023           <td></td>
3024           <td class="paramtype"><a class="el" href="structtjregion.html">tjregion</a>&#160;</td>
3025           <td class="paramname"><em>croppingRegion</em>&#160;</td>
3026         </tr>
3027         <tr>
3028           <td></td>
3029           <td>)</td>
3030           <td></td><td></td>
3031         </tr>
3032       </table>
3033 </div><div class="memdoc">
3034
3035 <p>Set the cropping region for partially decompressing a lossy JPEG image into a packed-pixel image. </p>
3036 <dl class="params"><dt>Parameters</dt><dd>
3037   <table class="params">
3038     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
3039     <tr><td class="paramname">croppingRegion</td><td><a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies a subregion of the JPEG image to decompress, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf" title="A tjregion structure that specifies no cropping.">TJUNCROPPED</a></code> for no cropping. The left boundary of the cropping region must be evenly divisible by the scaled MCU block width (<code><a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED</a>(<a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>[subsamp], scalingFactor)</code>, where <code>subsamp</code> is the level of chrominance subsampling in the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a2a3494a8215d3de4fdbaeb2ba6f6b03a" title="Chrominance subsampling level.">TJPARAM_SUBSAMP</a>) and <code>scalingFactor</code> is the decompression scaling factor (see <a class="el" href="group___turbo_j_p_e_g.html#ga89da17ee1e43ff423382cbc145803c75" title="Set the scaling factor for subsequent lossy decompression operations.">tj3SetScalingFactor()</a>.) The cropping region should be specified relative to the scaled image dimensions. Unless <code>croppingRegion</code> is <code><a class="el" href="group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf" title="A tjregion structure that specifies no cropping.">TJUNCROPPED</a></code>, the JPEG header must be read (see <a class="el" href="group___turbo_j_p_e_g.html#ga96d2c4b3432f9d88ad14758ae240b8d1" title="Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quan...">tj3DecompressHeader()</a>) prior to calling this function.</td></tr>
3040   </table>
3041   </dd>
3042 </dl>
3043 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
3044
3045 </div>
3046 </div>
3047 <a id="ga89da17ee1e43ff423382cbc145803c75"></a>
3048 <h2 class="memtitle"><span class="permalink"><a href="#ga89da17ee1e43ff423382cbc145803c75">&#9670;&nbsp;</a></span>tj3SetScalingFactor()</h2>
3049
3050 <div class="memitem">
3051 <div class="memproto">
3052       <table class="memname">
3053         <tr>
3054           <td class="memname">DLLEXPORT int tj3SetScalingFactor </td>
3055           <td>(</td>
3056           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
3057           <td class="paramname"><em>handle</em>, </td>
3058         </tr>
3059         <tr>
3060           <td class="paramkey"></td>
3061           <td></td>
3062           <td class="paramtype"><a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>&#160;</td>
3063           <td class="paramname"><em>scalingFactor</em>&#160;</td>
3064         </tr>
3065         <tr>
3066           <td></td>
3067           <td>)</td>
3068           <td></td><td></td>
3069         </tr>
3070       </table>
3071 </div><div class="memdoc">
3072
3073 <p>Set the scaling factor for subsequent lossy decompression operations. </p>
3074 <dl class="params"><dt>Parameters</dt><dd>
3075   <table class="params">
3076     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for decompression</td></tr>
3077     <tr><td class="paramname">scalingFactor</td><td><a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a fractional scaling factor that the decompressor supports (see <a class="el" href="group___turbo_j_p_e_g.html#ga74397f8e0587d4233182c72f085aaf04" title="Returns a list of fractional scaling factors that the JPEG decompressor supports.">tj3GetScalingFactors()</a>), or <code><a class="el" href="group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19" title="A tjscalingfactor structure that specifies a scaling factor of 1/1 (no scaling)">TJUNSCALED</a></code> for no scaling. Decompression scaling is a function of the IDCT algorithm, so scaling factors are generally limited to multiples of 1/8. If the entire JPEG image will be decompressed, then the width and height of the scaled destination image can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG width and height (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a02ab77fb294a0c9061a78cd424c82dd8" title="JPEG width (in pixels) [decompression only, read-only].">TJPARAM_JPEGWIDTH</a> and <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a8f76673be73f2b659440a9572a65a95f" title="JPEG height (in pixels) [decompression only, read-only].">TJPARAM_JPEGHEIGHT</a>) and the specified scaling factor. When decompressing into a planar YUV image, an intermediate buffer copy will be performed if the width or height of the scaled destination image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>.) Note that decompression scaling is not available (and the specified scaling factor is ignored) when decompressing lossless JPEG images (see <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a249f35f0770792b19f995e603bb17c6f" title="Lossless JPEG.">TJPARAM_LOSSLESS</a>), since the IDCT algorithm is not used with those images. Note also that <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82a6914692ac6ec5567787d592b7563f627" title="DCT/IDCT algorithm [lossy compression and decompression].">TJPARAM_FASTDCT</a> is ignored when decompression scaling is enabled.</td></tr>
3078   </table>
3079   </dd>
3080 </dl>
3081 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a>.) </dd></dl>
3082
3083 </div>
3084 </div>
3085 <a id="gaff23ba1dcabed456794b844791613920"></a>
3086 <h2 class="memtitle"><span class="permalink"><a href="#gaff23ba1dcabed456794b844791613920">&#9670;&nbsp;</a></span>tj3Transform()</h2>
3087
3088 <div class="memitem">
3089 <div class="memproto">
3090       <table class="memname">
3091         <tr>
3092           <td class="memname">DLLEXPORT int tj3Transform </td>
3093           <td>(</td>
3094           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
3095           <td class="paramname"><em>handle</em>, </td>
3096         </tr>
3097         <tr>
3098           <td class="paramkey"></td>
3099           <td></td>
3100           <td class="paramtype">const unsigned char *&#160;</td>
3101           <td class="paramname"><em>jpegBuf</em>, </td>
3102         </tr>
3103         <tr>
3104           <td class="paramkey"></td>
3105           <td></td>
3106           <td class="paramtype">size_t&#160;</td>
3107           <td class="paramname"><em>jpegSize</em>, </td>
3108         </tr>
3109         <tr>
3110           <td class="paramkey"></td>
3111           <td></td>
3112           <td class="paramtype">int&#160;</td>
3113           <td class="paramname"><em>n</em>, </td>
3114         </tr>
3115         <tr>
3116           <td class="paramkey"></td>
3117           <td></td>
3118           <td class="paramtype">unsigned char **&#160;</td>
3119           <td class="paramname"><em>dstBufs</em>, </td>
3120         </tr>
3121         <tr>
3122           <td class="paramkey"></td>
3123           <td></td>
3124           <td class="paramtype">size_t *&#160;</td>
3125           <td class="paramname"><em>dstSizes</em>, </td>
3126         </tr>
3127         <tr>
3128           <td class="paramkey"></td>
3129           <td></td>
3130           <td class="paramtype">const <a class="el" href="structtjtransform.html">tjtransform</a> *&#160;</td>
3131           <td class="paramname"><em>transforms</em>&#160;</td>
3132         </tr>
3133         <tr>
3134           <td></td>
3135           <td>)</td>
3136           <td></td><td></td>
3137         </tr>
3138       </table>
3139 </div><div class="memdoc">
3140
3141 <p>Losslessly transform a JPEG image into another JPEG image. </p>
3142 <p>Lossless transforms work by moving the raw DCT coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing entropy decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
3143 <dl class="params"><dt>Parameters</dt><dd>
3144   <table class="params">
3145     <tr><td class="paramname">handle</td><td>handle to a TurboJPEG instance that has been initialized for lossless transformation</td></tr>
3146     <tr><td class="paramname">jpegBuf</td><td>pointer to a byte buffer containing the JPEG source image to transform</td></tr>
3147     <tr><td class="paramname">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>
3148     <tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
3149     <tr><td class="paramname">dstBufs</td><td>pointer to an array of n byte buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG destination buffer to accommodate the size of the transformed JPEG image. Thus, you can choose to:<ol type="1">
3150 <li>pre-allocate the JPEG destination buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gab40a0b231122f536e503e3394569a68d" title="Allocate a byte buffer for use with TurboJPEG.">tj3Alloc()</a> and let TurboJPEG grow the buffer as needed,</li>
3151 <li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
3152 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gac6285e58e35a35d871d7162ec5a929c4" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tj3JPEGBufSize()</a> with the transformed or cropped width and height and the level of subsampling used in the source image. Under normal circumstances, this should ensure that the buffer never has to be re-allocated. (Setting <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> guarantees that it won't be.) Note, however, that there are some rare cases (such as transforming images with a large amount of embedded EXIF or ICC profile data) in which the transformed JPEG image will be larger than the worst-case size, and <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a> cannot be used in those cases.</li>
3153 </ol>
3154 If you choose option 1, then <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ggaa0f6be63ba78278299c9f5c12031fe82ae64ffb358bc7b194fd48e0f27750b29b" title="JPEG destination buffer (re)allocation [compression, lossless transformation].">TJPARAM_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>
3155     <tr><td class="paramname">dstSizes</td><td>pointer to an array of n size_t variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the transformed JPEG image (in bytes.)</td></tr>
3156     <tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed JPEG image.</td></tr>
3157   </table>
3158   </dd>
3159 </dl>
3160 <dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#gaf2aab0e6dbb3edc57646b0fec25e8bb2" title="Returns a descriptive error message explaining why the last command failed.">tj3GetErrorStr()</a> and <a class="el" href="group___turbo_j_p_e_g.html#gab8c8279f1415fe425ff30dbbc56013bd" title="Returns a code indicating the severity of the last error.">tj3GetErrorCode()</a>.) </dd></dl>
3161
3162 </div>
3163 </div>
3164 <a id="gaaebaa16973a0f550a66eca5765ed0546"></a>
3165 <h2 class="memtitle"><span class="permalink"><a href="#gaaebaa16973a0f550a66eca5765ed0546">&#9670;&nbsp;</a></span>tj3YUVBufSize()</h2>
3166
3167 <div class="memitem">
3168 <div class="memproto">
3169       <table class="memname">
3170         <tr>
3171           <td class="memname">DLLEXPORT size_t tj3YUVBufSize </td>
3172           <td>(</td>
3173           <td class="paramtype">int&#160;</td>
3174           <td class="paramname"><em>width</em>, </td>
3175         </tr>
3176         <tr>
3177           <td class="paramkey"></td>
3178           <td></td>
3179           <td class="paramtype">int&#160;</td>
3180           <td class="paramname"><em>align</em>, </td>
3181         </tr>
3182         <tr>
3183           <td class="paramkey"></td>
3184           <td></td>
3185           <td class="paramtype">int&#160;</td>
3186           <td class="paramname"><em>height</em>, </td>
3187         </tr>
3188         <tr>
3189           <td class="paramkey"></td>
3190           <td></td>
3191           <td class="paramtype">int&#160;</td>
3192           <td class="paramname"><em>subsamp</em>&#160;</td>
3193         </tr>
3194         <tr>
3195           <td></td>
3196           <td>)</td>
3197           <td></td><td></td>
3198         </tr>
3199       </table>
3200 </div><div class="memdoc">
3201
3202 <p>The size of the buffer (in bytes) required to hold a unified planar YUV image with the given parameters. </p>
3203 <dl class="params"><dt>Parameters</dt><dd>
3204   <table class="params">
3205     <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
3206     <tr><td class="paramname">align</td><td>row alignment (in bytes) of the image (must be a power of 2.) Setting this parameter to n specifies that each row in each plane of the image will be padded to the nearest multiple of n bytes (1 = unpadded.)</td></tr>
3207     <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
3208     <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
3209   </table>
3210   </dd>
3211 </dl>
3212 <dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the image, or 0 if the arguments are out of bounds. </dd></dl>
3213
3214 </div>
3215 </div>
3216 <a id="ga969767ec8180cc3edd99cf507f87299b"></a>
3217 <h2 class="memtitle"><span class="permalink"><a href="#ga969767ec8180cc3edd99cf507f87299b">&#9670;&nbsp;</a></span>tj3YUVPlaneHeight()</h2>
3218
3219 <div class="memitem">
3220 <div class="memproto">
3221       <table class="memname">
3222         <tr>
3223           <td class="memname">DLLEXPORT int tj3YUVPlaneHeight </td>
3224           <td>(</td>
3225           <td class="paramtype">int&#160;</td>
3226           <td class="paramname"><em>componentID</em>, </td>
3227         </tr>
3228         <tr>
3229           <td class="paramkey"></td>
3230           <td></td>
3231           <td class="paramtype">int&#160;</td>
3232           <td class="paramname"><em>height</em>, </td>
3233         </tr>
3234         <tr>
3235           <td class="paramkey"></td>
3236           <td></td>
3237           <td class="paramtype">int&#160;</td>
3238           <td class="paramname"><em>subsamp</em>&#160;</td>
3239         </tr>
3240         <tr>
3241           <td></td>
3242           <td>)</td>
3243           <td></td><td></td>
3244         </tr>
3245       </table>
3246 </div><div class="memdoc">
3247
3248 <p>The plane height of a YUV image plane with the given parameters. </p>
3249 <p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane height.</p>
3250 <dl class="params"><dt>Parameters</dt><dd>
3251   <table class="params">
3252     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
3253     <tr><td class="paramname">height</td><td>height (in pixels) of the YUV image</td></tr>
3254     <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
3255   </table>
3256   </dd>
3257 </dl>
3258 <dl class="section return"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or 0 if the arguments are out of bounds. </dd></dl>
3259
3260 </div>
3261 </div>
3262 <a id="gacc19d265edce76b46146f59579f9438d"></a>
3263 <h2 class="memtitle"><span class="permalink"><a href="#gacc19d265edce76b46146f59579f9438d">&#9670;&nbsp;</a></span>tj3YUVPlaneSize()</h2>
3264
3265 <div class="memitem">
3266 <div class="memproto">
3267       <table class="memname">
3268         <tr>
3269           <td class="memname">DLLEXPORT size_t tj3YUVPlaneSize </td>
3270           <td>(</td>
3271           <td class="paramtype">int&#160;</td>
3272           <td class="paramname"><em>componentID</em>, </td>
3273         </tr>
3274         <tr>
3275           <td class="paramkey"></td>
3276           <td></td>
3277           <td class="paramtype">int&#160;</td>
3278           <td class="paramname"><em>width</em>, </td>
3279         </tr>
3280         <tr>
3281           <td class="paramkey"></td>
3282           <td></td>
3283           <td class="paramtype">int&#160;</td>
3284           <td class="paramname"><em>stride</em>, </td>
3285         </tr>
3286         <tr>
3287           <td class="paramkey"></td>
3288           <td></td>
3289           <td class="paramtype">int&#160;</td>
3290           <td class="paramname"><em>height</em>, </td>
3291         </tr>
3292         <tr>
3293           <td class="paramkey"></td>
3294           <td></td>
3295           <td class="paramtype">int&#160;</td>
3296           <td class="paramname"><em>subsamp</em>&#160;</td>
3297         </tr>
3298         <tr>
3299           <td></td>
3300           <td>)</td>
3301           <td></td><td></td>
3302         </tr>
3303       </table>
3304 </div><div class="memdoc">
3305
3306 <p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>
3307 <dl class="params"><dt>Parameters</dt><dd>
3308   <table class="params">
3309     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
3310     <tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>
3311     <tr><td class="paramname">stride</td><td>bytes per row in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
3312     <tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>
3313     <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
3314   </table>
3315   </dd>
3316 </dl>
3317 <dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or 0 if the arguments are out of bounds. </dd></dl>
3318
3319 </div>
3320 </div>
3321 <a id="gac99d1933ede1d59fcada9a826e88eb2d"></a>
3322 <h2 class="memtitle"><span class="permalink"><a href="#gac99d1933ede1d59fcada9a826e88eb2d">&#9670;&nbsp;</a></span>tj3YUVPlaneWidth()</h2>
3323
3324 <div class="memitem">
3325 <div class="memproto">
3326       <table class="memname">
3327         <tr>
3328           <td class="memname">DLLEXPORT int tj3YUVPlaneWidth </td>
3329           <td>(</td>
3330           <td class="paramtype">int&#160;</td>
3331           <td class="paramname"><em>componentID</em>, </td>
3332         </tr>
3333         <tr>
3334           <td class="paramkey"></td>
3335           <td></td>
3336           <td class="paramtype">int&#160;</td>
3337           <td class="paramname"><em>width</em>, </td>
3338         </tr>
3339         <tr>
3340           <td class="paramkey"></td>
3341           <td></td>
3342           <td class="paramtype">int&#160;</td>
3343           <td class="paramname"><em>subsamp</em>&#160;</td>
3344         </tr>
3345         <tr>
3346           <td></td>
3347           <td>)</td>
3348           <td></td><td></td>
3349         </tr>
3350       </table>
3351 </div><div class="memdoc">
3352
3353 <p>The plane width of a YUV image plane with the given parameters. </p>
3354 <p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane width.</p>
3355 <dl class="params"><dt>Parameters</dt><dd>
3356   <table class="params">
3357     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
3358     <tr><td class="paramname">width</td><td>width (in pixels) of the YUV image</td></tr>
3359     <tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
3360   </table>
3361   </dd>
3362 </dl>
3363 <dl class="section return"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or 0 if the arguments are out of bounds. </dd></dl>
3364
3365 </div>
3366 </div>
3367 <h2 class="groupheader">Variable Documentation</h2>
3368 <a id="ga5af0ab065feefd526debf1e20c43e837"></a>
3369 <h2 class="memtitle"><span class="permalink"><a href="#ga5af0ab065feefd526debf1e20c43e837">&#9670;&nbsp;</a></span>tjAlphaOffset</h2>
3370
3371 <div class="memitem">
3372 <div class="memproto">
3373 <table class="mlabels">
3374   <tr>
3375   <td class="mlabels-left">
3376       <table class="memname">
3377         <tr>
3378           <td class="memname">const int tjAlphaOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
3379         </tr>
3380       </table>
3381   </td>
3382   <td class="mlabels-right">
3383 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3384   </tr>
3385 </table>
3386 </div><div class="memdoc">
3387
3388 <p>Alpha offset (in samples) for a given pixel format. </p>
3389 <p>This specifies the number of samples that the alpha component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRA is stored in <code>unsigned char pixel[]</code>, then the alpha component will be <code>pixel[tjAlphaOffset[TJPF_BGRA]]</code>. This will be -1 if the pixel format does not have an alpha component. </p>
3390
3391 </div>
3392 </div>
3393 <a id="ga84e2e35d3f08025f976ec1ec53693dea"></a>
3394 <h2 class="memtitle"><span class="permalink"><a href="#ga84e2e35d3f08025f976ec1ec53693dea">&#9670;&nbsp;</a></span>tjBlueOffset</h2>
3395
3396 <div class="memitem">
3397 <div class="memproto">
3398 <table class="mlabels">
3399   <tr>
3400   <td class="mlabels-left">
3401       <table class="memname">
3402         <tr>
3403           <td class="memname">const int tjBlueOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
3404         </tr>
3405       </table>
3406   </td>
3407   <td class="mlabels-right">
3408 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3409   </tr>
3410 </table>
3411 </div><div class="memdoc">
3412
3413 <p>Blue offset (in samples) for a given pixel format. </p>
3414 <p>This specifies the number of samples that the blue component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the blue component will be <code>pixel[tjBlueOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a blue component. </p>
3415
3416 </div>
3417 </div>
3418 <a id="ga82d6e35da441112a411da41923c0ba2f"></a>
3419 <h2 class="memtitle"><span class="permalink"><a href="#ga82d6e35da441112a411da41923c0ba2f">&#9670;&nbsp;</a></span>tjGreenOffset</h2>
3420
3421 <div class="memitem">
3422 <div class="memproto">
3423 <table class="mlabels">
3424   <tr>
3425   <td class="mlabels-left">
3426       <table class="memname">
3427         <tr>
3428           <td class="memname">const int tjGreenOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
3429         </tr>
3430       </table>
3431   </td>
3432   <td class="mlabels-right">
3433 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3434   </tr>
3435 </table>
3436 </div><div class="memdoc">
3437
3438 <p>Green offset (in samples) for a given pixel format. </p>
3439 <p>This specifies the number of samples that the green component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the green component will be <code>pixel[tjGreenOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a green component. </p>
3440
3441 </div>
3442 </div>
3443 <a id="gabd247bb9fecb393eca57366feb8327bf"></a>
3444 <h2 class="memtitle"><span class="permalink"><a href="#gabd247bb9fecb393eca57366feb8327bf">&#9670;&nbsp;</a></span>tjMCUHeight</h2>
3445
3446 <div class="memitem">
3447 <div class="memproto">
3448 <table class="mlabels">
3449   <tr>
3450   <td class="mlabels-left">
3451       <table class="memname">
3452         <tr>
3453           <td class="memname">const int tjMCUHeight[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
3454         </tr>
3455       </table>
3456   </td>
3457   <td class="mlabels-right">
3458 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3459   </tr>
3460 </table>
3461 </div><div class="memdoc">
3462
3463 <p>MCU block height (in pixels) for a given level of chrominance subsampling. </p>
3464 <p>MCU block sizes:</p><ul>
3465 <li>8x8 for no subsampling or grayscale</li>
3466 <li>16x8 for 4:2:2</li>
3467 <li>8x16 for 4:4:0</li>
3468 <li>16x16 for 4:2:0</li>
3469 <li>32x8 for 4:1:1</li>
3470 <li>8x32 for 4:4:1 </li>
3471 </ul>
3472
3473 </div>
3474 </div>
3475 <a id="ga9e61e7cd47a15a173283ba94e781308c"></a>
3476 <h2 class="memtitle"><span class="permalink"><a href="#ga9e61e7cd47a15a173283ba94e781308c">&#9670;&nbsp;</a></span>tjMCUWidth</h2>
3477
3478 <div class="memitem">
3479 <div class="memproto">
3480 <table class="mlabels">
3481   <tr>
3482   <td class="mlabels-left">
3483       <table class="memname">
3484         <tr>
3485           <td class="memname">const int tjMCUWidth[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
3486         </tr>
3487       </table>
3488   </td>
3489   <td class="mlabels-right">
3490 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3491   </tr>
3492 </table>
3493 </div><div class="memdoc">
3494
3495 <p>MCU block width (in pixels) for a given level of chrominance subsampling. </p>
3496 <p>MCU block sizes:</p><ul>
3497 <li>8x8 for no subsampling or grayscale</li>
3498 <li>16x8 for 4:2:2</li>
3499 <li>8x16 for 4:4:0</li>
3500 <li>16x16 for 4:2:0</li>
3501 <li>32x8 for 4:1:1</li>
3502 <li>8x32 for 4:4:1 </li>
3503 </ul>
3504
3505 </div>
3506 </div>
3507 <a id="gad77cf8fe5b2bfd3cb3f53098146abb4c"></a>
3508 <h2 class="memtitle"><span class="permalink"><a href="#gad77cf8fe5b2bfd3cb3f53098146abb4c">&#9670;&nbsp;</a></span>tjPixelSize</h2>
3509
3510 <div class="memitem">
3511 <div class="memproto">
3512 <table class="mlabels">
3513   <tr>
3514   <td class="mlabels-left">
3515       <table class="memname">
3516         <tr>
3517           <td class="memname">const int tjPixelSize[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
3518         </tr>
3519       </table>
3520   </td>
3521   <td class="mlabels-right">
3522 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3523   </tr>
3524 </table>
3525 </div><div class="memdoc">
3526
3527 <p>Pixel size (in samples) for a given pixel format. </p>
3528
3529 </div>
3530 </div>
3531 <a id="gadd9b446742ac8a3923f7992c7988fea8"></a>
3532 <h2 class="memtitle"><span class="permalink"><a href="#gadd9b446742ac8a3923f7992c7988fea8">&#9670;&nbsp;</a></span>tjRedOffset</h2>
3533
3534 <div class="memitem">
3535 <div class="memproto">
3536 <table class="mlabels">
3537   <tr>
3538   <td class="mlabels-left">
3539       <table class="memname">
3540         <tr>
3541           <td class="memname">const int tjRedOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
3542         </tr>
3543       </table>
3544   </td>
3545   <td class="mlabels-right">
3546 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3547   </tr>
3548 </table>
3549 </div><div class="memdoc">
3550
3551 <p>Red offset (in samples) for a given pixel format. </p>
3552 <p>This specifies the number of samples that the red component is offset from the start of the pixel. For instance, if an 8-bit-per-component pixel of format TJPF_BGRX is stored in <code>unsigned char pixel[]</code>, then the red component will be <code>pixel[tjRedOffset[TJPF_BGRX]]</code>. This will be -1 if the pixel format does not have a red component. </p>
3553
3554 </div>
3555 </div>
3556 <a id="ga6f192ad58a5a5802e145149d83c643bf"></a>
3557 <h2 class="memtitle"><span class="permalink"><a href="#ga6f192ad58a5a5802e145149d83c643bf">&#9670;&nbsp;</a></span>TJUNCROPPED</h2>
3558
3559 <div class="memitem">
3560 <div class="memproto">
3561 <table class="mlabels">
3562   <tr>
3563   <td class="mlabels-left">
3564       <table class="memname">
3565         <tr>
3566           <td class="memname">const <a class="el" href="structtjregion.html">tjregion</a> TJUNCROPPED</td>
3567         </tr>
3568       </table>
3569   </td>
3570   <td class="mlabels-right">
3571 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3572   </tr>
3573 </table>
3574 </div><div class="memdoc">
3575
3576 <p>A <a class="el" href="structtjregion.html" title="Cropping region.">tjregion</a> structure that specifies no cropping. </p>
3577
3578 </div>
3579 </div>
3580 <a id="ga7880644a0849161ad20933536169ee19"></a>
3581 <h2 class="memtitle"><span class="permalink"><a href="#ga7880644a0849161ad20933536169ee19">&#9670;&nbsp;</a></span>TJUNSCALED</h2>
3582
3583 <div class="memitem">
3584 <div class="memproto">
3585 <table class="mlabels">
3586   <tr>
3587   <td class="mlabels-left">
3588       <table class="memname">
3589         <tr>
3590           <td class="memname">const <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a> TJUNSCALED</td>
3591         </tr>
3592       </table>
3593   </td>
3594   <td class="mlabels-right">
3595 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
3596   </tr>
3597 </table>
3598 </div><div class="memdoc">
3599
3600 <p>A <a class="el" href="structtjscalingfactor.html" title="Scaling factor.">tjscalingfactor</a> structure that specifies a scaling factor of 1/1 (no scaling) </p>
3601
3602 </div>
3603 </div>
3604 </div><!-- contents -->
3605 <!-- start footer part -->
3606 <hr class="footer"/><address class="footer"><small>
3607 Generated by&#160;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20
3608 </small></address>
3609 </body>
3610 </html>