63d47910533928b5b8197317f91564e8d2b14ad9
[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">2.1.4</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: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>
96 <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>
97 <tr class="separator:ga5ef3d169162ce77ce348e292a0b7477c"><td class="memSeparator" colspan="2">&#160;</td></tr>
98 <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>
99 <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>
100 <tr class="separator:ga7010a4402f54a45ba822ad8675a4655e"><td class="memSeparator" colspan="2">&#160;</td></tr>
101 <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>
102 <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>
103 <tr class="separator:ga39f57a6fb02d9cf32e7b6890099b5a71"><td class="memSeparator" colspan="2">&#160;</td></tr>
104 <tr class="memitem:ga72ecf4ebe6eb702d3c6f5ca27455e1ec"><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#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">TJFLAG_BOTTOMUP</a></td></tr>
105 <tr class="memdesc:ga72ecf4ebe6eb702d3c6f5ca27455e1ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order.  <a href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">More...</a><br /></td></tr>
106 <tr class="separator:ga72ecf4ebe6eb702d3c6f5ca27455e1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
107 <tr class="memitem:ga4ee4506c81177a06f77e2504a22efd2d"><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#ga4ee4506c81177a06f77e2504a22efd2d">TJFLAG_FASTUPSAMPLE</a></td></tr>
108 <tr class="memdesc:ga4ee4506c81177a06f77e2504a22efd2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec.  <a href="group___turbo_j_p_e_g.html#ga4ee4506c81177a06f77e2504a22efd2d">More...</a><br /></td></tr>
109 <tr class="separator:ga4ee4506c81177a06f77e2504a22efd2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
110 <tr class="memitem:ga8808d403c68b62aaa58a4c1e58e98963"><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#ga8808d403c68b62aaa58a4c1e58e98963">TJFLAG_NOREALLOC</a></td></tr>
111 <tr class="memdesc:ga8808d403c68b62aaa58a4c1e58e98963"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable buffer (re)allocation.  <a href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963">More...</a><br /></td></tr>
112 <tr class="separator:ga8808d403c68b62aaa58a4c1e58e98963"><td class="memSeparator" colspan="2">&#160;</td></tr>
113 <tr class="memitem:gaabce235db80d3f698b27f36cbd453da2"><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#gaabce235db80d3f698b27f36cbd453da2">TJFLAG_FASTDCT</a></td></tr>
114 <tr class="memdesc:gaabce235db80d3f698b27f36cbd453da2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use the fastest DCT/IDCT algorithm available in the underlying codec.  <a href="group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2">More...</a><br /></td></tr>
115 <tr class="separator:gaabce235db80d3f698b27f36cbd453da2"><td class="memSeparator" colspan="2">&#160;</td></tr>
116 <tr class="memitem:gacb233cfd722d66d1ccbf48a7de81f0e0"><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#gacb233cfd722d66d1ccbf48a7de81f0e0">TJFLAG_ACCURATEDCT</a></td></tr>
117 <tr class="memdesc:gacb233cfd722d66d1ccbf48a7de81f0e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use the most accurate DCT/IDCT algorithm available in the underlying codec.  <a href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">More...</a><br /></td></tr>
118 <tr class="separator:gacb233cfd722d66d1ccbf48a7de81f0e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
119 <tr class="memitem:ga519cfa4ef6c18d9e5b455fdf59306a3a"><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#ga519cfa4ef6c18d9e5b455fdf59306a3a">TJFLAG_STOPONWARNING</a></td></tr>
120 <tr class="memdesc:ga519cfa4ef6c18d9e5b455fdf59306a3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Immediately discontinue the current compression/decompression/transform operation if the underlying codec throws a warning (non-fatal error).  <a href="group___turbo_j_p_e_g.html#ga519cfa4ef6c18d9e5b455fdf59306a3a">More...</a><br /></td></tr>
121 <tr class="separator:ga519cfa4ef6c18d9e5b455fdf59306a3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
122 <tr class="memitem:ga43b426750b46190a25d34a67ef76df1b"><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#ga43b426750b46190a25d34a67ef76df1b">TJFLAG_PROGRESSIVE</a></td></tr>
123 <tr class="memdesc:ga43b426750b46190a25d34a67ef76df1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use progressive entropy coding in JPEG images generated by the compression and transform functions.  <a href="group___turbo_j_p_e_g.html#ga43b426750b46190a25d34a67ef76df1b">More...</a><br /></td></tr>
124 <tr class="separator:ga43b426750b46190a25d34a67ef76df1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
125 <tr class="memitem:ga163e6482dc5096831feef9c79ff3f805"><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#ga163e6482dc5096831feef9c79ff3f805">TJFLAG_LIMITSCANS</a></td></tr>
126 <tr class="memdesc:ga163e6482dc5096831feef9c79ff3f805"><td class="mdescLeft">&#160;</td><td class="mdescRight">Limit the number of progressive JPEG scans that the decompression and transform functions will process.  <a href="group___turbo_j_p_e_g.html#ga163e6482dc5096831feef9c79ff3f805">More...</a><br /></td></tr>
127 <tr class="separator:ga163e6482dc5096831feef9c79ff3f805"><td class="memSeparator" colspan="2">&#160;</td></tr>
128 <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>
129 <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>
130 <tr class="separator:ga79bde1b4a3e2351e00887e47781b966e"><td class="memSeparator" colspan="2">&#160;</td></tr>
131 <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>
132 <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>
133 <tr class="separator:ga0f6dbd18adf38b7d46ac547f0f4d562c"><td class="memSeparator" colspan="2">&#160;</td></tr>
134 <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>
135 <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#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</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>
136 <tr class="separator:ga50e03cb5ed115330e212417429600b00"><td class="memSeparator" colspan="2">&#160;</td></tr>
137 <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>
138 <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#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</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>
139 <tr class="separator:ga319826b7eb1583c0595bbe7b95428709"><td class="memSeparator" colspan="2">&#160;</td></tr>
140 <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>
141 <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>
142 <tr class="separator:ga9c771a757fc1294add611906b89ab2d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
143 <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>
144 <tr class="memdesc:ga3acee7b48ade1b99e5588736007c2589"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will discard the color data in the input image and produce a grayscale output image.  <a href="group___turbo_j_p_e_g.html#ga3acee7b48ade1b99e5588736007c2589">More...</a><br /></td></tr>
145 <tr class="separator:ga3acee7b48ade1b99e5588736007c2589"><td class="memSeparator" colspan="2">&#160;</td></tr>
146 <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>
147 <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#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.)  <a href="group___turbo_j_p_e_g.html#gafbf992bbf6e006705886333703ffab31">More...</a><br /></td></tr>
148 <tr class="separator:gafbf992bbf6e006705886333703ffab31"><td class="memSeparator" colspan="2">&#160;</td></tr>
149 <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>
150 <tr class="memdesc:gad2371c80674584ecc1a7d75e564cf026"><td class="mdescLeft">&#160;</td><td class="mdescRight">This option will enable progressive entropy coding in the output image generated by this particular transform.  <a href="group___turbo_j_p_e_g.html#gad2371c80674584ecc1a7d75e564cf026">More...</a><br /></td></tr>
151 <tr class="separator:gad2371c80674584ecc1a7d75e564cf026"><td class="memSeparator" colspan="2">&#160;</td></tr>
152 <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>
153 <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#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image.  <a href="group___turbo_j_p_e_g.html#ga153b468cfb905d0de61706c838986fe8">More...</a><br /></td></tr>
154 <tr class="separator:ga153b468cfb905d0de61706c838986fe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
155 <tr class="memitem:ga0aba955473315e405295d978f0c16511"><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#ga0aba955473315e405295d978f0c16511">TJPAD</a>(width)</td></tr>
156 <tr class="memdesc:ga0aba955473315e405295d978f0c16511"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pad the given width to the nearest 32-bit boundary.  <a href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511">More...</a><br /></td></tr>
157 <tr class="separator:ga0aba955473315e405295d978f0c16511"><td class="memSeparator" colspan="2">&#160;</td></tr>
158 <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>
159 <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>
160 <tr class="separator:ga84878bb65404204743aa18cac02781df"><td class="memSeparator" colspan="2">&#160;</td></tr>
161 </table><table class="memberdecls">
162 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
163 Typedefs</h2></td></tr>
164 <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>
165 <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>
166 <tr class="separator:ga504805ec0161f1b505397ca0118bf8fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
167 <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>
168 <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>
169 <tr class="separator:ga758d2634ecb4949de7815cba621f5763"><td class="memSeparator" colspan="2">&#160;</td></tr>
170 </table><table class="memberdecls">
171 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
172 Enumerations</h2></td></tr>
173 <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 />
174 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3">TJSAMP_444</a>, 
175 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404">TJSAMP_422</a>, 
176 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>, 
177 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248">TJSAMP_GRAY</a>, 
178 <br />
179 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974">TJSAMP_440</a>, 
180 <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2">TJSAMP_411</a>
181 <br />
182  }</td></tr>
183 <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>
184 <tr class="separator:ga1d047060ea80bb9820d540bb928e9074"><td class="memSeparator" colspan="2">&#160;</td></tr>
185 <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 />
186 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7ce93230bff449518ce387c17e6ed37c">TJPF_RGB</a>, 
187 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839">TJPF_BGR</a>, 
188 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01">TJPF_RGBX</a>, 
189 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8">TJPF_BGRX</a>, 
190 <br />
191 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af">TJPF_XBGR</a>, 
192 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84">TJPF_XRGB</a>, 
193 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a>, 
194 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12">TJPF_RGBA</a>, 
195 <br />
196 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4">TJPF_BGRA</a>, 
197 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081">TJPF_ABGR</a>, 
198 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c">TJPF_ARGB</a>, 
199 <a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b">TJPF_CMYK</a>, 
200 <br />
201 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a>
202 <br />
203  }</td></tr>
204 <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>
205 <tr class="separator:gac916144e26c3817ac514e64ae5d12e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
206 <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 />
207 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a677cb7ccb85c4038ac41964a2e09e555">TJCS_RGB</a>, 
208 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75">TJCS_YCbCr</a>, 
209 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a">TJCS_GRAY</a>, 
210 <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53">TJCS_CMYK</a>, 
211 <br />
212 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e">TJCS_YCCK</a>
213 <br />
214  }</td></tr>
215 <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>
216 <tr class="separator:ga4f83ad3368e0e29d1957be0efa7c3720"><td class="memSeparator" colspan="2">&#160;</td></tr>
217 <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>, 
218 <a class="el" href="group___turbo_j_p_e_g.html#ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a">TJERR_FATAL</a>
219  }</td></tr>
220 <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>
221 <tr class="separator:gafbc17cfa57d0d5d11fea35ac025950fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
222 <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 />
223 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aad88c0366cd3f7d0eac9d7a3fa1c2c27">TJXOP_NONE</a>, 
224 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce">TJXOP_HFLIP</a>, 
225 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d">TJXOP_VFLIP</a>, 
226 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a31060aed199f886afdd417f80499c32d">TJXOP_TRANSPOSE</a>, 
227 <br />
228 &#160;&#160;<a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866af3b14d488aea6ece9e5b3df73a74d6a4">TJXOP_TRANSVERSE</a>, 
229 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128">TJXOP_ROT90</a>, 
230 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692">TJXOP_ROT180</a>, 
231 <a class="el" href="group___turbo_j_p_e_g.html#gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08">TJXOP_ROT270</a>
232 <br />
233  }</td></tr>
234 <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#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a>  <a href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">More...</a><br /></td></tr>
235 <tr class="separator:ga2de531af4e7e6c4f124908376b354866"><td class="memSeparator" colspan="2">&#160;</td></tr>
236 </table><table class="memberdecls">
237 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
238 Functions</h2></td></tr>
239 <tr class="memitem:ga9d63a05fc6d813f4aae06107041a37e8"><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#ga9d63a05fc6d813f4aae06107041a37e8">tjInitCompress</a> (void)</td></tr>
240 <tr class="memdesc:ga9d63a05fc6d813f4aae06107041a37e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a TurboJPEG compressor instance.  <a href="group___turbo_j_p_e_g.html#ga9d63a05fc6d813f4aae06107041a37e8">More...</a><br /></td></tr>
241 <tr class="separator:ga9d63a05fc6d813f4aae06107041a37e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
242 <tr class="memitem:gafbdce0112fd78fd38efae841443a9bcf"><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#gafbdce0112fd78fd38efae841443a9bcf">tjCompress2</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, unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)</td></tr>
243 <tr class="memdesc:gafbdce0112fd78fd38efae841443a9bcf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress an RGB, grayscale, or CMYK image into a JPEG image.  <a href="group___turbo_j_p_e_g.html#gafbdce0112fd78fd38efae841443a9bcf">More...</a><br /></td></tr>
244 <tr class="separator:gafbdce0112fd78fd38efae841443a9bcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
245 <tr class="memitem:ga7622a459b79aa1007e005b58783f875b"><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#ga7622a459b79aa1007e005b58783f875b">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
246 <tr class="memdesc:ga7622a459b79aa1007e005b58783f875b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a YUV planar image into a JPEG image.  <a href="group___turbo_j_p_e_g.html#ga7622a459b79aa1007e005b58783f875b">More...</a><br /></td></tr>
247 <tr class="separator:ga7622a459b79aa1007e005b58783f875b"><td class="memSeparator" colspan="2">&#160;</td></tr>
248 <tr class="memitem:ga29ec5dfbd2d84b8724e951d6fa0d5d9e"><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#ga29ec5dfbd2d84b8724e951d6fa0d5d9e">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char **srcPlanes, int width, const int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
249 <tr class="memdesc:ga29ec5dfbd2d84b8724e951d6fa0d5d9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image.  <a href="group___turbo_j_p_e_g.html#ga29ec5dfbd2d84b8724e951d6fa0d5d9e">More...</a><br /></td></tr>
250 <tr class="separator:ga29ec5dfbd2d84b8724e951d6fa0d5d9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
251 <tr class="memitem:ga67ac12fee79073242cb216e07c9f1f90"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga67ac12fee79073242cb216e07c9f1f90">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
252 <tr class="memdesc:ga67ac12fee79073242cb216e07c9f1f90"><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#ga67ac12fee79073242cb216e07c9f1f90">More...</a><br /></td></tr>
253 <tr class="separator:ga67ac12fee79073242cb216e07c9f1f90"><td class="memSeparator" colspan="2">&#160;</td></tr>
254 <tr class="memitem:ga2be2b9969d4df9ecce9b05deed273194"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga2be2b9969d4df9ecce9b05deed273194">tjBufSizeYUV2</a> (int width, int pad, int height, int subsamp)</td></tr>
255 <tr class="memdesc:ga2be2b9969d4df9ecce9b05deed273194"><td class="mdescLeft">&#160;</td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.  <a href="group___turbo_j_p_e_g.html#ga2be2b9969d4df9ecce9b05deed273194">More...</a><br /></td></tr>
256 <tr class="separator:ga2be2b9969d4df9ecce9b05deed273194"><td class="memSeparator" colspan="2">&#160;</td></tr>
257 <tr class="memitem:gab4ab7b24f6e797d79abaaa670373961d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gab4ab7b24f6e797d79abaaa670373961d">tjPlaneSizeYUV</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>
258 <tr class="memdesc:gab4ab7b24f6e797d79abaaa670373961d"><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#gab4ab7b24f6e797d79abaaa670373961d">More...</a><br /></td></tr>
259 <tr class="separator:gab4ab7b24f6e797d79abaaa670373961d"><td class="memSeparator" colspan="2">&#160;</td></tr>
260 <tr class="memitem:ga63fb66bb1e36c74008c4634360becbb1"><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#ga63fb66bb1e36c74008c4634360becbb1">tjPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>
261 <tr class="memdesc:ga63fb66bb1e36c74008c4634360becbb1"><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#ga63fb66bb1e36c74008c4634360becbb1">More...</a><br /></td></tr>
262 <tr class="separator:ga63fb66bb1e36c74008c4634360becbb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
263 <tr class="memitem:ga1a209696c6a80748f20e134b3c64789f"><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#ga1a209696c6a80748f20e134b3c64789f">tjPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>
264 <tr class="memdesc:ga1a209696c6a80748f20e134b3c64789f"><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#ga1a209696c6a80748f20e134b3c64789f">More...</a><br /></td></tr>
265 <tr class="separator:ga1a209696c6a80748f20e134b3c64789f"><td class="memSeparator" colspan="2">&#160;</td></tr>
266 <tr class="memitem:gac519b922cdf446e97d0cdcba513636bf"><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#gac519b922cdf446e97d0cdcba513636bf">tjEncodeYUV3</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 pad, int subsamp, int flags)</td></tr>
267 <tr class="memdesc:gac519b922cdf446e97d0cdcba513636bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an RGB or grayscale image into a YUV planar image.  <a href="group___turbo_j_p_e_g.html#gac519b922cdf446e97d0cdcba513636bf">More...</a><br /></td></tr>
268 <tr class="separator:gac519b922cdf446e97d0cdcba513636bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
269 <tr class="memitem:gae2d04c72457fe7f4d60cf78ab1b1feb1"><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#gae2d04c72457fe7f4d60cf78ab1b1feb1">tjEncodeYUVPlanes</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, int subsamp, int flags)</td></tr>
270 <tr class="memdesc:gae2d04c72457fe7f4d60cf78ab1b1feb1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#gae2d04c72457fe7f4d60cf78ab1b1feb1">More...</a><br /></td></tr>
271 <tr class="separator:gae2d04c72457fe7f4d60cf78ab1b1feb1"><td class="memSeparator" colspan="2">&#160;</td></tr>
272 <tr class="memitem:ga52300eac3f3d9ef4bab303bc244f62d3"><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#ga52300eac3f3d9ef4bab303bc244f62d3">tjInitDecompress</a> (void)</td></tr>
273 <tr class="memdesc:ga52300eac3f3d9ef4bab303bc244f62d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a TurboJPEG decompressor instance.  <a href="group___turbo_j_p_e_g.html#ga52300eac3f3d9ef4bab303bc244f62d3">More...</a><br /></td></tr>
274 <tr class="separator:ga52300eac3f3d9ef4bab303bc244f62d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
275 <tr class="memitem:ga0595681096bba7199cc6f3533cb25f77"><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#ga0595681096bba7199cc6f3533cb25f77">tjDecompressHeader3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int *width, int *height, int *jpegSubsamp, int *jpegColorspace)</td></tr>
276 <tr class="memdesc:ga0595681096bba7199cc6f3533cb25f77"><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#ga0595681096bba7199cc6f3533cb25f77">More...</a><br /></td></tr>
277 <tr class="separator:ga0595681096bba7199cc6f3533cb25f77"><td class="memSeparator" colspan="2">&#160;</td></tr>
278 <tr class="memitem:gac3854476006b10787bd128f7ede48057"><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#gac3854476006b10787bd128f7ede48057">tjGetScalingFactors</a> (int *numscalingfactors)</td></tr>
279 <tr class="memdesc:gac3854476006b10787bd128f7ede48057"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports.  <a href="group___turbo_j_p_e_g.html#gac3854476006b10787bd128f7ede48057">More...</a><br /></td></tr>
280 <tr class="separator:gac3854476006b10787bd128f7ede48057"><td class="memSeparator" colspan="2">&#160;</td></tr>
281 <tr class="memitem:gae9eccef8b682a48f43a9117c231ed013"><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#gae9eccef8b682a48f43a9117c231ed013">tjDecompress2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
282 <tr class="memdesc:gae9eccef8b682a48f43a9117c231ed013"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a JPEG image to an RGB, grayscale, or CMYK image.  <a href="group___turbo_j_p_e_g.html#gae9eccef8b682a48f43a9117c231ed013">More...</a><br /></td></tr>
283 <tr class="separator:gae9eccef8b682a48f43a9117c231ed013"><td class="memSeparator" colspan="2">&#160;</td></tr>
284 <tr class="memitem:ga04d1e839ff9a0860dd1475cff78d3364"><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#ga04d1e839ff9a0860dd1475cff78d3364">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>
285 <tr class="memdesc:ga04d1e839ff9a0860dd1475cff78d3364"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a JPEG image to a YUV planar image.  <a href="group___turbo_j_p_e_g.html#ga04d1e839ff9a0860dd1475cff78d3364">More...</a><br /></td></tr>
286 <tr class="separator:ga04d1e839ff9a0860dd1475cff78d3364"><td class="memSeparator" colspan="2">&#160;</td></tr>
287 <tr class="memitem:gaa59f901a5258ada5bd0185ad59368540"><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#gaa59f901a5258ada5bd0185ad59368540">tjDecompressToYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags)</td></tr>
288 <tr class="memdesc:gaa59f901a5258ada5bd0185ad59368540"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes.  <a href="group___turbo_j_p_e_g.html#gaa59f901a5258ada5bd0185ad59368540">More...</a><br /></td></tr>
289 <tr class="separator:gaa59f901a5258ada5bd0185ad59368540"><td class="memSeparator" colspan="2">&#160;</td></tr>
290 <tr class="memitem:ga70abbf38f77a26fd6da8813bef96f695"><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#ga70abbf38f77a26fd6da8813bef96f695">tjDecodeYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
291 <tr class="memdesc:ga70abbf38f77a26fd6da8813bef96f695"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode a YUV planar image into an RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#ga70abbf38f77a26fd6da8813bef96f695">More...</a><br /></td></tr>
292 <tr class="separator:ga70abbf38f77a26fd6da8813bef96f695"><td class="memSeparator" colspan="2">&#160;</td></tr>
293 <tr class="memitem:ga10e837c07fa9d25770565b237d3898d9"><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#ga10e837c07fa9d25770565b237d3898d9">tjDecodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char **srcPlanes, const int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
294 <tr class="memdesc:ga10e837c07fa9d25770565b237d3898d9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image.  <a href="group___turbo_j_p_e_g.html#ga10e837c07fa9d25770565b237d3898d9">More...</a><br /></td></tr>
295 <tr class="separator:ga10e837c07fa9d25770565b237d3898d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
296 <tr class="memitem:ga928beff6ac248ceadf01089fc6b41957"><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#ga928beff6ac248ceadf01089fc6b41957">tjInitTransform</a> (void)</td></tr>
297 <tr class="memdesc:ga928beff6ac248ceadf01089fc6b41957"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a new TurboJPEG transformer instance.  <a href="group___turbo_j_p_e_g.html#ga928beff6ac248ceadf01089fc6b41957">More...</a><br /></td></tr>
298 <tr class="separator:ga928beff6ac248ceadf01089fc6b41957"><td class="memSeparator" colspan="2">&#160;</td></tr>
299 <tr class="memitem:ga9cb8abf4cc91881e04a0329b2270be25"><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#ga9cb8abf4cc91881e04a0329b2270be25">tjTransform</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, const unsigned char *jpegBuf, unsigned long jpegSize, int n, unsigned char **dstBufs, unsigned long *dstSizes, <a class="el" href="structtjtransform.html">tjtransform</a> *transforms, int flags)</td></tr>
300 <tr class="memdesc:ga9cb8abf4cc91881e04a0329b2270be25"><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#ga9cb8abf4cc91881e04a0329b2270be25">More...</a><br /></td></tr>
301 <tr class="separator:ga9cb8abf4cc91881e04a0329b2270be25"><td class="memSeparator" colspan="2">&#160;</td></tr>
302 <tr class="memitem:ga75f355fa27225ba1a4ee392c852394d2"><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#ga75f355fa27225ba1a4ee392c852394d2">tjDestroy</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
303 <tr class="memdesc:ga75f355fa27225ba1a4ee392c852394d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a TurboJPEG compressor, decompressor, or transformer instance.  <a href="group___turbo_j_p_e_g.html#ga75f355fa27225ba1a4ee392c852394d2">More...</a><br /></td></tr>
304 <tr class="separator:ga75f355fa27225ba1a4ee392c852394d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
305 <tr class="memitem:gaec627dd4c5f30b7a775a7aea3bec5d83"><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#gaec627dd4c5f30b7a775a7aea3bec5d83">tjAlloc</a> (int bytes)</td></tr>
306 <tr class="memdesc:gaec627dd4c5f30b7a775a7aea3bec5d83"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate an image buffer for use with TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83">More...</a><br /></td></tr>
307 <tr class="separator:gaec627dd4c5f30b7a775a7aea3bec5d83"><td class="memSeparator" colspan="2">&#160;</td></tr>
308 <tr class="memitem:gaffbd83c375e79f5db4b5c5d8ad4466e7"><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#gaffbd83c375e79f5db4b5c5d8ad4466e7">tjLoadImage</a> (const char *filename, int *width, int align, int *height, int *pixelFormat, int flags)</td></tr>
309 <tr class="memdesc:gaffbd83c375e79f5db4b5c5d8ad4466e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load an uncompressed image from disk into memory.  <a href="group___turbo_j_p_e_g.html#gaffbd83c375e79f5db4b5c5d8ad4466e7">More...</a><br /></td></tr>
310 <tr class="separator:gaffbd83c375e79f5db4b5c5d8ad4466e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
311 <tr class="memitem:ga6f445b22d8933ae4815b3370a538d879"><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#ga6f445b22d8933ae4815b3370a538d879">tjSaveImage</a> (const char *filename, unsigned char *buffer, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
312 <tr class="memdesc:ga6f445b22d8933ae4815b3370a538d879"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save an uncompressed image from memory to disk.  <a href="group___turbo_j_p_e_g.html#ga6f445b22d8933ae4815b3370a538d879">More...</a><br /></td></tr>
313 <tr class="separator:ga6f445b22d8933ae4815b3370a538d879"><td class="memSeparator" colspan="2">&#160;</td></tr>
314 <tr class="memitem:gaea863d2da0cdb609563aabdf9196514b"><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#gaea863d2da0cdb609563aabdf9196514b">tjFree</a> (unsigned char *buffer)</td></tr>
315 <tr class="memdesc:gaea863d2da0cdb609563aabdf9196514b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free an image buffer previously allocated by TurboJPEG.  <a href="group___turbo_j_p_e_g.html#gaea863d2da0cdb609563aabdf9196514b">More...</a><br /></td></tr>
316 <tr class="separator:gaea863d2da0cdb609563aabdf9196514b"><td class="memSeparator" colspan="2">&#160;</td></tr>
317 <tr class="memitem:ga1ead8574f9f39fbafc6b497124e7aafa"><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#ga1ead8574f9f39fbafc6b497124e7aafa">tjGetErrorStr2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
318 <tr class="memdesc:ga1ead8574f9f39fbafc6b497124e7aafa"><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#ga1ead8574f9f39fbafc6b497124e7aafa">More...</a><br /></td></tr>
319 <tr class="separator:ga1ead8574f9f39fbafc6b497124e7aafa"><td class="memSeparator" colspan="2">&#160;</td></tr>
320 <tr class="memitem:ga414feeffbf860ebd31c745df203de410"><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#ga414feeffbf860ebd31c745df203de410">tjGetErrorCode</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle)</td></tr>
321 <tr class="memdesc:ga414feeffbf860ebd31c745df203de410"><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#ga414feeffbf860ebd31c745df203de410">More...</a><br /></td></tr>
322 <tr class="separator:ga414feeffbf860ebd31c745df203de410"><td class="memSeparator" colspan="2">&#160;</td></tr>
323 </table><table class="memberdecls">
324 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
325 Variables</h2></td></tr>
326 <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>
327 <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>
328 <tr class="separator:ga9e61e7cd47a15a173283ba94e781308c"><td class="memSeparator" colspan="2">&#160;</td></tr>
329 <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>
330 <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>
331 <tr class="separator:gabd247bb9fecb393eca57366feb8327bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
332 <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>
333 <tr class="memdesc:gadd9b446742ac8a3923f7992c7988fea8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Red offset (in bytes) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8">More...</a><br /></td></tr>
334 <tr class="separator:gadd9b446742ac8a3923f7992c7988fea8"><td class="memSeparator" colspan="2">&#160;</td></tr>
335 <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>
336 <tr class="memdesc:ga82d6e35da441112a411da41923c0ba2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Green offset (in bytes) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f">More...</a><br /></td></tr>
337 <tr class="separator:ga82d6e35da441112a411da41923c0ba2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
338 <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>
339 <tr class="memdesc:ga84e2e35d3f08025f976ec1ec53693dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Blue offset (in bytes) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea">More...</a><br /></td></tr>
340 <tr class="separator:ga84e2e35d3f08025f976ec1ec53693dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
341 <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>
342 <tr class="memdesc:ga5af0ab065feefd526debf1e20c43e837"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alpha offset (in bytes) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837">More...</a><br /></td></tr>
343 <tr class="separator:ga5af0ab065feefd526debf1e20c43e837"><td class="memSeparator" colspan="2">&#160;</td></tr>
344 <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>
345 <tr class="memdesc:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pixel size (in bytes) for a given pixel format.  <a href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c">More...</a><br /></td></tr>
346 <tr class="separator:gad77cf8fe5b2bfd3cb3f53098146abb4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
347 </table>
348 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
349 <p>TurboJPEG API. </p>
350 <p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>
351 <p><a class="anchor" id="YUVnotes"></a></p>
352 <h2><a class="anchor" id="autotoc_md0"></a>
353 YUV Image Format Notes</h2>
354 <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>
355 <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 (2 in the case of 4:2:0 and 4:2:2, 4 in the case of 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 or grayscale.) 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>
356 <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 line padding 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>
357 <h2 class="groupheader">Macro Definition Documentation</h2>
358 <a id="ga39f57a6fb02d9cf32e7b6890099b5a71"></a>
359 <h2 class="memtitle"><span class="permalink"><a href="#ga39f57a6fb02d9cf32e7b6890099b5a71">&#9670;&nbsp;</a></span>TJ_NUMCS</h2>
360
361 <div class="memitem">
362 <div class="memproto">
363       <table class="memname">
364         <tr>
365           <td class="memname">#define TJ_NUMCS</td>
366         </tr>
367       </table>
368 </div><div class="memdoc">
369
370 <p>The number of JPEG colorspaces. </p>
371
372 </div>
373 </div>
374 <a id="ga79bde1b4a3e2351e00887e47781b966e"></a>
375 <h2 class="memtitle"><span class="permalink"><a href="#ga79bde1b4a3e2351e00887e47781b966e">&#9670;&nbsp;</a></span>TJ_NUMERR</h2>
376
377 <div class="memitem">
378 <div class="memproto">
379       <table class="memname">
380         <tr>
381           <td class="memname">#define TJ_NUMERR</td>
382         </tr>
383       </table>
384 </div><div class="memdoc">
385
386 <p>The number of error codes. </p>
387
388 </div>
389 </div>
390 <a id="ga7010a4402f54a45ba822ad8675a4655e"></a>
391 <h2 class="memtitle"><span class="permalink"><a href="#ga7010a4402f54a45ba822ad8675a4655e">&#9670;&nbsp;</a></span>TJ_NUMPF</h2>
392
393 <div class="memitem">
394 <div class="memproto">
395       <table class="memname">
396         <tr>
397           <td class="memname">#define TJ_NUMPF</td>
398         </tr>
399       </table>
400 </div><div class="memdoc">
401
402 <p>The number of pixel formats. </p>
403
404 </div>
405 </div>
406 <a id="ga5ef3d169162ce77ce348e292a0b7477c"></a>
407 <h2 class="memtitle"><span class="permalink"><a href="#ga5ef3d169162ce77ce348e292a0b7477c">&#9670;&nbsp;</a></span>TJ_NUMSAMP</h2>
408
409 <div class="memitem">
410 <div class="memproto">
411       <table class="memname">
412         <tr>
413           <td class="memname">#define TJ_NUMSAMP</td>
414         </tr>
415       </table>
416 </div><div class="memdoc">
417
418 <p>The number of chrominance subsampling options. </p>
419
420 </div>
421 </div>
422 <a id="ga0f6dbd18adf38b7d46ac547f0f4d562c"></a>
423 <h2 class="memtitle"><span class="permalink"><a href="#ga0f6dbd18adf38b7d46ac547f0f4d562c">&#9670;&nbsp;</a></span>TJ_NUMXOP</h2>
424
425 <div class="memitem">
426 <div class="memproto">
427       <table class="memname">
428         <tr>
429           <td class="memname">#define TJ_NUMXOP</td>
430         </tr>
431       </table>
432 </div><div class="memdoc">
433
434 <p>The number of transform operations. </p>
435
436 </div>
437 </div>
438 <a id="gacb233cfd722d66d1ccbf48a7de81f0e0"></a>
439 <h2 class="memtitle"><span class="permalink"><a href="#gacb233cfd722d66d1ccbf48a7de81f0e0">&#9670;&nbsp;</a></span>TJFLAG_ACCURATEDCT</h2>
440
441 <div class="memitem">
442 <div class="memproto">
443       <table class="memname">
444         <tr>
445           <td class="memname">#define TJFLAG_ACCURATEDCT</td>
446         </tr>
447       </table>
448 </div><div class="memdoc">
449
450 <p>Use the most accurate DCT/IDCT algorithm available in the underlying codec. </p>
451 <p>The default if this flag is not specified is implementation-specific. For example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
452
453 </div>
454 </div>
455 <a id="ga72ecf4ebe6eb702d3c6f5ca27455e1ec"></a>
456 <h2 class="memtitle"><span class="permalink"><a href="#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">&#9670;&nbsp;</a></span>TJFLAG_BOTTOMUP</h2>
457
458 <div class="memitem">
459 <div class="memproto">
460       <table class="memname">
461         <tr>
462           <td class="memname">#define TJFLAG_BOTTOMUP</td>
463         </tr>
464       </table>
465 </div><div class="memdoc">
466
467 <p>The uncompressed source/destination image is stored in bottom-up (Windows, OpenGL) order, not top-down (X11) order. </p>
468
469 </div>
470 </div>
471 <a id="gaabce235db80d3f698b27f36cbd453da2"></a>
472 <h2 class="memtitle"><span class="permalink"><a href="#gaabce235db80d3f698b27f36cbd453da2">&#9670;&nbsp;</a></span>TJFLAG_FASTDCT</h2>
473
474 <div class="memitem">
475 <div class="memproto">
476       <table class="memname">
477         <tr>
478           <td class="memname">#define TJFLAG_FASTDCT</td>
479         </tr>
480       </table>
481 </div><div class="memdoc">
482
483 <p>Use the fastest DCT/IDCT algorithm available in the underlying codec. </p>
484 <p>The default if this flag is not specified is implementation-specific. For example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast algorithm by default when compressing, because this has been shown to have only a very slight effect on accuracy, but it uses the accurate algorithm when decompressing, because this has been shown to have a larger effect. </p>
485
486 </div>
487 </div>
488 <a id="ga4ee4506c81177a06f77e2504a22efd2d"></a>
489 <h2 class="memtitle"><span class="permalink"><a href="#ga4ee4506c81177a06f77e2504a22efd2d">&#9670;&nbsp;</a></span>TJFLAG_FASTUPSAMPLE</h2>
490
491 <div class="memitem">
492 <div class="memproto">
493       <table class="memname">
494         <tr>
495           <td class="memname">#define TJFLAG_FASTUPSAMPLE</td>
496         </tr>
497       </table>
498 </div><div class="memdoc">
499
500 <p>When decompressing an image that was compressed using chrominance subsampling, use the fastest chrominance upsampling algorithm available in the underlying codec. </p>
501 <p>The default is to use smooth upsampling, which creates a smooth transition between neighboring chrominance components in order to reduce upsampling artifacts in the decompressed image. </p>
502
503 </div>
504 </div>
505 <a id="ga163e6482dc5096831feef9c79ff3f805"></a>
506 <h2 class="memtitle"><span class="permalink"><a href="#ga163e6482dc5096831feef9c79ff3f805">&#9670;&nbsp;</a></span>TJFLAG_LIMITSCANS</h2>
507
508 <div class="memitem">
509 <div class="memproto">
510       <table class="memname">
511         <tr>
512           <td class="memname">#define TJFLAG_LIMITSCANS</td>
513         </tr>
514       </table>
515 </div><div class="memdoc">
516
517 <p>Limit the number of progressive JPEG scans that the decompression and transform functions will process. </p>
518 <p>If a progressive JPEG image contains an unreasonably large number of scans, then this flag will cause the decompression and transform functions to return an error. 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>
519
520 </div>
521 </div>
522 <a id="ga8808d403c68b62aaa58a4c1e58e98963"></a>
523 <h2 class="memtitle"><span class="permalink"><a href="#ga8808d403c68b62aaa58a4c1e58e98963">&#9670;&nbsp;</a></span>TJFLAG_NOREALLOC</h2>
524
525 <div class="memitem">
526 <div class="memproto">
527       <table class="memname">
528         <tr>
529           <td class="memname">#define TJFLAG_NOREALLOC</td>
530         </tr>
531       </table>
532 </div><div class="memdoc">
533
534 <p>Disable buffer (re)allocation. </p>
535 <p>If passed to one of the JPEG compression or transform functions, this flag will cause those functions to generate an error if the JPEG image buffer is invalid or too small rather than attempting to allocate or reallocate that buffer. This reproduces the behavior of earlier versions of TurboJPEG. </p>
536
537 </div>
538 </div>
539 <a id="ga43b426750b46190a25d34a67ef76df1b"></a>
540 <h2 class="memtitle"><span class="permalink"><a href="#ga43b426750b46190a25d34a67ef76df1b">&#9670;&nbsp;</a></span>TJFLAG_PROGRESSIVE</h2>
541
542 <div class="memitem">
543 <div class="memproto">
544       <table class="memname">
545         <tr>
546           <td class="memname">#define TJFLAG_PROGRESSIVE</td>
547         </tr>
548       </table>
549 </div><div class="memdoc">
550
551 <p>Use progressive entropy coding in JPEG images generated by the compression and transform functions. </p>
552 <p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce compression and decompression performance considerably. </p>
553
554 </div>
555 </div>
556 <a id="ga519cfa4ef6c18d9e5b455fdf59306a3a"></a>
557 <h2 class="memtitle"><span class="permalink"><a href="#ga519cfa4ef6c18d9e5b455fdf59306a3a">&#9670;&nbsp;</a></span>TJFLAG_STOPONWARNING</h2>
558
559 <div class="memitem">
560 <div class="memproto">
561       <table class="memname">
562         <tr>
563           <td class="memname">#define TJFLAG_STOPONWARNING</td>
564         </tr>
565       </table>
566 </div><div class="memdoc">
567
568 <p>Immediately discontinue the current compression/decompression/transform operation if the underlying codec throws a warning (non-fatal error). </p>
569 <p>The default behavior is to allow the operation to complete unless a fatal error is encountered. </p>
570
571 </div>
572 </div>
573 <a id="ga0aba955473315e405295d978f0c16511"></a>
574 <h2 class="memtitle"><span class="permalink"><a href="#ga0aba955473315e405295d978f0c16511">&#9670;&nbsp;</a></span>TJPAD</h2>
575
576 <div class="memitem">
577 <div class="memproto">
578       <table class="memname">
579         <tr>
580           <td class="memname">#define TJPAD</td>
581           <td>(</td>
582           <td class="paramtype">&#160;</td>
583           <td class="paramname">width</td><td>)</td>
584           <td></td>
585         </tr>
586       </table>
587 </div><div class="memdoc">
588
589 <p>Pad the given width to the nearest 32-bit boundary. </p>
590
591 </div>
592 </div>
593 <a id="ga84878bb65404204743aa18cac02781df"></a>
594 <h2 class="memtitle"><span class="permalink"><a href="#ga84878bb65404204743aa18cac02781df">&#9670;&nbsp;</a></span>TJSCALED</h2>
595
596 <div class="memitem">
597 <div class="memproto">
598       <table class="memname">
599         <tr>
600           <td class="memname">#define TJSCALED</td>
601           <td>(</td>
602           <td class="paramtype">&#160;</td>
603           <td class="paramname">dimension, </td>
604         </tr>
605         <tr>
606           <td class="paramkey"></td>
607           <td></td>
608           <td class="paramtype">&#160;</td>
609           <td class="paramname">scalingFactor&#160;</td>
610         </tr>
611         <tr>
612           <td></td>
613           <td>)</td>
614           <td></td><td></td>
615         </tr>
616       </table>
617 </div><div class="memdoc">
618
619 <p>Compute the scaled value of <code>dimension</code> using the given scaling factor. </p>
620 <p>This macro performs the integer equivalent of <code>ceil(dimension * scalingFactor)</code>. </p>
621
622 </div>
623 </div>
624 <a id="ga153b468cfb905d0de61706c838986fe8"></a>
625 <h2 class="memtitle"><span class="permalink"><a href="#ga153b468cfb905d0de61706c838986fe8">&#9670;&nbsp;</a></span>TJXOPT_COPYNONE</h2>
626
627 <div class="memitem">
628 <div class="memproto">
629       <table class="memname">
630         <tr>
631           <td class="memname">#define TJXOPT_COPYNONE</td>
632         </tr>
633       </table>
634 </div><div class="memdoc">
635
636 <p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from copying any extra markers (including EXIF and ICC profile data) from the source image to the output image. </p>
637
638 </div>
639 </div>
640 <a id="ga9c771a757fc1294add611906b89ab2d2"></a>
641 <h2 class="memtitle"><span class="permalink"><a href="#ga9c771a757fc1294add611906b89ab2d2">&#9670;&nbsp;</a></span>TJXOPT_CROP</h2>
642
643 <div class="memitem">
644 <div class="memproto">
645       <table class="memname">
646         <tr>
647           <td class="memname">#define TJXOPT_CROP</td>
648         </tr>
649       </table>
650 </div><div class="memdoc">
651
652 <p>This option will enable lossless cropping. </p>
653 <p>See <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> for more information. </p>
654
655 </div>
656 </div>
657 <a id="ga3acee7b48ade1b99e5588736007c2589"></a>
658 <h2 class="memtitle"><span class="permalink"><a href="#ga3acee7b48ade1b99e5588736007c2589">&#9670;&nbsp;</a></span>TJXOPT_GRAY</h2>
659
660 <div class="memitem">
661 <div class="memproto">
662       <table class="memname">
663         <tr>
664           <td class="memname">#define TJXOPT_GRAY</td>
665         </tr>
666       </table>
667 </div><div class="memdoc">
668
669 <p>This option will discard the color data in the input image and produce a grayscale output image. </p>
670
671 </div>
672 </div>
673 <a id="gafbf992bbf6e006705886333703ffab31"></a>
674 <h2 class="memtitle"><span class="permalink"><a href="#gafbf992bbf6e006705886333703ffab31">&#9670;&nbsp;</a></span>TJXOPT_NOOUTPUT</h2>
675
676 <div class="memitem">
677 <div class="memproto">
678       <table class="memname">
679         <tr>
680           <td class="memname">#define TJXOPT_NOOUTPUT</td>
681         </tr>
682       </table>
683 </div><div class="memdoc">
684
685 <p>This option will prevent <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> from outputting a JPEG image for this particular transform (this can be used in conjunction with a custom filter to capture the transformed DCT coefficients without transcoding them.) </p>
686
687 </div>
688 </div>
689 <a id="ga50e03cb5ed115330e212417429600b00"></a>
690 <h2 class="memtitle"><span class="permalink"><a href="#ga50e03cb5ed115330e212417429600b00">&#9670;&nbsp;</a></span>TJXOPT_PERFECT</h2>
691
692 <div class="memitem">
693 <div class="memproto">
694       <table class="memname">
695         <tr>
696           <td class="memname">#define TJXOPT_PERFECT</td>
697         </tr>
698       </table>
699 </div><div class="memdoc">
700
701 <p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to return an error if the transform is not perfect. </p>
702 <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>
703
704 </div>
705 </div>
706 <a id="gad2371c80674584ecc1a7d75e564cf026"></a>
707 <h2 class="memtitle"><span class="permalink"><a href="#gad2371c80674584ecc1a7d75e564cf026">&#9670;&nbsp;</a></span>TJXOPT_PROGRESSIVE</h2>
708
709 <div class="memitem">
710 <div class="memproto">
711       <table class="memname">
712         <tr>
713           <td class="memname">#define TJXOPT_PROGRESSIVE</td>
714         </tr>
715       </table>
716 </div><div class="memdoc">
717
718 <p>This option will enable progressive entropy coding in the output image generated by this particular transform. </p>
719 <p>Progressive entropy coding will generally improve compression relative to baseline entropy coding (the default), but it will reduce compression and decompression performance considerably. </p>
720
721 </div>
722 </div>
723 <a id="ga319826b7eb1583c0595bbe7b95428709"></a>
724 <h2 class="memtitle"><span class="permalink"><a href="#ga319826b7eb1583c0595bbe7b95428709">&#9670;&nbsp;</a></span>TJXOPT_TRIM</h2>
725
726 <div class="memitem">
727 <div class="memproto">
728       <table class="memname">
729         <tr>
730           <td class="memname">#define TJXOPT_TRIM</td>
731         </tr>
732       </table>
733 </div><div class="memdoc">
734
735 <p>This option will cause <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> to discard any partial MCU blocks that cannot be transformed. </p>
736
737 </div>
738 </div>
739 <h2 class="groupheader">Typedef Documentation</h2>
740 <a id="ga758d2634ecb4949de7815cba621f5763"></a>
741 <h2 class="memtitle"><span class="permalink"><a href="#ga758d2634ecb4949de7815cba621f5763">&#9670;&nbsp;</a></span>tjhandle</h2>
742
743 <div class="memitem">
744 <div class="memproto">
745       <table class="memname">
746         <tr>
747           <td class="memname">typedef void* <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a></td>
748         </tr>
749       </table>
750 </div><div class="memdoc">
751
752 <p>TurboJPEG instance handle. </p>
753
754 </div>
755 </div>
756 <a id="ga504805ec0161f1b505397ca0118bf8fd"></a>
757 <h2 class="memtitle"><span class="permalink"><a href="#ga504805ec0161f1b505397ca0118bf8fd">&#9670;&nbsp;</a></span>tjtransform</h2>
758
759 <div class="memitem">
760 <div class="memproto">
761       <table class="memname">
762         <tr>
763           <td class="memname">typedef struct <a class="el" href="structtjtransform.html">tjtransform</a> <a class="el" href="structtjtransform.html">tjtransform</a></td>
764         </tr>
765       </table>
766 </div><div class="memdoc">
767
768 <p>Lossless transform. </p>
769
770 </div>
771 </div>
772 <h2 class="groupheader">Enumeration Type Documentation</h2>
773 <a id="ga4f83ad3368e0e29d1957be0efa7c3720"></a>
774 <h2 class="memtitle"><span class="permalink"><a href="#ga4f83ad3368e0e29d1957be0efa7c3720">&#9670;&nbsp;</a></span>TJCS</h2>
775
776 <div class="memitem">
777 <div class="memproto">
778       <table class="memname">
779         <tr>
780           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">TJCS</a></td>
781         </tr>
782       </table>
783 </div><div class="memdoc">
784
785 <p>JPEG colorspaces. </p>
786 <table class="fieldtable">
787 <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>
788 <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 decompressed to any of the extended RGB pixel formats or grayscale, but they cannot be decompressed to YUV images. </p>
789 </td></tr>
790 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75"></a>TJCS_YCbCr&#160;</td><td class="fielddoc"><p>YCbCr colorspace. </p>
791 <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 bandwidth or disk space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images can be compressed from and decompressed to any of the extended RGB pixel formats or grayscale, or they can be decompressed to YUV planar images. </p>
792 </td></tr>
793 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a"></a>TJCS_GRAY&#160;</td><td class="fielddoc"><p>Grayscale colorspace. </p>
794 <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 any of the extended RGB pixel formats or grayscale, or they can be decompressed to YUV planar images. </p>
795 </td></tr>
796 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53"></a>TJCS_CMYK&#160;</td><td class="fielddoc"><p>CMYK colorspace. </p>
797 <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 decompressed to CMYK pixels. </p>
798 </td></tr>
799 <tr><td class="fieldname"><a id="gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e"></a>TJCS_YCCK&#160;</td><td class="fielddoc"><p>YCCK colorspace. </p>
800 <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 CMYK pixels. </p>
801 </td></tr>
802 </table>
803
804 </div>
805 </div>
806 <a id="gafbc17cfa57d0d5d11fea35ac025950fe"></a>
807 <h2 class="memtitle"><span class="permalink"><a href="#gafbc17cfa57d0d5d11fea35ac025950fe">&#9670;&nbsp;</a></span>TJERR</h2>
808
809 <div class="memitem">
810 <div class="memproto">
811       <table class="memname">
812         <tr>
813           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">TJERR</a></td>
814         </tr>
815       </table>
816 </div><div class="memdoc">
817
818 <p>Error codes. </p>
819 <table class="fieldtable">
820 <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 image may still be corrupt. </p>
821 </td></tr>
822 <tr><td class="fieldname"><a id="ggafbc17cfa57d0d5d11fea35ac025950feafc9cceeada13122b09e4851e3788039a"></a>TJERR_FATAL&#160;</td><td class="fielddoc"><p>The error was fatal and non-recoverable. </p>
823 </td></tr>
824 </table>
825
826 </div>
827 </div>
828 <a id="gac916144e26c3817ac514e64ae5d12e2a"></a>
829 <h2 class="memtitle"><span class="permalink"><a href="#gac916144e26c3817ac514e64ae5d12e2a">&#9670;&nbsp;</a></span>TJPF</h2>
830
831 <div class="memitem">
832 <div class="memproto">
833       <table class="memname">
834         <tr>
835           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">TJPF</a></td>
836         </tr>
837       </table>
838 </div><div class="memdoc">
839
840 <p>Pixel formats. </p>
841 <table class="fieldtable">
842 <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>
843 <p>The red, green, and blue components in the image are stored in 3-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. </p>
844 </td></tr>
845 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aab10624437fb8ef495a0b153e65749839"></a>TJPF_BGR&#160;</td><td class="fielddoc"><p>BGR pixel format. </p>
846 <p>The red, green, and blue components in the image are stored in 3-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. </p>
847 </td></tr>
848 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa83973bebb7e2dc6fa8bae89ff3f42e01"></a>TJPF_RGBX&#160;</td><td class="fielddoc"><p>RGBX pixel format. </p>
849 <p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
850 </td></tr>
851 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa2a1fbf569ca79897eae886e3376ca4c8"></a>TJPF_BGRX&#160;</td><td class="fielddoc"><p>BGRX pixel format. </p>
852 <p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from lowest to highest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
853 </td></tr>
854 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af"></a>TJPF_XBGR&#160;</td><td class="fielddoc"><p>XBGR pixel format. </p>
855 <p>The red, green, and blue components in the image are stored in 4-byte pixels in the order R, G, B from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
856 </td></tr>
857 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84"></a>TJPF_XRGB&#160;</td><td class="fielddoc"><p>XRGB pixel format. </p>
858 <p>The red, green, and blue components in the image are stored in 4-byte pixels in the order B, G, R from highest to lowest byte address within each pixel. The X component is ignored when compressing and undefined when decompressing. </p>
859 </td></tr>
860 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a"></a>TJPF_GRAY&#160;</td><td class="fielddoc"><p>Grayscale pixel format. </p>
861 <p>Each 1-byte pixel represents a luminance (brightness) level from 0 to 255. </p>
862 </td></tr>
863 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa88d2e88fab67f6503cf972e14851cc12"></a>TJPF_RGBA&#160;</td><td class="fielddoc"><p>RGBA pixel format. </p>
864 <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 0xFF, which can be interpreted as an opaque alpha channel. </p>
865 </td></tr>
866 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aac037ff1845cf9b74bb81a3659c2b9fb4"></a>TJPF_BGRA&#160;</td><td class="fielddoc"><p>BGRA pixel format. </p>
867 <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 0xFF, which can be interpreted as an opaque alpha channel. </p>
868 </td></tr>
869 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa1ba1a7f1631dbeaa49a0a85fc4a40081"></a>TJPF_ABGR&#160;</td><td class="fielddoc"><p>ABGR pixel format. </p>
870 <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 0xFF, which can be interpreted as an opaque alpha channel. </p>
871 </td></tr>
872 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aae8f846ed9d9de99b6e1dfe448848765c"></a>TJPF_ARGB&#160;</td><td class="fielddoc"><p>ARGB pixel format. </p>
873 <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 0xFF, which can be interpreted as an opaque alpha channel. </p>
874 </td></tr>
875 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa7f5100ec44c91994e243f1cf55553f8b"></a>TJPF_CMYK&#160;</td><td class="fielddoc"><p>CMYK pixel format. </p>
876 <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 CMYK pixels into a YCCK JPEG image (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 CMYK pixels. </p>
877 </td></tr>
878 <tr><td class="fieldname"><a id="ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed"></a>TJPF_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown pixel format. </p>
879 <p>Currently this is only used by <a class="el" href="group___turbo_j_p_e_g.html#gaffbd83c375e79f5db4b5c5d8ad4466e7" title="Load an uncompressed image from disk into memory.">tjLoadImage()</a>. </p>
880 </td></tr>
881 </table>
882
883 </div>
884 </div>
885 <a id="ga1d047060ea80bb9820d540bb928e9074"></a>
886 <h2 class="memtitle"><span class="permalink"><a href="#ga1d047060ea80bb9820d540bb928e9074">&#9670;&nbsp;</a></span>TJSAMP</h2>
887
888 <div class="memitem">
889 <div class="memproto">
890       <table class="memname">
891         <tr>
892           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">TJSAMP</a></td>
893         </tr>
894       </table>
895 </div><div class="memdoc">
896
897 <p>Chrominance subsampling options. </p>
898 <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>
899 <table class="fieldtable">
900 <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>
901 <p>The JPEG or YUV image will contain one chrominance component for every pixel in the source image. </p>
902 </td></tr>
903 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a136130902cc578f11f32429b59368404"></a>TJSAMP_422&#160;</td><td class="fielddoc"><p>4:2:2 chrominance subsampling. </p>
904 <p>The JPEG or YUV image will contain one chrominance component for every 2x1 block of pixels in the source image. </p>
905 </td></tr>
906 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737"></a>TJSAMP_420&#160;</td><td class="fielddoc"><p>4:2:0 chrominance subsampling. </p>
907 <p>The JPEG or YUV image will contain one chrominance component for every 2x2 block of pixels in the source image. </p>
908 </td></tr>
909 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a3f1c9504842ddc7a48d0f690754b6248"></a>TJSAMP_GRAY&#160;</td><td class="fielddoc"><p>Grayscale. </p>
910 <p>The JPEG or YUV image will contain no chrominance components. </p>
911 </td></tr>
912 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440&#160;</td><td class="fielddoc"><p>4:4:0 chrominance subsampling. </p>
913 <p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
914 <dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
915 </td></tr>
916 <tr><td class="fieldname"><a id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411&#160;</td><td class="fielddoc"><p>4:1:1 chrominance subsampling. </p>
917 <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>
918 <dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
919 </td></tr>
920 </table>
921
922 </div>
923 </div>
924 <a id="ga2de531af4e7e6c4f124908376b354866"></a>
925 <h2 class="memtitle"><span class="permalink"><a href="#ga2de531af4e7e6c4f124908376b354866">&#9670;&nbsp;</a></span>TJXOP</h2>
926
927 <div class="memitem">
928 <div class="memproto">
929       <table class="memname">
930         <tr>
931           <td class="memname">enum <a class="el" href="group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866">TJXOP</a></td>
932         </tr>
933       </table>
934 </div><div class="memdoc">
935
936 <p>Transform operations for <a class="el" href="group___turbo_j_p_e_g.html#ga9cb8abf4cc91881e04a0329b2270be25" title="Losslessly transform a JPEG image into another JPEG image.">tjTransform()</a> </p>
937 <table class="fieldtable">
938 <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>
939 </td></tr>
940 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866aa0df69776caa30f0fa28e26332d311ce"></a>TJXOP_HFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image horizontally. </p>
941 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
942 </td></tr>
943 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a324eddfbec53b7e691f61e56929d0d5d"></a>TJXOP_VFLIP&#160;</td><td class="fielddoc"><p>Flip (mirror) image vertically. </p>
944 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
945 </td></tr>
946 <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>
947 </td></tr>
948 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
949 </td></tr>
950 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a43b2bbb23bc4bd548422d43fbe9af128"></a>TJXOP_ROT90&#160;</td><td class="fielddoc"><p>Rotate image clockwise by 90 degrees. </p>
951 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
952 </td></tr>
953 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a140952eb8dd0300accfcc22726d69692"></a>TJXOP_ROT180&#160;</td><td class="fielddoc"><p>Rotate image 180 degrees. </p>
954 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
955 </td></tr>
956 <tr><td class="fieldname"><a id="gga2de531af4e7e6c4f124908376b354866a3064ee5dfb7f032df332818587567a08"></a>TJXOP_ROT270&#160;</td><td class="fielddoc"><p>Rotate image counter-clockwise by 90 degrees. </p>
957 <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 tjTransform() to return an error if the transform is not perfect.">TJXOPT_PERFECT</a>.) </p>
958 </td></tr>
959 </table>
960
961 </div>
962 </div>
963 <h2 class="groupheader">Function Documentation</h2>
964 <a id="gaec627dd4c5f30b7a775a7aea3bec5d83"></a>
965 <h2 class="memtitle"><span class="permalink"><a href="#gaec627dd4c5f30b7a775a7aea3bec5d83">&#9670;&nbsp;</a></span>tjAlloc()</h2>
966
967 <div class="memitem">
968 <div class="memproto">
969       <table class="memname">
970         <tr>
971           <td class="memname">DLLEXPORT unsigned char* tjAlloc </td>
972           <td>(</td>
973           <td class="paramtype">int&#160;</td>
974           <td class="paramname"><em>bytes</em></td><td>)</td>
975           <td></td>
976         </tr>
977       </table>
978 </div><div class="memdoc">
979
980 <p>Allocate an image buffer for use with TurboJPEG. </p>
981 <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>.)</p>
982 <dl class="params"><dt>Parameters</dt><dd>
983   <table class="params">
984     <tr><td class="paramname">bytes</td><td>the number of bytes to allocate</td></tr>
985   </table>
986   </dd>
987 </dl>
988 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>
989 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gaea863d2da0cdb609563aabdf9196514b" title="Free an image buffer previously allocated by TurboJPEG.">tjFree()</a> </dd></dl>
990
991 </div>
992 </div>
993 <a id="ga67ac12fee79073242cb216e07c9f1f90"></a>
994 <h2 class="memtitle"><span class="permalink"><a href="#ga67ac12fee79073242cb216e07c9f1f90">&#9670;&nbsp;</a></span>tjBufSize()</h2>
995
996 <div class="memitem">
997 <div class="memproto">
998       <table class="memname">
999         <tr>
1000           <td class="memname">DLLEXPORT unsigned long tjBufSize </td>
1001           <td>(</td>
1002           <td class="paramtype">int&#160;</td>
1003           <td class="paramname"><em>width</em>, </td>
1004         </tr>
1005         <tr>
1006           <td class="paramkey"></td>
1007           <td></td>
1008           <td class="paramtype">int&#160;</td>
1009           <td class="paramname"><em>height</em>, </td>
1010         </tr>
1011         <tr>
1012           <td class="paramkey"></td>
1013           <td></td>
1014           <td class="paramtype">int&#160;</td>
1015           <td class="paramname"><em>jpegSubsamp</em>&#160;</td>
1016         </tr>
1017         <tr>
1018           <td></td>
1019           <td>)</td>
1020           <td></td><td></td>
1021         </tr>
1022       </table>
1023 </div><div class="memdoc">
1024
1025 <p>The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. </p>
1026 <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, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>
1027 <dl class="params"><dt>Parameters</dt><dd>
1028   <table class="params">
1029     <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
1030     <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
1031     <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>.)</td></tr>
1032   </table>
1033   </dd>
1034 </dl>
1035 <dl class="section return"><dt>Returns</dt><dd>the maximum size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds. </dd></dl>
1036
1037 </div>
1038 </div>
1039 <a id="ga2be2b9969d4df9ecce9b05deed273194"></a>
1040 <h2 class="memtitle"><span class="permalink"><a href="#ga2be2b9969d4df9ecce9b05deed273194">&#9670;&nbsp;</a></span>tjBufSizeYUV2()</h2>
1041
1042 <div class="memitem">
1043 <div class="memproto">
1044       <table class="memname">
1045         <tr>
1046           <td class="memname">DLLEXPORT unsigned long tjBufSizeYUV2 </td>
1047           <td>(</td>
1048           <td class="paramtype">int&#160;</td>
1049           <td class="paramname"><em>width</em>, </td>
1050         </tr>
1051         <tr>
1052           <td class="paramkey"></td>
1053           <td></td>
1054           <td class="paramtype">int&#160;</td>
1055           <td class="paramname"><em>pad</em>, </td>
1056         </tr>
1057         <tr>
1058           <td class="paramkey"></td>
1059           <td></td>
1060           <td class="paramtype">int&#160;</td>
1061           <td class="paramname"><em>height</em>, </td>
1062         </tr>
1063         <tr>
1064           <td class="paramkey"></td>
1065           <td></td>
1066           <td class="paramtype">int&#160;</td>
1067           <td class="paramname"><em>subsamp</em>&#160;</td>
1068         </tr>
1069         <tr>
1070           <td></td>
1071           <td>)</td>
1072           <td></td><td></td>
1073         </tr>
1074       </table>
1075 </div><div class="memdoc">
1076
1077 <p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>
1078 <dl class="params"><dt>Parameters</dt><dd>
1079   <table class="params">
1080     <tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
1081     <tr><td class="paramname">pad</td><td>the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
1082     <tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
1083     <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>
1084   </table>
1085   </dd>
1086 </dl>
1087 <dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the image, or -1 if the arguments are out of bounds. </dd></dl>
1088
1089 </div>
1090 </div>
1091 <a id="gafbdce0112fd78fd38efae841443a9bcf"></a>
1092 <h2 class="memtitle"><span class="permalink"><a href="#gafbdce0112fd78fd38efae841443a9bcf">&#9670;&nbsp;</a></span>tjCompress2()</h2>
1093
1094 <div class="memitem">
1095 <div class="memproto">
1096       <table class="memname">
1097         <tr>
1098           <td class="memname">DLLEXPORT int tjCompress2 </td>
1099           <td>(</td>
1100           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1101           <td class="paramname"><em>handle</em>, </td>
1102         </tr>
1103         <tr>
1104           <td class="paramkey"></td>
1105           <td></td>
1106           <td class="paramtype">const unsigned char *&#160;</td>
1107           <td class="paramname"><em>srcBuf</em>, </td>
1108         </tr>
1109         <tr>
1110           <td class="paramkey"></td>
1111           <td></td>
1112           <td class="paramtype">int&#160;</td>
1113           <td class="paramname"><em>width</em>, </td>
1114         </tr>
1115         <tr>
1116           <td class="paramkey"></td>
1117           <td></td>
1118           <td class="paramtype">int&#160;</td>
1119           <td class="paramname"><em>pitch</em>, </td>
1120         </tr>
1121         <tr>
1122           <td class="paramkey"></td>
1123           <td></td>
1124           <td class="paramtype">int&#160;</td>
1125           <td class="paramname"><em>height</em>, </td>
1126         </tr>
1127         <tr>
1128           <td class="paramkey"></td>
1129           <td></td>
1130           <td class="paramtype">int&#160;</td>
1131           <td class="paramname"><em>pixelFormat</em>, </td>
1132         </tr>
1133         <tr>
1134           <td class="paramkey"></td>
1135           <td></td>
1136           <td class="paramtype">unsigned char **&#160;</td>
1137           <td class="paramname"><em>jpegBuf</em>, </td>
1138         </tr>
1139         <tr>
1140           <td class="paramkey"></td>
1141           <td></td>
1142           <td class="paramtype">unsigned long *&#160;</td>
1143           <td class="paramname"><em>jpegSize</em>, </td>
1144         </tr>
1145         <tr>
1146           <td class="paramkey"></td>
1147           <td></td>
1148           <td class="paramtype">int&#160;</td>
1149           <td class="paramname"><em>jpegSubsamp</em>, </td>
1150         </tr>
1151         <tr>
1152           <td class="paramkey"></td>
1153           <td></td>
1154           <td class="paramtype">int&#160;</td>
1155           <td class="paramname"><em>jpegQual</em>, </td>
1156         </tr>
1157         <tr>
1158           <td class="paramkey"></td>
1159           <td></td>
1160           <td class="paramtype">int&#160;</td>
1161           <td class="paramname"><em>flags</em>&#160;</td>
1162         </tr>
1163         <tr>
1164           <td></td>
1165           <td>)</td>
1166           <td></td><td></td>
1167         </tr>
1168       </table>
1169 </div><div class="memdoc">
1170
1171 <p>Compress an RGB, grayscale, or CMYK image into a JPEG image. </p>
1172 <dl class="params"><dt>Parameters</dt><dd>
1173   <table class="params">
1174     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
1175     <tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed</td></tr>
1176     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
1177     <tr><td class="paramname">pitch</td><td>bytes per line 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
1178     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
1179     <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>
1180     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image 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">
1181 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1182 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1183 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga67ac12fee79073242cb216e07c9f1f90" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees that it won't be.)</li>
1184 </ol>
1185 If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1186     <tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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 image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1187     <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>.)</td></tr>
1188     <tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
1189     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1190   </table>
1191   </dd>
1192 </dl>
1193 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1194
1195 </div>
1196 </div>
1197 <a id="ga7622a459b79aa1007e005b58783f875b"></a>
1198 <h2 class="memtitle"><span class="permalink"><a href="#ga7622a459b79aa1007e005b58783f875b">&#9670;&nbsp;</a></span>tjCompressFromYUV()</h2>
1199
1200 <div class="memitem">
1201 <div class="memproto">
1202       <table class="memname">
1203         <tr>
1204           <td class="memname">DLLEXPORT int tjCompressFromYUV </td>
1205           <td>(</td>
1206           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1207           <td class="paramname"><em>handle</em>, </td>
1208         </tr>
1209         <tr>
1210           <td class="paramkey"></td>
1211           <td></td>
1212           <td class="paramtype">const unsigned char *&#160;</td>
1213           <td class="paramname"><em>srcBuf</em>, </td>
1214         </tr>
1215         <tr>
1216           <td class="paramkey"></td>
1217           <td></td>
1218           <td class="paramtype">int&#160;</td>
1219           <td class="paramname"><em>width</em>, </td>
1220         </tr>
1221         <tr>
1222           <td class="paramkey"></td>
1223           <td></td>
1224           <td class="paramtype">int&#160;</td>
1225           <td class="paramname"><em>pad</em>, </td>
1226         </tr>
1227         <tr>
1228           <td class="paramkey"></td>
1229           <td></td>
1230           <td class="paramtype">int&#160;</td>
1231           <td class="paramname"><em>height</em>, </td>
1232         </tr>
1233         <tr>
1234           <td class="paramkey"></td>
1235           <td></td>
1236           <td class="paramtype">int&#160;</td>
1237           <td class="paramname"><em>subsamp</em>, </td>
1238         </tr>
1239         <tr>
1240           <td class="paramkey"></td>
1241           <td></td>
1242           <td class="paramtype">unsigned char **&#160;</td>
1243           <td class="paramname"><em>jpegBuf</em>, </td>
1244         </tr>
1245         <tr>
1246           <td class="paramkey"></td>
1247           <td></td>
1248           <td class="paramtype">unsigned long *&#160;</td>
1249           <td class="paramname"><em>jpegSize</em>, </td>
1250         </tr>
1251         <tr>
1252           <td class="paramkey"></td>
1253           <td></td>
1254           <td class="paramtype">int&#160;</td>
1255           <td class="paramname"><em>jpegQual</em>, </td>
1256         </tr>
1257         <tr>
1258           <td class="paramkey"></td>
1259           <td></td>
1260           <td class="paramtype">int&#160;</td>
1261           <td class="paramname"><em>flags</em>&#160;</td>
1262         </tr>
1263         <tr>
1264           <td></td>
1265           <td>)</td>
1266           <td></td><td></td>
1267         </tr>
1268       </table>
1269 </div><div class="memdoc">
1270
1271 <p>Compress a YUV planar image into a JPEG image. </p>
1272 <dl class="params"><dt>Parameters</dt><dd>
1273   <table class="params">
1274     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
1275     <tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar 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#ga2be2b9969d4df9ecce9b05deed273194" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. 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>
1276     <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 within TurboJPEG.</td></tr>
1277     <tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</td></tr>
1278     <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 within TurboJPEG.</td></tr>
1279     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
1280     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image 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">
1281 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1282 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1283 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga67ac12fee79073242cb216e07c9f1f90" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees that it won't be.)</li>
1284 </ol>
1285 If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1286     <tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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 image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1287     <tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
1288     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1289   </table>
1290   </dd>
1291 </dl>
1292 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1293
1294 </div>
1295 </div>
1296 <a id="ga29ec5dfbd2d84b8724e951d6fa0d5d9e"></a>
1297 <h2 class="memtitle"><span class="permalink"><a href="#ga29ec5dfbd2d84b8724e951d6fa0d5d9e">&#9670;&nbsp;</a></span>tjCompressFromYUVPlanes()</h2>
1298
1299 <div class="memitem">
1300 <div class="memproto">
1301       <table class="memname">
1302         <tr>
1303           <td class="memname">DLLEXPORT int tjCompressFromYUVPlanes </td>
1304           <td>(</td>
1305           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1306           <td class="paramname"><em>handle</em>, </td>
1307         </tr>
1308         <tr>
1309           <td class="paramkey"></td>
1310           <td></td>
1311           <td class="paramtype">const unsigned char **&#160;</td>
1312           <td class="paramname"><em>srcPlanes</em>, </td>
1313         </tr>
1314         <tr>
1315           <td class="paramkey"></td>
1316           <td></td>
1317           <td class="paramtype">int&#160;</td>
1318           <td class="paramname"><em>width</em>, </td>
1319         </tr>
1320         <tr>
1321           <td class="paramkey"></td>
1322           <td></td>
1323           <td class="paramtype">const int *&#160;</td>
1324           <td class="paramname"><em>strides</em>, </td>
1325         </tr>
1326         <tr>
1327           <td class="paramkey"></td>
1328           <td></td>
1329           <td class="paramtype">int&#160;</td>
1330           <td class="paramname"><em>height</em>, </td>
1331         </tr>
1332         <tr>
1333           <td class="paramkey"></td>
1334           <td></td>
1335           <td class="paramtype">int&#160;</td>
1336           <td class="paramname"><em>subsamp</em>, </td>
1337         </tr>
1338         <tr>
1339           <td class="paramkey"></td>
1340           <td></td>
1341           <td class="paramtype">unsigned char **&#160;</td>
1342           <td class="paramname"><em>jpegBuf</em>, </td>
1343         </tr>
1344         <tr>
1345           <td class="paramkey"></td>
1346           <td></td>
1347           <td class="paramtype">unsigned long *&#160;</td>
1348           <td class="paramname"><em>jpegSize</em>, </td>
1349         </tr>
1350         <tr>
1351           <td class="paramkey"></td>
1352           <td></td>
1353           <td class="paramtype">int&#160;</td>
1354           <td class="paramname"><em>jpegQual</em>, </td>
1355         </tr>
1356         <tr>
1357           <td class="paramkey"></td>
1358           <td></td>
1359           <td class="paramtype">int&#160;</td>
1360           <td class="paramname"><em>flags</em>&#160;</td>
1361         </tr>
1362         <tr>
1363           <td></td>
1364           <td>)</td>
1365           <td></td><td></td>
1366         </tr>
1367       </table>
1368 </div><div class="memdoc">
1369
1370 <p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>
1371 <dl class="params"><dt>Parameters</dt><dd>
1372   <table class="params">
1373     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
1374     <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 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#gab4ab7b24f6e797d79abaaa670373961d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
1375     <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 within TurboJPEG.</td></tr>
1376     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line 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 line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.</td></tr>
1377     <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 within TurboJPEG.</td></tr>
1378     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
1379     <tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image 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">
1380 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
1381 <li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
1382 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga67ac12fee79073242cb216e07c9f1f90" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tjBufSize()</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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees that it won't be.)</li>
1383 </ol>
1384 If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
1385     <tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image 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 image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
1386     <tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
1387     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1388   </table>
1389   </dd>
1390 </dl>
1391 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1392
1393 </div>
1394 </div>
1395 <a id="ga70abbf38f77a26fd6da8813bef96f695"></a>
1396 <h2 class="memtitle"><span class="permalink"><a href="#ga70abbf38f77a26fd6da8813bef96f695">&#9670;&nbsp;</a></span>tjDecodeYUV()</h2>
1397
1398 <div class="memitem">
1399 <div class="memproto">
1400       <table class="memname">
1401         <tr>
1402           <td class="memname">DLLEXPORT int tjDecodeYUV </td>
1403           <td>(</td>
1404           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1405           <td class="paramname"><em>handle</em>, </td>
1406         </tr>
1407         <tr>
1408           <td class="paramkey"></td>
1409           <td></td>
1410           <td class="paramtype">const unsigned char *&#160;</td>
1411           <td class="paramname"><em>srcBuf</em>, </td>
1412         </tr>
1413         <tr>
1414           <td class="paramkey"></td>
1415           <td></td>
1416           <td class="paramtype">int&#160;</td>
1417           <td class="paramname"><em>pad</em>, </td>
1418         </tr>
1419         <tr>
1420           <td class="paramkey"></td>
1421           <td></td>
1422           <td class="paramtype">int&#160;</td>
1423           <td class="paramname"><em>subsamp</em>, </td>
1424         </tr>
1425         <tr>
1426           <td class="paramkey"></td>
1427           <td></td>
1428           <td class="paramtype">unsigned char *&#160;</td>
1429           <td class="paramname"><em>dstBuf</em>, </td>
1430         </tr>
1431         <tr>
1432           <td class="paramkey"></td>
1433           <td></td>
1434           <td class="paramtype">int&#160;</td>
1435           <td class="paramname"><em>width</em>, </td>
1436         </tr>
1437         <tr>
1438           <td class="paramkey"></td>
1439           <td></td>
1440           <td class="paramtype">int&#160;</td>
1441           <td class="paramname"><em>pitch</em>, </td>
1442         </tr>
1443         <tr>
1444           <td class="paramkey"></td>
1445           <td></td>
1446           <td class="paramtype">int&#160;</td>
1447           <td class="paramname"><em>height</em>, </td>
1448         </tr>
1449         <tr>
1450           <td class="paramkey"></td>
1451           <td></td>
1452           <td class="paramtype">int&#160;</td>
1453           <td class="paramname"><em>pixelFormat</em>, </td>
1454         </tr>
1455         <tr>
1456           <td class="paramkey"></td>
1457           <td></td>
1458           <td class="paramtype">int&#160;</td>
1459           <td class="paramname"><em>flags</em>&#160;</td>
1460         </tr>
1461         <tr>
1462           <td></td>
1463           <td>)</td>
1464           <td></td><td></td>
1465         </tr>
1466       </table>
1467 </div><div class="memdoc">
1468
1469 <p>Decode a YUV planar image into an RGB or grayscale image. </p>
1470 <p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
1471 <dl class="params"><dt>Parameters</dt><dd>
1472   <table class="params">
1473     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1474     <tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar 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#ga2be2b9969d4df9ecce9b05deed273194" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. 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>
1475     <tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
1476     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
1477     <tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
1478     <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
1479     <tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
1480     <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
1481     <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>
1482     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1483   </table>
1484   </dd>
1485 </dl>
1486 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1487
1488 </div>
1489 </div>
1490 <a id="ga10e837c07fa9d25770565b237d3898d9"></a>
1491 <h2 class="memtitle"><span class="permalink"><a href="#ga10e837c07fa9d25770565b237d3898d9">&#9670;&nbsp;</a></span>tjDecodeYUVPlanes()</h2>
1492
1493 <div class="memitem">
1494 <div class="memproto">
1495       <table class="memname">
1496         <tr>
1497           <td class="memname">DLLEXPORT int tjDecodeYUVPlanes </td>
1498           <td>(</td>
1499           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1500           <td class="paramname"><em>handle</em>, </td>
1501         </tr>
1502         <tr>
1503           <td class="paramkey"></td>
1504           <td></td>
1505           <td class="paramtype">const unsigned char **&#160;</td>
1506           <td class="paramname"><em>srcPlanes</em>, </td>
1507         </tr>
1508         <tr>
1509           <td class="paramkey"></td>
1510           <td></td>
1511           <td class="paramtype">const int *&#160;</td>
1512           <td class="paramname"><em>strides</em>, </td>
1513         </tr>
1514         <tr>
1515           <td class="paramkey"></td>
1516           <td></td>
1517           <td class="paramtype">int&#160;</td>
1518           <td class="paramname"><em>subsamp</em>, </td>
1519         </tr>
1520         <tr>
1521           <td class="paramkey"></td>
1522           <td></td>
1523           <td class="paramtype">unsigned char *&#160;</td>
1524           <td class="paramname"><em>dstBuf</em>, </td>
1525         </tr>
1526         <tr>
1527           <td class="paramkey"></td>
1528           <td></td>
1529           <td class="paramtype">int&#160;</td>
1530           <td class="paramname"><em>width</em>, </td>
1531         </tr>
1532         <tr>
1533           <td class="paramkey"></td>
1534           <td></td>
1535           <td class="paramtype">int&#160;</td>
1536           <td class="paramname"><em>pitch</em>, </td>
1537         </tr>
1538         <tr>
1539           <td class="paramkey"></td>
1540           <td></td>
1541           <td class="paramtype">int&#160;</td>
1542           <td class="paramname"><em>height</em>, </td>
1543         </tr>
1544         <tr>
1545           <td class="paramkey"></td>
1546           <td></td>
1547           <td class="paramtype">int&#160;</td>
1548           <td class="paramname"><em>pixelFormat</em>, </td>
1549         </tr>
1550         <tr>
1551           <td class="paramkey"></td>
1552           <td></td>
1553           <td class="paramtype">int&#160;</td>
1554           <td class="paramname"><em>flags</em>&#160;</td>
1555         </tr>
1556         <tr>
1557           <td></td>
1558           <td>)</td>
1559           <td></td><td></td>
1560         </tr>
1561       </table>
1562 </div><div class="memdoc">
1563
1564 <p>Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. </p>
1565 <p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
1566 <dl class="params"><dt>Parameters</dt><dd>
1567   <table class="params">
1568     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1569     <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#gab4ab7b24f6e797d79abaaa670373961d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
1570     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line 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 line padding in each plane or to decode a subregion of a larger YUV planar image.</td></tr>
1571     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
1572     <tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
1573     <tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
1574     <tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
1575     <tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
1576     <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>
1577     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1578   </table>
1579   </dd>
1580 </dl>
1581 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1582
1583 </div>
1584 </div>
1585 <a id="gae9eccef8b682a48f43a9117c231ed013"></a>
1586 <h2 class="memtitle"><span class="permalink"><a href="#gae9eccef8b682a48f43a9117c231ed013">&#9670;&nbsp;</a></span>tjDecompress2()</h2>
1587
1588 <div class="memitem">
1589 <div class="memproto">
1590       <table class="memname">
1591         <tr>
1592           <td class="memname">DLLEXPORT int tjDecompress2 </td>
1593           <td>(</td>
1594           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1595           <td class="paramname"><em>handle</em>, </td>
1596         </tr>
1597         <tr>
1598           <td class="paramkey"></td>
1599           <td></td>
1600           <td class="paramtype">const unsigned char *&#160;</td>
1601           <td class="paramname"><em>jpegBuf</em>, </td>
1602         </tr>
1603         <tr>
1604           <td class="paramkey"></td>
1605           <td></td>
1606           <td class="paramtype">unsigned long&#160;</td>
1607           <td class="paramname"><em>jpegSize</em>, </td>
1608         </tr>
1609         <tr>
1610           <td class="paramkey"></td>
1611           <td></td>
1612           <td class="paramtype">unsigned char *&#160;</td>
1613           <td class="paramname"><em>dstBuf</em>, </td>
1614         </tr>
1615         <tr>
1616           <td class="paramkey"></td>
1617           <td></td>
1618           <td class="paramtype">int&#160;</td>
1619           <td class="paramname"><em>width</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>pitch</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>height</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>pixelFormat</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>flags</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>Decompress a JPEG image to an RGB, grayscale, or CMYK image. </p>
1654 <dl class="params"><dt>Parameters</dt><dd>
1655   <table class="params">
1656     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1657     <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
1658     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1659     <tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> 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 image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#gac3854476006b10787bd128f7ede48057" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer.</td></tr>
1660     <tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size.</td></tr>
1661     <tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> 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 image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#gac3854476006b10787bd128f7ede48057" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
1662     <tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size.</td></tr>
1663     <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>
1664     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1669
1670 </div>
1671 </div>
1672 <a id="ga0595681096bba7199cc6f3533cb25f77"></a>
1673 <h2 class="memtitle"><span class="permalink"><a href="#ga0595681096bba7199cc6f3533cb25f77">&#9670;&nbsp;</a></span>tjDecompressHeader3()</h2>
1674
1675 <div class="memitem">
1676 <div class="memproto">
1677       <table class="memname">
1678         <tr>
1679           <td class="memname">DLLEXPORT int tjDecompressHeader3 </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 *&#160;</td>
1688           <td class="paramname"><em>jpegBuf</em>, </td>
1689         </tr>
1690         <tr>
1691           <td class="paramkey"></td>
1692           <td></td>
1693           <td class="paramtype">unsigned long&#160;</td>
1694           <td class="paramname"><em>jpegSize</em>, </td>
1695         </tr>
1696         <tr>
1697           <td class="paramkey"></td>
1698           <td></td>
1699           <td class="paramtype">int *&#160;</td>
1700           <td class="paramname"><em>width</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>height</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>jpegSubsamp</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>jpegColorspace</em>&#160;</td>
1719         </tr>
1720         <tr>
1721           <td></td>
1722           <td>)</td>
1723           <td></td><td></td>
1724         </tr>
1725       </table>
1726 </div><div class="memdoc">
1727
1728 <p>Retrieve information about a JPEG image without decompressing it, or prime the decompressor with quantization and Huffman tables. </p>
1729 <dl class="params"><dt>Parameters</dt><dd>
1730   <table class="params">
1731     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1732     <tr><td class="paramname">jpegBuf</td><td>pointer to a 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>
1733     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image or tables-only datastream (in bytes)</td></tr>
1734     <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image. If <code>jpegBuf</code> points to a tables-only datastream, then <code>width</code> is ignored.</td></tr>
1735     <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image. If <code>jpegBuf</code> points to a tables-only datastream, then <code>height</code> is ignored.</td></tr>
1736     <tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when the JPEG image was compressed (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) If <code>jpegBuf</code> points to a tables-only datastream, then <code>jpegSubsamp</code> is ignored.</td></tr>
1737     <tr><td class="paramname">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a>.) If <code>jpegBuf</code> points to a tables-only datastream, then <code>jpegColorspace</code> is ignored.</td></tr>
1738   </table>
1739   </dd>
1740 </dl>
1741 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1742
1743 </div>
1744 </div>
1745 <a id="ga04d1e839ff9a0860dd1475cff78d3364"></a>
1746 <h2 class="memtitle"><span class="permalink"><a href="#ga04d1e839ff9a0860dd1475cff78d3364">&#9670;&nbsp;</a></span>tjDecompressToYUV2()</h2>
1747
1748 <div class="memitem">
1749 <div class="memproto">
1750       <table class="memname">
1751         <tr>
1752           <td class="memname">DLLEXPORT int tjDecompressToYUV2 </td>
1753           <td>(</td>
1754           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1755           <td class="paramname"><em>handle</em>, </td>
1756         </tr>
1757         <tr>
1758           <td class="paramkey"></td>
1759           <td></td>
1760           <td class="paramtype">const unsigned char *&#160;</td>
1761           <td class="paramname"><em>jpegBuf</em>, </td>
1762         </tr>
1763         <tr>
1764           <td class="paramkey"></td>
1765           <td></td>
1766           <td class="paramtype">unsigned long&#160;</td>
1767           <td class="paramname"><em>jpegSize</em>, </td>
1768         </tr>
1769         <tr>
1770           <td class="paramkey"></td>
1771           <td></td>
1772           <td class="paramtype">unsigned char *&#160;</td>
1773           <td class="paramname"><em>dstBuf</em>, </td>
1774         </tr>
1775         <tr>
1776           <td class="paramkey"></td>
1777           <td></td>
1778           <td class="paramtype">int&#160;</td>
1779           <td class="paramname"><em>width</em>, </td>
1780         </tr>
1781         <tr>
1782           <td class="paramkey"></td>
1783           <td></td>
1784           <td class="paramtype">int&#160;</td>
1785           <td class="paramname"><em>pad</em>, </td>
1786         </tr>
1787         <tr>
1788           <td class="paramkey"></td>
1789           <td></td>
1790           <td class="paramtype">int&#160;</td>
1791           <td class="paramname"><em>height</em>, </td>
1792         </tr>
1793         <tr>
1794           <td class="paramkey"></td>
1795           <td></td>
1796           <td class="paramtype">int&#160;</td>
1797           <td class="paramname"><em>flags</em>&#160;</td>
1798         </tr>
1799         <tr>
1800           <td></td>
1801           <td>)</td>
1802           <td></td><td></td>
1803         </tr>
1804       </table>
1805 </div><div class="memdoc">
1806
1807 <p>Decompress a JPEG image to a YUV planar image. </p>
1808 <p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
1809 <dl class="params"><dt>Parameters</dt><dd>
1810   <table class="params">
1811     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1812     <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
1813     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1814     <tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga2be2b9969d4df9ecce9b05deed273194" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. 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>
1815     <tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled 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 within TurboJPEG.</td></tr>
1816     <tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
1817     <tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled 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 within TurboJPEG.</td></tr>
1818     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1819   </table>
1820   </dd>
1821 </dl>
1822 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1823
1824 </div>
1825 </div>
1826 <a id="gaa59f901a5258ada5bd0185ad59368540"></a>
1827 <h2 class="memtitle"><span class="permalink"><a href="#gaa59f901a5258ada5bd0185ad59368540">&#9670;&nbsp;</a></span>tjDecompressToYUVPlanes()</h2>
1828
1829 <div class="memitem">
1830 <div class="memproto">
1831       <table class="memname">
1832         <tr>
1833           <td class="memname">DLLEXPORT int tjDecompressToYUVPlanes </td>
1834           <td>(</td>
1835           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1836           <td class="paramname"><em>handle</em>, </td>
1837         </tr>
1838         <tr>
1839           <td class="paramkey"></td>
1840           <td></td>
1841           <td class="paramtype">const unsigned char *&#160;</td>
1842           <td class="paramname"><em>jpegBuf</em>, </td>
1843         </tr>
1844         <tr>
1845           <td class="paramkey"></td>
1846           <td></td>
1847           <td class="paramtype">unsigned long&#160;</td>
1848           <td class="paramname"><em>jpegSize</em>, </td>
1849         </tr>
1850         <tr>
1851           <td class="paramkey"></td>
1852           <td></td>
1853           <td class="paramtype">unsigned char **&#160;</td>
1854           <td class="paramname"><em>dstPlanes</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>width</em>, </td>
1861         </tr>
1862         <tr>
1863           <td class="paramkey"></td>
1864           <td></td>
1865           <td class="paramtype">int *&#160;</td>
1866           <td class="paramname"><em>strides</em>, </td>
1867         </tr>
1868         <tr>
1869           <td class="paramkey"></td>
1870           <td></td>
1871           <td class="paramtype">int&#160;</td>
1872           <td class="paramname"><em>height</em>, </td>
1873         </tr>
1874         <tr>
1875           <td class="paramkey"></td>
1876           <td></td>
1877           <td class="paramtype">int&#160;</td>
1878           <td class="paramname"><em>flags</em>&#160;</td>
1879         </tr>
1880         <tr>
1881           <td></td>
1882           <td>)</td>
1883           <td></td><td></td>
1884         </tr>
1885       </table>
1886 </div><div class="memdoc">
1887
1888 <p>Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. </p>
1889 <p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
1890 <dl class="params"><dt>Parameters</dt><dd>
1891   <table class="params">
1892     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
1893     <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
1894     <tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
1895     <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 YUV image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#gab4ab7b24f6e797d79abaaa670373961d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
1896     <tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled 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 within TurboJPEG.</td></tr>
1897     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output 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 line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image.</td></tr>
1898     <tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled 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 within TurboJPEG.</td></tr>
1899     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
1900   </table>
1901   </dd>
1902 </dl>
1903 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
1904
1905 </div>
1906 </div>
1907 <a id="ga75f355fa27225ba1a4ee392c852394d2"></a>
1908 <h2 class="memtitle"><span class="permalink"><a href="#ga75f355fa27225ba1a4ee392c852394d2">&#9670;&nbsp;</a></span>tjDestroy()</h2>
1909
1910 <div class="memitem">
1911 <div class="memproto">
1912       <table class="memname">
1913         <tr>
1914           <td class="memname">DLLEXPORT int tjDestroy </td>
1915           <td>(</td>
1916           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1917           <td class="paramname"><em>handle</em></td><td>)</td>
1918           <td></td>
1919         </tr>
1920       </table>
1921 </div><div class="memdoc">
1922
1923 <p>Destroy a TurboJPEG compressor, decompressor, or transformer instance. </p>
1924 <dl class="params"><dt>Parameters</dt><dd>
1925   <table class="params">
1926     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor, decompressor or transformer instance</td></tr>
1927   </table>
1928   </dd>
1929 </dl>
1930 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
1931
1932 </div>
1933 </div>
1934 <a id="gac519b922cdf446e97d0cdcba513636bf"></a>
1935 <h2 class="memtitle"><span class="permalink"><a href="#gac519b922cdf446e97d0cdcba513636bf">&#9670;&nbsp;</a></span>tjEncodeYUV3()</h2>
1936
1937 <div class="memitem">
1938 <div class="memproto">
1939       <table class="memname">
1940         <tr>
1941           <td class="memname">DLLEXPORT int tjEncodeYUV3 </td>
1942           <td>(</td>
1943           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
1944           <td class="paramname"><em>handle</em>, </td>
1945         </tr>
1946         <tr>
1947           <td class="paramkey"></td>
1948           <td></td>
1949           <td class="paramtype">const unsigned char *&#160;</td>
1950           <td class="paramname"><em>srcBuf</em>, </td>
1951         </tr>
1952         <tr>
1953           <td class="paramkey"></td>
1954           <td></td>
1955           <td class="paramtype">int&#160;</td>
1956           <td class="paramname"><em>width</em>, </td>
1957         </tr>
1958         <tr>
1959           <td class="paramkey"></td>
1960           <td></td>
1961           <td class="paramtype">int&#160;</td>
1962           <td class="paramname"><em>pitch</em>, </td>
1963         </tr>
1964         <tr>
1965           <td class="paramkey"></td>
1966           <td></td>
1967           <td class="paramtype">int&#160;</td>
1968           <td class="paramname"><em>height</em>, </td>
1969         </tr>
1970         <tr>
1971           <td class="paramkey"></td>
1972           <td></td>
1973           <td class="paramtype">int&#160;</td>
1974           <td class="paramname"><em>pixelFormat</em>, </td>
1975         </tr>
1976         <tr>
1977           <td class="paramkey"></td>
1978           <td></td>
1979           <td class="paramtype">unsigned char *&#160;</td>
1980           <td class="paramname"><em>dstBuf</em>, </td>
1981         </tr>
1982         <tr>
1983           <td class="paramkey"></td>
1984           <td></td>
1985           <td class="paramtype">int&#160;</td>
1986           <td class="paramname"><em>pad</em>, </td>
1987         </tr>
1988         <tr>
1989           <td class="paramkey"></td>
1990           <td></td>
1991           <td class="paramtype">int&#160;</td>
1992           <td class="paramname"><em>subsamp</em>, </td>
1993         </tr>
1994         <tr>
1995           <td class="paramkey"></td>
1996           <td></td>
1997           <td class="paramtype">int&#160;</td>
1998           <td class="paramname"><em>flags</em>&#160;</td>
1999         </tr>
2000         <tr>
2001           <td></td>
2002           <td>)</td>
2003           <td></td><td></td>
2004         </tr>
2005       </table>
2006 </div><div class="memdoc">
2007
2008 <p>Encode an RGB or grayscale image into a YUV planar image. </p>
2009 <p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
2010 <dl class="params"><dt>Parameters</dt><dd>
2011   <table class="params">
2012     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
2013     <tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
2014     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
2015     <tr><td class="paramname">pitch</td><td>bytes per line 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2016     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
2017     <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>
2018     <tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#ga2be2b9969d4df9ecce9b05deed273194" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters.">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. 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>
2019     <tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
2020     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
2021     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
2022   </table>
2023   </dd>
2024 </dl>
2025 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
2026
2027 </div>
2028 </div>
2029 <a id="gae2d04c72457fe7f4d60cf78ab1b1feb1"></a>
2030 <h2 class="memtitle"><span class="permalink"><a href="#gae2d04c72457fe7f4d60cf78ab1b1feb1">&#9670;&nbsp;</a></span>tjEncodeYUVPlanes()</h2>
2031
2032 <div class="memitem">
2033 <div class="memproto">
2034       <table class="memname">
2035         <tr>
2036           <td class="memname">DLLEXPORT int tjEncodeYUVPlanes </td>
2037           <td>(</td>
2038           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2039           <td class="paramname"><em>handle</em>, </td>
2040         </tr>
2041         <tr>
2042           <td class="paramkey"></td>
2043           <td></td>
2044           <td class="paramtype">const unsigned char *&#160;</td>
2045           <td class="paramname"><em>srcBuf</em>, </td>
2046         </tr>
2047         <tr>
2048           <td class="paramkey"></td>
2049           <td></td>
2050           <td class="paramtype">int&#160;</td>
2051           <td class="paramname"><em>width</em>, </td>
2052         </tr>
2053         <tr>
2054           <td class="paramkey"></td>
2055           <td></td>
2056           <td class="paramtype">int&#160;</td>
2057           <td class="paramname"><em>pitch</em>, </td>
2058         </tr>
2059         <tr>
2060           <td class="paramkey"></td>
2061           <td></td>
2062           <td class="paramtype">int&#160;</td>
2063           <td class="paramname"><em>height</em>, </td>
2064         </tr>
2065         <tr>
2066           <td class="paramkey"></td>
2067           <td></td>
2068           <td class="paramtype">int&#160;</td>
2069           <td class="paramname"><em>pixelFormat</em>, </td>
2070         </tr>
2071         <tr>
2072           <td class="paramkey"></td>
2073           <td></td>
2074           <td class="paramtype">unsigned char **&#160;</td>
2075           <td class="paramname"><em>dstPlanes</em>, </td>
2076         </tr>
2077         <tr>
2078           <td class="paramkey"></td>
2079           <td></td>
2080           <td class="paramtype">int *&#160;</td>
2081           <td class="paramname"><em>strides</em>, </td>
2082         </tr>
2083         <tr>
2084           <td class="paramkey"></td>
2085           <td></td>
2086           <td class="paramtype">int&#160;</td>
2087           <td class="paramname"><em>subsamp</em>, </td>
2088         </tr>
2089         <tr>
2090           <td class="paramkey"></td>
2091           <td></td>
2092           <td class="paramtype">int&#160;</td>
2093           <td class="paramname"><em>flags</em>&#160;</td>
2094         </tr>
2095         <tr>
2096           <td></td>
2097           <td>)</td>
2098           <td></td><td></td>
2099         </tr>
2100       </table>
2101 </div><div class="memdoc">
2102
2103 <p>Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. </p>
2104 <p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
2105 <dl class="params"><dt>Parameters</dt><dd>
2106   <table class="params">
2107     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
2108     <tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
2109     <tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
2110     <tr><td class="paramname">pitch</td><td>bytes per line 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2111     <tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
2112     <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>
2113     <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#gab4ab7b24f6e797d79abaaa670373961d" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters.">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
2114     <tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output 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 line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image.</td></tr>
2115     <tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
2116     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
2117   </table>
2118   </dd>
2119 </dl>
2120 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
2121
2122 </div>
2123 </div>
2124 <a id="gaea863d2da0cdb609563aabdf9196514b"></a>
2125 <h2 class="memtitle"><span class="permalink"><a href="#gaea863d2da0cdb609563aabdf9196514b">&#9670;&nbsp;</a></span>tjFree()</h2>
2126
2127 <div class="memitem">
2128 <div class="memproto">
2129       <table class="memname">
2130         <tr>
2131           <td class="memname">DLLEXPORT void tjFree </td>
2132           <td>(</td>
2133           <td class="paramtype">unsigned char *&#160;</td>
2134           <td class="paramname"><em>buffer</em></td><td>)</td>
2135           <td></td>
2136         </tr>
2137       </table>
2138 </div><div class="memdoc">
2139
2140 <p>Free an image buffer previously allocated by TurboJPEG. </p>
2141 <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#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a>.</p>
2142 <dl class="params"><dt>Parameters</dt><dd>
2143   <table class="params">
2144     <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>
2145   </table>
2146   </dd>
2147 </dl>
2148 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> </dd></dl>
2149
2150 </div>
2151 </div>
2152 <a id="ga414feeffbf860ebd31c745df203de410"></a>
2153 <h2 class="memtitle"><span class="permalink"><a href="#ga414feeffbf860ebd31c745df203de410">&#9670;&nbsp;</a></span>tjGetErrorCode()</h2>
2154
2155 <div class="memitem">
2156 <div class="memproto">
2157       <table class="memname">
2158         <tr>
2159           <td class="memname">DLLEXPORT int tjGetErrorCode </td>
2160           <td>(</td>
2161           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2162           <td class="paramname"><em>handle</em></td><td>)</td>
2163           <td></td>
2164         </tr>
2165       </table>
2166 </div><div class="memdoc">
2167
2168 <p>Returns a code indicating the severity of the last error. </p>
2169 <p>See <a class="el" href="group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe">Error codes</a>.</p>
2170 <dl class="params"><dt>Parameters</dt><dd>
2171   <table class="params">
2172     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor, decompressor or transformer instance</td></tr>
2173   </table>
2174   </dd>
2175 </dl>
2176 <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>
2177
2178 </div>
2179 </div>
2180 <a id="ga1ead8574f9f39fbafc6b497124e7aafa"></a>
2181 <h2 class="memtitle"><span class="permalink"><a href="#ga1ead8574f9f39fbafc6b497124e7aafa">&#9670;&nbsp;</a></span>tjGetErrorStr2()</h2>
2182
2183 <div class="memitem">
2184 <div class="memproto">
2185       <table class="memname">
2186         <tr>
2187           <td class="memname">DLLEXPORT char* tjGetErrorStr2 </td>
2188           <td>(</td>
2189           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2190           <td class="paramname"><em>handle</em></td><td>)</td>
2191           <td></td>
2192         </tr>
2193       </table>
2194 </div><div class="memdoc">
2195
2196 <p>Returns a descriptive error message explaining why the last command failed. </p>
2197 <dl class="params"><dt>Parameters</dt><dd>
2198   <table class="params">
2199     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor, decompressor, or transformer 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>
2200   </table>
2201   </dd>
2202 </dl>
2203 <dl class="section return"><dt>Returns</dt><dd>a descriptive error message explaining why the last command failed. </dd></dl>
2204
2205 </div>
2206 </div>
2207 <a id="gac3854476006b10787bd128f7ede48057"></a>
2208 <h2 class="memtitle"><span class="permalink"><a href="#gac3854476006b10787bd128f7ede48057">&#9670;&nbsp;</a></span>tjGetScalingFactors()</h2>
2209
2210 <div class="memitem">
2211 <div class="memproto">
2212       <table class="memname">
2213         <tr>
2214           <td class="memname">DLLEXPORT <a class="el" href="structtjscalingfactor.html">tjscalingfactor</a>* tjGetScalingFactors </td>
2215           <td>(</td>
2216           <td class="paramtype">int *&#160;</td>
2217           <td class="paramname"><em>numscalingfactors</em></td><td>)</td>
2218           <td></td>
2219         </tr>
2220       </table>
2221 </div><div class="memdoc">
2222
2223 <p>Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of TurboJPEG supports. </p>
2224 <dl class="params"><dt>Parameters</dt><dd>
2225   <table class="params">
2226     <tr><td class="paramname">numscalingfactors</td><td>pointer to an integer variable that will receive the number of elements in the list</td></tr>
2227   </table>
2228   </dd>
2229 </dl>
2230 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
2231
2232 </div>
2233 </div>
2234 <a id="ga9d63a05fc6d813f4aae06107041a37e8"></a>
2235 <h2 class="memtitle"><span class="permalink"><a href="#ga9d63a05fc6d813f4aae06107041a37e8">&#9670;&nbsp;</a></span>tjInitCompress()</h2>
2236
2237 <div class="memitem">
2238 <div class="memproto">
2239       <table class="memname">
2240         <tr>
2241           <td class="memname">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> tjInitCompress </td>
2242           <td>(</td>
2243           <td class="paramtype">void&#160;</td>
2244           <td class="paramname"></td><td>)</td>
2245           <td></td>
2246         </tr>
2247       </table>
2248 </div><div class="memdoc">
2249
2250 <p>Create a TurboJPEG compressor instance. </p>
2251 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
2252
2253 </div>
2254 </div>
2255 <a id="ga52300eac3f3d9ef4bab303bc244f62d3"></a>
2256 <h2 class="memtitle"><span class="permalink"><a href="#ga52300eac3f3d9ef4bab303bc244f62d3">&#9670;&nbsp;</a></span>tjInitDecompress()</h2>
2257
2258 <div class="memitem">
2259 <div class="memproto">
2260       <table class="memname">
2261         <tr>
2262           <td class="memname">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> tjInitDecompress </td>
2263           <td>(</td>
2264           <td class="paramtype">void&#160;</td>
2265           <td class="paramname"></td><td>)</td>
2266           <td></td>
2267         </tr>
2268       </table>
2269 </div><div class="memdoc">
2270
2271 <p>Create a TurboJPEG decompressor instance. </p>
2272 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
2273
2274 </div>
2275 </div>
2276 <a id="ga928beff6ac248ceadf01089fc6b41957"></a>
2277 <h2 class="memtitle"><span class="permalink"><a href="#ga928beff6ac248ceadf01089fc6b41957">&#9670;&nbsp;</a></span>tjInitTransform()</h2>
2278
2279 <div class="memitem">
2280 <div class="memproto">
2281       <table class="memname">
2282         <tr>
2283           <td class="memname">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> tjInitTransform </td>
2284           <td>(</td>
2285           <td class="paramtype">void&#160;</td>
2286           <td class="paramname"></td><td>)</td>
2287           <td></td>
2288         </tr>
2289       </table>
2290 </div><div class="memdoc">
2291
2292 <p>Create a new TurboJPEG transformer instance. </p>
2293 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
2294
2295 </div>
2296 </div>
2297 <a id="gaffbd83c375e79f5db4b5c5d8ad4466e7"></a>
2298 <h2 class="memtitle"><span class="permalink"><a href="#gaffbd83c375e79f5db4b5c5d8ad4466e7">&#9670;&nbsp;</a></span>tjLoadImage()</h2>
2299
2300 <div class="memitem">
2301 <div class="memproto">
2302       <table class="memname">
2303         <tr>
2304           <td class="memname">DLLEXPORT unsigned char* tjLoadImage </td>
2305           <td>(</td>
2306           <td class="paramtype">const char *&#160;</td>
2307           <td class="paramname"><em>filename</em>, </td>
2308         </tr>
2309         <tr>
2310           <td class="paramkey"></td>
2311           <td></td>
2312           <td class="paramtype">int *&#160;</td>
2313           <td class="paramname"><em>width</em>, </td>
2314         </tr>
2315         <tr>
2316           <td class="paramkey"></td>
2317           <td></td>
2318           <td class="paramtype">int&#160;</td>
2319           <td class="paramname"><em>align</em>, </td>
2320         </tr>
2321         <tr>
2322           <td class="paramkey"></td>
2323           <td></td>
2324           <td class="paramtype">int *&#160;</td>
2325           <td class="paramname"><em>height</em>, </td>
2326         </tr>
2327         <tr>
2328           <td class="paramkey"></td>
2329           <td></td>
2330           <td class="paramtype">int *&#160;</td>
2331           <td class="paramname"><em>pixelFormat</em>, </td>
2332         </tr>
2333         <tr>
2334           <td class="paramkey"></td>
2335           <td></td>
2336           <td class="paramtype">int&#160;</td>
2337           <td class="paramname"><em>flags</em>&#160;</td>
2338         </tr>
2339         <tr>
2340           <td></td>
2341           <td>)</td>
2342           <td></td><td></td>
2343         </tr>
2344       </table>
2345 </div><div class="memdoc">
2346
2347 <p>Load an uncompressed image from disk into memory. </p>
2348 <dl class="params"><dt>Parameters</dt><dd>
2349   <table class="params">
2350     <tr><td class="paramname">filename</td><td>name of a file containing an uncompressed image in Windows BMP or PBMPLUS (PPM/PGM) format</td></tr>
2351     <tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the uncompressed image</td></tr>
2352     <tr><td class="paramname">align</td><td>row alignment of the image buffer to be returned (must be a power of 2.) For instance, setting this parameter to 4 will cause all rows in the image buffer to be padded to the nearest 32-bit boundary, and setting this parameter to 1 will cause all rows in the image buffer to be unpadded.</td></tr>
2353     <tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the uncompressed image</td></tr>
2354     <tr><td class="paramname">pixelFormat</td><td>pointer to an integer variable that specifies or will receive the pixel format of the uncompressed image buffer. The behavior of <a class="el" href="group___turbo_j_p_e_g.html#gaffbd83c375e79f5db4b5c5d8ad4466e7" title="Load an uncompressed image from disk into memory.">tjLoadImage()</a> will vary depending on the value of <code>*pixelFormat</code> passed to the function:<ul>
2355 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa84c1a6cead7952998e2fb895844a21ed">TJPF_UNKNOWN</a> : The uncompressed image buffer returned by the function will use the most optimal pixel format for the file type, and <code>*pixelFormat</code> will contain the ID of this pixel format upon successful return from the function.</li>
2356 <li><a class="el" href="group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aa5431b54b015337705f13118073711a1a">TJPF_GRAY</a> : Only PGM files and 8-bit BMP files with a grayscale colormap can be loaded.</li>
2357 <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>
2358 <li>Other <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">pixel formats</a> : The uncompressed image buffer will use the specified pixel format, and pixel format conversion will be performed if necessary.</li>
2359 </ul>
2360 </td></tr>
2361     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
2362   </table>
2363   </dd>
2364 </dl>
2365 <dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer containing the uncompressed 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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) This buffer should be freed using <a class="el" href="group___turbo_j_p_e_g.html#gaea863d2da0cdb609563aabdf9196514b" title="Free an image buffer previously allocated by TurboJPEG.">tjFree()</a>. </dd></dl>
2366
2367 </div>
2368 </div>
2369 <a id="ga1a209696c6a80748f20e134b3c64789f"></a>
2370 <h2 class="memtitle"><span class="permalink"><a href="#ga1a209696c6a80748f20e134b3c64789f">&#9670;&nbsp;</a></span>tjPlaneHeight()</h2>
2371
2372 <div class="memitem">
2373 <div class="memproto">
2374       <table class="memname">
2375         <tr>
2376           <td class="memname">DLLEXPORT int tjPlaneHeight </td>
2377           <td>(</td>
2378           <td class="paramtype">int&#160;</td>
2379           <td class="paramname"><em>componentID</em>, </td>
2380         </tr>
2381         <tr>
2382           <td class="paramkey"></td>
2383           <td></td>
2384           <td class="paramtype">int&#160;</td>
2385           <td class="paramname"><em>height</em>, </td>
2386         </tr>
2387         <tr>
2388           <td class="paramkey"></td>
2389           <td></td>
2390           <td class="paramtype">int&#160;</td>
2391           <td class="paramname"><em>subsamp</em>&#160;</td>
2392         </tr>
2393         <tr>
2394           <td></td>
2395           <td>)</td>
2396           <td></td><td></td>
2397         </tr>
2398       </table>
2399 </div><div class="memdoc">
2400
2401 <p>The plane height of a YUV image plane with the given parameters. </p>
2402 <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>
2403 <dl class="params"><dt>Parameters</dt><dd>
2404   <table class="params">
2405     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
2406     <tr><td class="paramname">height</td><td>height (in pixels) of the YUV image</td></tr>
2407     <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>
2408   </table>
2409   </dd>
2410 </dl>
2411 <dl class="section return"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
2412
2413 </div>
2414 </div>
2415 <a id="gab4ab7b24f6e797d79abaaa670373961d"></a>
2416 <h2 class="memtitle"><span class="permalink"><a href="#gab4ab7b24f6e797d79abaaa670373961d">&#9670;&nbsp;</a></span>tjPlaneSizeYUV()</h2>
2417
2418 <div class="memitem">
2419 <div class="memproto">
2420       <table class="memname">
2421         <tr>
2422           <td class="memname">DLLEXPORT unsigned long tjPlaneSizeYUV </td>
2423           <td>(</td>
2424           <td class="paramtype">int&#160;</td>
2425           <td class="paramname"><em>componentID</em>, </td>
2426         </tr>
2427         <tr>
2428           <td class="paramkey"></td>
2429           <td></td>
2430           <td class="paramtype">int&#160;</td>
2431           <td class="paramname"><em>width</em>, </td>
2432         </tr>
2433         <tr>
2434           <td class="paramkey"></td>
2435           <td></td>
2436           <td class="paramtype">int&#160;</td>
2437           <td class="paramname"><em>stride</em>, </td>
2438         </tr>
2439         <tr>
2440           <td class="paramkey"></td>
2441           <td></td>
2442           <td class="paramtype">int&#160;</td>
2443           <td class="paramname"><em>height</em>, </td>
2444         </tr>
2445         <tr>
2446           <td class="paramkey"></td>
2447           <td></td>
2448           <td class="paramtype">int&#160;</td>
2449           <td class="paramname"><em>subsamp</em>&#160;</td>
2450         </tr>
2451         <tr>
2452           <td></td>
2453           <td>)</td>
2454           <td></td><td></td>
2455         </tr>
2456       </table>
2457 </div><div class="memdoc">
2458
2459 <p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>
2460 <dl class="params"><dt>Parameters</dt><dd>
2461   <table class="params">
2462     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
2463     <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>
2464     <tr><td class="paramname">stride</td><td>bytes per line in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
2465     <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>
2466     <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>
2467   </table>
2468   </dd>
2469 </dl>
2470 <dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or -1 if the arguments are out of bounds. </dd></dl>
2471
2472 </div>
2473 </div>
2474 <a id="ga63fb66bb1e36c74008c4634360becbb1"></a>
2475 <h2 class="memtitle"><span class="permalink"><a href="#ga63fb66bb1e36c74008c4634360becbb1">&#9670;&nbsp;</a></span>tjPlaneWidth()</h2>
2476
2477 <div class="memitem">
2478 <div class="memproto">
2479       <table class="memname">
2480         <tr>
2481           <td class="memname">DLLEXPORT int tjPlaneWidth </td>
2482           <td>(</td>
2483           <td class="paramtype">int&#160;</td>
2484           <td class="paramname"><em>componentID</em>, </td>
2485         </tr>
2486         <tr>
2487           <td class="paramkey"></td>
2488           <td></td>
2489           <td class="paramtype">int&#160;</td>
2490           <td class="paramname"><em>width</em>, </td>
2491         </tr>
2492         <tr>
2493           <td class="paramkey"></td>
2494           <td></td>
2495           <td class="paramtype">int&#160;</td>
2496           <td class="paramname"><em>subsamp</em>&#160;</td>
2497         </tr>
2498         <tr>
2499           <td></td>
2500           <td>)</td>
2501           <td></td><td></td>
2502         </tr>
2503       </table>
2504 </div><div class="memdoc">
2505
2506 <p>The plane width of a YUV image plane with the given parameters. </p>
2507 <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>
2508 <dl class="params"><dt>Parameters</dt><dd>
2509   <table class="params">
2510     <tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
2511     <tr><td class="paramname">width</td><td>width (in pixels) of the YUV image</td></tr>
2512     <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>
2513   </table>
2514   </dd>
2515 </dl>
2516 <dl class="section return"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
2517
2518 </div>
2519 </div>
2520 <a id="ga6f445b22d8933ae4815b3370a538d879"></a>
2521 <h2 class="memtitle"><span class="permalink"><a href="#ga6f445b22d8933ae4815b3370a538d879">&#9670;&nbsp;</a></span>tjSaveImage()</h2>
2522
2523 <div class="memitem">
2524 <div class="memproto">
2525       <table class="memname">
2526         <tr>
2527           <td class="memname">DLLEXPORT int tjSaveImage </td>
2528           <td>(</td>
2529           <td class="paramtype">const char *&#160;</td>
2530           <td class="paramname"><em>filename</em>, </td>
2531         </tr>
2532         <tr>
2533           <td class="paramkey"></td>
2534           <td></td>
2535           <td class="paramtype">unsigned char *&#160;</td>
2536           <td class="paramname"><em>buffer</em>, </td>
2537         </tr>
2538         <tr>
2539           <td class="paramkey"></td>
2540           <td></td>
2541           <td class="paramtype">int&#160;</td>
2542           <td class="paramname"><em>width</em>, </td>
2543         </tr>
2544         <tr>
2545           <td class="paramkey"></td>
2546           <td></td>
2547           <td class="paramtype">int&#160;</td>
2548           <td class="paramname"><em>pitch</em>, </td>
2549         </tr>
2550         <tr>
2551           <td class="paramkey"></td>
2552           <td></td>
2553           <td class="paramtype">int&#160;</td>
2554           <td class="paramname"><em>height</em>, </td>
2555         </tr>
2556         <tr>
2557           <td class="paramkey"></td>
2558           <td></td>
2559           <td class="paramtype">int&#160;</td>
2560           <td class="paramname"><em>pixelFormat</em>, </td>
2561         </tr>
2562         <tr>
2563           <td class="paramkey"></td>
2564           <td></td>
2565           <td class="paramtype">int&#160;</td>
2566           <td class="paramname"><em>flags</em>&#160;</td>
2567         </tr>
2568         <tr>
2569           <td></td>
2570           <td>)</td>
2571           <td></td><td></td>
2572         </tr>
2573       </table>
2574 </div><div class="memdoc">
2575
2576 <p>Save an uncompressed image from memory to disk. </p>
2577 <dl class="params"><dt>Parameters</dt><dd>
2578   <table class="params">
2579     <tr><td class="paramname">filename</td><td>name of a file to which to save the uncompressed image. The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, depending on the file extension.</td></tr>
2580     <tr><td class="paramname">buffer</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be saved</td></tr>
2581     <tr><td class="paramname">width</td><td>width (in pixels) of the uncompressed image</td></tr>
2582     <tr><td class="paramname">pitch</td><td>bytes per line in the image buffer. 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 bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
2583     <tr><td class="paramname">height</td><td>height (in pixels) of the uncompressed image</td></tr>
2584     <tr><td class="paramname">pixelFormat</td><td>pixel format of the image buffer (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 (indexed color) BMP format. Otherwise, the image will be stored in PPM or 24-bit 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 (proper conversion between CMYK and other formats requires a color management system.)</td></tr>
2585     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
2586   </table>
2587   </dd>
2588 </dl>
2589 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a>.) </dd></dl>
2590
2591 </div>
2592 </div>
2593 <a id="ga9cb8abf4cc91881e04a0329b2270be25"></a>
2594 <h2 class="memtitle"><span class="permalink"><a href="#ga9cb8abf4cc91881e04a0329b2270be25">&#9670;&nbsp;</a></span>tjTransform()</h2>
2595
2596 <div class="memitem">
2597 <div class="memproto">
2598       <table class="memname">
2599         <tr>
2600           <td class="memname">DLLEXPORT int tjTransform </td>
2601           <td>(</td>
2602           <td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a>&#160;</td>
2603           <td class="paramname"><em>handle</em>, </td>
2604         </tr>
2605         <tr>
2606           <td class="paramkey"></td>
2607           <td></td>
2608           <td class="paramtype">const unsigned char *&#160;</td>
2609           <td class="paramname"><em>jpegBuf</em>, </td>
2610         </tr>
2611         <tr>
2612           <td class="paramkey"></td>
2613           <td></td>
2614           <td class="paramtype">unsigned long&#160;</td>
2615           <td class="paramname"><em>jpegSize</em>, </td>
2616         </tr>
2617         <tr>
2618           <td class="paramkey"></td>
2619           <td></td>
2620           <td class="paramtype">int&#160;</td>
2621           <td class="paramname"><em>n</em>, </td>
2622         </tr>
2623         <tr>
2624           <td class="paramkey"></td>
2625           <td></td>
2626           <td class="paramtype">unsigned char **&#160;</td>
2627           <td class="paramname"><em>dstBufs</em>, </td>
2628         </tr>
2629         <tr>
2630           <td class="paramkey"></td>
2631           <td></td>
2632           <td class="paramtype">unsigned long *&#160;</td>
2633           <td class="paramname"><em>dstSizes</em>, </td>
2634         </tr>
2635         <tr>
2636           <td class="paramkey"></td>
2637           <td></td>
2638           <td class="paramtype"><a class="el" href="structtjtransform.html">tjtransform</a> *&#160;</td>
2639           <td class="paramname"><em>transforms</em>, </td>
2640         </tr>
2641         <tr>
2642           <td class="paramkey"></td>
2643           <td></td>
2644           <td class="paramtype">int&#160;</td>
2645           <td class="paramname"><em>flags</em>&#160;</td>
2646         </tr>
2647         <tr>
2648           <td></td>
2649           <td>)</td>
2650           <td></td><td></td>
2651         </tr>
2652       </table>
2653 </div><div class="memdoc">
2654
2655 <p>Losslessly transform a JPEG image into another JPEG image. </p>
2656 <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 Huffman 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>
2657 <dl class="params"><dt>Parameters</dt><dd>
2658   <table class="params">
2659     <tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance</td></tr>
2660     <tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG source image to transform</td></tr>
2661     <tr><td class="paramname">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>
2662     <tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
2663     <tr><td class="paramname">dstBufs</td><td>pointer to an array of n image 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 buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
2664 <li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#gaec627dd4c5f30b7a775a7aea3bec5d83" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
2665 <li>set <code>dstBufs[i]</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
2666 <li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga67ac12fee79073242cb216e07c9f1f90" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters.">tjBufSize()</a> with the transformed or cropped width and height. 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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_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 output image will be larger than the worst-case size, and <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> cannot be used in those cases.</li>
2667 </ol>
2668 If you choose option 1, <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#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>
2669     <tr><td class="paramname">dstSizes</td><td>pointer to an array of n unsigned long 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 JPEG image (in bytes.)</td></tr>
2670     <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 output image.</td></tr>
2671     <tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0">flags</a></td></tr>
2672   </table>
2673   </dd>
2674 </dl>
2675 <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#ga1ead8574f9f39fbafc6b497124e7aafa" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr2()</a> and <a class="el" href="group___turbo_j_p_e_g.html#ga414feeffbf860ebd31c745df203de410" title="Returns a code indicating the severity of the last error.">tjGetErrorCode()</a>.) </dd></dl>
2676
2677 </div>
2678 </div>
2679 <h2 class="groupheader">Variable Documentation</h2>
2680 <a id="ga5af0ab065feefd526debf1e20c43e837"></a>
2681 <h2 class="memtitle"><span class="permalink"><a href="#ga5af0ab065feefd526debf1e20c43e837">&#9670;&nbsp;</a></span>tjAlphaOffset</h2>
2682
2683 <div class="memitem">
2684 <div class="memproto">
2685 <table class="mlabels">
2686   <tr>
2687   <td class="mlabels-left">
2688       <table class="memname">
2689         <tr>
2690           <td class="memname">const int tjAlphaOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
2691         </tr>
2692       </table>
2693   </td>
2694   <td class="mlabels-right">
2695 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2696   </tr>
2697 </table>
2698 </div><div class="memdoc">
2699
2700 <p>Alpha offset (in bytes) for a given pixel format. </p>
2701 <p>This specifies the number of bytes that the Alpha component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRA is stored in <code>char pixel[]</code>, then the alpha component will be <code>pixel[tjAlphaOffset[TJ_BGRA]]</code>. This will be -1 if the pixel format does not have an alpha component. </p>
2702
2703 </div>
2704 </div>
2705 <a id="ga84e2e35d3f08025f976ec1ec53693dea"></a>
2706 <h2 class="memtitle"><span class="permalink"><a href="#ga84e2e35d3f08025f976ec1ec53693dea">&#9670;&nbsp;</a></span>tjBlueOffset</h2>
2707
2708 <div class="memitem">
2709 <div class="memproto">
2710 <table class="mlabels">
2711   <tr>
2712   <td class="mlabels-left">
2713       <table class="memname">
2714         <tr>
2715           <td class="memname">const int tjBlueOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
2716         </tr>
2717       </table>
2718   </td>
2719   <td class="mlabels-right">
2720 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2721   </tr>
2722 </table>
2723 </div><div class="memdoc">
2724
2725 <p>Blue offset (in bytes) for a given pixel format. </p>
2726 <p>This specifies the number of bytes that the Blue component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the blue component will be <code>pixel[tjBlueOffset[TJ_BGRX]]</code>. This will be -1 if the pixel format does not have a blue component. </p>
2727
2728 </div>
2729 </div>
2730 <a id="ga82d6e35da441112a411da41923c0ba2f"></a>
2731 <h2 class="memtitle"><span class="permalink"><a href="#ga82d6e35da441112a411da41923c0ba2f">&#9670;&nbsp;</a></span>tjGreenOffset</h2>
2732
2733 <div class="memitem">
2734 <div class="memproto">
2735 <table class="mlabels">
2736   <tr>
2737   <td class="mlabels-left">
2738       <table class="memname">
2739         <tr>
2740           <td class="memname">const int tjGreenOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
2741         </tr>
2742       </table>
2743   </td>
2744   <td class="mlabels-right">
2745 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2746   </tr>
2747 </table>
2748 </div><div class="memdoc">
2749
2750 <p>Green offset (in bytes) for a given pixel format. </p>
2751 <p>This specifies the number of bytes that the green component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the green component will be <code>pixel[tjGreenOffset[TJ_BGRX]]</code>. This will be -1 if the pixel format does not have a green component. </p>
2752
2753 </div>
2754 </div>
2755 <a id="gabd247bb9fecb393eca57366feb8327bf"></a>
2756 <h2 class="memtitle"><span class="permalink"><a href="#gabd247bb9fecb393eca57366feb8327bf">&#9670;&nbsp;</a></span>tjMCUHeight</h2>
2757
2758 <div class="memitem">
2759 <div class="memproto">
2760 <table class="mlabels">
2761   <tr>
2762   <td class="mlabels-left">
2763       <table class="memname">
2764         <tr>
2765           <td class="memname">const int tjMCUHeight[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
2766         </tr>
2767       </table>
2768   </td>
2769   <td class="mlabels-right">
2770 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2771   </tr>
2772 </table>
2773 </div><div class="memdoc">
2774
2775 <p>MCU block height (in pixels) for a given level of chrominance subsampling. </p>
2776 <p>MCU block sizes:</p><ul>
2777 <li>8x8 for no subsampling or grayscale</li>
2778 <li>16x8 for 4:2:2</li>
2779 <li>8x16 for 4:4:0</li>
2780 <li>16x16 for 4:2:0</li>
2781 <li>32x8 for 4:1:1 </li>
2782 </ul>
2783
2784 </div>
2785 </div>
2786 <a id="ga9e61e7cd47a15a173283ba94e781308c"></a>
2787 <h2 class="memtitle"><span class="permalink"><a href="#ga9e61e7cd47a15a173283ba94e781308c">&#9670;&nbsp;</a></span>tjMCUWidth</h2>
2788
2789 <div class="memitem">
2790 <div class="memproto">
2791 <table class="mlabels">
2792   <tr>
2793   <td class="mlabels-left">
2794       <table class="memname">
2795         <tr>
2796           <td class="memname">const int tjMCUWidth[<a class="el" href="group___turbo_j_p_e_g.html#ga5ef3d169162ce77ce348e292a0b7477c">TJ_NUMSAMP</a>]</td>
2797         </tr>
2798       </table>
2799   </td>
2800   <td class="mlabels-right">
2801 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2802   </tr>
2803 </table>
2804 </div><div class="memdoc">
2805
2806 <p>MCU block width (in pixels) for a given level of chrominance subsampling. </p>
2807 <p>MCU block sizes:</p><ul>
2808 <li>8x8 for no subsampling or grayscale</li>
2809 <li>16x8 for 4:2:2</li>
2810 <li>8x16 for 4:4:0</li>
2811 <li>16x16 for 4:2:0</li>
2812 <li>32x8 for 4:1:1 </li>
2813 </ul>
2814
2815 </div>
2816 </div>
2817 <a id="gad77cf8fe5b2bfd3cb3f53098146abb4c"></a>
2818 <h2 class="memtitle"><span class="permalink"><a href="#gad77cf8fe5b2bfd3cb3f53098146abb4c">&#9670;&nbsp;</a></span>tjPixelSize</h2>
2819
2820 <div class="memitem">
2821 <div class="memproto">
2822 <table class="mlabels">
2823   <tr>
2824   <td class="mlabels-left">
2825       <table class="memname">
2826         <tr>
2827           <td class="memname">const int tjPixelSize[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
2828         </tr>
2829       </table>
2830   </td>
2831   <td class="mlabels-right">
2832 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2833   </tr>
2834 </table>
2835 </div><div class="memdoc">
2836
2837 <p>Pixel size (in bytes) for a given pixel format. </p>
2838
2839 </div>
2840 </div>
2841 <a id="gadd9b446742ac8a3923f7992c7988fea8"></a>
2842 <h2 class="memtitle"><span class="permalink"><a href="#gadd9b446742ac8a3923f7992c7988fea8">&#9670;&nbsp;</a></span>tjRedOffset</h2>
2843
2844 <div class="memitem">
2845 <div class="memproto">
2846 <table class="mlabels">
2847   <tr>
2848   <td class="mlabels-left">
2849       <table class="memname">
2850         <tr>
2851           <td class="memname">const int tjRedOffset[<a class="el" href="group___turbo_j_p_e_g.html#ga7010a4402f54a45ba822ad8675a4655e">TJ_NUMPF</a>]</td>
2852         </tr>
2853       </table>
2854   </td>
2855   <td class="mlabels-right">
2856 <span class="mlabels"><span class="mlabel">static</span></span>  </td>
2857   </tr>
2858 </table>
2859 </div><div class="memdoc">
2860
2861 <p>Red offset (in bytes) for a given pixel format. </p>
2862 <p>This specifies the number of bytes that the red component is offset from the start of the pixel. For instance, if a pixel of format TJ_BGRX is stored in <code>char pixel[]</code>, then the red component will be <code>pixel[tjRedOffset[TJ_BGRX]]</code>. This will be -1 if the pixel format does not have a red component. </p>
2863
2864 </div>
2865 </div>
2866 </div><!-- contents -->
2867 <!-- start footer part -->
2868 <hr class="footer"/><address class="footer"><small>
2869 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
2870 </small></address>
2871 </body>
2872 </html>