1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7<title>StartJpegEncoder</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/jpeg/Overview.html">jpeg</a>::<a href="../../../../nn/jpeg/CTR/Overview.html">CTR</a>::<a href="../../../../nn/jpeg/CTR/JpegMpEncoder/Overview.html">JpegMpEncoder</a>::StartJpegEncoder</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/jpeg.h&gt;
14
15size_t StartJpegEncoder(
16     <a href="../../../../nn_types/u8.html">u8</a> * dst,
17     size_t limit,
18     const void * src,
19     <a href="../../../../nn_types/u32.html">u32</a> width,
20     <a href="../../../../nn_types/u32.html">u32</a> height,
21     <a href="../../../../nn_types/u32.html">u32</a> quality,
22     <a href="../../../../nn/jpeg/CTR/PixelSampling.html">PixelSampling</a> dstPixelSampling,
23     <a href="../../../../nn/jpeg/CTR/PixelFormat.html">PixelFormat</a> srcPixelFormat,
24     bool addThumbnail
25);
26</pre>
27    </div>
28<h2>Parameters</h2>
29    <div class="section">
30      <table class="arguments">
31        <thead>
32          <tr>
33            <td width="15" />
34<th>Name</th>
35<td>Description</td>
36          </tr>
37        </thead>
38        <tr>
39<td>out</td>
40<th>dst</th>
41<td>Specifies the buffer that stores the encoded result.</td>
42        </tr>
43        <tr>
44<td>in</td>
45<th>limit</th>
46<td>Specifies the size of <SPAN class="argument">dst</SPAN> in bytes. Encoding fails if this size is exceeded.</td>
47        </tr>
48        <tr>
49<td>in</td>
50<th>src</th>
51<td>Specifies the buffer of image data to encode. Must be 4-byte aligned.</td>
52        </tr>
53        <tr>
54<td>in</td>
55<th>width</th>
56<td>Specifies the image width in pixels (equal to or less than 65536).</td>
57        </tr>
58        <tr>
59<td>in</td>
60<th>height</th>
61<td>Specifies the image height in pixels (equal to or less than 65536).</td>
62        </tr>
63        <tr>
64<td>in</td>
65<th>quality</th>
66<td>Specifies the encoding quality.<br />Values can be set from 1-100, 100 being the highest quality and the largest size.</td>
67        </tr>
68        <tr>
69<td>in</td>
70<th>dstPixelSampling</th>
71<td>Specifies the image's output format (its pixel sampling).</td>
72        </tr>
73        <tr>
74<td>in</td>
75<th>srcPixelFormat</th>
76<td>Specifies the input pixel format of the image to encode.</td>
77        </tr>
78        <tr>
79<td>in</td>
80<th>addThumbnail</th>
81<td>Specifies whether to add a thumbnail.</td>
82        </tr> </table>
83    </div>
84<h2>Return Values</h2>
85<div class="section">If successful, returns the number of bytes of JPEG-format data that were generated. Returns <CODE>0</CODE> on failure.<br />Use the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpEncoder/GetLastError.html">GetLastError</a></CODE> function to get the reason for failure. </div>
86<h2>Description</h2>
87    <div class="section">
88<p>Runs the JPEG encoder.</p><p>The widths and heights of images that this function can encode depend on the output format of the image (in other words, the <SPAN class="argument">dstPixelSampling</SPAN> argument).</p><p><UL> <LI> If <CODE>PIXEL_SAMPLING_YUV444</CODE> is specified, the width and height of the image must both be multiples of 8.<LI> If <CODE>PIXEL_SAMPLING_YUV420</CODE> is specified, the width and height of the image must both be multiples of 16.<LI> If <CODE>PIXEL_SAMPLING_YUV422</CODE> is specified, the height must be a multiple of 8 and the width a multiple of 16. </LI></UL></p><!-- write here --></div>
89<h2>Revision History</h2>
90    <div class="section">
91      <dl class="history">
92        <dt>2010/04/14</dt>
93<dd>Initial version.<br />
94        </dd>
95      </dl>
96    </div>
97  <hr><p>CONFIDENTIAL</p></body>
98</html>
99