Tizen 2.1 base
[adaptation/intel_mfld/libmfldadvci-blackbay-bin.git] / devel / usr / include / libmfldadvci / ci_adv_property.h
1 /*
2 **
3 ** Copyright 2012, Intel Corporation
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 **     http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17
18 #ifndef _3A_PROPERTY_H
19 #define _3A_PROPERTY_H
20
21 #include <stdbool.h>
22 #include "ia_3a_types.h"
23
24 typedef enum {
25   ci_adv_success,
26   ci_adv_not_implemented,
27   ci_adv_general_error,
28   ci_adv_Invalid_argument,
29   ci_adv_out_of_memory,
30   /* extend this enum with error identifiers needed to correctly
31      report all possible errors. */
32 } ci_adv_err;
33
34 typedef enum {
35 /*! Bit '1' means successful result of selected event */
36   ci_adv_init_state         = 0,            /*!< Init. state */
37   ci_adv_load_camera_1      = (1 << 1),     /*!< Loaded camera module #1 */
38   ci_adv_load_camera_2      = (1 << 2),     /*!< Loaded camera module #2 */
39   ci_adv_load_camera_3      = (1 << 3),     /*!< Loaded camera module #3 */
40   ci_adv_load_camera_4      = (1 << 4),     /*!< Loaded camera module #4 */
41   ci_adv_cam_sensor_data    = (1 << 5),     /*!< Sensor calibration data from camera presents */
42   ci_adv_file_sensor_data   = (1 << 6),     /*!< Sensor calibration data from file presents */
43   ci_adv_cam_motor_data     = (1 << 7),     /*!< Motor calibration data presents */
44   /* extend this enum with flags - identifiers needed to cover all
45      possible boot-up events. */
46 } ci_adv_boot_event;
47
48 /* ***********************************
49  * Auto Exposure
50  * *********************************** */
51
52 ci_adv_err ci_adv_ae_set_mode(ia_3a_ae_mode mode);
53 ci_adv_err ci_adv_ae_get_mode(ia_3a_ae_mode *mode);
54
55 ci_adv_err ci_adv_ae_set_metering_mode(ia_3a_ae_metering_mode mode);
56 ci_adv_err ci_adv_ae_get_metering_mode(ia_3a_ae_metering_mode *mode);
57
58 ci_adv_err ci_adv_ae_set_bias(float bias); /* bias: -2.0(EV) to +2.0(EV) */
59 ci_adv_err ci_adv_ae_get_bias(float *bias); /* bias: -2.0(EV) to +2.0(EV) */
60
61 ci_adv_err ci_adv_ae_set_flicker_mode(ia_3a_ae_flicker_mode mode);
62 ci_adv_err ci_adv_ae_get_flicker_mode(ia_3a_ae_flicker_mode *mode);
63 ci_adv_err ci_adv_ae_get_last_flicker_cancel_mode(ia_3a_ae_flicker_mode *mode);
64
65 ci_adv_err ci_adv_ae_get_manual_brightness(float *value);
66
67 ci_adv_err ci_adv_ae_set_manual_shutter(float time);
68 ci_adv_err ci_adv_ae_get_manual_shutter(float *time);
69
70 ci_adv_err ci_adv_ae_set_manual_aperture(float aperture);
71 ci_adv_err ci_adv_ae_get_manual_aperture(float *aperture);
72
73 ci_adv_err ci_adv_ae_set_manual_iso(float sensitivity);
74 ci_adv_err ci_adv_ae_get_manual_iso(float *sensitivity);
75
76 ci_adv_err ci_adv_ae_set_exposure_program(ia_3a_ae_exposure_program program);
77 ci_adv_err ci_adv_ae_get_exposure_program(ia_3a_ae_exposure_program *program);
78
79 ci_adv_err ci_adv_ae_lock(bool lock);
80 ci_adv_err ci_adv_ae_is_locked(bool *lock);
81
82 ci_adv_err ci_adv_ae_save_exposure_state(void);
83 ci_adv_err ci_adv_ae_restore_exposure_state(void);
84
85 ci_adv_err ci_adv_ae_set_flash_mode(ia_3a_ae_flash_mode mode);
86 ci_adv_err ci_adv_ae_get_flash_mode(ia_3a_ae_flash_mode *mode);
87 ci_adv_err ci_adv_ae_is_flash_necessary(bool *bUsed);
88
89 ci_adv_err ci_adv_ae_set_aperture_range(ia_3a_exec_mode mode, float min, float max);
90 ci_adv_err ci_adv_ae_get_aperture_range(ia_3a_exec_mode mode, float *min, float *max);
91
92 ci_adv_err ci_adv_ae_set_shutter_speed_range(ia_3a_exec_mode mode, float min, float max);
93 ci_adv_err ci_adv_ae_get_shutter_speed_range(ia_3a_exec_mode mode, float *min, float *max);
94
95 ci_adv_err ci_adv_ae_set_iso_range(ia_3a_exec_mode mode, float min, float max);
96 ci_adv_err ci_adv_ae_get_iso_range(ia_3a_exec_mode mode, float *min, float *max);
97
98 ci_adv_err ci_adv_ae_set_dyn_range(float range, float center);
99
100 ci_adv_err ci_adv_ae_set_backlight_correction(bool enable);
101 ci_adv_err ci_adv_ae_get_backlight_correction(bool *enable);
102
103 /*
104    Get sensor's configuration for AE
105     exp_time: Preview exposure time
106     aperture: Aperture
107    Get the AEC outputs (which we hope are used by the sensor)
108     aec_apex_Tv -> Shutter speed
109     aec_apex_Sv -> Sensitivity
110     aec_apex_Av -> Aperture
111 */
112 void ci_adv_ae_get_exp_cfg(int *exp_time,
113                            int *aperture,
114                            int *aec_apex_Tv,
115                            int *aec_apex_Sv,
116                            int *aec_apex_Av,
117                            float *digital_gain);
118
119 /* Set window for AE spot mode.
120    The window structure must be allocated and filled by the
121    caller. The callee will copy all necessary data into its own
122    structures. After the call has been completed, the caller is
123    free to release the window structure. */
124 ci_adv_err ci_adv_ae_set_window(const ia_3a_window *window);
125
126 /* Get window for AE spot mode.
127    The window structure must be allocated by the caller. */
128 ci_adv_err ci_adv_ae_get_window(ia_3a_window *window);
129
130 ci_adv_err ci_adv_ae_get_windows_num(int *num);
131
132 /* Set weight map for AE customized mode.
133    The weightMap and its fields must be allocated by the caller,
134    the callee will copy all necessary fields into its own structures.
135    After the call has been completed, the caller is free to release
136    the weight map structure and its fields. */
137 ci_adv_err ci_adv_ae_set_weight_map(const ia_3a_weight_map *weightMap);
138
139 /* Get weight map for AE customized mode.
140    The weight map structure will be allocated by this function and
141    must be freed by calling WeightMapDestroy(). */
142 ci_adv_err ci_adv_ae_get_weight_map(ia_3a_weight_map **weightMap);
143
144 ci_adv_err ci_adv_ae_destroy_weight_map(ia_3a_weight_map *weightMap);
145
146 void ci_adv_ae_enable(bool enable);
147 bool ci_adv_ae_is_enabled(void);
148
149 /* ***********************************
150  * Auto White Balance
151  * *********************************** */
152
153 /* AWB mode */
154 ci_adv_err ci_adv_awb_set_mode(ia_3a_awb_mode mode);
155 ci_adv_err ci_adv_awb_get_mode(ia_3a_awb_mode *mode);
156
157 /* AWB Light Source */
158 ci_adv_err ci_adv_awb_set_light_source(ia_3a_awb_light_source ls);
159 ci_adv_err ci_adv_awb_get_light_source(ia_3a_awb_light_source *ls);
160
161 /* AWB Color temperature of source of light */
162 ci_adv_err ci_adv_awb_set_manual_color_temperature(int ctemp);
163 ci_adv_err ci_adv_awb_get_manual_color_temperature(int *ctemp);
164 /* AWB map */
165 ci_adv_err ci_adv_awb_set_map(ia_3a_awb_map map);
166 ci_adv_err ci_adv_awb_get_map(ia_3a_awb_map *map);
167
168 void ci_adv_awb_enable(bool en);
169 bool ci_adv_awb_is_enabled(void);
170 int  ci_adv_awb_lock(bool lock);
171 int  ci_adv_awb_is_locked(bool *lock);
172
173 /* Image Effects */
174 void ci_adv_isp_set_image_effect(ia_3a_image_effect effect);
175 ia_3a_image_effect ci_adv_isp_get_image_effect(void);
176
177 /* ***********************************
178  * Auto Focus
179  * *********************************** */
180
181 void ci_adv_af_start(void);
182 void ci_adv_af_stop(void);
183 ia_3a_af_status ci_adv_af_get_status(void);
184 void ci_adv_af_enable(bool en);
185 bool ci_adv_af_is_enabled(void);
186 int  ci_adv_af_lock(bool lock);
187 int  ci_adv_af_is_locked(bool *lock);
188 int  ci_adv_get_focus_next_pos(int *pos);
189 int  ci_adv_get_focus_current_pos(int *pos);
190 int  ci_adv_set_manual_focus_inc(int step);
191 int  ci_adv_get_lens_range(ia_3a_af_lens_range *lensPosRange);
192 int  ci_adv_focus_pos_to_distance(int pos); /*!< Converts pos to focus distance in cm */
193
194 ci_adv_err ci_adv_af_set_mode(ia_3a_af_mode mode);
195 ci_adv_err ci_adv_af_get_mode(ia_3a_af_mode *mode);
196
197 ci_adv_err ci_adv_af_manual_focus_inc(int step);     /*!< positive -> far, negative -> near */
198 ci_adv_err ci_adv_af_manual_focus_abs(int distance); /*!< set focus distance in cm */
199
200 ci_adv_err ci_adv_af_set_range(ia_3a_af_range range);
201 ci_adv_err ci_adv_af_get_range(ia_3a_af_range *range);
202
203 ci_adv_err ci_adv_af_set_metering_mode(ia_3a_af_metering_mode mode);
204 ci_adv_err ci_adv_af_get_metering_mode(ia_3a_af_metering_mode *mode);
205
206 /* Multipoint focus. */
207 int ci_adv_af_maxnum_windows();
208 /* Set window for AF spot mode.
209    The window structure must be allocated and filled by the
210    caller. The callee will copy all necessary data into its own
211    structures. After the call has been completed, the caller is
212    free to release the window structure. */
213 ci_adv_err ci_adv_af_set_windows(int count, const ia_3a_window *windows);
214
215 ci_adv_err ci_adv_af_need_assist_light(bool *bNeed);
216
217 /* GBCE */
218 void ci_adv_set_gbce_strength(int gbce_strength);
219
220 void ci_adv_awb_version(int * major, int * minor);
221 void ci_adv_ae_version(int * major, int * minor);
222 void ci_adv_af_version(int * major, int * minor);
223 void ci_adv_rer_version(int * major, int * minor);
224
225 /* Makernote */
226
227 ia_3a_mknote* ci_adv_get_maker_note(ia_3a_mknote_mode mode);
228 int           ci_adv_add_maker_note_record(ia_3a_mknote_field_type type,
229                                            ia_3a_mknote_field_name name,
230                                            const void *record,
231                                            unsigned long record_size);
232 void          ci_adv_put_maker_note(ia_3a_mknote *mknote);
233 void          ci_adv_reset_maker_note(void);
234
235 /* NVM parse error reason. */
236 ia_3a_nvm_semco_error ci_adv_get_nvm_error(void);
237
238 #endif /* _3A_PROPERTY_H */