xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAwbV32Handle.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Copyright (c) 2019-2022 Rockchip Eletronics Co., Ltd.
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 #ifndef _RK_AIQ_AWB_V32_HANDLE_INT_H_
17 #define _RK_AIQ_AWB_V32_HANDLE_INT_H_
18 
19 #include "RkAiqAwbHandle.h"
20 #include "RkAiqHandle.h"
21 #include "awb/rk_aiq_uapi_awb_int.h"
22 #include "awb/rk_aiq_uapiv2_awb_int.h"
23 #include "rk_aiq_api_private.h"
24 #include "rk_aiq_pool.h"
25 #include "xcam_mutex.h"
26 #if RKAIQ_HAVE_AWB_V32
27 namespace RkCam {
28 
29 class RkAiqCustomAwbHandle;
30 class RkAiqAwbV32HandleInt : public RkAiqAwbHandleInt {
31     friend class RkAiqCustomAwbHandle;
32 
33  public:
RkAiqAwbV32HandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)34     explicit RkAiqAwbV32HandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
35         : RkAiqAwbHandleInt(des, aiqCore) {
36 #ifndef DISABLE_HANDLE_ATTRIB
37         memset(&mCurWbV32Attr, 0, sizeof(rk_aiq_uapiV2_wbV32_attrib_t));
38         memset(&mNewWbV32Attr, 0, sizeof(rk_aiq_uapiV2_wbV32_attrib_t));
39         memset(&mCurWbV32AwbMultiWindowAttr, 0, sizeof(rk_aiq_uapiV2_wbV32_awb_mulWindow_t));
40         memset(&mNewWbV32AwbMultiWindowAttr, 0, sizeof(rk_aiq_uapiV2_wbV32_awb_mulWindow_t));
41         memset(&mCurWriteAwbInputAttr, 0, sizeof(rk_aiq_uapiV2_awb_wrtIn_attr_t));
42         memset(&mNewWriteAwbInputAttr, 0, sizeof(rk_aiq_uapiV2_awb_wrtIn_attr_t));
43         updateWbV32Attr = false;
44         updateWbV32AwbMultiWindowAttr = false;
45         updateWriteAwbInputAttr = false;
46 #endif
47     };
~RkAiqAwbV32HandleInt()48     virtual ~RkAiqAwbV32HandleInt() {
49         RkAiqAwbHandleInt::deInit();
50     };
51     virtual XCamReturn updateConfig(bool needSync);
52     XCamReturn setWbV32Attrib(rk_aiq_uapiV2_wbV32_attrib_t att);
53     XCamReturn getWbV32Attrib(rk_aiq_uapiV2_wbV32_attrib_t* att);
54     XCamReturn setWbV32AwbMultiWindowAttrib(rk_aiq_uapiV2_wbV32_awb_mulWindow_t att);
55     XCamReturn getWbV32AwbMultiWindowAttrib(rk_aiq_uapiV2_wbV32_awb_mulWindow_t* att);
56     XCamReturn writeAwbIn(rk_aiq_uapiV2_awb_wrtIn_attr_t att);
57 
58  protected:
59  private:
60     // TODO
61 #ifndef DISABLE_HANDLE_ATTRIB
62     rk_aiq_uapiV2_wbV32_attrib_t mCurWbV32Attr;
63     rk_aiq_uapiV2_wbV32_attrib_t mNewWbV32Attr;
64     mutable std::atomic<bool> updateWbV32Attr;
65     rk_aiq_uapiV2_wbV32_awb_mulWindow_t mCurWbV32AwbMultiWindowAttr;
66     rk_aiq_uapiV2_wbV32_awb_mulWindow_t mNewWbV32AwbMultiWindowAttr;
67     mutable std::atomic<bool> updateWbV32AwbMultiWindowAttr;
68     rk_aiq_uapiV2_awb_wrtIn_attr_t mCurWriteAwbInputAttr;
69     rk_aiq_uapiV2_awb_wrtIn_attr_t mNewWriteAwbInputAttr;
70     mutable std::atomic<bool>  updateWriteAwbInputAttr;
71 #endif
72  private:
73     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAwbV32HandleInt);
74 };
75 
76 }  // namespace RkCam
77 #endif
78 #endif
79