1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
5<meta http-equiv="Content-Style-Type" content="text/css" />
6<title>SSP_StartJpegEncoder</title>
7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" />
8</head>
9<body>
10
11<h1>SSP_StartJpegEncoder <img src="../../image/NTR.gif" align="middle"><img src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13
14<pre><code>
15u32 SSP_StartJpegEncoder(const void* src, u8 *dst, u32 limit, u8 *wrk, u32 width, u32 height, u32 quality, u32 sampling, u32 option);
16</code></pre>
17
18<h2>Arguments</h2>
19<table style="width:100%">
20<tbody>
21<tr>
22<td style="width:13%"><SPAN class="argument">src</SPAN></td>
23<td style="width:87%">Image data to be encoded. (RGB555 or YUV422)</td>
24</tr>
25<tr>
26<td style="width:13%"><SPAN class="argument">dst</SPAN></td>
27<td style="width:87%">Buffer that stores encoded results.</td>
28</tr>
29<tr>
30<td style="width:13%"><SPAN class="argument">limit</SPAN></td>
31<td style="width:87%">Represents the <SPAN class="argument">dst</SPAN> size.<br>Encoding fails if this size is exceeded.</td>
32</tr>
33<tr>
34<td style="width:13%"><SPAN class="argument">wrk</SPAN></td>
35<td style="width:87%">Work buffer.<br> The <a href="SSP_GetJpegEncoderBufferSize.html"><CODE>SSP_GetJpegEncoderBufferSize</CODE></a> function calculates the required size.</td>
36</tr>
37<tr>
38<td style="width:13%"><SPAN class="argument">width</SPAN></td>
39<td style="width:87%">Width (in pixels) of the image to encode.</td>
40</tr>
41<tr>
42<td style="width:13%"><SPAN class="argument">height</SPAN></td>
43<td style="width:87%">Height (in pixels) of the image to encode.</td>
44</tr>
45<tr>
46<td style="width:13%"><SPAN class="argument">quality</SPAN></td>
47<td style="width:87%">Encode quality.<br> Values can be from 1 to 100, where 100 represents the highest quality and the largest size.</td>
48</tr>
49<tr>
50<td style="width:13%"><SPAN class="argument">sampling</SPAN></td>
51<td style="width:87%">Main image output formats (<CODE>SSP_JPEG_OUTPUT_YUV444</CODE>, <CODE>SSP_JPEG_OUTPUT_YUV420</CODE>, or <CODE>SSP_JPEG_OUTPUT_YUV422</CODE>).</td>
52</tr>
53<tr>
54<td style="width:13%"><SPAN class="argument">option</SPAN></td>
55<td style="width:87%">Encoding options (<CODE>SSP_JPEG_RGB555</CODE>, <CODE>SSP_JPEG_YUV422</CODE>, or <CODE>SSP_JPEG_THUMBNAIL</CODE>).</td>
56</tr>
57</tbody>
58</table>
59
60
61<h2>Return Values</h2>
62<p>Returns the size of the created JPEG file when successful.<BR>Returns 0 when it fails.</p>
63
64<h2>Description</h2>
65<p>Encodes image data as a JPEG file. RGB555 and YUV422 images can be encoded. When you specify YUV422 image data as <SPAN class="argument">src</SPAN>, you must specify <code>SSP_JPEG_YUV422</code> in <SPAN class="argument">option</SPAN>. If you want to encode a thumbnail icon, you must specify <code>SSP_JPEG_THUMBNAIL</code> in <SPAN class="argument">option</SPAN>.<br>Therefore, to encode a YUV422 image along with a thumbnail icon, you must specify <code>SSP_JPEG_YUV422|SSP_JPEG_THUMBNAIL</code> in <SPAN class="argument">option</SPAN>.<br><br>The height and width of images that can be encoded using this function differs depending on the value of <SPAN class="argument">sampling</SPAN>.<br>If <code>SSP_JPEG_OUTPUT_YUV444</code> is specified, both the height and width of the image must be a multiple of 8.<br>If <code>SSP_JPEG_OUTPUT_YUV420</code> is specified, both the height and width of the image must be a multiple of 16.<br>If <code>SSP_JPEG_OUTPUT_YUV422</code> is specified, the height must be a multiple of 8, and the width a multiple of 16.<br><br><br> <font color="red"><B>Note:</B></font><br> Regardless of whether this function succeeds or fails at encoding, after completion the values set by the <a href="SSP_SetJpegEncoderDateTime.html"><CODE>SSP_SetJpegEncoderDateTime</CODE></a>,<a href="SSP_SetJpegEncoderDateTimeNow.html"><CODE>SSP_SetJpegEncoderDateTimeNow</CODE></a>,<a href="SSP_SetJpegEncoderMakerNote.html"><CODE>SSP_SetJpegEncoderMakerNote</CODE></a>, and <a href="SSP_SetJpegEncoderMakerNoteEx.html"><CODE>SSP_SetJpegEncoderMakerNoteEx</CODE></a> functions are cleared.<br>If the <a href="SSP_SetJpegEncoderDateTime.html"><CODE>SSP_SetJpegEncoderDateTime</CODE></a> or <a href="SSP_SetJpegEncoderDateTimeNow.html"><CODE>SSP_SetJpegEncoderDateTimeNow</CODE></a> functions are not called, the <a href="../../rtc/RTC_GetDateTime.html"><CODE>RTC_GetDateTime</CODE></a> function is called internally.
66</p>
67
68<h2>See Also</h2>
69<p><a href="SSP_SetJpegEncoderDateTime.html"><CODE>SSP_SetJpegEncoderDateTime</CODE></a><BR> <a href="SSP_SetJpegEncoderDateTimeNow.html"><CODE>SSP_SetJpegEncoderDateTimeNow</CODE></a><BR> <a href="SSP_GetJpegEncoderBufferSize.html"><CODE>SSP_GetJpegEncoderBufferSize</CODE></a></p>
70
71<h2>Revision History</h2>
72<p>
732008/11/04 Added a description of values cleared after completion of this function.<br> 2008/10/15 Added a description of the limitations on the height and width of images that can be encoded.<br> 2008/10/09 Added a description of RSF file settings.<br> 2008/09/15 Initial version.
74</p>
75<hr><p>CONFIDENTIAL</p></body>
76</html>
77