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>nn::y2r::CTR 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 the Y2R conversion during the transition to sleep, make sure that the system transitions to sleep only after conversion is complete and not when the <CODE>IsBusyConversion</CODE> function returns <CODE>true</CODE> or while it is waiting for the event object obtained with the <CODE>GetTransferEndEvent</CODE> function. If the system transitions to sleep when an event object returned by <CODE>GetTransferEndEvent</CODE> is waiting for an event, after the system recovers from sleep, the event object will not be signaled. 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> 61A hangup occurs during Y2R conversion, which causes the transfer completion event obtained using the <CODE>GetTransferEvent</CODE> function not to be signaled. 62 </p><p> 63<B>Conditions for occurrence</B> 64 </p><p><ul><li> 65If the camera and the Y2R hardware are used at the same time. 66 </li><li> 67In addition, if a buffer error occurs during the transfer of camera data, and the timing of the <CODE>nn::camera::CTR::SetReceiving</CODE> part of the recovery process 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> 73Insert a timeout when waiting for the transfer completion event obtained using the <CODE>GetTransferEndEvent</CODE> function. 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. When this error occurs, you can call <CODE>StopConversion</CODE> to forcibly stop the conversion, after which you can resume use of Y2R. 74 </p><p> 75The chances of this error occurring are proportional to the frequency of camera buffer errors. It is therefore recommended that the camera be used in situations 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 camera. Additionally, set the thread in which <CODE>nn::camera::CTR::SetReceiving</CODE> is called to high priority. 76 </p></p></div> 77 <a name="class" id="class"> 78<h2>Classes</h2> 79 <div class="section"> 80 <table class="members"> 81 <tr> 82 <th> 83<a href="../../../nn/y2r/CTR/ResultIsSleeping/Overview.html"><CODE>nn::y2r::CTR::ResultIsSleeping</CODE></a> 84 </th> 85<td>Indicates that the Y2R library cannot be used because the system is sleeping.</td> 86 </tr> </table> 87 </div> 88 </a> <a name="struct" id="struct"> 89<h2>Structures</h2> 90 <div class="section"> 91 <table class="members"> 92 <tr> 93 <th> 94<a href="../../../nn/y2r/CTR/DitheringWeightParams/Overview.html"><CODE>nn::y2r::CTR::DitheringWeightParams</CODE></a> 95 </th> 96<td>Structure representing a dithering pattern.</td> 97 </tr> 98 <tr> 99 <th> 100<a href="../../../nn/y2r/CTR/PackageParameter/Overview.html"><CODE>nn::y2r::CTR::PackageParameter</CODE></a> 101 </th> 102<td>Structure used for batch parameter configuration.</td> 103 </tr> </table> 104 </div> 105 </a> <a name="enum" id="enum"> 106<h2>Enumerated Types</h2> 107 <div class="section"> 108 <table class="members"> 109 <tr> 110 <td width="100"> </td> 111 <th> 112<a href="../../../nn/y2r/CTR/InputFormat.html"><CODE>InputFormat</CODE></a> 113 </th> 114<td>Enumerated type that indicates the input mode.</td> 115 </tr> 116 <tr> 117 <td width="100"> </td> 118 <th> 119<a href="../../../nn/y2r/CTR/OutputFormat.html"><CODE>OutputFormat</CODE></a> 120 </th> 121<td>Enumerated type that indicates the output pixel format.</td> 122 </tr> 123 <tr> 124 <td width="100"> </td> 125 <th> 126<a href="../../../nn/y2r/CTR/Rotation.html"><CODE>Rotation</CODE></a> 127 </th> 128<td>Enumerated type that indicates the output buffer rotation.</td> 129 </tr> 130 <tr> 131 <td width="100"> </td> 132 <th> 133<a href="../../../nn/y2r/CTR/BlockAlignment.html"><CODE>BlockAlignment</CODE></a> 134 </th> 135<td>Enumerated type that indicates an array of output buffers.</td> 136 </tr> 137 <tr> 138 <td width="100"> </td> 139 <th> 140<a href="../../../nn/y2r/CTR/StandardCoefficient.html"><CODE>StandardCoefficient</CODE></a> 141 </th> 142<td>Enumerated type that indicates the standard conversion coefficient.</td> 143 </tr> </table> 144 </div> 145 </a> <a name="function" id="function"> 146<h2>Functions</h2> 147 <div class="section"> 148 <table class="members"> 149 <tr> 150 <td width="100"> </td> 151 <th> 152<a href="../../../nn/y2r/CTR/Initialize.html"><CODE>Initialize</CODE></a> 153 </th> 154<td>Initializes the Y2R library.</td> 155 </tr> 156 <tr> 157 <td width="100"> </td> 158 <th> 159<a href="../../../nn/y2r/CTR/Finalize.html"><CODE>Finalize</CODE></a> 160 </th> 161<td>Finalizes the Y2R library.</td> 162 </tr> 163 <tr> 164 <td width="100"> </td> 165 <th> 166<a href="../../../nn/y2r/CTR/SetInputFormat.html"><CODE>SetInputFormat</CODE></a> 167 </th> 168<td>Sets the input format.</td> 169 </tr> 170 <tr> 171 <td width="100"> </td> 172 <th> 173<a href="../../../nn/y2r/CTR/GetInputFormat.html"><CODE>GetInputFormat</CODE></a> 174 </th> 175<td>Gets the input format.</td> 176 </tr> 177 <tr> 178 <td width="100"> </td> 179 <th> 180<a href="../../../nn/y2r/CTR/SetOutputFormat.html"><CODE>SetOutputFormat</CODE></a> 181 </th> 182<td>Sets the output format.</td> 183 </tr> 184 <tr> 185 <td width="100"> </td> 186 <th> 187<a href="../../../nn/y2r/CTR/GetOutputFormat.html"><CODE>GetOutputFormat</CODE></a> 188 </th> 189<td>Gets the output format.</td> 190 </tr> 191 <tr> 192 <td width="100"> </td> 193 <th> 194<a href="../../../nn/y2r/CTR/SetRotation.html"><CODE>SetRotation</CODE></a> 195 </th> 196<td>Sets the rotation angle of the output buffer.</td> 197 </tr> 198 <tr> 199 <td width="100"> </td> 200 <th> 201<a href="../../../nn/y2r/CTR/GetRotation.html"><CODE>GetRotation</CODE></a> 202 </th> 203<td>Gets the rotation angle of the output buffer.</td> 204 </tr> 205 <tr> 206 <td width="100"> </td> 207 <th> 208<a href="../../../nn/y2r/CTR/SetBlockAlignment.html"><CODE>SetBlockAlignment</CODE></a> 209 </th> 210<td>Sets the alignment of the data in the output buffer.</td> 211 </tr> 212 <tr> 213 <td width="100"> </td> 214 <th> 215<a href="../../../nn/y2r/CTR/GetBlockAlignment.html"><CODE>GetBlockAlignment</CODE></a> 216 </th> 217<td>Gets the alignment of the data in the output buffer.</td> 218 </tr> 219 <tr> 220 <td width="100"> </td> 221 <th> 222<a href="../../../nn/y2r/CTR/SetSpacialDithering.html"><CODE>SetSpacialDithering</CODE></a> 223 </th> 224<td>Enables or disables spacial dithering of the output image.</td> 225 </tr> 226 <tr> 227 <td width="100"> </td> 228 <th> 229<a href="../../../nn/y2r/CTR/GetSpacialDithering.html"><CODE>GetSpacialDithering</CODE></a> 230 </th> 231<td>Checks whether spacial dithering of the output image is enabled.</td> 232 </tr> 233 <tr> 234 <td width="100"> </td> 235 <th> 236<a href="../../../nn/y2r/CTR/SetTemporalDithering.html"><CODE>SetTemporalDithering</CODE></a> 237 </th> 238<td>Enables or disables temporal dithering of the output image. The initial value is <CODE>false</CODE>.</td> 239 </tr> 240 <tr> 241 <td width="100"> </td> 242 <th> 243<a href="../../../nn/y2r/CTR/GetTemporalDithering.html"><CODE>GetTemporalDithering</CODE></a> 244 </th> 245<td>Checks whether temporal dithering of the output image is enabled. The initial value is <CODE>false</CODE>.</td> 246 </tr> 247 <tr> 248 <td width="100"> </td> 249 <th> 250<a href="../../../nn/y2r/CTR/SetTransferEndInterrupt.html"><CODE>SetTransferEndInterrupt</CODE></a> 251 </th> 252<td>Enables or disables data transfer completion interrupts. The initial value is <CODE>true</CODE>.</td> 253 </tr> 254 <tr> 255 <td width="100"> </td> 256 <th> 257<a href="../../../nn/y2r/CTR/GetTransferEndInterrupt.html"><CODE>GetTransferEndInterrupt</CODE></a> 258 </th> 259<td>Checks whether data transfer completion interrupts are enabled.</td> 260 </tr> 261 <tr> 262 <td width="100"> </td> 263 <th> 264<a href="../../../nn/y2r/CTR/GetTransferEndEvent.html"><CODE>GetTransferEndEvent</CODE></a> 265 </th> 266<td>Gets the event that is used to detect the occurrence of a data transfer completion interrupt.</td> 267 </tr> 268 <tr> 269 <td width="100"> </td> 270 <th> 271<a href="../../../nn/y2r/CTR/SetSendingY.html"><CODE>SetSendingY</CODE></a> 272 </th> 273<td>Configures writing of Y data. The actual transfer operation takes place after <CODE>StartConversion</CODE> is called.</td> 274 </tr> 275 <tr> 276 <td width="100"> </td> 277 <th> 278<a href="../../../nn/y2r/CTR/SetSendingU.html"><CODE>SetSendingU</CODE></a> 279 </th> 280<td>Configures writing of U data. The actual transfer operation takes place after <CODE>StartConversion</CODE> is called.</td> 281 </tr> 282 <tr> 283 <td width="100"> </td> 284 <th> 285<a href="../../../nn/y2r/CTR/SetSendingV.html"><CODE>SetSendingV</CODE></a> 286 </th> 287<td>Configures writing of V data. The actual transfer operation takes place after <CODE>StartConversion</CODE> is called.</td> 288 </tr> 289 <tr> 290 <td width="100"> </td> 291 <th> 292<a href="../../../nn/y2r/CTR/SetSendingYuv.html"><CODE>SetSendingYuv</CODE></a> 293 </th> 294<td>Configures writing of YUV data. The actual transfer operation takes place after <CODE>StartConversion</CODE> is called.</td> 295 </tr> 296 <tr> 297 <td width="100"> </td> 298 <th> 299<a href="../../../nn/y2r/CTR/IsFinishedSendingYuv.html"><CODE>IsFinishedSendingYuv</CODE></a> 300 </th> 301<td>Determines whether writing of YUV data has finished.</td> 302 </tr> 303 <tr> 304 <td width="100"> </td> 305 <th> 306<a href="../../../nn/y2r/CTR/IsFinishedSendingY.html"><CODE>IsFinishedSendingY</CODE></a> 307 </th> 308<td>Determines whether writing of Y data has finished.</td> 309 </tr> 310 <tr> 311 <td width="100"> </td> 312 <th> 313<a href="../../../nn/y2r/CTR/IsFinishedSendingU.html"><CODE>IsFinishedSendingU</CODE></a> 314 </th> 315<td>Determines whether writing of U data has finished.</td> 316 </tr> 317 <tr> 318 <td width="100"> </td> 319 <th> 320<a href="../../../nn/y2r/CTR/IsFinishedSendingV.html"><CODE>IsFinishedSendingV</CODE></a> 321 </th> 322<td>Determines whether writing of V data has finished.</td> 323 </tr> 324 <tr> 325 <td width="100"> </td> 326 <th> 327<a href="../../../nn/y2r/CTR/SetReceiving.html"><CODE>SetReceiving</CODE></a> 328 </th> 329<td>Configures loading of RGB data. The actual transfer operation takes place after <CODE>StartConversion</CODE> is called.</td> 330 </tr> 331 <tr> 332 <td width="100"> </td> 333 <th> 334<a href="../../../nn/y2r/CTR/IsFinishedReceiving.html"><CODE>IsFinishedReceiving</CODE></a> 335 </th> 336<td>Checks whether loading has finished.</td> 337 </tr> 338 <tr> 339 <td width="100"> </td> 340 <th> 341<a href="../../../nn/y2r/CTR/SetInputLineWidth.html"><CODE>SetInputLineWidth</CODE></a> 342 </th> 343<td>Sets the width of a single line of input data.</td> 344 </tr> 345 <tr> 346 <td width="100"> </td> 347 <th> 348<a href="../../../nn/y2r/CTR/GetInputLineWidth.html"><CODE>GetInputLineWidth</CODE></a> 349 </th> 350<td>Gets the width of a single line of input data.</td> 351 </tr> 352 <tr> 353 <td width="100"> </td> 354 <th> 355<a href="../../../nn/y2r/CTR/SetInputLines.html"><CODE>SetInputLines</CODE></a> 356 </th> 357<td>Sets the number of vertical lines of input data.</td> 358 </tr> 359 <tr> 360 <td width="100"> </td> 361 <th> 362<a href="../../../nn/y2r/CTR/GetInputLines.html"><CODE>GetInputLines</CODE></a> 363 </th> 364<td>Gets the number of vertical lines of input data.</td> 365 </tr> 366 <tr> 367 <td width="100"> </td> 368 <th> 369<a href="../../../nn/y2r/CTR/GetOutputFormatBytes.html"><CODE>GetOutputFormatBytes</CODE></a> 370 </th> 371<td>Calculates the number of bytes per pixel in the specified output format.</td> 372 </tr> 373 <tr> 374 <td width="100"> </td> 375 <th> 376<a href="../../../nn/y2r/CTR/GetOutputBlockSize.html"><CODE>GetOutputBlockSize</CODE></a> 377 </th> 378<td>Calculates the size of the output block.</td> 379 </tr> 380 <tr> 381 <td width="100"> </td> 382 <th> 383<a href="../../../nn/y2r/CTR/GetOutputImageSize.html"><CODE>GetOutputImageSize</CODE></a> 384 </th> 385<td>Calculates the size of the output image.</td> 386 </tr> 387 <tr> 388 <td width="100"> </td> 389 <th> 390<a href="../../../nn/y2r/CTR/SetStandardCoefficient.html"><CODE>SetStandardCoefficient</CODE></a> 391 </th> 392<td>Sets the standard conversion coefficients.</td> 393 </tr> 394 <tr> 395 <td width="100"> </td> 396 <th> 397<a href="../../../nn/y2r/CTR/SetAlpha.html"><CODE>SetAlpha</CODE></a> 398 </th> 399<td>Sets the alpha value for a 32-bit RGB or RGB555 output format.</td> 400 </tr> 401 <tr> 402 <td width="100"> </td> 403 <th> 404<a href="../../../nn/y2r/CTR/GetAlpha.html"><CODE>GetAlpha</CODE></a> 405 </th> 406<td>Gets the alpha value for a 32-bit RGB or RGB555 output format.</td> 407 </tr> 408 <tr> 409 <td width="100"> </td> 410 <th> 411<a href="../../../nn/y2r/CTR/SetDitheringWeightParams.html"><CODE>SetDitheringWeightParams</CODE></a> 412 </th> 413<td>Sets the dithering pattern.</td> 414 </tr> 415 <tr> 416 <td width="100"> </td> 417 <th> 418<a href="../../../nn/y2r/CTR/GetDitheringWeightParams.html"><CODE>GetDitheringWeightParams</CODE></a> 419 </th> 420<td>Gets the dithering pattern.</td> 421 </tr> 422 <tr> 423 <td width="100"> </td> 424 <th> 425<a href="../../../nn/y2r/CTR/StartConversion.html"><CODE>StartConversion</CODE></a> 426 </th> 427<td>Starts conversion.</td> 428 </tr> 429 <tr> 430 <td width="100"> </td> 431 <th> 432<a href="../../../nn/y2r/CTR/StopConversion.html"><CODE>StopConversion</CODE></a> 433 </th> 434<td>Forcibly stops conversion.</td> 435 </tr> 436 <tr> 437 <td width="100"> </td> 438 <th> 439<a href="../../../nn/y2r/CTR/IsBusyConversion.html"><CODE>IsBusyConversion</CODE></a> 440 </th> 441<td>Checks whether conversion is underway.</td> 442 </tr> 443 <tr> 444 <td width="100"> </td> 445 <th> 446<a href="../../../nn/y2r/CTR/SetPackageParameter.html"><CODE>SetPackageParameter</CODE></a> 447 </th> 448<td>Configures the Y2R settings all at once.</td> 449 </tr> </table> 450 </div> 451 </a> 452<h2>Revision History</h2> 453 <div class="section"> 454 <dl class="history"> 455 <dt>2010/11/10</dt> 456<dd>Added descriptions to the symptoms and workaround for the transfer bug.<br /> 457 </dd> 458 <dt>2010/10/30</dt> 459<dd>Added an explanation of sleep transition and recovery behaviors and methods for supporting them.<br /> 460 </dd> 461 <dt>2010/01/07</dt> 462<dd>Initial version.<br /> 463 </dd> 464 </dl> 465 </div> 466 <hr><p>CONFIDENTIAL</p></body> 467</html> 468