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    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21      span.virtual_style
22      {
23        font-size			 : 8pt;
24        color				 : white;
25        font-weight			: bold;
26        background			: #0a0;
27        border-left			: solid 1px #0f0;
28        border-top			: solid 1px #0f0;
29        border-right		: solid 1px #060;
30        border-bottom		: solid 1px #060;
31        padding-left		: 2px;
32        padding-right		: 2px;
33      }
34      span.protected_style
35      {
36        font-size			 : 8pt;
37        color				 : white;
38        font-weight			: bold;
39        background			: #444;
40        border-left			: solid 1px #ccc;
41        border-top			: solid 1px #ccc;
42        border-right		: solid 1px #222;
43        border-bottom		: solid 1px #222;
44        padding-left		: 2px;
45        padding-right		: 2px;
46      }
47        --></style>
48<title>nn::y2r::CTR</title>
49  </head>
50  <body>
51<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/y2r/Overview.html">y2r</a>::CTR</CODE> Namespace</h1>
52<h2>Description</h2>
53    <div class="section">
54<p>CTR namespace for Y2R (YUV to RGB conversion). <br />(This can also be written without the <CODE>::CTR</CODE> portion.)</p><p>
55<B>Note about support for Sleep Mode:</B><br />If the system transitions to sleep during a Y2R conversion, it will forcibly suspend the conversion. Also, the conversion will not be restarted once the system recovers from sleep. To support Sleep Mode, implement your application to transition to sleep only after Y2R conversion is complete and not while conversion is in progress. (That is, not while the <CODE><a href="../../../nn/y2r/CTR/IsBusyConversion.html">nn::y2r::CTR::IsBusyConversion</a></CODE> function returns <CODE>true</CODE> or while control is waiting for the event obtained by the <CODE><a href="../../../nn/y2r/CTR/GetTransferEndEvent.html">nn::y2r::CTR::GetTransferEndEvent</a></CODE> function.) Note that if the application transitions to sleep while waiting for an event obtained by the <CODE><a href="../../../nn/y2r/CTR/GetTransferEndEvent.html">nn::y2r::CTR::GetTransferEndEvent</a></CODE> function, then the event will not be signaled after the system recovers from sleep. Be extremely careful to avoid this.
56			</p><p>
57<B>Note about transfer bug:</B><br />There is a bug with the Y2R hardware that causes hangs during data transfers. A workaround is therefore required.
58                <p>
59<B>Symptoms</B>
60                </p><p>
61The system freezes during Y2R conversion, so the the transfer completion event obtained by the <CODE>nn::y2r::CTR::GetTransferEvent</CODE> function is not signaled and the <CODE><a href="../../../nn/y2r/CTR/IsBusyConversion.html">nn::y2r::CTR::IsBusyConversion</a></CODE> function does not return <CODE>true</CODE>.
62                </p><p>
63<B>Conditions for occurrence</B>
64                </p><p><ul><li>
65Cameras and Y2R hardware are used at the same time
66                        </li><li>
67AND, a buffer error occurs during the transfer of camera data and during error recovery the <CODE><a href="../../../nn/y2r/CTR/SetReceiving.html">nn::y2r::CTR::SetReceiving</a></CODE> function processing coincides with a certain portion of the Y2R data transfer operation.
68                        </li></ul>
69These conditions occur only in rare situations, so the occurrence of a camera buffer error won't always cause this bug to occur. The bug will not occur if the camera and Y2R hardware are not used at the same time.
70                </p><p>
71<B>Workaround</B>
72</p><p>Enter timeouts when waiting for the transfer completion event being obtained by the <CODE><a href="../../../nn/y2r/CTR/GetTransferEndEvent.html">nn::y2r::CTR::GetTransferEndEvent</a></CODE> function and when waiting for the <CODE><a href="../../../nn/y2r/CTR/IsBusyConversion.html">nn::y2r::CTR::IsBusyConversion</a></CODE> function to return <CODE>true</CODE>. The timeout should be set to a value longer than the time required for Y2R conversion. The time required for conversion depends on the size of the input image and the output format. A VGA image being output as 16-bit RGB will take about 13 milliseconds, and a VGA image being output as 24-bit RGB will take about 16 milliseconds. Also note that you can call the <CODE><a href="../../../nn/y2r/CTR/StopConversion.html">nn::y2r::CTR::StopConversion</a></CODE> function to forcibly stop the conversion when this bug occurs, after which you can resume use of Y2R.
73                </p><p>
74The chances of this bug occurring are proportional to the frequency of camera buffer errors. It is therefore recommended that the cameras be used under conditions in which it is unlikely for a buffer error to occur. If buffer errors are occurring with high frequency, reduce the frame rate of the cameras. Also, set the thread in which the <CODE><a href="../../../nn/y2r/CTR/SetReceiving.html">nn::y2r::CTR::SetReceiving</a></CODE> function is called to a relatively high priority.
75                </p></p></div>
76    <a name="class" id="class">
77<h2>Classes</h2>
78      <div class="section">
79        <table class="members">
80          <tr>
81            <th>
82<a href="../../../nn/y2r/CTR/ResultIsSleeping/Overview.html"><CODE>nn::y2r::CTR::ResultIsSleeping</CODE></a>
83            </th>
84<td>Indicates that the Y2R library cannot be used because the system is sleeping.</td>
85          </tr> </table>
86      </div>
87    </a> <a name="struct" id="struct">
88<h2>Structures</h2>
89      <div class="section">
90        <table class="members">
91          <tr>
92            <th>
93<a href="../../../nn/y2r/CTR/DitheringWeightParams/Overview.html"><CODE>nn::y2r::CTR::DitheringWeightParams</CODE></a>
94            </th>
95<td>Structure representing a dithering pattern.</td>
96          </tr>
97          <tr>
98            <th>
99<a href="../../../nn/y2r/CTR/PackageParameter/Overview.html"><CODE>nn::y2r::CTR::PackageParameter</CODE></a>
100            </th>
101<td>Structure used for batch parameter configuration.</td>
102          </tr> </table>
103      </div>
104    </a> <a name="enum" id="enum">
105<h2>Enumerated Types</h2>
106      <div class="section">
107        <table class="members">
108          <tr>
109            <td width="100"> </td>
110            <th>
111<a href="../../../nn/y2r/CTR/InputFormat.html"><CODE>InputFormat</CODE></a>
112            </th>
113<td>Enumerated type that indicates the input mode.</td>
114          </tr>
115          <tr>
116            <td width="100"> </td>
117            <th>
118<a href="../../../nn/y2r/CTR/OutputFormat.html"><CODE>OutputFormat</CODE></a>
119            </th>
120<td>Enumerated type that indicates the output pixel format.</td>
121          </tr>
122          <tr>
123            <td width="100"> </td>
124            <th>
125<a href="../../../nn/y2r/CTR/Rotation.html"><CODE>Rotation</CODE></a>
126            </th>
127<td>Enumerated type that indicates the output buffer rotation.</td>
128          </tr>
129          <tr>
130            <td width="100"> </td>
131            <th>
132<a href="../../../nn/y2r/CTR/BlockAlignment.html"><CODE>BlockAlignment</CODE></a>
133            </th>
134<td>Enumerated type that indicates an array of output buffers.</td>
135          </tr>
136          <tr>
137            <td width="100"> </td>
138            <th>
139<a href="../../../nn/y2r/CTR/StandardCoefficient.html"><CODE>StandardCoefficient</CODE></a>
140            </th>
141<td>Enumerated type that indicates the standard conversion coefficient.</td>
142          </tr> </table>
143      </div>
144    </a> <a name="function" id="function">
145<h2>Functions</h2>
146      <div class="section">
147        <table class="members">
148          <tr>
149            <td width="100">  </td>
150            <th>
151<a href="../../../nn/y2r/CTR/Initialize.html"><CODE>Initialize</CODE></a>
152            </th>
153<td>Initializes the Y2R library.</td>
154          </tr>
155          <tr>
156            <td width="100">  </td>
157            <th>
158<a href="../../../nn/y2r/CTR/Finalize.html"><CODE>Finalize</CODE></a>
159            </th>
160<td>Finalizes the Y2R library.</td>
161          </tr>
162          <tr>
163            <td width="100">  </td>
164            <th>
165<a href="../../../nn/y2r/CTR/SetInputFormat.html"><CODE>SetInputFormat</CODE></a>
166            </th>
167<td>Sets the input format.</td>
168          </tr>
169          <tr>
170            <td width="100">  </td>
171            <th>
172<a href="../../../nn/y2r/CTR/GetInputFormat.html"><CODE>GetInputFormat</CODE></a>
173            </th>
174<td>Gets the input format.</td>
175          </tr>
176          <tr>
177            <td width="100">  </td>
178            <th>
179<a href="../../../nn/y2r/CTR/SetOutputFormat.html"><CODE>SetOutputFormat</CODE></a>
180            </th>
181<td>Sets the output format.</td>
182          </tr>
183          <tr>
184            <td width="100">  </td>
185            <th>
186<a href="../../../nn/y2r/CTR/GetOutputFormat.html"><CODE>GetOutputFormat</CODE></a>
187            </th>
188<td>Gets the output format.</td>
189          </tr>
190          <tr>
191            <td width="100">  </td>
192            <th>
193<a href="../../../nn/y2r/CTR/SetRotation.html"><CODE>SetRotation</CODE></a>
194            </th>
195<td>Sets the rotation angle of the output buffer.</td>
196          </tr>
197          <tr>
198            <td width="100">  </td>
199            <th>
200<a href="../../../nn/y2r/CTR/GetRotation.html"><CODE>GetRotation</CODE></a>
201            </th>
202<td>Gets the rotation angle of the output buffer.</td>
203          </tr>
204          <tr>
205            <td width="100">  </td>
206            <th>
207<a href="../../../nn/y2r/CTR/SetBlockAlignment.html"><CODE>SetBlockAlignment</CODE></a>
208            </th>
209<td>Sets the alignment of the data in the output buffer.</td>
210          </tr>
211          <tr>
212            <td width="100">  </td>
213            <th>
214<a href="../../../nn/y2r/CTR/GetBlockAlignment.html"><CODE>GetBlockAlignment</CODE></a>
215            </th>
216<td>Gets the alignment of the data in the output buffer.</td>
217          </tr>
218          <tr>
219            <td width="100">  </td>
220            <th>
221<a href="../../../nn/y2r/CTR/SetSpacialDithering.html"><CODE>SetSpacialDithering</CODE></a>
222            </th>
223<td>Enables or disables spacial dithering of the output image.</td>
224          </tr>
225          <tr>
226            <td width="100">  </td>
227            <th>
228<a href="../../../nn/y2r/CTR/GetSpacialDithering.html"><CODE>GetSpacialDithering</CODE></a>
229            </th>
230<td>Checks whether spacial dithering of the output image is enabled.</td>
231          </tr>
232          <tr>
233            <td width="100">  </td>
234            <th>
235<a href="../../../nn/y2r/CTR/SetTemporalDithering.html"><CODE>SetTemporalDithering</CODE></a>
236            </th>
237<td>Enables or disables temporal dithering of the output image. The initial value is <CODE>false</CODE>.</td>
238          </tr>
239          <tr>
240            <td width="100">  </td>
241            <th>
242<a href="../../../nn/y2r/CTR/GetTemporalDithering.html"><CODE>GetTemporalDithering</CODE></a>
243            </th>
244<td>Checks whether temporal dithering of the output image is enabled. The initial value is <CODE>false</CODE>.</td>
245          </tr>
246          <tr>
247            <td width="100">  </td>
248            <th>
249<a href="../../../nn/y2r/CTR/SetTransferEndInterrupt.html"><CODE>SetTransferEndInterrupt</CODE></a>
250            </th>
251<td>Enables or disables data transfer completion interrupts. The initial value is <CODE>true</CODE>.</td>
252          </tr>
253          <tr>
254            <td width="100">  </td>
255            <th>
256<a href="../../../nn/y2r/CTR/GetTransferEndInterrupt.html"><CODE>GetTransferEndInterrupt</CODE></a>
257            </th>
258<td>Checks whether data transfer completion interrupts are enabled.</td>
259          </tr>
260          <tr>
261            <td width="100">  </td>
262            <th>
263<a href="../../../nn/y2r/CTR/GetTransferEndEvent.html"><CODE>GetTransferEndEvent</CODE></a>
264            </th>
265<td>Gets the event that is used to detect the occurrence of a data transfer completion interrupt.</td>
266          </tr>
267          <tr>
268            <td width="100">  </td>
269            <th>
270<a href="../../../nn/y2r/CTR/SetSendingY.html"><CODE>SetSendingY</CODE></a>
271            </th>
272<td>Configures writing of Y data. The actual transfer operation takes place after the <CODE><a href="../../../nn/y2r/CTR/StartConversion.html">StartConversion</a></CODE> function is called.</td>
273          </tr>
274          <tr>
275            <td width="100">  </td>
276            <th>
277<a href="../../../nn/y2r/CTR/SetSendingU.html"><CODE>SetSendingU</CODE></a>
278            </th>
279<td>Configures writing of U data. The actual transfer operation takes place after the <CODE><a href="../../../nn/y2r/CTR/StartConversion.html">StartConversion</a></CODE> function is called.</td>
280          </tr>
281          <tr>
282            <td width="100">  </td>
283            <th>
284<a href="../../../nn/y2r/CTR/SetSendingV.html"><CODE>SetSendingV</CODE></a>
285            </th>
286<td>Configures writing of V data. The actual transfer operation takes place after the <CODE><a href="../../../nn/y2r/CTR/StartConversion.html">StartConversion</a></CODE> function is called.</td>
287          </tr>
288          <tr>
289            <td width="100">  </td>
290            <th>
291<a href="../../../nn/y2r/CTR/SetSendingYuv.html"><CODE>SetSendingYuv</CODE></a>
292            </th>
293<td>Configures writing of YUV data. The actual transfer operation takes place after the <CODE><a href="../../../nn/y2r/CTR/StartConversion.html">StartConversion</a></CODE> function is called.</td>
294          </tr>
295          <tr>
296            <td width="100">  </td>
297            <th>
298<a href="../../../nn/y2r/CTR/IsFinishedSendingYuv.html"><CODE>IsFinishedSendingYuv</CODE></a>
299            </th>
300<td>Determines whether writing of YUV data has finished.</td>
301          </tr>
302          <tr>
303            <td width="100">  </td>
304            <th>
305<a href="../../../nn/y2r/CTR/IsFinishedSendingY.html"><CODE>IsFinishedSendingY</CODE></a>
306            </th>
307<td>Determines whether writing of Y data has finished.</td>
308          </tr>
309          <tr>
310            <td width="100">  </td>
311            <th>
312<a href="../../../nn/y2r/CTR/IsFinishedSendingU.html"><CODE>IsFinishedSendingU</CODE></a>
313            </th>
314<td>Determines whether writing of U data has finished.</td>
315          </tr>
316          <tr>
317            <td width="100">  </td>
318            <th>
319<a href="../../../nn/y2r/CTR/IsFinishedSendingV.html"><CODE>IsFinishedSendingV</CODE></a>
320            </th>
321<td>Determines whether writing of V data has finished.</td>
322          </tr>
323          <tr>
324            <td width="100">  </td>
325            <th>
326<a href="../../../nn/y2r/CTR/SetReceiving.html"><CODE>SetReceiving</CODE></a>
327            </th>
328<td>Configures loading of RGB data. The actual transfer operation takes place after the <CODE><a href="../../../nn/y2r/CTR/StartConversion.html">StartConversion</a></CODE> function is called.</td>
329          </tr>
330          <tr>
331            <td width="100">  </td>
332            <th>
333<a href="../../../nn/y2r/CTR/IsFinishedReceiving.html"><CODE>IsFinishedReceiving</CODE></a>
334            </th>
335<td>Checks whether loading has finished.</td>
336          </tr>
337          <tr>
338            <td width="100">  </td>
339            <th>
340<a href="../../../nn/y2r/CTR/SetInputLineWidth.html"><CODE>SetInputLineWidth</CODE></a>
341            </th>
342<td>Sets the width of a single line of input data.</td>
343          </tr>
344          <tr>
345            <td width="100">  </td>
346            <th>
347<a href="../../../nn/y2r/CTR/GetInputLineWidth.html"><CODE>GetInputLineWidth</CODE></a>
348            </th>
349<td>Gets the width of a single line of input data.</td>
350          </tr>
351          <tr>
352            <td width="100">  </td>
353            <th>
354<a href="../../../nn/y2r/CTR/SetInputLines.html"><CODE>SetInputLines</CODE></a>
355            </th>
356<td>Sets the number of vertical lines of input data.</td>
357          </tr>
358          <tr>
359            <td width="100">  </td>
360            <th>
361<a href="../../../nn/y2r/CTR/GetInputLines.html"><CODE>GetInputLines</CODE></a>
362            </th>
363<td>Gets the number of vertical lines of input data.</td>
364          </tr>
365          <tr>
366            <td width="100">  </td>
367            <th>
368<a href="../../../nn/y2r/CTR/GetOutputFormatBytes.html"><CODE>GetOutputFormatBytes</CODE></a>
369            </th>
370<td>Calculates the number of bytes per pixel in the specified output format.</td>
371          </tr>
372          <tr>
373            <td width="100">  </td>
374            <th>
375<a href="../../../nn/y2r/CTR/GetOutputBlockSize.html"><CODE>GetOutputBlockSize</CODE></a>
376            </th>
377<td>Calculates the size of the output block.</td>
378          </tr>
379          <tr>
380            <td width="100">  </td>
381            <th>
382<a href="../../../nn/y2r/CTR/GetOutputImageSize.html"><CODE>GetOutputImageSize</CODE></a>
383            </th>
384<td>Calculates the size of the output image.</td>
385          </tr>
386          <tr>
387            <td width="100">  </td>
388            <th>
389<a href="../../../nn/y2r/CTR/SetStandardCoefficient.html"><CODE>SetStandardCoefficient</CODE></a>
390            </th>
391<td>Sets the standard conversion coefficients.</td>
392          </tr>
393          <tr>
394            <td width="100">  </td>
395            <th>
396<a href="../../../nn/y2r/CTR/SetAlpha.html"><CODE>SetAlpha</CODE></a>
397            </th>
398<td>Sets the alpha value for a 32-bit RGB or RGB555 output format.</td>
399          </tr>
400          <tr>
401            <td width="100">  </td>
402            <th>
403<a href="../../../nn/y2r/CTR/GetAlpha.html"><CODE>GetAlpha</CODE></a>
404            </th>
405<td>Gets the alpha value for a 32-bit RGB or RGB555 output format.</td>
406          </tr>
407          <tr>
408            <td width="100">  </td>
409            <th>
410<a href="../../../nn/y2r/CTR/SetDitheringWeightParams.html"><CODE>SetDitheringWeightParams</CODE></a>
411            </th>
412<td>Sets the dithering pattern.</td>
413          </tr>
414          <tr>
415            <td width="100">  </td>
416            <th>
417<a href="../../../nn/y2r/CTR/GetDitheringWeightParams.html"><CODE>GetDitheringWeightParams</CODE></a>
418            </th>
419<td>Gets the dithering pattern.</td>
420          </tr>
421          <tr>
422            <td width="100">  </td>
423            <th>
424<a href="../../../nn/y2r/CTR/StartConversion.html"><CODE>StartConversion</CODE></a>
425            </th>
426<td>Starts conversion.</td>
427          </tr>
428          <tr>
429            <td width="100">  </td>
430            <th>
431<a href="../../../nn/y2r/CTR/StopConversion.html"><CODE>StopConversion</CODE></a>
432            </th>
433<td>Forcibly stops conversion.</td>
434          </tr>
435          <tr>
436            <td width="100">  </td>
437            <th>
438<a href="../../../nn/y2r/CTR/IsBusyConversion.html"><CODE>IsBusyConversion</CODE></a>
439            </th>
440<td>Checks whether conversion is underway.</td>
441          </tr>
442          <tr>
443            <td width="100">  </td>
444            <th>
445<a href="../../../nn/y2r/CTR/SetPackageParameter.html"><CODE>SetPackageParameter</CODE></a>
446            </th>
447<td>Configures the Y2R settings all at once.</td>
448          </tr>
449          <tr>
450            <td width="100">  </td>
451            <th>
452<a href="../../../nn/y2r/CTR/GetPackageParameter.html"><CODE>GetPackageParameter</CODE></a>
453            </th>
454<td>Gets the Y2R settings all at once.</td>
455          </tr> </table>
456      </div>
457    </a>
458<h2>Revision History</h2>
459    <div class="section">
460      <dl class="history">
461        <dt>2011/06/24</dt>
462<dd>Added functions that have problems when the transfer bug occurs.<br />
463        </dd>
464        <dt>2010/11/10</dt>
465<dd>Added descriptions to the symptoms and workaround for the transfer bug.<br />
466        </dd>
467        <dt>2010/10/30</dt>
468<dd>Added an explanation of sleep transition and recovery behaviors and methods for supporting them.<br />
469        </dd>
470        <dt>2010/01/07</dt>
471<dd>Initial version.<br />
472        </dd>
473      </dl>
474    </div>
475  <hr><p>CONFIDENTIAL</p></body>
476</html>
477