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>nn::jpeg::CTR::JpegMpEncoder::StartJpegEncoder</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/jpeg.h&gt;
14size_t StartJpegEncoder(
15     u8 * dst,
16     size_t limit,
17     const void * src,
18     u32 width,
19     u32 height,
20     u32 quality,
21     <a href="../../../../nn/jpeg/CTR/PixelSampling.html">PixelSampling</a> dstPixelSampling,
22     <a href="../../../../nn/jpeg/CTR/PixelFormat.html">PixelFormat</a> srcPixelFormat,
23     bool addThumbnail
24);
25</pre>
26    </div>
27<h2>Arguments</h2>
28    <div class="section">
29      <table class="arguments">
30        <thead>
31          <tr>
32            <td width="15" />
33<th>Name</th>
34<td>Description</td>
35          </tr>
36        </thead>
37        <tr>
38<td>out</td>
39<th>dst</th>
40<td>Specifies the buffer that stores the encoded result.</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th>limit</th>
45<td>Specifies the size of <SPAN class="argument">dst</SPAN> in bytes. Encoding fails if this size is exceeded.</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th>src</th>
50<td>Specifies the buffer of image data to encode. Must be 4-byte aligned.</td>
51        </tr>
52        <tr>
53<td>in</td>
54<th>width</th>
55<td>Specifies the image width in pixels (equal to or less than 65536).</td>
56        </tr>
57        <tr>
58<td>in</td>
59<th>height</th>
60<td>Specifies the image height in pixels (equal to or less than 65536).</td>
61        </tr>
62        <tr>
63<td>in</td>
64<th>quality</th>
65<td>Specifies the encoding quality.<br />Values can be set from 1-100, 100 being the highest quality and the largest size.</td>
66        </tr>
67        <tr>
68<td>in</td>
69<th>dstPixelSampling</th>
70<td>Specifies the image's output format (its pixel sampling).</td>
71        </tr>
72        <tr>
73<td>in</td>
74<th>srcPixelFormat</th>
75<td>Specifies the input pixel format of the image to encode.</td>
76        </tr>
77        <tr>
78<td>in</td>
79<th>addThumbnail</th>
80<td>Specifies whether to add a thumbnail.</td>
81        </tr> </table>
82    </div>
83<h2>Return Values</h2>
84<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>
85<h2>Description</h2>
86    <div class="section">
87<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>
88<h2>Revision History</h2>
89    <div class="section">
90      <dl class="history">
91        <dt>2010/04/14</dt>
92<dd>Initial version.<br />
93        </dd>
94      </dl>
95    </div>
96  <hr><p>CONFIDENTIAL</p></body>
97</html>
98