xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAldchHandle.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_LDCH_HANDLE_INT_H_
17 #define _RK_AIQ_LDCH_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #if (RKAIQ_HAVE_LDCH_V21)
21 #include "aldch/rk_aiq_uapi_aldch_v21_int.h"
22 #else
23 #include "aldch/rk_aiq_uapi_aldch_int.h"
24 #endif
25 #include "rk_aiq_api_private.h"
26 #include "rk_aiq_pool.h"
27 #include "xcam_mutex.h"
28 
29 namespace RkCam {
30 
31 #if (RKAIQ_HAVE_LDCH_V10 || RKAIQ_HAVE_LDCH_V21)
32 class RkAiqAldchHandleInt : virtual public RkAiqHandle {
33  public:
RkAiqAldchHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)34     explicit RkAiqAldchHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
35         : RkAiqHandle(des, aiqCore) {
36 #ifndef DISABLE_HANDLE_ATTRIB
37 #if (RKAIQ_HAVE_LDCH_V21)
38         memset(&mCurAtt, 0, sizeof(rk_aiq_ldch_v21_attrib_t));
39         memset(&mNewAtt, 0, sizeof(rk_aiq_ldch_v21_attrib_t));
40 #else
41         memset(&mCurAtt, 0, sizeof(rk_aiq_ldch_attrib_t));
42         memset(&mNewAtt, 0, sizeof(rk_aiq_ldch_attrib_t));
43 #endif
44 #endif
45     };
~RkAiqAldchHandleInt()46     virtual ~RkAiqAldchHandleInt() { RkAiqHandle::deInit(); };
47     virtual XCamReturn updateConfig(bool needSync);
48     virtual XCamReturn prepare();
49     virtual XCamReturn preProcess();
50     virtual XCamReturn processing();
51     virtual XCamReturn postProcess();
52     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
53 
54 #if (RKAIQ_HAVE_LDCH_V21)
55     XCamReturn setAttrib(const rk_aiq_ldch_v21_attrib_t* att);
56     XCamReturn getAttrib(rk_aiq_ldch_v21_attrib_t* att);
57     XCamReturn copyLutFromExtBuffer(const rk_aiq_ldch_v21_attrib_t* att);
58 #else
59     XCamReturn setAttrib(const rk_aiq_ldch_attrib_t* att);
60     XCamReturn getAttrib(rk_aiq_ldch_attrib_t* att);
61 #endif
62 
63  protected:
64     virtual void init();
deInit()65     virtual void deInit() { RkAiqHandle::deInit(); };
66 
67  private:
68 #ifndef DISABLE_HANDLE_ATTRIB
69 #if (RKAIQ_HAVE_LDCH_V21)
70     rk_aiq_ldch_v21_attrib_t mCurAtt;
71     rk_aiq_ldch_v21_attrib_t mNewAtt;
72 #else
73     rk_aiq_ldch_attrib_t mCurAtt;
74     rk_aiq_ldch_attrib_t mNewAtt;
75 #endif
76 #endif
77 
78  private:
79     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAldchHandleInt);
80 };
81 #endif
82 
83 }  // namespace RkCam
84 
85 #endif
86