• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) Texas Instruments - http://www.ti.com/
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 /**
18 * @file OMXSceneModeTables.h
19 *
20 * This holds scene mode settings for different omx cameras.
21 *
22 */
23 
24 #include "OMX_TI_IVCommon.h"
25 #include "OMX_TI_Common.h"
26 #include "OMX_TI_Index.h"
27 
28 #ifndef OMXCAMERAADAPTER_SCENEMODES_H
29 #define OMXCAMERAADAPTER_SCENEMODES_H
30 
31 #ifndef ARRAY_SIZE
32 #define ARRAY_SIZE(array) (sizeof((array)) / sizeof((array)[0]))
33 #endif
34 
35 struct SceneModesEntry {
36     OMX_SCENEMODETYPE scene;
37     OMX_IMAGE_FLASHCONTROLTYPE flash;
38     int focus;
39     OMX_WHITEBALCONTROLTYPE wb;
40 };
41 
42 struct CameraToSensorModesLUTEntry {
43     const char* name;
44     const SceneModesEntry* Table;
45     const unsigned int size;
46 };
47 
48 static const SceneModesEntry S5K4E1GA_SceneModesLUT [] = {
49     { OMX_Closeup,
50       OMX_IMAGE_FlashControlAuto,
51       OMX_IMAGE_FocusControlAutoMacro,
52       OMX_WhiteBalControlAuto },
53     { OMX_Landscape,
54       OMX_IMAGE_FlashControlOff,
55       OMX_IMAGE_FocusControlHyperfocal,
56       OMX_WhiteBalControlAuto },
57     { OMX_Underwater,
58       OMX_IMAGE_FlashControlAuto,
59       OMX_IMAGE_FocusControlAutoLock,
60       OMX_WhiteBalControlSunLight },
61     { OMX_Sport,
62       OMX_IMAGE_FlashControlOff,
63       OMX_IMAGE_FocusControlHyperfocal,
64       OMX_WhiteBalControlAuto },
65     { OMX_Mood,
66        OMX_IMAGE_FlashControlAuto,
67       OMX_IMAGE_FocusControlAutoLock,
68       OMX_WhiteBalControlAuto },
69     { OMX_NightPortrait,
70       OMX_IMAGE_FlashControlAuto,
71       OMX_IMAGE_FocusControlPortrait,
72       OMX_WhiteBalControlAuto },
73     { OMX_NightIndoor,
74       OMX_IMAGE_FlashControlAuto,
75       OMX_IMAGE_FocusControlHyperfocal,
76       OMX_WhiteBalControlAuto },
77     { OMX_Fireworks,
78       OMX_IMAGE_FlashControlOn,
79       OMX_IMAGE_FocusControlHyperfocal,
80       OMX_WhiteBalControlAuto },
81     { OMX_Document,
82       OMX_IMAGE_FlashControlOff,
83       OMX_IMAGE_FocusControlAutoMacro,
84       OMX_WhiteBalControlAuto },
85     { OMX_Barcode,
86       OMX_IMAGE_FlashControlAuto,
87       OMX_IMAGE_FocusControlAutoMacro,
88       OMX_WhiteBalControlAuto },
89     { OMX_SuperNight,
90       OMX_IMAGE_FlashControlAuto,
91       OMX_IMAGE_FocusControlHyperfocal,
92       OMX_WhiteBalControlAuto },
93     { OMX_Cine,
94       OMX_IMAGE_FlashControlAuto,
95       OMX_IMAGE_FocusControlHyperfocal,
96       OMX_WhiteBalControlAuto },
97     { OMX_OldFilm,
98       OMX_IMAGE_FlashControlAuto,
99       OMX_IMAGE_FocusControlHyperfocal,
100       OMX_WhiteBalControlAuto },
101     { OMX_TI_Action,
102       OMX_IMAGE_FlashControlOff,
103       OMX_IMAGE_FocusControlAuto,
104       OMX_WhiteBalControlAuto },
105     { OMX_TI_Beach,
106       OMX_IMAGE_FlashControlOff,
107       OMX_IMAGE_FocusControlAutoLock,
108       OMX_WhiteBalControlAuto },
109     { OMX_TI_Candlelight,
110       OMX_IMAGE_FlashControlAuto,
111       OMX_IMAGE_FocusControlHyperfocal,
112       OMX_WhiteBalControlIncandescent },
113     { OMX_TI_Night,
114       OMX_IMAGE_FlashControlOff,
115       OMX_IMAGE_FocusControlAuto,
116       OMX_WhiteBalControlAuto },
117     { OMX_TI_Party,
118       OMX_IMAGE_FlashControlAuto,
119       OMX_IMAGE_FocusControlAuto,
120       OMX_WhiteBalControlAuto },
121     { OMX_TI_Portrait,
122       OMX_IMAGE_FlashControlAuto,
123       OMX_IMAGE_FocusControlPortrait,
124       OMX_WhiteBalControlAuto },
125     { OMX_TI_Snow,
126       OMX_IMAGE_FlashControlOff,
127       OMX_IMAGE_FocusControlAutoLock,
128       OMX_WhiteBalControlAuto },
129     { OMX_TI_Steadyphoto,
130       OMX_IMAGE_FlashControlAuto,
131       OMX_IMAGE_FocusControlHyperfocal,
132       OMX_WhiteBalControlAuto },
133     { OMX_TI_Sunset,
134       OMX_IMAGE_FlashControlOff,
135       OMX_IMAGE_FocusControlAuto,
136       OMX_WhiteBalControlSunLight },
137     { OMX_TI_Theatre,
138       OMX_IMAGE_FlashControlAuto,
139       OMX_IMAGE_FocusControlHyperfocal,
140       OMX_WhiteBalControlAuto },
141 };
142 
143 static const SceneModesEntry S5K6A1GX03_SceneModesLUT [] = {
144     { OMX_Closeup,
145       OMX_IMAGE_FlashControlOff,
146       OMX_IMAGE_FocusControlHyperfocal,
147       OMX_WhiteBalControlAuto },
148     { OMX_Landscape,
149       OMX_IMAGE_FlashControlOff,
150       OMX_IMAGE_FocusControlHyperfocal,
151       OMX_WhiteBalControlAuto },
152     { OMX_Underwater,
153       OMX_IMAGE_FlashControlOff,
154       OMX_IMAGE_FocusControlHyperfocal,
155       OMX_WhiteBalControlSunLight },
156     { OMX_Sport,
157       OMX_IMAGE_FlashControlOff,
158       OMX_IMAGE_FocusControlHyperfocal,
159       OMX_WhiteBalControlAuto },
160     { OMX_SnowBeach,
161       OMX_IMAGE_FlashControlOff,
162       OMX_IMAGE_FocusControlHyperfocal,
163       OMX_WhiteBalControlAuto },
164     { OMX_Mood,
165       OMX_IMAGE_FlashControlOff,
166       OMX_IMAGE_FocusControlHyperfocal,
167       OMX_WhiteBalControlAuto },
168     { OMX_NightPortrait,
169       OMX_IMAGE_FlashControlOff,
170       OMX_IMAGE_FocusControlHyperfocal,
171       OMX_WhiteBalControlAuto },
172     { OMX_NightIndoor,
173       OMX_IMAGE_FlashControlOff,
174       OMX_IMAGE_FocusControlHyperfocal,
175       OMX_WhiteBalControlAuto },
176     { OMX_Fireworks,
177       OMX_IMAGE_FlashControlOff,
178       OMX_IMAGE_FocusControlHyperfocal,
179       OMX_WhiteBalControlAuto },
180     { OMX_Document,
181       OMX_IMAGE_FlashControlOff,
182       OMX_IMAGE_FocusControlHyperfocal,
183       OMX_WhiteBalControlAuto },
184     { OMX_Barcode,
185       OMX_IMAGE_FlashControlOff,
186       OMX_IMAGE_FocusControlHyperfocal,
187       OMX_WhiteBalControlAuto },
188     { OMX_SuperNight,
189       OMX_IMAGE_FlashControlOff,
190       OMX_IMAGE_FocusControlHyperfocal,
191       OMX_WhiteBalControlAuto },
192     { OMX_Cine,
193       OMX_IMAGE_FlashControlOff,
194       OMX_IMAGE_FocusControlHyperfocal,
195       OMX_WhiteBalControlAuto },
196     { OMX_OldFilm,
197       OMX_IMAGE_FlashControlOff,
198       OMX_IMAGE_FocusControlHyperfocal,
199       OMX_WhiteBalControlAuto },
200     { OMX_TI_Action,
201       OMX_IMAGE_FlashControlOff,
202       OMX_IMAGE_FocusControlHyperfocal,
203       OMX_WhiteBalControlAuto },
204     { OMX_TI_Beach,
205       OMX_IMAGE_FlashControlOff,
206       OMX_IMAGE_FocusControlHyperfocal,
207       OMX_WhiteBalControlAuto },
208     { OMX_TI_Candlelight,
209       OMX_IMAGE_FlashControlOff,
210       OMX_IMAGE_FocusControlHyperfocal,
211       OMX_WhiteBalControlIncandescent },
212     { OMX_TI_Night,
213       OMX_IMAGE_FlashControlOff,
214       OMX_IMAGE_FocusControlHyperfocal,
215       OMX_WhiteBalControlAuto },
216     { OMX_TI_Party,
217       OMX_IMAGE_FlashControlOff,
218       OMX_IMAGE_FocusControlHyperfocal,
219       OMX_WhiteBalControlAuto },
220     { OMX_TI_Portrait,
221       OMX_IMAGE_FlashControlOff,
222       OMX_IMAGE_FocusControlHyperfocal,
223       OMX_WhiteBalControlAuto },
224     { OMX_TI_Snow,
225       OMX_IMAGE_FlashControlOff,
226       OMX_IMAGE_FocusControlHyperfocal,
227       OMX_WhiteBalControlAuto },
228     { OMX_TI_Steadyphoto,
229       OMX_IMAGE_FlashControlOff,
230       OMX_IMAGE_FocusControlHyperfocal,
231       OMX_WhiteBalControlAuto },
232     { OMX_TI_Sunset,
233       OMX_IMAGE_FlashControlOff,
234       OMX_IMAGE_FocusControlHyperfocal,
235       OMX_WhiteBalControlSunLight },
236     { OMX_TI_Theatre,
237       OMX_IMAGE_FlashControlOff,
238       OMX_IMAGE_FocusControlHyperfocal,
239       OMX_WhiteBalControlAuto },
240 };
241 
242 static const CameraToSensorModesLUTEntry CameraToSensorModesLUT [] = {
243     { "S5K4E1GA", S5K4E1GA_SceneModesLUT, ARRAY_SIZE(S5K4E1GA_SceneModesLUT)},
244     { "S5K6A1GX03", S5K6A1GX03_SceneModesLUT, ARRAY_SIZE(S5K6A1GX03_SceneModesLUT)},
245 };
246 
247 #endif
248