xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/include/uAPI2/rk_aiq_user_api2_custom_awb.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 _RK_AIQ_USER_API_CUSTOM_AWB_H_
19 #define _RK_AIQ_USER_API_CUSTOM_AWB_H_
20 
21 #include "rk_aiq_types.h" /* common structs */
22 #include "rk_aiq_user_api2_sysctl.h" /* rk_aiq_sys_ctx_t */
23 
24 RKAIQ_BEGIN_DECLARE
25 
26 
27 typedef struct rk_aiq_customeAwb_cbs_s
28 {
29     /* ctx is the rk_aiq_sys_ctx_t which is corresponded to
30      * camera, could be mapped to camera id.
31      */
32     int32_t (*pfn_awb_init)(void* ctx);
33     int32_t (*pfn_awb_run)(void* ctx, const void* pstAwbInfo,
34                           void* pstAwbResult);
35     /* not used now */
36     int32_t (*pfn_awb_ctrl)(void* ctx, uint32_t u32Cmd, void *pValue);
37     int32_t (*pfn_awb_exit)(void* ctx);
38 } rk_aiq_customeAwb_cbs_t;
39 
40 /*!
41  * \brief register custom Awb algo
42  *
43  * \param[in] ctx             context
44  * \param[in] cbs             custom Awb callbacks
45  * \note should be called after rk_aiq_uapi_sysctl_init
46  */
47 XCamReturn
48 rk_aiq_uapi2_customAWB_register(const rk_aiq_sys_ctx_t* ctx, rk_aiq_customeAwb_cbs_t* cbs);
49 
50 /*!
51  * \brief enable/disable custom Awb algo
52  *
53  * \param[in] ctx             context
54  * \param[in] enable          enable/diable custom Awb
55  * \note should be called after rk_aiq_uapi_customAWB_register. If custom Awb was enabled,
56  *       Rk awb will be stopped, vice versa.
57  */
58 XCamReturn
59 rk_aiq_uapi2_customAWB_enable(const rk_aiq_sys_ctx_t* ctx, bool enable);
60 
61 /*!
62  * \brief unregister custom Awb algo
63  *
64  * \param[in] ctx             context
65  * \note should be called after rk_aiq_uapi_customAWB_register.
66  */
67 XCamReturn
68 rk_aiq_uapi2_customAWB_unRegister(const rk_aiq_sys_ctx_t* ctx);
69 
70 RKAIQ_END_DECLARE
71 
72 #endif
73