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 _IA_3A_TYPES_H_
19 #define _IA_3A_TYPES_H_
25 #define IA_3A_S15_16_FROM_FLOAT(n) ((n)*65536.0)
26 #define IA_3A_S15_16_FROM_INT(n) ((n)<<16)
27 #define IA_3A_S15_16_TO_FLOAT(n) ((n)/65536.0)
29 typedef int ia_3a_s15_16;
38 int infinity; /*!< AF-lib value for INF position */
39 int macro; /*!< AF-lib value for Macro position*/
40 } ia_3a_af_lens_range;
43 ia_3a_isp_mode_preview,
45 ia_3a_isp_mode_capture,
46 ia_3a_isp_mode_continuous
49 /* This one will come form ia_css_types.h in the near future. */
50 struct ia_css_3a_output {
61 /* 3A execution mode */
63 ia_3a_exec_mode_movie,
64 ia_3a_exec_mode_preview,
65 ia_3a_exec_mode_still,
66 ia_3a_exec_mode_continuous
70 unsigned int num_windows_x;
71 unsigned int num_windows_y;
72 /* This array of weights covers the entire frame.
73 The size of this weight array is NumWindowsX x NumWindowsY */
74 unsigned int *weights;
85 /* This enum is defined the same value as enum v4l2_colorfx */
87 ia_3a_image_effect_none = 0,
88 ia_3a_image_effect_bw,
89 ia_3a_image_effect_sepia,
90 ia_3a_image_effect_negative
95 ia_3a_af_lens_status_stop,
96 ia_3a_af_lens_status_move
97 } ia_3a_af_lens_status;
99 /* Home Position state */
101 ia_3a_af_hp_status_incomplete, /* HP Undetected */
102 ia_3a_af_hp_status_complete, /* HP Reached */
103 ia_3a_af_hp_status_error /* HP Detection failure */
104 } ia_3a_af_hp_status;
106 /* Callback function types */
107 typedef ia_3a_status (*ia_3a_af_cb_move_focus_position)(short pos);
108 typedef ia_3a_af_lens_status (*ia_3a_af_cb_get_focus_status)(void);
109 typedef bool (*ia_3a_af_cb_focus_req_ready)(void);
110 typedef ia_3a_af_hp_status (*ia_3a_af_cb_get_hp_status)(void);
112 /* Individual module variation calibration data */
116 } ia_3a_private_data;
119 ia_3a_af_cb_move_focus_position cb_move_focus_position;
120 ia_3a_af_cb_get_focus_status cb_get_focus_status;
121 ia_3a_af_cb_focus_req_ready cb_focus_req_ready;
122 ia_3a_af_cb_get_hp_status cb_get_hp_status;
123 const ia_3a_private_data *param_calibration;
124 const ia_3a_private_data *motor_calibration;
125 const void *param_module;
130 ia_3a_ae_mode_auto, /* Automatic */
131 ia_3a_ae_mode_manual, /* Manual */
132 ia_3a_ae_mode_shutter_priority, /* Shutter priority */
133 ia_3a_ae_mode_aperture_priority /* Aperture priority */
136 /* Light metering method */
138 ia_3a_ae_metering_mode_auto, /* Automatic */
139 ia_3a_ae_metering_mode_spot, /* Spot metering, the window is specified by ia_3a_ae_set_window() */
140 ia_3a_ae_metering_mode_center, /* Center-weighted metering */
141 ia_3a_ae_metering_mode_customized, /* Customized, the weight map is specified by ia_3a_ae_set_weight_map() */
142 ia_3a_ae_metering_mode_average, /* Average metering */
143 } ia_3a_ae_metering_mode;
145 /* Digital Flicker Cancel Mode */
147 ia_3a_ae_flicker_mode_off, /* No flicker correction */
148 ia_3a_ae_flicker_mode_50hz, /* Correct 50Hz flicker */
149 ia_3a_ae_flicker_mode_60hz, /* Correct 60Hz flicker */
150 ia_3a_ae_flicker_mode_auto /* Auto detect and correct flicker */
151 } ia_3a_ae_flicker_mode;
154 ia_3a_ae_exposure_program_auto,
155 ia_3a_ae_exposure_program_portrait,
156 ia_3a_ae_exposure_program_sports,
157 ia_3a_ae_exposure_program_landscape,
158 ia_3a_ae_exposure_program_night,
159 ia_3a_ae_exposure_program_fireworks
160 } ia_3a_ae_exposure_program;
163 ia_3a_ae_flash_mode_auto, /* Automatic (don't flash when it's dark) */
164 ia_3a_ae_flash_mode_off, /* Off */
165 ia_3a_ae_flash_mode_on, /* On */
166 ia_3a_ae_flash_mode_day_sync, /* Day Sync */
167 ia_3a_ae_flash_mode_slow_sync, /* Slow Sync */
168 } ia_3a_ae_flash_mode;
171 ia_3a_flash_stage_none,
172 ia_3a_flash_stage_pre,
173 ia_3a_flash_stage_main
176 /* Auto White Balance */
178 ia_3a_awb_mode_auto, /* Corrected colors are calibrated to match changes in illuminant color */
179 ia_3a_awb_mode_manual /* The current color balance is retained */
183 ia_3a_awb_light_source_other,
184 ia_3a_awb_light_source_filament_lamp,
185 ia_3a_awb_light_source_clear_sky,
186 ia_3a_awb_light_source_cloudiness,
187 ia_3a_awb_light_source_shadow_area,
188 ia_3a_awb_light_source_fluorlamp_w,
189 ia_3a_awb_light_source_fluorlamp_n,
190 ia_3a_awb_light_source_fluorlamp_d,
191 } ia_3a_awb_light_source;
194 ia_3a_awb_map_auto, /* Select based on scene brightness */
195 ia_3a_awb_map_indoor, /* Always use Indoor map */
196 ia_3a_awb_map_outdoor /* Always use Outdoor map */
202 ia_3a_af_mode_manual,
209 ia_3a_af_status_error, /* Cannot focus */
210 ia_3a_af_status_success, /* Successfully focussed */
211 ia_3a_af_status_cancelled, /* Canceled by user */
212 ia_3a_af_status_busy, /* Busy focussing */
213 ia_3a_af_status_idle /* AF not running */
218 ia_3a_af_range_macro,
223 ia_3a_af_metering_mode_auto,
224 ia_3a_af_metering_mode_spot, /* set window using ia_3a_af_set_window() */
225 ia_3a_af_metering_mode_multi,
226 } ia_3a_af_metering_mode;
228 /* Makernote support */
231 * \brief Maker note data target.
232 * Used in function ia_3a_mknote_get() to indicate which data section is wanted from the makernote.
235 ia_3a_mknote_mode_jpeg, /* Returns makernote data for JPEG EXIF */
236 ia_3a_mknote_mode_raw /* Returns makernote data for RAW Header */
240 * \brief Structure containing the pointer and size of the makernote data section.
241 * Function ia_3a_mknote_get() returns this structure filled.
249 * \brief Data Format ID (DFID) enumeration describes data type of the Data field in the MKN record.
250 * This enum must not be modified.
253 ia_3a_mknote_field_type_first_record = 0,
255 /*! Standard integer data types */
256 ia_3a_mknote_field_type_int8, /*!< 8-bit, int. values, range: -1128 to 127 */
257 ia_3a_mknote_field_type_uint8, /*!< 8-bit, int. values, range: 0 to 255 */
258 ia_3a_mknote_field_type_int16, /*!< 16-bit, int. values, range: -32768 to 32767 */
259 ia_3a_mknote_field_type_uint16, /*!< 16-bit, int. values, range: 0 to 65535 */
260 ia_3a_mknote_field_type_int32, /*!< 32-bit, int. values, range: -2147483648 to 2147483647 */
261 ia_3a_mknote_field_type_uint32, /*!< 32-bit, int. values, range: 0 to 4294967295 */
262 /* TODO: do we need these lint32 and ulint32? */
263 ia_3a_mknote_field_type_lint32, /*!< 32-bit, int. values, range: -2147483648 to 2147483647 */
264 ia_3a_mknote_field_type_ulint32, /*!< 32-bit, int. values, range: 0 to 4294967295 */
265 ia_3a_mknote_field_type_int64, /*!< 64-bit, int. values, range: -9223372036854775808 to 9223372036854775807 */
266 ia_3a_mknote_field_type_uint64, /*!< 64-bit, int. values, range: 0 to 18446744073709551615 */
268 /*! Non-standard data type */
269 ia_3a_mknote_field_type_uint8_array, /*!< Binary array with unsigned char data */
270 ia_3a_mknote_field_type_ascii_string, /*!< NULL-terminated string in ASCII format */
271 } ia_3a_mknote_field_type;
274 * \brief Data Name ID (DNID) enumeration describes a name (or functionality) of data in the Data field.
277 ia_3a_mknote_field_name_first_record = 255, /* <----- Do not remove this! */
278 ia_3a_mknote_field_name_raw_info,
279 } ia_3a_mknote_field_name;
282 * \brief NVM parsing status codes.
283 * Note. This is a copy of enum used in the NVM parser. Make sure this is in sync.
287 ia_3a_nvm_semco_error_none, /*!< No error. */
288 ia_3a_nvm_semco_error_internal, /*!< Parser internal failure (not enough memory). */
289 ia_3a_nvm_semco_error_no_data, /*!< NULL pointer as input. */
290 ia_3a_nvm_semco_error_af, /*!< Error parsing AF parameters. */
291 ia_3a_nvm_semco_error_lsc, /*!< Error parsing AF parameters. (lsc dimensions, lsc data) */
292 ia_3a_nvm_semco_error_awb, /*!< Error parsing AWB parameters (sensitivities, n_lights). */
293 ia_3a_nvm_semco_error_crc, /*!< CRC check error. */
294 ia_3a_nvm_semco_error_not_used, /*!< No error in NVM data but NVM data is not used. */
295 } ia_3a_nvm_semco_error;
297 #endif /* _IA_3A_TYPES_H_ */