xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/algos/ablc/rk_aiq_types_ablc_algo_int.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 
2 /*
3  *rk_aiq_types_alsc_algo_int.h
4  *
5  *  Copyright (c) 2019 Rockchip Corporation
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 #ifndef _RK_AIQ_TYPE_ABLC_ALGO_INT_H_
22 #define _RK_AIQ_TYPE_ABLC_ALGO_INT_H_
23 #include "ablc/rk_aiq_types_ablc_algo.h"
24 #include "RkAiqCalibDbTypes.h"
25 #include "ablc_head.h"
26 #include "ablc_uapi_head.h"
27 
28 
29 #define ABLC_RECALCULATE_DELTE_ISO  (10)
30 
31 typedef enum AblcResult_e {
32     ABLC_RET_SUCCESS            = 0,   // this has to be 0, if clauses rely on it
33     ABLC_RET_FAILURE            = 1,   // process failure
34     ABLC_RET_INVALID_PARM       = 2,   // invalid parameter
35     ABLC_RET_WRONG_CONFIG       = 3,   // feature not supported
36     ABLC_RET_BUSY               = 4,   // there's already something going on...
37     ABLC_RET_CANCELED           = 5,   // operation canceled
38     ABLC_RET_OUTOFMEM           = 6,   // out of memory
39     ABLC_RET_OUTOFRANGE         = 7,   // parameter/value out of range
40     ABLC_RET_NULL_POINTER       = 8,   // the/one/all parameter(s) is a(are) NULL pointer(s)
41     ABLC_RET_DIVISION_BY_ZERO   = 9,   // a divisor equals ZERO
42     ABLC_RET_NO_INPUTIMAGE      = 10   // no input image
43 } AblcResult_t;
44 
45 typedef enum AblcState_e {
46     ABLC_STATE_INVALID           = 0,                   /**< initialization value */
47     ABLC_STATE_INITIALIZED       = 1,                   /**< instance is created, but not initialized */
48     ABLC_STATE_STOPPED           = 2,                   /**< instance is confiured (ready to start) or stopped */
49     ABLC_STATE_RUNNING           = 3,                   /**< instance is running (processes frames) */
50     ABLC_STATE_LOCKED            = 4,                   /**< instance is locked (for taking snapshots) */
51     ABLC_STATE_MAX                                      /**< max */
52 } AblcState_t;
53 
54 typedef enum AblcOPMode_e {
55     ABLC_OP_MODE_OFF         = 0,                    /**< initialization value */
56     ABLC_OP_MODE_AUTO             = 1,                   /**< instance is created, but not initialized */
57     ABLC_OP_MODE_MANUAL           = 2,                   /**< instance is confiured (ready to start) or stopped */
58     ABLC_OP_MODE_MAX                                      /**< max */
59 } AblcOPMode_t;
60 
61 typedef enum AblcParamMode_e {
62     ABLC_PARAM_MODE_INVALID          = 0,                    /**< initialization value */
63     ABLC_PARAM_MODE_NORMAL             = 1,                   /**< instance is created, but not initialized */
64     ABLC_PARAM_MODE_HDR           = 2,                   /**< instance is confiured (ready to start) or stopped */
65     ABLC_PARAM_MODE_MAX                                        /**< max */
66 } AblcParamMode_t;
67 
68 typedef struct AblcParams_s {
69     bool enable;
70     int len;
71     float iso[ABLC_MAX_ISO_LEVEL];
72     float blc_r[ABLC_MAX_ISO_LEVEL];
73     float blc_gr[ABLC_MAX_ISO_LEVEL];
74     float blc_gb[ABLC_MAX_ISO_LEVEL];
75     float blc_b[ABLC_MAX_ISO_LEVEL];
76 } AblcParams_t;
77 
78 #if 0
79 typedef struct AblcSelect_s {
80     bool enable;
81     short int blc_r;
82     short int blc_gr;
83     short int blc_gb;
84     short int blc_b;
85 } AblcSelect_t;
86 
87 
88 typedef AblcSelect_t AblcManualAttr_t;
89 #endif
90 
91 
92 typedef struct AblcProc_s {
93     bool enable;
94     short int blc_r;
95     short int blc_gr;
96     short int blc_gb;
97     short int blc_b;
98 
99     bool blc1_enable;
100 
101     float blc1_r;
102     float blc1_gr;
103     float blc1_gb;
104     float blc1_b;
105 } AblcProc_t;
106 
107 
108 
109 typedef struct rk_aiq_blc_attrib_s {
110     rk_aiq_uapi_sync_t sync;
111     AblcOPMode_t eMode;
112     AblcParams_t stBlc0Auto;
113     AblcParams_t stBlc1Auto;
114     AblcManualAttr_t stBlc0Manual;
115     AblcManualAttr_t stBlc1Manual;
116 } rk_aiq_blc_attrib_t;
117 
118 
119 
120 #endif
121 
122