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>SetThumbnailSize</title> 8 </head> 9 <body> 10<h1><CODE>nn::jpeg::CTR::JpegMpEncoder::SetThumbnailSize</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nn/jpeg.h> 14 15void SetThumbnailSize( 16 u32 width, 17 u32 height, 18 <a href="../../../../nn/jpeg/CTR/PixelSampling.html">PixelSampling</a> dstPixelSampling = <a href="../../../../nn/jpeg/CTR/DEFAULT_THUMBNAIL_PIXEL_SAMPLING.html">DEFAULT_THUMBNAIL_PIXEL_SAMPLING</a> 19); 20</pre> 21 </div> 22<h2>Arguments</h2> 23 <div class="section"> 24 <table class="arguments"> 25 <thead> 26 <tr> 27 <td width="15" /> 28<th>Name</th> 29<td>Description</td> 30 </tr> 31 </thead> 32 <tr> 33<td>in</td> 34<th>width</th> 35<td>Specifies the thumbnail width in pixels. (Up to 65535.)</td> 36 </tr> 37 <tr> 38<td>in</td> 39<th>height</th> 40<td>Specifies the thumbnail height in pixels. (Up to 65535.)</td> 41 </tr> 42 <tr> 43<td>in</td> 44<th>dstPixelSampling</th> 45<td>Specifies the image's output format (its pixel sampling).<br />The default is <CODE><a href="../../../../nn/jpeg/CTR/DEFAULT_THUMBNAIL_PIXEL_SAMPLING.html">DEFAULT_THUMBNAIL_PIXEL_SAMPLING</a></CODE> (<CODE>PIXEL_SAMPLING_YUV422</CODE>).</td> 46 </tr> </table> 47 </div> 48<h2>Return Values</h2> 49 <div class="section"> 50None. 51 </div> 52<h2>Description</h2> 53 <div class="section"> 54<p>Specifies the thumbnail image size and output format.</p><p>If the encoding function appends a thumbnail, the thumbnail image size in pixels is by default <CODE><a href="../../../../nn/jpeg/CTR/DEFAULT_THUMBNAIL_WIDTH.html">DEFAULT_THUMBNAIL_WIDTH</a></CODE> (160) wide and <CODE><a href="../../../../nn/jpeg/CTR/DEFAULT_THUMBNAIL_HEIGHT.html">DEFAULT_THUMBNAIL_HEIGHT</a></CODE> (120) high, with an aspect ratio of 4:3.</p><p>The thumbnail is generated to have the specified image size, so when the original image has an aspect ratio that is not 4:3, the thumbnail image is shrunk more on one axis than the other, leading to image distortion.</p><p>By specifying the thumbnail image size with this function, you can ensure that the original image and thumbnail image aspect ratios match or are at least close. If the thumbnail image size is increased too much, the image will not fit in the <CODE>APP1</CODE> segment (up to byte <CODE>0xFFFF</CODE>) and encoding will fail.</p><p>The specifiable image sizes change depending on the output format (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><p>The default image output format is <CODE><a href="../../../../nn/jpeg/CTR/DEFAULT_THUMBNAIL_PIXEL_SAMPLING.html">DEFAULT_THUMBNAIL_PIXEL_SAMPLING</a></CODE> (<CODE>PIXEL_SAMPLING_YUV422</CODE>).</p><p>Call this function before calling the encoding function. The values specified by this function are cleared after the encoding function completes, regardless of whether the encoding function succeeded or failed. When encoding multiple times, you must call this function before each encoding function call. The values specified by this function are cleared if you reinitialize the encoder object using the <a href="../../../../nn/jpeg/CTR/JpegMpEncoder/Initialize.html"><CODE>Initialize</CODE></a> function.</p><p>If the combination of the <SPAN class="argument">width</SPAN>, <SPAN class="argument">height</SPAN>, and <SPAN class="argument">dstPixelSampling</SPAN> arguments is invalid, all these values are replaced with the defaults.</p><!-- write here --></div> 55<h2>Revision History</h2> 56 <div class="section"> 57 <dl class="history"> 58 <dt>2010/06/14</dt> 59<dd>Initial version.<br /> 60 </dd> 61 </dl> 62 </div> 63 <hr><p>CONFIDENTIAL</p></body> 64</html>