xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAwbV21Handle.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_V21_HANDLE_INT_H_
17 #define _RK_AIQ_AWB_V21_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_V21
27 namespace RkCam {
28 
29 class RkAiqCustomAwbHandle;
30 class RkAiqAwbV21HandleInt : public RkAiqAwbHandleInt {
31     friend class RkAiqCustomAwbHandle;
32 
33  public:
RkAiqAwbV21HandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)34     explicit RkAiqAwbV21HandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
35         : RkAiqAwbHandleInt(des, aiqCore) {
36 #ifndef DISABLE_HANDLE_ATTRIB
37         memset(&mCurWbV21Attr, 0, sizeof(rk_aiq_uapiV2_wbV21_attrib_t));
38         memset(&mNewWbV21Attr, 0, sizeof(rk_aiq_uapiV2_wbV21_attrib_t));
39         updateWbV21Attr = false;
40 #endif
41     };
~RkAiqAwbV21HandleInt()42     virtual ~RkAiqAwbV21HandleInt() {
43 #ifndef DISABLE_HANDLE_ATTRIB
44         freeWbGainAdjustAttrib(&mNewWbV21Attr.stAuto.wbGainAdjust);
45         freeWbGainAdjustAttrib(&mCurWbV21Attr.stAuto.wbGainAdjust);
46 #endif
47         RkAiqAwbHandleInt::deInit();
48     };
49     virtual XCamReturn updateConfig(bool needSync);
50     XCamReturn setWbV21Attrib(rk_aiq_uapiV2_wbV21_attrib_t att);
51     XCamReturn getWbV21Attrib(rk_aiq_uapiV2_wbV21_attrib_t* att);
52 
53  protected:
54  private:
55 #ifndef DISABLE_HANDLE_ATTRIB
56     // TODO
57     rk_aiq_uapiV2_wbV21_attrib_t mCurWbV21Attr;
58     rk_aiq_uapiV2_wbV21_attrib_t mNewWbV21Attr;
59     mutable std::atomic<bool> updateWbV21Attr;
60 #endif
61 
62  private:
63     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAwbV21HandleInt);
64 };
65 
66 }  // namespace RkCam
67 #endif
68 #endif
69