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/>
15	<br/>
16	<pre><code>
17TCLResult TCL_EncodeAndWritePicture( TCLAccessor* pAccessor ,
18                                     const void* imageBuffer ,
19                                     u8* jpegBuffer ,
20                                     u32 jpegBufferSize ,
21                                     u8* workBuffer ,
22                                     u32 quality ,
23                                     u32 option ,
24                                     FSResult* pFSResult );
25
26TCLResult TCL_EncodeAndWritePictureEx( TCLAccessor* pAccessor ,
27                                       const void* imageBuffer ,
28                                       u8* jpegBuffer ,
29                                       u32 jpegBufferSize ,
30                                       u8* workBuffer ,
31                                       u32 quality ,
32                                       u32 option ,
33                                       u8* makerNoteBuffer ,
34                                       u16 makerNoteBufferSize ,
35                                       FSResult* pFSResult );
36	</code></pre>
37</dl>
38
39<h2>Arguments</h2>
40<p>
41<table>
42<tr><td><SPAN class="argument">pAccessor</SPAN><td><a href="TCLAccessor.html">Accessor</a>
43<tr><td><SPAN class="argument">imageBuffer</SPAN><td>Source image buffer
44<tr><td><SPAN class="argument">jpegBuffer</SPAN><td>JPEG image buffer
45<tr><td><SPAN class="argument">jpegBufferSize</SPAN><td>Size of the JPEG image buffer
46<tr><td><SPAN class="argument">workBuffer</SPAN><td>JPEG encoding work buffer
47<tr><td><SPAN class="argument">quality</SPAN><td>JPEG encoding quality
48<tr><td><SPAN class="argument">option</SPAN><td>JPEG encoding option
49<tr><td><SPAN class="argument">makerNoteBuffer</SPAN><td>User maker note buffer
50<tr><td><SPAN class="argument">makerNoteBufferSize</SPAN><td>User maker note buffer size
51<tr><td><SPAN class="argument">pFSResult</SPAN><td>Processing result when an error has been generated by an FS function inside this function
52</table>
53</p>
54
55<h2>Return Values</h2>
56<p><a href="TCLResult.html">Processing result</a></p>
57
58<h2>Description</h2>
59<p>Encodes the source image data in JPEG and saves the data. Calls the <code>SSP_StartJpegEncoderFast</code> function.</p>
60<p>The source image must have VGA dimensions.</p>
61<p>The work buffer should allocate the size determined by the <a href="TCL_GetJpegEncoderBufferSize.html"><code>TCL_GetJpegEncoderBufferSize</code></a> function.</p>
62<p>After encoding succeeds, saves to the JPEG image's next save path and overwrites the management file.</p>
63<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>
64<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>
65<p>
66If 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.
67</p>
68<h2>See Also</h2>
69<p><a href="TCL_GetJpegEncoderBufferSize.html"><code>TCL_GetJpegEncoderBufferSize</code></a></p>
70
71<h2>Revision History</h2>
72<p>
732009/06/29 Changed the SSP function that is called.<br> 2009/04/30 Changed the SSP function that is called.<br> 2009/04/16 Added description of operations when the internal encoder fails.<br> 2008/12/05 Initial version.
74</p>
75
76<hr><p>CONFIDENTIAL</p></body>
77</html>
78