21#ifndef __INCLUDE_NUTTX_VIDEO_IMGSENSOR_H
22#define __INCLUDE_NUTTX_VIDEO_IMGSENSOR_H
37#define IMGSENSOR_ID_BRIGHTNESS (0x00000100)
38#define IMGSENSOR_ID_CONTRAST (0x00000101)
39#define IMGSENSOR_ID_SATURATION (0x00000102)
40#define IMGSENSOR_ID_HUE (0x00000103)
41#define IMGSENSOR_ID_AUTO_WHITE_BALANCE (0x00000104)
42#define IMGSENSOR_ID_RED_BALANCE (0x00000105)
43#define IMGSENSOR_ID_BLUE_BALANCE (0x00000106)
44#define IMGSENSOR_ID_GAMMA (0x00000107)
45#define IMGSENSOR_ID_GAMMA_CURVE (0x00000108)
46#define IMGSENSOR_ID_EXPOSURE (0x00000109)
47#define IMGSENSOR_ID_HFLIP_VIDEO (0x0000010a)
48#define IMGSENSOR_ID_VFLIP_VIDEO (0x0000010b)
49#define IMGSENSOR_ID_HFLIP_STILL (0x0000010c)
50#define IMGSENSOR_ID_VFLIP_STILL (0x0000010d)
51#define IMGSENSOR_ID_SHARPNESS (0x0000010e)
52#define IMGSENSOR_ID_COLOR_KILLER (0x0000010f)
53#define IMGSENSOR_ID_COLORFX (0x00000110)
54#define IMGSENSOR_ID_AUTOBRIGHTNESS (0x00000111)
55#define IMGSENSOR_ID_ROTATE (0x00000112)
56#define IMGSENSOR_ID_EXPOSURE_AUTO (0x00000200)
57#define IMGSENSOR_ID_EXPOSURE_ABSOLUTE (0x00000201)
58#define IMGSENSOR_ID_FOCUS_ABSOLUTE (0x00000202)
59#define IMGSENSOR_ID_FOCUS_RELATIVE (0x00000203)
60#define IMGSENSOR_ID_FOCUS_AUTO (0x00000204)
61#define IMGSENSOR_ID_ZOOM_ABSOLUTE (0x00000205)
62#define IMGSENSOR_ID_ZOOM_RELATIVE (0x00000206)
63#define IMGSENSOR_ID_ZOOM_CONTINUOUS (0x00000207)
64#define IMGSENSOR_ID_IRIS_ABSOLUTE (0x00000208)
65#define IMGSENSOR_ID_IRIS_RELATIVE (0x00000209)
66#define IMGSENSOR_ID_AUTO_N_PRESET_WB (0x0000020a)
67#define IMGSENSOR_ID_WIDE_DYNAMIC_RANGE (0x0000020b)
68#define IMGSENSOR_ID_IMG_STABILIZATION (0x0000020c)
69#define IMGSENSOR_ID_ISO_SENSITIVITY (0x0000020d)
70#define IMGSENSOR_ID_ISO_SENSITIVITY_AUTO (0x0000020e)
71#define IMGSENSOR_ID_EXPOSURE_METERING (0x0000020f)
72#define IMGSENSOR_ID_SPOT_POSITION (0x00000216)
73#define IMGSENSOR_ID_3A_LOCK (0x00000211)
74#define IMGSENSOR_ID_AUTO_FOCUS_START (0x00000212)
75#define IMGSENSOR_ID_AUTO_FOCUS_STOP (0x00000213)
76#define IMGSENSOR_ID_3A_PARAMETER (0x00000214)
77#define IMGSENSOR_ID_3A_STATUS (0x00000215)
78#define IMGSENSOR_ID_FLASH_LED_MODE (0x00000300)
79#define IMGSENSOR_ID_JPEG_QUALITY (0x00000400)
80#define IMGSENSOR_ID_CLIP_VIDEO (0xFFFF0000)
81#define IMGSENSOR_ID_CLIP_STILL (0xFFFF0001)
87#define IMGSENSOR_CLIP_NELEM (4)
93#define IMGSENSOR_CLIP_INDEX_LEFT (0)
94#define IMGSENSOR_CLIP_INDEX_TOP (1)
95#define IMGSENSOR_CLIP_INDEX_WIDTH (2)
96#define IMGSENSOR_CLIP_INDEX_HEIGHT (3)
100#define IMGSENSOR_LOCK_EXPOSURE (1 << 0)
101#define IMGSENSOR_LOCK_WHITE_BALANCE (1 << 1)
102#define IMGSENSOR_LOCK_FOCUS (1 << 2)
106#define IMGSENSOR_3A_STATUS_STABLE (0)
107#define IMGSENSOR_3A_STATUS_AE_OPERATING (1 << 0)
108#define IMGSENSOR_3A_STATUS_AWB_OPERATING (1 << 1)
109#define IMGSENSOR_3A_STATUS_AF_OPERATING (1 << 2)
113#define IMGSENSOR_FMT_MAX (2)
114#define IMGSENSOR_FMT_MAIN (0)
115#define IMGSENSOR_FMT_SUB (1)
116#define IMGSENSOR_PIX_FMT_UYVY (0)
117#define IMGSENSOR_PIX_FMT_RGB565 (1)
118#define IMGSENSOR_PIX_FMT_JPEG (2)
119#define IMGSENSOR_PIX_FMT_JPEG_WITH_SUBIMG (3)
120#define IMGSENSOR_PIX_FMT_SUBIMG_UYVY (4)
121#define IMGSENSOR_PIX_FMT_SUBIMG_RGB565 (5)
122#define IMGSENSOR_PIX_FMT_YUYV (6)
123#define IMGSENSOR_PIX_FMT_YUV420P (7)
124#define IMGSENSOR_PIX_FMT_NV12 (8)
128#define IMGSENSOR_IS_AVAILABLE(s) \
129 ((s)->ops->is_available ? (s)->ops->is_available(s) : false)
130#define IMGSENSOR_INIT(s) \
131 ((s)->ops->init ? (s)->ops->init(s) : -ENOTTY)
132#define IMGSENSOR_UNINIT(s) \
133 ((s)->ops->uninit ? (s)->ops->uninit(s) : -ENOTTY)
134#define IMGSENSOR_GET_DRIVER_NAME(s) \
135 ((s)->ops->get_driver_name ? (s)->ops->get_driver_name(s) : NULL)
136#define IMGSENSOR_VALIDATE_FRAME_SETTING(s, t, n, f, i) \
137 ((s)->ops->validate_frame_setting ? \
138 (s)->ops->validate_frame_setting(s, t, n, f, i) : -ENOTTY)
139#define IMGSENSOR_START_CAPTURE(s, t, n, f, i) \
140 ((s)->ops->start_capture ? \
141 (s)->ops->start_capture(s, t, n, f, i) : -ENOTTY)
142#define IMGSENSOR_STOP_CAPTURE(s, t) \
143 ((s)->ops->stop_capture ? (s)->ops->stop_capture(s, t) : -ENOTTY)
144#define IMGSENSOR_GET_FRAME_INTERVAL(s, t, i) \
145 ((s)->ops->get_frame_interval ? \
146 (s)->ops->get_frame_interval(s, t, i) : -ENOTTY)
147#define IMGSENSOR_GET_SUPPORTED_VALUE(s, i, v) \
148 ((s)->ops->get_supported_value ? \
149 (s)->ops->get_supported_value(s, i, v) : -ENOTTY)
150#define IMGSENSOR_GET_VALUE(s, i, l, v) \
151 ((s)->ops->get_value ? (s)->ops->get_value(s, i, l, v) : -ENOTTY)
152#define IMGSENSOR_SET_VALUE(s, i, l, v) \
153 ((s)->ops->set_value ? (s)->ops->set_value(s, i, l, v) : -ENOTTY)
161typedef enum imgsensor_colorfx_e
163 IMGSENSOR_COLORFX_NONE = 0,
164 IMGSENSOR_COLORFX_BW = 1,
165 IMGSENSOR_COLORFX_SEPIA = 2,
166 IMGSENSOR_COLORFX_NEGATIVE = 3,
167 IMGSENSOR_COLORFX_EMBOSS = 4,
168 IMGSENSOR_COLORFX_SKETCH = 5,
169 IMGSENSOR_COLORFX_SKY_BLUE = 6,
170 IMGSENSOR_COLORFX_GRASS_GREEN = 7,
171 IMGSENSOR_COLORFX_SKIN_WHITEN = 8,
172 IMGSENSOR_COLORFX_VIVID = 9,
173 IMGSENSOR_COLORFX_AQUA = 10,
174 IMGSENSOR_COLORFX_ART_FREEZE = 11,
175 IMGSENSOR_COLORFX_SILHOUETTE = 12,
176 IMGSENSOR_COLORFX_SOLARIZATION = 13,
177 IMGSENSOR_COLORFX_ANTIQUE = 14,
178 IMGSENSOR_COLORFX_SET_CBCR = 15,
179 IMGSENSOR_COLORFX_PASTEL = 16,
180} imgsensor_colorfx_t;
184typedef enum imgsensor_exposure_auto_type_e
188 IMGSENSOR_EXPOSURE_AUTO = 0,
192 IMGSENSOR_EXPOSURE_MANUAL = 1,
196 IMGSENSOR_EXPOSURE_SHUTTER_PRIORITY = 2,
200 IMGSENSOR_EXPOSURE_APERTURE_PRIORITY = 3
201} imgsensor_exposure_auto_type_t;
205typedef enum imgsensor_white_balance_e
207 IMGSENSOR_WHITE_BALANCE_MANUAL = 0,
208 IMGSENSOR_WHITE_BALANCE_AUTO = 1,
209 IMGSENSOR_WHITE_BALANCE_INCANDESCENT = 2,
210 IMGSENSOR_WHITE_BALANCE_FLUORESCENT = 3,
211 IMGSENSOR_WHITE_BALANCE_FLUORESCENT_H = 4,
212 IMGSENSOR_WHITE_BALANCE_HORIZON = 5,
213 IMGSENSOR_WHITE_BALANCE_DAYLIGHT = 6,
214 IMGSENSOR_WHITE_BALANCE_FLASH = 7,
215 IMGSENSOR_WHITE_BALANCE_CLOUDY = 8,
216 IMGSENSOR_WHITE_BALANCE_SHADE = 9,
217} imgsensor_white_balance_t;
221typedef enum imgsensor_iso_sensitivity_auto_type_e
223 IMGSENSOR_ISO_SENSITIVITY_MANUAL = 0,
224 IMGSENSOR_ISO_SENSITIVITY_AUTO = 1,
225} imgsensor_iso_sensitivity_auto_type_t;
229typedef enum imgsensor_exposure_metering_e
231 IMGSENSOR_EXPOSURE_METERING_AVERAGE = 0,
232 IMGSENSOR_EXPOSURE_METERING_CENTER_WEIGHTED = 1,
233 IMGSENSOR_EXPOSURE_METERING_SPOT = 2,
234 IMGSENSOR_EXPOSURE_METERING_MATRIX = 3,
235} imgsensor_exposure_metering_t;
239typedef enum imgsensor_flash_led_mode_e
241 IMGSENSOR_FLASH_LED_MODE_NONE = 0,
242 IMGSENSOR_FLASH_LED_MODE_FLASH = 1,
243 IMGSENSOR_FLASH_LED_MODE_TORCH = 2,
244} imgsensor_flash_led_mode_t;
248typedef enum imgsensor_ctrl_type_e
250 IMGSENSOR_CTRL_TYPE_INTEGER = 1,
251 IMGSENSOR_CTRL_TYPE_BOOLEAN = 2,
252 IMGSENSOR_CTRL_TYPE_INTEGER64 = 5,
253 IMGSENSOR_CTRL_TYPE_BITMASK = 8,
254 IMGSENSOR_CTRL_TYPE_INTEGER_MENU = 9,
255 IMGSENSOR_CTRL_TYPE_U8FIXEDPOINT_Q7 = 10,
256 IMGSENSOR_CTRL_TYPE_U16FIXEDPOINT_Q8 = 11,
257 IMGSENSOR_CTRL_TYPE_INTEGER_TIMES_3 = 12,
258 IMGSENSOR_CTRL_TYPE_U8 = 0x0100,
259 IMGSENSOR_CTRL_TYPE_U16 = 0x0101,
260 IMGSENSOR_CTRL_TYPE_U32 = 0x0102,
261} imgsensor_ctrl_type_t;
265typedef enum imgsensor_stream_type_e
267 IMGSENSOR_STREAM_TYPE_VIDEO = 0,
268 IMGSENSOR_STREAM_TYPE_STILL = 1,
269} imgsensor_stream_type_t;
277 uint32_t pixelformat;
283 uint32_t denominator;
293 int64_t default_value;
299 FAR
const int32_t *values;
300 int32_t default_value;
313 imgsensor_ctrl_type_t type;
358 CODE bool (*is_available)(FAR
struct imgsensor_s *sensor);
360 CODE int (*uninit)(FAR
struct imgsensor_s *sensor);
361 CODE
const char * (*get_driver_name)(FAR
struct imgsensor_s *sensor);
362 CODE int (*validate_frame_setting)(FAR
struct imgsensor_s *sensor,
363 imgsensor_stream_type_t type,
367 CODE int (*start_capture)(FAR
struct imgsensor_s *sensor,
368 imgsensor_stream_type_t type,
372 CODE int (*stop_capture)(FAR
struct imgsensor_s *sensor,
373 imgsensor_stream_type_t type);
374 CODE int (*get_frame_interval)(FAR
struct imgsensor_s *sensor,
375 imgsensor_stream_type_t type,
377 CODE int (*get_supported_value)(FAR
struct imgsensor_s *sensor,
380 CODE int (*get_value)(FAR
struct imgsensor_s *sensor,
381 uint32_t id, uint32_t size,
383 CODE int (*set_value)(FAR
struct imgsensor_s *sensor,
384 uint32_t id, uint32_t size,
399#define EXTERN extern "C"
412int imgsensor_register(FAR
struct imgsensor_s *sensor);
Definition: imgsensor.h:297
Definition: imgsensor.h:304
Definition: imgsensor.h:289
Definition: imgsensor.h:281
Definition: imgsensor.h:357
Definition: imgsensor.h:394
Definition: imgsensor.h:312
Definition: imgsensor.h:345