xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/iq_parser_v2/ccm_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 __CCM_UAPI_HEAD_H__
19 #define __CCM_UAPI_HEAD_H__
20 
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #define RK_AIQ_ACCM_COLOR_GAIN_NUM 4
27 #ifndef CCM_CURVE_DOT_NUM
28 #define CCM_CURVE_DOT_NUM 17
29 #endif
30 #ifndef CCM_CURVE_DOT_NUM_V2
31 #define CCM_CURVE_DOT_NUM_V2 18
32 #endif
33 
34 typedef struct rk_aiq_ccm_mccm_attrib_s {
35     // M4_ARRAY_DESC("ccMatrix", "f32", M4_SIZE(3,3), M4_RANGE(-8,7.992), "[1,0,0,0,1,0,0,0,1]", M4_DIGIT(4), M4_DYNAMIC(0))
36     float  ccMatrix[9];
37     // M4_ARRAY_DESC("ccOffsets", "f32", M4_SIZE(1,3), M4_RANGE(-4095,4095), "0", M4_DIGIT(1), M4_DYNAMIC(0))
38     float  ccOffsets[3];
39     // M4_ARRAY_DESC("y_alpha_curve", "f32", M4_SIZE(1,17), M4_RANGE(-4095,4095), "1024", M4_DIGIT(0), M4_DYNAMIC(0))
40     float  y_alpha_curve[CCM_CURVE_DOT_NUM];
41     // M4_NUMBER_DESC("bound pos bit", "f32", M4_RANGE(4, 10), "8", M4_DIGIT(0))
42     float low_bound_pos_bit;
43 } rk_aiq_ccm_mccm_attrib_t;
44 
45 typedef struct rk_aiq_ccm_mccm_attrib_v2_s {
46     // M4_ARRAY_DESC("ccMatrix", "f32", M4_SIZE(3,3), M4_RANGE(-8,7.992), "[1,0,0,0,1,0,0,0,1]", M4_DIGIT(4), M4_DYNAMIC(0))
47     float ccMatrix[9];
48     // M4_ARRAY_DESC("ccOffsets", "f32", M4_SIZE(1,3), M4_RANGE(-4095,4095), "0", M4_DIGIT(1), M4_DYNAMIC(0))
49     float ccOffsets[3];
50     // M4_BOOL_DESC("high Y adjust enable", "1")
51     bool highy_adj_en;
52     // M4_BOOL_DESC("asym enable", "0")
53     bool asym_enable;
54     // M4_NUMBER_DESC("left bound pos bit", "f32", M4_RANGE(3, 11), "10", M4_DIGIT(0))
55     float bound_pos_bit;  // low y alpha adjust
56     // M4_NUMBER_DESC("right bound pos bit", "f32", M4_RANGE(3, 11), "10", M4_DIGIT(0))
57     float right_pos_bit;  // high y alpha adjust
58     // M4_ARRAY_DESC("y alpha curve", "f32", M4_SIZE(1,18), M4_RANGE(-4095,4095), "1024", M4_DIGIT(0), M4_DYNAMIC(0))
59     float y_alpha_curve[CCM_CURVE_DOT_NUM_V2];
60     // M4_NUMBER_DESC("ccm enhance enable", "u8", M4_RANGE(0, 1), "0", M4_DIGIT(0))
61     unsigned short enh_adj_en;
62     // M4_ARRAY_DESC("Enhance RGB2Y para", "u8", M4_SIZE(1,3), M4_RANGE(0,128), "[38 75 15]", M4_DIGIT(0),  M4_DYNAMIC(0))
63     unsigned char enh_rgb2y_para[3];
64     // M4_NUMBER_DESC("Enhance ratio max", "f32", M4_RANGE(0, 8), "0", M4_DIGIT(1))
65     float enh_rat_max;
66 } rk_aiq_ccm_mccm_attrib_v2_t;
67 
68 typedef enum rk_aiq_ccm_op_mode_s {
69     RK_AIQ_CCM_MODE_INVALID                     = 0,        /**< initialization value */
70     RK_AIQ_CCM_MODE_MANUAL                      = 1,        /**< run manual lens shading correction */
71     RK_AIQ_CCM_MODE_AUTO                        = 2,        /**< run auto lens shading correction */
72     RK_AIQ_CCM_MODE_MAX
73 } rk_aiq_ccm_op_mode_t;
74 
75 typedef struct rk_aiq_ccm_querry_info_s {
76     bool ccm_en;
77     // M4_ARRAY_DESC("ccMatrix", "f32", M4_SIZE(3,3), M4_RANGE(-8,7.992), "[1,0,0,0,1,0,0,0,1]", M4_DIGIT(4), M4_DYNAMIC(0), "0", "1")
78     float ccMatrix[9];
79     // M4_ARRAY_DESC("ccOffsets", "f32", M4_SIZE(1,3), M4_RANGE(-4095,4095), "0", M4_DIGIT(0), M4_DYNAMIC(0), "0", "1")
80     float ccOffsets[3];
81     bool highy_adj_en;
82     bool asym_enable;
83     float y_alpha_curve[CCM_CURVE_DOT_NUM_V2];
84     // M4_NUMBER_DESC("bound pos bit", "f32", M4_RANGE(3, 11), "8", M4_DIGIT(0), "0", "1")
85     float low_bound_pos_bit;
86     // M4_NUMBER_DESC("high bound pos bit", "f32", M4_RANGE(3, 11), "8", M4_DIGIT(0), "0", "1")
87     float right_pos_bit;
88     float color_inhibition_level;
89     float color_saturation_level;
90     // M4_NUMBER_DESC("CCM Saturation", "f32", M4_RANGE(0,200), "0", M4_DIGIT(2), "0", "1")
91     float finalSat;
92     // M4_STRING_DESC("usedCcm1", M4_SIZE(1,1), M4_RANGE(0, 25), "A_100",M4_DYNAMIC(0), "0", "1")
93     char ccmname1[25];
94     // M4_STRING_DESC("usedCcm2", M4_SIZE(1,1), M4_RANGE(0, 25), "A_100",M4_DYNAMIC(0), "0", "1")
95     char ccmname2[25];
96 } rk_aiq_ccm_querry_info_t;
97 
98 
99 #ifdef __cplusplus
100 }
101 #endif
102 
103 
104 #endif  /*__AWB_UAPI_HEAD_H__*/
105