3 ** Copyright 2012, Intel Corporation
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
9 ** http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef _3A_PROPERTY_H
19 #define _3A_PROPERTY_H
22 #include "ia_3a_types.h"
26 ci_adv_not_implemented,
28 ci_adv_Invalid_argument,
30 /* extend this enum with error identifiers needed to correctly
31 report all possible errors. */
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. */
48 /* ***********************************
50 * *********************************** */
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);
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);
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) */
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);
65 ci_adv_err ci_adv_ae_get_manual_brightness(float *value);
67 ci_adv_err ci_adv_ae_set_manual_shutter(float time);
68 ci_adv_err ci_adv_ae_get_manual_shutter(float *time);
70 ci_adv_err ci_adv_ae_set_manual_aperture(float aperture);
71 ci_adv_err ci_adv_ae_get_manual_aperture(float *aperture);
73 ci_adv_err ci_adv_ae_set_manual_iso(float sensitivity);
74 ci_adv_err ci_adv_ae_get_manual_iso(float *sensitivity);
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);
79 ci_adv_err ci_adv_ae_lock(bool lock);
80 ci_adv_err ci_adv_ae_is_locked(bool *lock);
82 ci_adv_err ci_adv_ae_save_exposure_state(void);
83 ci_adv_err ci_adv_ae_restore_exposure_state(void);
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);
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);
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);
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);
98 ci_adv_err ci_adv_ae_set_dyn_range(float range, float center);
100 ci_adv_err ci_adv_ae_set_backlight_correction(bool enable);
101 ci_adv_err ci_adv_ae_get_backlight_correction(bool *enable);
104 Get sensor's configuration for AE
105 exp_time: Preview exposure time
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
112 void ci_adv_ae_get_exp_cfg(int *exp_time,
117 float *digital_gain);
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);
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);
130 ci_adv_err ci_adv_ae_get_windows_num(int *num);
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);
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);
144 ci_adv_err ci_adv_ae_destroy_weight_map(ia_3a_weight_map *weightMap);
146 void ci_adv_ae_enable(bool enable);
147 bool ci_adv_ae_is_enabled(void);
149 /* ***********************************
151 * *********************************** */
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);
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);
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);
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);
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);
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);
177 /* ***********************************
179 * *********************************** */
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 */
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);
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 */
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);
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);
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);
215 ci_adv_err ci_adv_af_need_assist_light(bool *bNeed);
218 void ci_adv_set_gbce_strength(int gbce_strength);
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);
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,
231 unsigned long record_size);
232 void ci_adv_put_maker_note(ia_3a_mknote *mknote);
233 void ci_adv_reset_maker_note(void);
235 /* NVM parse error reason. */
236 ia_3a_nvm_semco_error ci_adv_get_nvm_error(void);
238 #endif /* _3A_PROPERTY_H */