xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/aiq_core/algo_handlers/RkAiqAdebayerHandle.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_DEBAYER_HANDLE_INT_H_
17 #define _RK_AIQ_DEBAYER_HANDLE_INT_H_
18 
19 #include "RkAiqHandle.h"
20 #include "adebayer/rk_aiq_uapi_adebayer_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 
27 class RkAiqAdebayerHandleInt : virtual public RkAiqHandle {
28 public:
RkAiqAdebayerHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)29     explicit RkAiqAdebayerHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore)
30         : RkAiqHandle(des, aiqCore) {}
~RkAiqAdebayerHandleInt()31     virtual ~RkAiqAdebayerHandleInt() {
32         RkAiqHandle::deInit();
33     };
34     virtual XCamReturn updateConfig(bool needSync);
35     virtual XCamReturn prepare();
36     virtual XCamReturn preProcess();
37     virtual XCamReturn processing();
38     virtual XCamReturn postProcess();
39     virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params);
40     // TODO add algo specific methords, this is a sample
41 #if RKAIQ_HAVE_DEBAYER_V1
42     XCamReturn setAttrib(adebayer_attrib_t att);
43     XCamReturn getAttrib(adebayer_attrib_t* att);
44 #endif
45 
46 #if RKAIQ_HAVE_DEBAYER_V2
47     XCamReturn setAttribV2(adebayer_v2_attrib_t att);
48     XCamReturn getAttribV2(adebayer_v2_attrib_t* att);
49 #endif
50 
51 #if RKAIQ_HAVE_DEBAYER_V2_LITE
52     XCamReturn setAttribV2(adebayer_v2lite_attrib_t att);
53     XCamReturn getAttribV2(adebayer_v2lite_attrib_t* att);
54 #endif
55 
56 protected:
57     virtual void init();
deInit()58     virtual void deInit() {
59         RkAiqHandle::deInit();
60     };
61 
62 private:
63 
64 #ifndef DISABLE_HANDLE_ATTRIB
65 #if RKAIQ_HAVE_DEBAYER_V1
66     adebayer_attrib_t mCurAtt;
67     adebayer_attrib_t mNewAtt;
68 #endif
69 
70 #if RKAIQ_HAVE_DEBAYER_V2
71     adebayer_v2_attrib_t mCurAttV2;
72     adebayer_v2_attrib_t mNewAttV2;
73 #endif
74 
75 #if RKAIQ_HAVE_DEBAYER_V2_LITE
76     adebayer_v2lite_attrib_t mCurAttV2Lite;
77     adebayer_v2lite_attrib_t mNewAttV2Lite;
78 #endif
79 #endif
80 
81 private:
82     DECLARE_HANDLE_REGISTER_TYPE(RkAiqAdebayerHandleInt);
83 };
84 
85 }  // namespace RkCam
86 
87 #endif
88