xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAsharpV4Handle.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_SHARP_V4_HANDLE_INT_H_
17 #define _RK_AIQ_SHARP_V4_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #include "asharp4/rk_aiq_uapi_asharp_int_v4.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_V4
27 
28 class RkAiqAsharpV4HandleInt : virtual public RkAiqHandle {
29 public:
RkAiqAsharpV4HandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)30     explicit RkAiqAsharpV4HandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
31         : RkAiqHandle(des, aiqCore) {
32 #ifndef DISABLE_HANDLE_ATTRIB
33         updateStrength = false;
34         updateAtt      = false;
35         memset(&mCurStrength, 0x00, sizeof(mCurStrength));
36         memset(&mNewStrength, 0x00, sizeof(mNewStrength));
37         mCurStrength.percent = 1.0;
38         mNewStrength.percent = 1.0;
39         memset(&mCurAtt, 0x00, sizeof(mCurAtt));
40         memset(&mNewAtt, 0x00, sizeof(mNewAtt));
41 #endif
42     };
~RkAiqAsharpV4HandleInt()43     virtual ~RkAiqAsharpV4HandleInt() {
44         RkAiqHandle::deInit();
45     };
46     virtual XCamReturn updateConfig(bool needSync);
47     virtual XCamReturn prepare();
48     virtual XCamReturn preProcess();
49     virtual XCamReturn processing();
50     virtual XCamReturn postProcess();
51     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
52     // TODO add algo specific methords, this is a sample
53     XCamReturn setAttrib(rk_aiq_sharp_attrib_v4_t* att);
54     XCamReturn getAttrib(rk_aiq_sharp_attrib_v4_t* att);
55     XCamReturn setStrength(rk_aiq_sharp_strength_v4_t* pStrength);
56     XCamReturn getStrength(rk_aiq_sharp_strength_v4_t* pStrength);
57     XCamReturn getInfo(rk_aiq_sharp_info_v4_t* pInfo);
58 protected:
59     virtual void init();
deInit()60     virtual void deInit() {
61         RkAiqHandle::deInit();
62     };
63 
64 private:
65 #ifndef DISABLE_HANDLE_ATTRIB
66     // TODO
67     rk_aiq_sharp_attrib_v4_t mCurAtt;
68     rk_aiq_sharp_attrib_v4_t mNewAtt;
69     rk_aiq_sharp_strength_v4_t mCurStrength;
70     rk_aiq_sharp_strength_v4_t mNewStrength;
71     mutable std::atomic<bool> updateStrength;
72 #endif
73 
74 private:
75     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAsharpV4HandleInt);
76 };
77 #endif
78 }  // namespace RkCam
79 
80 #endif
81