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 <nn/jpeg.h> 14 15size_t StartJpegDecoder( 16 void * dst, 17 size_t dstSize, 18 const u8 * src, 19 size_t srcSize, 20 u32 maxWidth, 21 u32 maxHeight, 22 <a href="../../../../nn/jpeg/CTR/PixelFormat.html">PixelFormat</a> dstPixelFormat, 23 bool decodeThumbnail 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 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> 41 </tr> 42 <tr> 43<td>in</td> 44<th>dstSize</th> 45<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> 46 </tr> 47 <tr> 48<td>in</td> 49<th>src</th> 50<td>Specifies the JPEG data to decode.</td> 51 </tr> 52 <tr> 53<td>in</td> 54<th>srcSize</th> 55<td>Specifies the size of <SPAN class="argument">src</SPAN> in bytes.</td> 56 </tr> 57 <tr> 58<td>in</td> 59<th>maxWidth</th> 60<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> 61 </tr> 62 <tr> 63<td>in</td> 64<th>maxHeight</th> 65<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> 66 </tr> 67 <tr> 68<td>in</td> 69<th>dstPixelFormat</th> 70<td>Specifies the output pixel format.</td> 71 </tr> 72 <tr> 73<td>in</td> 74<th>decodeThumbnail</th> 75<td>Specify <CODE>true</CODE> to decode the thumbnail.<br />Specify <CODE>false</CODE> to decode the primary image.</td> 76 </tr> </table> 77 </div> 78<h2>Return Values</h2> 79<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> 80<h2>Description</h2> 81 <div class="section"> 82<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> 83<h2>Revision History</h2> 84 <div class="section"> 85 <dl class="history"> 86 <dt>2010/10/21</dt> 87<dd>Added a description of <CODE>SetOption</CODE>.<br /> 88 </dd> 89 <dt>2010/04/14</dt> 90<dd>Initial version.<br /> 91 </dd> 92 </dl> 93 </div> 94 <hr><p>CONFIDENTIAL</p></body> 95</html>