xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/adehaze_uapi_compact.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *  Copyright (c) 2023 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_COMPACT_H__
19 #define __ADEHAZE_UAPI_COMPACT_H__
20 
21 #include "adehaze_head.h"
22 
23 #define CALIBDB_ADEHAZE_ENHANCE_CURVE_KNOTS_NUM (DHAZ_ENHANCE_CURVE_KNOTS_NUM)
24 
25 typedef DehazeDataV11_t aDehazeDataV21_t;
26 
27 typedef struct aDehaze_Setting_V21_s {
28     // M4_BOOL_DESC("en", "1")
29     bool en;
30     // M4_BOOL_DESC("air_lc_en", "1")
31     bool air_lc_en;
32     // M4_NUMBER_DESC("stab_fnum", "f32", M4_RANGE(0,31), "8.0", M4_DIGIT(4))
33     float stab_fnum;
34     // M4_NUMBER_DESC("sigma", "f32", M4_RANGE(0,255), "6.0", M4_DIGIT(4))
35     float sigma;
36     // M4_NUMBER_DESC("wt_sigma", "f32", M4_RANGE(0,256), "8.0", M4_DIGIT(4))
37     float wt_sigma;
38     // M4_NUMBER_DESC("air_sigma", "f32", M4_RANGE(0,255), "120.0", M4_DIGIT(4))
39     float air_sigma;
40     // M4_NUMBER_DESC("tmax_sigma", "f32", M4_RANGE(0,1), "0.0100", M4_DIGIT(4))
41     float tmax_sigma;
42     // M4_NUMBER_DESC("pre_wet", "f32", M4_RANGE(0,1), "0.0100", M4_DIGIT(4))
43     float pre_wet;
44     // M4_STRUCT_DESC("DehazeData", "normal_ui_style")
45     aDehazeDataV21_t DehazeData;
46 } aDehaze_Setting_V21_t;
47 
48 typedef EnhanceDataV11_t aEnhanceDataV21_t;
49 
50 typedef struct aEnhance_Setting_V21_s {
51     // M4_BOOL_DESC("en", "1")
52     bool en;
53     // 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))
54     float enhance_curve[CALIBDB_ADEHAZE_ENHANCE_CURVE_KNOTS_NUM];
55     // M4_STRUCT_DESC("EnhanceData", "normal_ui_style")
56     aEnhanceDataV21_t EnhanceData;
57 } aEnhance_Setting_V21_t;
58 
59 typedef HistDataV11_t aHistDataV21_t;
60 
61 typedef struct aHist_setting_V21_s {
62     // M4_BOOL_DESC("en", "1")
63     bool en;
64     // M4_BOOL_DESC("hist_para_en", "1")
65     bool hist_para_en;
66     // M4_STRUCT_DESC("HistData", "normal_ui_style")
67     aHistDataV21_t HistData;
68 } aHist_setting_V21_t;
69 
70 typedef struct aDehazeAttrData_s {
71     // M4_BOOL_DESC("Enable", "1")
72     bool Enable;
73     // M4_ENUM_DESC("CtrlDataType", "CtrlDataType_t", "CTRLDATATYPE_ENVLV")
74     CtrlDataType_t CtrlDataType;
75     // M4_NUMBER_DESC("cfg_alpha", "f32", M4_RANGE(0,1), "1", M4_DIGIT(4))
76     float cfg_alpha;
77     // M4_NUMBER_DESC("ByPassThr", "f32", M4_RANGE(0,1), "0", M4_DIGIT(4))
78     float ByPassThr;
79     // M4_STRUCT_DESC("dehaze_setting", "normal_ui_style")
80     aDehaze_Setting_V21_t dehaze_setting;
81     // M4_STRUCT_DESC("enhance_setting", "normal_ui_style")
82     aEnhance_Setting_V21_t enhance_setting;
83     // M4_STRUCT_DESC("hist_setting", "normal_ui_style")
84     aHist_setting_V21_t hist_setting;
85 } aDehazeAttrData_t;
86 
87 typedef struct aDehazeAttr_s {
88     // M4_STRUCT_DESC("DehazeTuningPara", "normal_ui_style")
89     aDehazeAttrData_t DehazeTuningPara;
90 } aDehazeAttr_t;
91 
92 typedef mDehazeDataV11_t mDehazeDataV21_t;
93 
94 typedef struct mDehaze_Setting_V21_s {
95     // M4_BOOL_DESC("en", "1")
96     bool en;
97     // M4_BOOL_DESC("air_lc_en", "1")
98     bool air_lc_en;
99     // M4_NUMBER_DESC("stab_fnum", "f32", M4_RANGE(0,31), "8.0", M4_DIGIT(4))
100     float stab_fnum;
101     // M4_NUMBER_DESC("sigma", "f32", M4_RANGE(0,255), "6.0", M4_DIGIT(4))
102     float sigma;
103     // M4_NUMBER_DESC("wt_sigma", "f32", M4_RANGE(0,256), "8.0", M4_DIGIT(4))
104     float wt_sigma;
105     // M4_NUMBER_DESC("air_sigma", "f32", M4_RANGE(0,255), "120.0", M4_DIGIT(4))
106     float air_sigma;
107     // M4_NUMBER_DESC("tmax_sigma", "f32", M4_RANGE(0,1), "0.0100", M4_DIGIT(4))
108     float tmax_sigma;
109     // M4_NUMBER_DESC("pre_wet", "f32", M4_RANGE(0,1), "0.0100", M4_DIGIT(4))
110     float pre_wet;
111     // M4_STRUCT_DESC("DehazeData", "normal_ui_style")
112     mDehazeDataV21_t DehazeData;
113 } mDehaze_Setting_V21_t;
114 
115 typedef mEnhanceDataV11_t mEnhanceDataV21_t;
116 
117 typedef struct mEnhance_Setting_V21_s {
118     // M4_BOOL_DESC("en", "1")
119     bool en;
120     // 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))
121     float enhance_curve[CALIBDB_ADEHAZE_ENHANCE_CURVE_KNOTS_NUM];
122     // M4_STRUCT_DESC("EnhanceData", "normal_ui_style")
123     mEnhanceDataV21_t EnhanceData;
124 } mEnhance_Setting_V21_t;
125 
126 typedef mHistDataV11_t mHistDataV21_t;
127 
128 typedef struct mHist_setting_V21_s {
129     // M4_BOOL_DESC("en", "1")
130     bool en;
131     // M4_BOOL_DESC("hist_para_en", "1")
132     bool hist_para_en;
133     // M4_STRUCT_DESC("HistData", "normal_ui_style")
134     mHistDataV21_t HistData;
135 } mHist_setting_V21_t;
136 
137 typedef struct mDehazeAttr_s {
138     // M4_BOOL_DESC("Enable", "1")
139     bool Enable;
140     // M4_NUMBER_DESC("cfg_alpha", "f32", M4_RANGE(0,1), "1", M4_DIGIT(4))
141     float cfg_alpha;
142     // M4_STRUCT_DESC("dehaze_setting", "normal_ui_style")
143     mDehaze_Setting_V21_t dehaze_setting;
144     // M4_STRUCT_DESC("enhance_setting", "normal_ui_style")
145     mEnhance_Setting_V21_t enhance_setting;
146     // M4_STRUCT_DESC("hist_setting", "normal_ui_style")
147     mHist_setting_V21_t hist_setting;
148 } mDehazeAttr_t;
149 
150 typedef struct EnhanceManuAttr_s {
151     bool update;
152     int level;  // 0~100
153 } EnhanceManuAttr_t;
154 
155 typedef struct DehazeManuAttr_s {
156     bool update;
157     int level;  // 0~100
158 } DehazeManuAttr_t;
159 
160 typedef struct adehaze_sw_V2_s {
161     rk_aiq_uapi_sync_t sync;
162 
163     dehaze_api_mode_t mode;
164     aDehazeAttr_t stAuto;
165     mDehazeAttr_t stManual;
166     DehazeManuAttr_t stDehazeManu;
167     EnhanceManuAttr_t stEnhanceManu;
168 } adehaze_sw_V2_t;
169 
170 #endif /*__ADEHAZE_UAPI_COMPACT_H__*/
171