Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
libisp.h
Go to the documentation of this file.
1 #ifndef _LIBISP_H
2 #define _LIBISP_H
3 
4 #include "reg_avi.h"
6 
7 #define AVI_DEFINE_NODE(EXPANDER) \
8  EXPANDER(chain_bayer_inter) \
9  EXPANDER(vlformat_32to40) \
10  EXPANDER(pedestal) \
11  EXPANDER(green_imbalance) \
12  EXPANDER(green_imbalance_green_red_coeff_mem) \
13  EXPANDER(green_imbalance_green_blue_coeff_mem) \
14  EXPANDER(dead_pixel_correction) \
15  EXPANDER(dead_pixel_correction_list_mem) \
16  EXPANDER(denoising) \
17  EXPANDER(statistics_bayer) \
18  EXPANDER(lens_shading_correction) \
19  EXPANDER(lens_shading_correction_red_coeff_mem) \
20  EXPANDER(lens_shading_correction_green_coeff_mem) \
21  EXPANDER(lens_shading_correction_blue_coeff_mem) \
22  EXPANDER(chromatic_aberration) \
23  EXPANDER(bayer) \
24  EXPANDER(color_correction) \
25  EXPANDER(vlformat_40to32) \
26  EXPANDER(gamma_corrector) \
27  EXPANDER(gamma_corrector_ry_lut) \
28  EXPANDER(gamma_corrector_gu_lut) \
29  EXPANDER(gamma_corrector_bv_lut) \
30  EXPANDER(chroma) \
31  EXPANDER(statistics_yuv) \
32  EXPANDER(statistics_yuv_ae_histogram_y) \
33  EXPANDER(chain_yuv_inter) \
34  EXPANDER(edge_enhancement_color_reduction_filter) \
35  EXPANDER(edge_enhancement_color_reduction_filter_ee_lut) \
36  EXPANDER(i3d_lut) \
37  EXPANDER(i3d_lut_lut_outside) \
38  EXPANDER(i3d_lut_lut_inside) \
39  EXPANDER(drop)
40 
41 #define EXPAND_AS_ENUM(_node) \
42  _node,
43 
44 enum {
47 };
48 
49 /* ISP Context */
51  int devmem;
52  unsigned long avi_base;
53  unsigned offsets[ISP_NODE_NR];
54 };
55 
56 /* Configuration of ISP */
57 struct libisp_config {
74  /*struct avi_isp_chromatic_aberration_regs chromatic_aberration;*/
75  struct avi_isp_bayer_regs bayer;
86  eecrf_lut;
88 };
89 
90 /* Output YUV statistics */
98 };
99 
100 extern int configure_isp(struct v4l2_device *dev);
101 extern int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats);
102 extern int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end,
103  uint16_t x_odd_inc, uint16_t y_odd_inc);
104 
105 /* Registers access */
106 #define EXPAND_AS_PROTOTYPE(_node) \
107  void avi_isp_ ## _node ## _set_registers(struct libisp_context *, \
108  struct avi_isp_ ## _node ## _regs const *regs); \
109  void avi_isp_ ## _node ## _get_registers(struct libisp_context *, \
110  struct avi_isp_ ## _node ## _regs *regs);
111 
113 
114 #endif /* _LIBISP_H */
@ ISP_NODE_NR
Definition: libisp.h:46
unsigned long avi_base
Definition: libisp.h:52
struct avi_isp_gamma_corrector_gu_lut_regs gc_gu_lut
Gamma corrector GU lut.
Definition: libisp.h:80
struct avi_isp_edge_enhancement_color_reduction_filter_ee_lut_regs eecrf_lut
Edge enhancement + Color correction lut.
Definition: libisp.h:85
struct avi_isp_lens_shading_correction_regs lens_shading_correction
Lens shade correction.
Definition: libisp.h:67
int configure_isp(struct v4l2_device *dev)
Definition: libisp.c:177
struct avi_isp_gamma_corrector_ry_lut_regs gc_ry_lut
Gamma corrector RY lut.
Definition: libisp.h:79
struct avi_isp_green_imbalance_green_red_coeff_mem_regs grim_gr
Green imbalance GR coefficients.
Definition: libisp.h:62
uint32_t awb_nb_grey_pixels
Definition: libisp.h:95
uint32_t ae_histogram_Y[256]
Definition: libisp.h:97
uint32_t awb_sum_Y
Definition: libisp.h:92
struct avi_isp_color_correction_regs color_correction
Color correction parameters.
Definition: libisp.h:76
int isp_get_statistics_yuv(struct isp_yuv_stats_t *yuv_stats)
Definition: libisp.c:261
struct avi_isp_lens_shading_correction_red_coeff_mem_regs lsc_red_coeffs
Lens shade correction red coefficients.
Definition: libisp.h:68
struct avi_isp_vlformat_40to32_regs vlformat_40to32
Conversion factor (10bit to 10bit default)
Definition: libisp.h:77
#define AVI_DEFINE_NODE(EXPANDER)
Definition: libisp.h:7
struct avi_isp_gamma_corrector_bv_lut_regs gc_bv_lut
Gamma corrector BV lut.
Definition: libisp.h:81
struct avi_isp_edge_enhancement_color_reduction_filter_regs eecrf
Edge enhancement + Color reduction.
Definition: libisp.h:84
struct avi_isp_statistics_yuv_regs statistics_yuv
YUV statistics parameters.
Definition: libisp.h:83
struct avi_isp_chain_yuv_inter_regs chain_yuv_inter
YUV chain bypass configuration (enable/disable features)
Definition: libisp.h:87
struct avi_isp_statistics_bayer_regs statistics_bayer
Statistics bayer parameters.
Definition: libisp.h:66
struct avi_isp_lens_shading_correction_blue_coeff_mem_regs lsc_blue_coeffs
Lens shade correction blue coefficients.
Definition: libisp.h:72
uint32_t awb_sum_V
Definition: libisp.h:94
struct avi_isp_gamma_corrector_regs gamma_corrector
Gamma corrector (Curves)
Definition: libisp.h:78
int isp_request_statistics_yuv_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end, uint16_t x_odd_inc, uint16_t y_odd_inc)
Definition: libisp.c:214
struct avi_isp_chroma_regs chroma
Color space conversion.
Definition: libisp.h:82
struct avi_isp_bayer_regs bayer
< Chromatic abberation (Disabled for now)
Definition: libisp.h:75
struct avi_isp_green_imbalance_regs green_imbalance
Green imbalance correction.
Definition: libisp.h:61
struct avi_isp_chain_bayer_inter_regs bayer_inter
Enable or disable bayer ISP functions by bypassing them.
Definition: libisp.h:59
int devmem
Definition: libisp.h:51
struct avi_isp_dead_pixel_correction_regs dead_pixel_correction
Dead pixel correction (disabled)
Definition: libisp.h:64
struct avi_isp_lens_shading_correction_green_coeff_mem_regs lsc_green_coeffs
Lens shade correction green coefficients.
Definition: libisp.h:70
struct avi_isp_denoising_regs denoising
Denoising parameters.
Definition: libisp.h:65
struct avi_isp_green_imbalance_green_blue_coeff_mem_regs grim_gb
Green imbalance GB coefficients.
Definition: libisp.h:63
#define EXPAND_AS_ENUM(_node)
Definition: libisp.h:41
struct avi_isp_pedestal_regs pedestal
Pedestral parameters (substract from pixels)
Definition: libisp.h:60
#define EXPAND_AS_PROTOTYPE(_node)
Definition: libisp.h:106
struct avi_isp_vlformat_32to40_regs vlformat_32to40
Conversion factor (10bit to 10bit default)
Definition: libisp.h:58
uint32_t nb_valid_Y
Definition: libisp.h:96
uint32_t awb_sum_U
Definition: libisp.h:93
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
Capture images from a V4L2 device (Video for Linux 2)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
Definition: vl53l1_types.h:78