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>StartJpegDecoder</title>
8  </head>
9  <body>
10<h1><CODE>nn::jpeg::CTR::JpegMpDecoder::StartJpegDecoder</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nn/jpeg.h&gt;
14size_t StartJpegDecoder(
15     void * dst,
16     size_t dstSize,
17     const u8 * src,
18     size_t srcSize,
19     u32 maxWidth,
20     u32 maxHeight,
21     <a href="../../../../nn/jpeg/CTR/PixelFormat.html">PixelFormat</a> dstPixelFormat,
22     bool decodeThumbnail
23);
24</pre>
25    </div>
26<h2>Arguments</h2>
27    <div class="section">
28      <table class="arguments">
29        <thead>
30          <tr>
31            <td width="15" />
32<th>Name</th>
33<td>Description</td>
34          </tr>
35        </thead>
36        <tr>
37<td>out</td>
38<th>dst</th>
39<td>Specifies the buffer that stores the decoded result.<br />Must be 4-byte aligned.<br />Must be 128-byte aligned if you are accessing the output buffer directly as a GPU texture. (No check is made when using this function.)</td>
40        </tr>
41        <tr>
42<td>in</td>
43<th>dstSize</th>
44<td>Specifies the size of <SPAN class="argument">dst</SPAN> in bytes.<br />Specify the return value of <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetDstBufferSize.html">GetDstBufferSize</a></CODE>.</td>
45        </tr>
46        <tr>
47<td>in</td>
48<th>src</th>
49<td>Specifies the JPEG data to decode.</td>
50        </tr>
51        <tr>
52<td>in</td>
53<th>srcSize</th>
54<td>Specifies the size of <SPAN class="argument">src</SPAN> in bytes.</td>
55        </tr>
56        <tr>
57<td>in</td>
58<th>maxWidth</th>
59<td>Specifies the maximum width (in pixels) of an image that can be decoded (equal to or less than 65536). After decoding successfully completes, use the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetLastWidth.html">GetLastWidth</a></CODE> function to get the actual image width and the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetLastOutputBufferWidth.html">GetLastOutputBufferWidth</a></CODE> function to get the buffer width.</td>
60        </tr>
61        <tr>
62<td>in</td>
63<th>maxHeight</th>
64<td>Specifies the maximum height (in pixels) of an image that can be decoded (equal to or less than 65536). After decoding successfully completes, use the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetLastHeight.html">GetLastHeight</a></CODE> function to get the actual image height and the <CODE><a href="../../../../nn/jpeg/CTR/JpegMpDecoder/GetLastOutputBufferHeight.html">GetLastOutputBufferHeight</a></CODE> function to get the buffer height.</td>
65        </tr>
66        <tr>
67<td>in</td>
68<th>dstPixelFormat</th>
69<td>Specifies the output pixel format.</td>
70        </tr>
71        <tr>
72<td>in</td>
73<th>decodeThumbnail</th>
74<td>Specify <CODE>true</CODE> to decode the thumbnail.<br />Specify <CODE>false</CODE> to decode the primary image.</td>
75        </tr> </table>
76    </div>
77<h2>Return Values</h2>
78<div class="section">On success, returns the size (in bytes) of the buffer storing the decoded result.<br />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>
79<h2>Description</h2>
80    <div class="section">
81<p>Runs the JPEG decoder.</p><p>Processing takes longer if the image size is not a multiple of 8 or 16 pixels.<br /> Depending on the pixel sampling format, images that meet certain conditions can be decoded faster.</p><p><UL> <LI> For <CODE>PIXEL_SAMPLING_YUV444</CODE>, the width and height of the image must both be multiples of 8.<LI> For <CODE>PIXEL_SAMPLING_YUV420</CODE>, the width and height of the image must both be multiples of 16.<LI> For <CODE>PIXEL_SAMPLING_YUV422</CODE>, the height must be a multiple of 8, and the width must be a multiple of 16.</LI></UL></p><p>If JPEG_DECODER_OPTION_MATCH_WIDTH_HEIGHT is specified using <a href="../../../../nn/jpeg/CTR/JpegMpDecoder/SetOption.html">SetOption</a>, the values of arguments maxWidth and maxHeight must match, otherwise decoding will fail.</p><!-- write here --></div>
82<h2>Revision History</h2>
83    <div class="section">
84      <dl class="history">
85        <dt>2010/10/21</dt>
86<dd>Added a description of <CODE>SetOption</CODE>.<br />
87        </dd>
88        <dt>2010/04/14</dt>
89<dd>Initial version.<br />
90        </dd>
91      </dl>
92    </div>
93  <hr><p>CONFIDENTIAL</p></body>
94</html>
95