xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAccmHandle.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_CCM_HANDLE_INT_H_
17 #define _RK_AIQ_CCM_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #include "accm/rk_aiq_uapi_accm_int.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_CCM_V1 || RKAIQ_HAVE_CCM_V2
27 class RkAiqAccmHandleInt : virtual public RkAiqHandle {
28  public:
RkAiqAccmHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)29     explicit RkAiqAccmHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
30         : RkAiqHandle(des, aiqCore) {
31 #ifndef DISABLE_HANDLE_ATTRIB
32 #if RKAIQ_HAVE_CCM_V1
33         memset(&mCurAtt, 0, sizeof(rk_aiq_ccm_attrib_t));
34         memset(&mNewAtt, 0, sizeof(rk_aiq_ccm_attrib_t));
35 #endif
36 #if RKAIQ_HAVE_CCM_V2
37         memset(&mCurAttV2, 0, sizeof(rk_aiq_ccm_v2_attrib_t));
38         memset(&mNewAttV2, 0, sizeof(rk_aiq_ccm_v2_attrib_t));
39 #endif
40 #endif
41     };
~RkAiqAccmHandleInt()42     virtual ~RkAiqAccmHandleInt() { RkAiqHandle::deInit(); };
43     virtual XCamReturn updateConfig(bool needSync);
44     virtual XCamReturn prepare();
45     virtual XCamReturn preProcess();
46     virtual XCamReturn processing();
47     virtual XCamReturn postProcess();
48     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
49     // TODO add algo specific methords, this is a sample
50 #if RKAIQ_HAVE_CCM_V1
51     XCamReturn setAttrib(const rk_aiq_ccm_attrib_t* att);
52     XCamReturn getAttrib(rk_aiq_ccm_attrib_t* att);
53 #endif
54 #if RKAIQ_HAVE_CCM_V2
55     XCamReturn setAttribV2(const rk_aiq_ccm_v2_attrib_t* att);
56     XCamReturn getAttribV2(rk_aiq_ccm_v2_attrib_t* att);
57 #endif
58     XCamReturn queryCcmInfo(rk_aiq_ccm_querry_info_t* ccm_querry_info);
59 
60  protected:
61     virtual void init();
deInit()62     virtual void deInit() { RkAiqHandle::deInit(); };
63 
64  private:
65 #ifndef DISABLE_HANDLE_ATTRIB
66     // TODO
67 #if RKAIQ_HAVE_CCM_V1
68     rk_aiq_ccm_attrib_t mCurAtt;
69     rk_aiq_ccm_attrib_t mNewAtt;
70 #endif
71 #if RKAIQ_HAVE_CCM_V2
72     rk_aiq_ccm_v2_attrib_t mCurAttV2;
73     rk_aiq_ccm_v2_attrib_t mNewAttV2;
74 #endif
75 #endif
76  private:
77     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAccmHandleInt);
78 };
79 #endif
80 }  // namespace RkCam
81 
82 #endif
83