1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>Camera Library Overview</TITLE>
8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">Camera Library Overview</H1>
12<P>
13The TWL system includes two cameras. Although cameras can be controlled separately, it is not possible to get images from both cameras simultaneously.<BR><BR> The Camera library cannot be used in CODEC-DS mode. Always use it in CODEC-TWL mode.<BR><br> Use the API to operate the camera.
14</P>
15<H2>Basic Camera Specifications</H2>
16<P>
17The basic camera specifications are listed below.
18</P>
19<ul>
20<li>Aperture: F2.8 (fixed)</li>
21<li>Angles of view (when photographing at maximum resolution): <BR> Diagonal: 66&deg;<BR> Horizontal: approximately 54&deg;<BR> Vertical: approximately 42&deg;</li>
22<li>Depth of field: 20cm to infinity (Pan focus. Cameras do not contain a macro switch.)</li>
23<li>Maximum resolution: VGA</li>
24<li>Maximum frame rate: 30 fps (fps: frames per second)</li>
25<li>Output format: YCrYCb (a YUV-&gt;RGB conversion circuit also makes it possible to output in RGB555)</li>
26<li>Resolution settings (supports fast configuration changes)</li>
27<li>Frame rate settings</li>
28<li>Effect processing (supports fast configuration changes)</li>
29<li>Flipping (supports fast configuration changes)</li>
30<li>Photo mode settings</li>
31<li>White balance settings</li>
32<li>Exposure settings</li>
33<li>Sharpness setting</li>
34</ul>
35<P>
36Of these specifications, Resolution, Effects, and Flipping are capable of handling two contexts for each camera. It can be faster to switch contexts than to set the specifications separately.<BR> The library automatically puts the cameras in standby mode when the hardware is reset or put to sleep. To enable the camera after recovering from sleep, the application must implement the process.
37</P>
38
39<P><h2>Default Camera Settings</h2></P>
40<p>
41Contexts handle the following default values when the cameras are started (when the <A href="CAMERA_Init.html"><CODE>CAMERA_Init</CODE></A> function is called).
42</p>
43<p>Inner Camera: Context A
44<table>
45<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_DS_LCD</A></td></tr>
46<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
47<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_HORIZONTAL</A></td></tr>
48</table></p>
49<p>Inner Camera: Context B
50<table>
51<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_VGA</A></td></tr>
52<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
53<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_HORIZONTAL</A></td></tr>
54</table></p>
55<p>Outer Camera: Context A
56<table>
57<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_DS_LCD</A></td></tr>
58<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
59<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_NONE</A></td></tr>
60</table></p>
61<p>Outer Camera: Context B
62<table>
63<tr><td>Resolution</td><td><A href="CAMERASize.html">CAMERA_SIZE_VGA</A></td></tr>
64<tr><td>Effect</td><td><A href="CAMERAEffect.html">CAMERA_EFFECT_NONE</A></td></tr>
65<tr><td>Flipping</td><td><A href="CAMERAFlip.html">CAMERA_FLIP_NONE</A></td></tr>
66</table></p>
67<p>By default, both the inner and outer cameras are in context A.<BR><BR>Contexts do not handle the following default values.
68<p>Inner Camera
69<table>
70<tr><td>Frame rate</td><td><A href="CAMERAFrameRate.html">CAMERA_FRAME_RATE_15</A></td></tr>
71<tr><td>Photo mode</td><td><A href="CAMERAPhotoMode.html">CAMERA_PHOTO_MODE_PORTRAIT</A></td></tr>
72</table></p>
73<p>Outer Camera
74<table>
75<tr><td>Frame rate</td><td><A href="CAMERAFrameRate.html">CAMERA_FRAME_RATE_15</A></td></tr>
76<tr><td>Photo mode</td><td><A href="CAMERAPhotoMode.html">CAMERA_PHOTO_MODE_NORMAL</A></td></tr>
77</table></p>
78<BR>Common settings for the inner and outer cameras take the following default values.
79<p>
80<table>
81<tr><td>Output Format</td><td><A href="CAMERAOutput.html">CAMERA_OUTPUT_YUV</A></td></tr>
82<tr><td>Number of Lines to Transfer</td><td>1 line</td></tr>
83</table></p>
84<p>See the links for specific descriptions of the parameter meanings.</p>
85</p>
86
87<P><h2>RGB Conversion</h2></P>
88<p>
89The camera gets image data in the YCrYCb (YUV4:2:2) format or the RGB (RGB5:5:5) format.<BR><BR>YUV422 is converted into RGB8:8:8 as follows.
90
91<PRE>
92R = 1.000 x Y                     + 1.402 x (V - 128)
93G = 1.000 x Y - 0.344 x (U - 128) - 0.714 x (V - 128)
94B = 1.000 x Y + 1.772 x (U - 128)
95</PRE>
96</p>
97<p>
98The results of the calculation are rounded off if they are less than 0 or more than 255. Then they are scaled to the range [0-31], after which they are in RGB555 format.<BR><BR>The formulas for the reverse conversion (that is, converting RGB555 to YUV422) are shown below.
99
100<PRE>
101Y =  0.299 x R + 0.587 x G + 0.114 x B
102U = -0.169 x R - 0.331 x G + 0.500 x B + 128
103V =  0.500 x R - 0.419 x G - 0.081 x B + 128
104</PRE>
105</p>
106<H2>See Also</H2>
107<P><CODE><A href="list_camera.html">CAMERA Function List</A><BR></CODE></P>
108<H2>Revision History</H2>
109<P>
1102009/06/09 Updated Basic Camera Specifications.<br> 2008/10/06 Described the Camera library's CODEC mode restrictions.<br> 2008/09/11 Added a description of the camera's initial values.<br> 2008/04/21 Added photo mode to the camera's initial values.<br> 2008/03/17 Added a description of operations during hardware reset and during sleep mode.<br> 2007/11/14 Initial version.
111</P>
112<hr><p>CONFIDENTIAL</p></body>
113</HTML>