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_BLC_HANDLE_INT_H_ 17 #define _RK_AIQ_BLC_HANDLE_INT_H_ 18 19 #include "RkAiqHandle.h" 20 #include "ablc/rk_aiq_uapi_ablc_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_BLC_V1 27 28 class RkAiqAblcHandleInt : virtual public RkAiqHandle { 29 public: RkAiqAblcHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)30 explicit RkAiqAblcHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore) 31 : RkAiqHandle(des, aiqCore) { 32 #ifndef DISABLE_HANDLE_ATTRIB 33 memset(&mCurAtt, 0, sizeof(rk_aiq_blc_attrib_t)); 34 memset(&mNewAtt, 0, sizeof(rk_aiq_blc_attrib_t)); 35 updateAtt = false; 36 #endif 37 }; ~RkAiqAblcHandleInt()38 virtual ~RkAiqAblcHandleInt() { 39 RkAiqHandle::deInit(); 40 }; 41 virtual XCamReturn updateConfig(bool needSync); 42 virtual XCamReturn prepare(); 43 virtual XCamReturn preProcess(); 44 virtual XCamReturn processing(); 45 virtual XCamReturn postProcess(); 46 virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params); 47 // TODO add algo specific methords, this is a sample 48 XCamReturn setAttrib(const rk_aiq_blc_attrib_t* att); 49 XCamReturn getAttrib(rk_aiq_blc_attrib_t* att); 50 XCamReturn getProcRes(AblcProc_t* ProcRes); 51 XCamReturn getInfo(rk_aiq_ablc_info_t *pInfo); 52 53 protected: 54 virtual void init(); deInit()55 virtual void deInit() { 56 RkAiqHandle::deInit(); 57 }; 58 SmartPtr<RkAiqAlgoProcResAblcIntShared> mProcResShared; 59 60 private: 61 #ifndef DISABLE_HANDLE_ATTRIB 62 // TODO 63 rk_aiq_blc_attrib_t mCurAtt; 64 rk_aiq_blc_attrib_t mNewAtt; 65 #endif 66 rk_aiq_isp_blc_t* mLatestparam; 67 private: 68 DECLARE_HANDLE_REGISTER_TYPE(RkAiqAblcHandleInt); 69 }; 70 #endif 71 } // namespace RkCam 72 73 #endif 74