xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAsharpV33Handle.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_ASHARP_V33_HANDLE_INT_H_
17 #define _RK_AIQ_ASHARP_V33_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #include "asharpV33/rk_aiq_uapi_asharp_int_v33.h"
21 #include "rk_aiq_api_private.h"
22 #include "rk_aiq_pool.h"
23 #include "xcam_mutex.h"
24 
25 namespace RkCam {
26 #if (RKAIQ_HAVE_SHARP_V33 || RKAIQ_HAVE_SHARP_V33_LITE)
27 
28 class RkAiqAsharpV33HandleInt : virtual public RkAiqHandle {
29 public:
RkAiqAsharpV33HandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)30     explicit RkAiqAsharpV33HandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
31         : RkAiqHandle(des, aiqCore) {
32 #ifndef DISABLE_HANDLE_ATTRIB
33         updateStrength = false;
34         updateAtt      = false;
35         updateAttLite  = false;
36         memset(&mCurStrength, 0x00, sizeof(mCurStrength));
37         memset(&mNewStrength, 0x00, sizeof(mNewStrength));
38         mCurStrength.percent = 1.0;
39         mNewStrength.percent = 1.0;
40         memset(&mCurAtt, 0x00, sizeof(mCurAtt));
41         memset(&mNewAtt, 0x00, sizeof(mNewAtt));
42         memset(&mCurAttLite, 0x00, sizeof(mCurAttLite));
43         memset(&mNewAttLite, 0x00, sizeof(mNewAttLite));
44 #endif
45     };
~RkAiqAsharpV33HandleInt()46     virtual ~RkAiqAsharpV33HandleInt() {
47         RkAiqHandle::deInit();
48     };
49     virtual XCamReturn updateConfig(bool needSync);
50     virtual XCamReturn prepare();
51     virtual XCamReturn preProcess();
52     virtual XCamReturn processing();
53     virtual XCamReturn postProcess();
54     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
55     // TODO add algo specific methords, this is a sample
56 
57     XCamReturn setAttrib(const rk_aiq_sharp_attrib_v33_t* att);
58     XCamReturn getAttrib(rk_aiq_sharp_attrib_v33_t* att);
59     XCamReturn setAttribLite(const rk_aiq_sharp_attrib_v33LT_t* att);
60     XCamReturn getAttribLite(rk_aiq_sharp_attrib_v33LT_t* att);
61     XCamReturn setStrength(const rk_aiq_sharp_strength_v33_t* pStrength);
62     XCamReturn getStrength(rk_aiq_sharp_strength_v33_t* pStrength);
63 
64     XCamReturn getInfo(rk_aiq_sharp_info_v33_t* pInfo);
65 protected:
66     virtual void init();
deInit()67     virtual void deInit() {
68         RkAiqHandle::deInit();
69     };
70 
71 private:
72     // TODO
73 #ifndef DISABLE_HANDLE_ATTRIB
74     rk_aiq_sharp_attrib_v33_t mCurAtt;
75     rk_aiq_sharp_attrib_v33_t mNewAtt;
76     rk_aiq_sharp_strength_v33_t mCurStrength;
77     rk_aiq_sharp_strength_v33_t mNewStrength;
78     mutable std::atomic<bool> updateStrength;
79     rk_aiq_sharp_attrib_v33LT_t mCurAttLite;
80     rk_aiq_sharp_attrib_v33LT_t mNewAttLite;
81     mutable std::atomic<bool> updateAttLite;
82 #endif
83  private:
84     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAsharpV33HandleInt);
85 };
86 #endif
87 };  // namespace RkCam
88 
89 #endif
90