xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/adehaze_uapi_head.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *  Copyright (c) 2021 Rockchip Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef __ADEHAZE_UAPI_HEAD_H__
19 #define __ADEHAZE_UAPI_HEAD_H__
20 
21 #include "adehaze_head.h"
22 
23 typedef struct mDehazeDataV11_s {
24     // M4_NUMBER_DESC("dc_min_th", "f32", M4_RANGE(0,255), "64", M4_DIGIT(4))
25     float dc_min_th;
26     // M4_NUMBER_DESC("dc_max_th", "f32", M4_RANGE(0,255), "192", M4_DIGIT(4))
27     float dc_max_th;
28     // M4_NUMBER_DESC("yhist_th", "f32", M4_RANGE(0,255), "249", M4_DIGIT(4))
29     float yhist_th;
30     // M4_NUMBER_DESC("yblk_th", "f32", M4_RANGE(0,512), "0.002", M4_DIGIT(4))
31     float yblk_th;
32     // M4_NUMBER_DESC("dark_th", "f32", M4_RANGE(0,255), "250", M4_DIGIT(4))
33     float dark_th;
34     // M4_NUMBER_DESC("bright_min", "f32", M4_RANGE(0,255), "180", M4_DIGIT(4))
35     float bright_min;
36     // M4_NUMBER_DESC("bright_max", "f32", M4_RANGE(0,255), "240", M4_DIGIT(4))
37     float bright_max;
38     // M4_NUMBER_DESC("wt_max", "f32", M4_RANGE(0,1), "0.9", M4_DIGIT(4))
39     float wt_max;
40     // M4_NUMBER_DESC("air_min", "f32", M4_RANGE(0,255), "200", M4_DIGIT(4))
41     float air_min;
42     // M4_NUMBER_DESC("air_max", "f32", M4_RANGE(0,255), "250", M4_DIGIT(4))
43     float air_max;
44     // M4_NUMBER_DESC("tmax_base", "f32", M4_RANGE(0,255), "125", M4_DIGIT(4))
45     float tmax_base;
46     // M4_NUMBER_DESC("tmax_off", "f32", M4_RANGE(0,1), "0.1", M4_DIGIT(4))
47     float tmax_off;
48     // M4_NUMBER_DESC("tmax_max", "f32", M4_RANGE(0,1), "0.8", M4_DIGIT(4))
49     float tmax_max;
50     // M4_NUMBER_DESC("cfg_wt", "f32", M4_RANGE(0,1), "0.8", M4_DIGIT(4))
51     float cfg_wt;
52     // M4_NUMBER_DESC("cfg_air", "f32", M4_RANGE(0,255), "210", M4_DIGIT(4))
53     float cfg_air;
54     // M4_NUMBER_DESC("cfg_tmax", "f32", M4_RANGE(0,1), "0.2", M4_DIGIT(4))
55     float cfg_tmax;
56     // M4_NUMBER_DESC("dc_weitcur", "f32", M4_RANGE(0,1), "1", M4_DIGIT(4))
57     float dc_weitcur;
58     // M4_NUMBER_DESC("bf_weight", "f32", M4_RANGE(0,1), "0.5", M4_DIGIT(4))
59     float bf_weight;
60     // M4_NUMBER_DESC("range_sigma", "f32", M4_RANGE(0,1), "0.04", M4_DIGIT(4))
61     float range_sigma;
62     // M4_NUMBER_DESC("space_sigma_pre", "f32", M4_RANGE(0,1), "0.4", M4_DIGIT(4))
63     float space_sigma_pre;
64     // M4_NUMBER_DESC("space_sigma_cur", "f32", M4_RANGE(0,1), "0.8", M4_DIGIT(4))
65     float space_sigma_cur;
66 } mDehazeDataV11_t;
67 
68 typedef struct mDehaze_setting_v11_s {
69     // M4_BOOL_DESC("en", "1")
70     bool en;
71     // M4_BOOL_DESC("air_lc_en", "1")
72     bool air_lc_en;
73     // M4_NUMBER_DESC("stab_fnum", "f32", M4_RANGE(0,31), "8", M4_DIGIT(0))
74     float stab_fnum;
75     // M4_NUMBER_DESC("sigma", "f32", M4_RANGE(1,255), "255", M4_DIGIT(0))
76     float sigma;
77     // M4_NUMBER_DESC("wt_sigma", "f32", M4_RANGE(0,256), "8.0", M4_DIGIT(4))
78     float wt_sigma;
79     // M4_NUMBER_DESC("air_sigma", "f32", M4_RANGE(4,1024), "120.0", M4_DIGIT(4))
80     float air_sigma;
81     // M4_NUMBER_DESC("tmax_sigma", "f32", M4_RANGE(0.0004,1), "0.0100", M4_DIGIT(4))
82     float tmax_sigma;
83     // M4_NUMBER_DESC("pre_wet", "f32", M4_RANGE(0,16), "8", M4_DIGIT(0))
84     float pre_wet;
85     // M4_STRUCT_DESC("DehazeData", "normal_ui_style")
86     mDehazeDataV11_t DehazeData;
87 } mDehaze_setting_v11_t;
88 
89 typedef struct mEnhanceDataV11_s {
90     // M4_NUMBER_DESC("enhance_value", "f32", M4_RANGE(0,32), "1", M4_DIGIT(4))
91     float enhance_value;
92     // M4_NUMBER_DESC("enhance_chroma", "f32", M4_RANGE(0,32), "1", M4_DIGIT(4))
93     float enhance_chroma;
94 } mEnhanceDataV11_t;
95 
96 typedef struct mEnhance_setting_v11_s {
97     // M4_BOOL_DESC("en", "1")
98     bool en;
99     // M4_ARRAY_DESC("enhance_curve", "f32", M4_SIZE(1,17),  M4_RANGE(0, 1024), "[0,64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1023]", M4_DIGIT(0), M4_DYNAMIC(0))
100     float enhance_curve[DHAZ_ENHANCE_CURVE_KNOTS_NUM];
101     // M4_STRUCT_DESC("EnhanceData", "normal_ui_style")
102     mEnhanceDataV11_t EnhanceData;
103 } mEnhance_setting_v11_t;
104 
105 typedef struct mHistDataV11_s {
106     // M4_NUMBER_DESC("hist_gratio", "f32", M4_RANGE(0,32), "4", M4_DIGIT(4))
107     float hist_gratio;
108     // M4_NUMBER_DESC("hist_th_off", "f32", M4_RANGE(0,255), "64", M4_DIGIT(4))
109     float hist_th_off;
110     // M4_NUMBER_DESC("hist_k", "f32", M4_RANGE(0,8), "2", M4_DIGIT(4))
111     float hist_k;
112     // M4_NUMBER_DESC("hist_min", "f32", M4_RANGE(0,2), "0.016", M4_DIGIT(4))
113     float hist_min;
114     // M4_NUMBER_DESC("hist_scale", "f32", M4_RANGE(0,32), "0.09", M4_DIGIT(4))
115     float hist_scale;
116     // M4_NUMBER_DESC("cfg_gratio", "f32", M4_RANGE(0,32), "2", M4_DIGIT(4))
117     float cfg_gratio;
118 } mHistDataV11_t;
119 
120 typedef struct mHist_setting_v11_s {
121     // M4_BOOL_DESC("en", "1")
122     bool en;
123     // M4_BOOL_DESC("hist_para_en", "1")
124     bool hist_para_en;
125     // M4_STRUCT_DESC("HistData", "normal_ui_style")
126     mHistDataV11_t HistData;
127 } mHist_setting_v11_t;
128 
129 typedef struct mDehazeAttrV11_s {
130     // M4_BOOL_DESC("Enable", "1")
131     bool Enable;
132     // M4_NUMBER_DESC("cfg_alpha", "f32", M4_RANGE(0,1), "1", M4_DIGIT(4))
133     float cfg_alpha;
134     // M4_STRUCT_DESC("dehaze_setting", "normal_ui_style")
135     mDehaze_setting_v11_t dehaze_setting;
136     // M4_STRUCT_DESC("enhance_setting", "normal_ui_style")
137     mEnhance_setting_v11_t enhance_setting;
138     // M4_STRUCT_DESC("hist_setting", "normal_ui_style")
139     mHist_setting_v11_t hist_setting;
140 } mDehazeAttrV11_t;
141 
142 typedef struct mDehazeAttrInfoV11_s {
143     // M4_NUMBER_DESC("ISO", "f32", M4_RANGE(50,1000000000), "0", M4_DIGIT(4))
144     float ISO;
145     // M4_NUMBER_DESC("EnvLv", "f32", M4_RANGE(0,1), "0", M4_DIGIT(6))
146     float EnvLv;
147     // M4_BOOL_DESC("updateMDehazeStrth", "0", "1")
148     bool updateMDehazeStrth;
149     // M4_NUMBER_DESC("MDehazeStrth", "u8", M4_RANGE(0,100), "50", M4_DIGIT(0))
150     unsigned int MDehazeStrth;
151     // M4_BOOL_DESC("updateMEnhanceStrth", "0", "1")
152     bool updateMEnhanceStrth;
153     // M4_NUMBER_DESC("MEnhanceStrth", "u8", M4_RANGE(0,100), "50", M4_DIGIT(0))
154     unsigned int MEnhanceStrth;
155     // M4_BOOL_DESC("updateMEnhanceChromeStrth", "0", "1")
156     bool updateMEnhanceChromeStrth;
157     // M4_NUMBER_DESC("MEnhanceChromeStrth", "u8", M4_RANGE(0,100), "50", M4_DIGIT(0))
158     unsigned int MEnhanceChromeStrth;
159 } mDehazeAttrInfoV11_t;
160 
161 typedef struct mEnhanceDataV12_s {
162     // M4_ARRAY_DESC("enhance_curve", "f32", M4_SIZE(1,17),  M4_RANGE(0, 1023), "[0,64,128,192,256,320,384,448,512,576,640,704,768,832,896,960,1023]", M4_DIGIT(0), M4_DYNAMIC(0))
163     float enhance_curve[DHAZ_ENHANCE_CURVE_KNOTS_NUM];
164     // M4_ARRAY_DESC("enh_luma", "f32", M4_SIZE(1,17),	M4_RANGE(0, 16), "[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]", M4_DIGIT(2), M4_DYNAMIC(0))
165     float enh_luma[DHAZ_ENHANCE_CURVE_KNOTS_NUM];
166     // M4_NUMBER_DESC("enhance_value", "f32", M4_RANGE(0,32), "1", M4_DIGIT(4))
167     float enhance_value;
168     // M4_NUMBER_DESC("enhance_chroma", "f32", M4_RANGE(0,32), "1", M4_DIGIT(4))
169     float enhance_chroma;
170 } mEnhanceDataV12_t;
171 
172 typedef struct mEnhance_setting_v12_s {
173     // M4_BOOL_DESC("en", "1")
174     bool en;
175     // M4_BOOL_DESC("color_deviate_en", "0")
176     bool color_deviate_en;
177     // M4_BOOL_DESC("enh_luma_en", "0")
178     bool enh_luma_en;
179     // M4_STRUCT_DESC("EnhanceData", "normal_ui_style")
180     mEnhanceDataV12_t EnhanceData;
181 } mEnhance_setting_v12_t;
182 
183 typedef struct mManual_curve_s {
184     // M4_ARRAY_MARK_DESC("curve_x", "u32", M4_SIZE(1,17),  M4_RANGE(0, 1023), "[0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1023]", M4_DIGIT(0), M4_DYNAMIC(0), 0)
185     int curve_x[DHAZ_V12_HIST_WR_CURVE_NUM];
186     // M4_ARRAY_MARK_DESC("curve_y", "u32", M4_SIZE(1,17),  M4_RANGE(0, 1023), "[0, 64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, 1023]", M4_DIGIT(0), M4_DYNAMIC(0), 0)
187     int curve_y[DHAZ_V12_HIST_WR_CURVE_NUM];
188 } mManual_curve_t;
189 
190 typedef struct mhist_wr_semiauto_s {
191     // M4_NUMBER_DESC("clim0", "f32", M4_RANGE(0.1,32), "1", M4_DIGIT(4))
192     float clim0;
193     // M4_NUMBER_DESC("clim1", "f32", M4_RANGE(0.1,32), "1", M4_DIGIT(4))
194     float clim1;
195     // M4_NUMBER_DESC("dark_th", "f32", M4_RANGE(0,1023), "1", M4_DIGIT(0))
196     float dark_th;
197 } mhist_wr_semiauto_t;
198 
199 typedef struct mHistWr_s {
200     // M4_ENUM_DESC("mode", "HistWrMode_t", "HIST_WR_MANUAL")
201     HistWrMode_t mode;
202     // M4_STRUCT_DESC("manual_curve", "normal_ui_style")
203     mManual_curve_t manual_curve;
204     // M4_STRUCT_DESC("semiauto_curve", "normal_ui_style")
205     mhist_wr_semiauto_t semiauto_curve;
206 } mHistWr_t;
207 
208 typedef struct mHist_setting_v12_s {
209     // M4_BOOL_DESC("en", "1")
210     bool en;
211     // M4_BOOL_DESC("hist_para_en", "1")
212     bool hist_para_en;
213     // M4_STRUCT_DESC("hist_wr", "normal_ui_style")
214     mHistWr_t hist_wr;
215     // M4_STRUCT_DESC("HistData", "normal_ui_style")
216     mHistDataV11_t HistData;
217 } mHist_setting_v12_t;
218 
219 typedef struct mDehazeAttrV12_s {
220     // M4_BOOL_DESC("Enable", "1")
221     bool Enable;
222     // M4_NUMBER_DESC("cfg_alpha", "f32", M4_RANGE(0,1), "1", M4_DIGIT(4))
223     float cfg_alpha;
224     // M4_STRUCT_DESC("dehaze_setting", "normal_ui_style")
225     mDehaze_setting_v11_t dehaze_setting;
226     // M4_STRUCT_DESC("enhance_setting", "normal_ui_style")
227     mEnhance_setting_v12_t enhance_setting;
228     // M4_STRUCT_DESC("hist_setting", "normal_ui_style")
229     mHist_setting_v12_t hist_setting;
230 } mDehazeAttrV12_t;
231 
232 #endif /*__ADEHAZE_UAPI_HEAD_H__*/
233