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