1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
4<meta http-equiv="Content-Style-Type" content="text/css">
5<title>TCL_EncodeAndWritePicture</title>
6<link rel="stylesheet" href="../css/nitro.css" type="text/css">
7</head>
8<body>
9<h1 align="left">TCL_EncodeAndWritePicture(Ex) <img src="../image/TWL.gif" align="middle"></h1>
10
11<h2>Definition</h2>
12<dl>
13	<dd>
14	<code>#include &lt;twl/tcl.h&gt;</code><br/> <br/>
15	<pre><code>
16TCLResult TCL_EncodeAndWritePicture( TCLAccessor* pAccessor ,
17                                     const void* imageBuffer ,
18                                     u8* jpegBuffer ,
19                                     u32 jpegBufferSize ,
20                                     u8* workBuffer ,
21                                     u32 quality ,
22                                     u32 option ,
23                                     FSResult* pFSResult );
24
25TCLResult TCL_EncodeAndWritePictureEx( TCLAccessor* pAccessor ,
26                                       const void* imageBuffer ,
27                                       u8* jpegBuffer ,
28                                       u32 jpegBufferSize ,
29                                       u8* workBuffer ,
30                                       u32 quality ,
31                                       u32 option ,
32                                       u8* makerNoteBuffer ,
33                                       u16 makerNoteBufferSize ,
34                                       FSResult* pFSResult );
35	</code></pre>
36</dl>
37
38<h2>Arguments</h2>
39<p>
40<table>
41<tr><td>pAccessor<td><a href="TCLAccessor.html">Accessor</a>
42<tr><td>imageBuffer<td>Source image buffer
43<tr><td>jpegBuffer<td>JPEG image buffer
44<tr><td>jpegBufferSize<td>Size of the JPEG image buffer
45<tr><td>workBuffer<td>JPEG encoding work buffer
46<tr><td>quality<td>JPEG encoding quality
47<tr><td>option<td>JPEG encoding option
48<tr><td>makerNoteBuffer<td>User maker note buffer
49<tr><td>makerNoteBufferSize<td>User maker note buffer size
50<tr><td>pFSResult<td>Processing result when an error has been generated by an FS function inside this function
51</table>
52</p>
53
54<h2>Return Values</h2>
55<p><a href="TCLResult.html">Processing result</a></p>
56
57<h2>Description</h2>
58<p>Encodes the source image data in JPEG and saves the data. Internally calls the <code>SSP_StartJpegEncoderLite</code> function.</p>
59<p>It is necessary for the source image to have VGA dimensions.</p>
60<p>The work buffer should allocate the size determined by the <a href="TCL_GetJpegEncoderBufferSize.html"><code>TCL_GetJpegEncoderBufferSize</code></a> function.</p>
61<p>After encoding succeeds, saves to the JPEG image's next save path and overwrites the management file.</p>
62<p>If this function returns <code>TCL_RESULT_ERROR_NO_NEXT_INDEX</code>, the JPEG image cannot be saved because of a path restriction. Note that this error is also returned when <a href="TCL_CalcNumEnableToTakePictures.html"><code>TCL_CalcNumEnableToTakePictures</code></a> is greater than 0.</p>
63<p>The accessor must be initialized by the <a href="TCL_LoadTable.html"><code>TCL_LoadTable</code></a> or <a href="TCL_CreateTable.html"><code>TCL_CreateTable</code></a> function.</p>
64<p>
65If the encoding process failed because <CODE>jpegBufferSize</CODE> was small, <CODE>quality</CODE> was high, or for some other reason, the function will automatically lower <CODE>quality</CODE> internally and continue to retry until encoding is successful. If even lowering <CODE>quality</CODE> to its limit does not result in success, <CODE>TCL_RESULT_ERROR_OTHER</CODE> is returned.
66</p>
67<h2>See Also</h2>
68<p><code><a href="TCL_GetJpegEncoderBufferSize.html">TCL_GetJpegEncoderBufferSize</a></code></p>
69
70<h2>Revision History</h2>
71<p>
722009/04/30 Changed the SSP function that is called internally. <br>2009/04/16 Added information on behavior when internal encoding fails. <br>2008/12/05 Initial version.<br/>
73</p>
74
75<hr><p>CONFIDENTIAL</p></body>
76</html>
77