xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAynrHandle.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_YNR_HANDLE_INT_H_
17 #define _RK_AIQ_YNR_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #include "aynr/rk_aiq_uapi_aynr_int_v1.h"
21 #include "rk_aiq_api_private.h"
22 #include "rk_aiq_pool.h"
23 #include "xcam_mutex.h"
24 
25 namespace RkCam {
26 
27 #if RKAIQ_HAVE_YNR_V1
28 
29 class RkAiqAynrHandleInt : virtual public RkAiqHandle {
30 public:
RkAiqAynrHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)31     explicit RkAiqAynrHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
32         : RkAiqHandle(des, aiqCore) {
33 #ifndef DISABLE_HANDLE_ATTRIB
34         memset(&mCurAtt, 0, sizeof(rk_aiq_ynr_attrib_v1_t));
35         memset(&mNewAtt, 0, sizeof(rk_aiq_ynr_attrib_v1_t));
36 #endif
37     };
~RkAiqAynrHandleInt()38     virtual ~RkAiqAynrHandleInt() {
39         RkAiqHandle::deInit();
40     };
41     virtual XCamReturn updateConfig(bool needSync);
42     virtual XCamReturn prepare();
43     virtual XCamReturn preProcess();
44     virtual XCamReturn processing();
45     virtual XCamReturn postProcess();
46     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
47     // TODO add algo specific methords, this is a sample
48     XCamReturn setAttrib(rk_aiq_ynr_attrib_v1_t* att);
49     XCamReturn getAttrib(rk_aiq_ynr_attrib_v1_t* att);
50     XCamReturn setStrength(float fPercent);
51     XCamReturn getStrength(float* pPercent);
52     XCamReturn setIQPara(rk_aiq_ynr_IQPara_V1_t* pPara);
53     XCamReturn getIQPara(rk_aiq_ynr_IQPara_V1_t* pPara);
54     XCamReturn setJsonPara(rk_aiq_ynr_JsonPara_V1_t* para);
55     XCamReturn getJsonPara(rk_aiq_ynr_JsonPara_V1_t* para);
56 
57 protected:
58     virtual void init();
deInit()59     virtual void deInit() {
60         RkAiqHandle::deInit();
61     };
62 
63 private:
64 #ifndef DISABLE_HANDLE_ATTRIB
65     // TODO
66     rk_aiq_ynr_attrib_v1_t mCurAtt;
67     rk_aiq_ynr_attrib_v1_t mNewAtt;
68     rk_aiq_ynr_IQPara_V1_t mCurIQPara;
69     rk_aiq_ynr_IQPara_V1_t mNewIQPara;
70     rk_aiq_ynr_JsonPara_V1_t mCurJsonPara;
71     rk_aiq_ynr_JsonPara_V1_t mNewJsonPara;
72     bool updateIQpara   = false;
73     bool updateJsonpara = false;
74 #endif
75 
76 private:
77     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAynrHandleInt);
78 };
79 #endif
80 }  // namespace RkCam
81 
82 #endif
83