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_YNR_V2_HANDLE_INT_H_ 17 #define _RK_AIQ_YNR_V2_HANDLE_INT_H_ 18 19 #include "RkAiqHandle.h" 20 #include "aynr2/rk_aiq_uapi_aynr_int_v2.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_YNR_V2 27 28 class RkAiqAynrV2HandleInt : virtual public RkAiqHandle { 29 public: RkAiqAynrV2HandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)30 explicit RkAiqAynrV2HandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore) 31 : RkAiqHandle(des, aiqCore) { 32 #ifndef DISABLE_HANDLE_ATTRIB 33 memset(&mCurAtt, 0, sizeof(rk_aiq_ynr_attrib_v2_t)); 34 memset(&mNewAtt, 0, sizeof(rk_aiq_ynr_attrib_v2_t)); 35 #endif 36 }; ~RkAiqAynrV2HandleInt()37 virtual ~RkAiqAynrV2HandleInt() { 38 RkAiqHandle::deInit(); 39 }; 40 virtual XCamReturn updateConfig(bool needSync); 41 virtual XCamReturn prepare(); 42 virtual XCamReturn preProcess(); 43 virtual XCamReturn processing(); 44 virtual XCamReturn postProcess(); 45 virtual XCamReturn genIspResult(RkAiqFullParams* params, RkAiqFullParams* cur_params); 46 // TODO add algo specific methords, this is a sample 47 XCamReturn setAttrib(rk_aiq_ynr_attrib_v2_t* att); 48 XCamReturn getAttrib(rk_aiq_ynr_attrib_v2_t* att); 49 XCamReturn setStrength(float fPercent); 50 XCamReturn getStrength(float* pPercent); 51 XCamReturn setIQPara(rk_aiq_ynr_IQPara_V2_t* pPara); 52 XCamReturn getIQPara(rk_aiq_ynr_IQPara_V2_t* pPara); 53 54 protected: 55 virtual void init(); deInit()56 virtual void deInit() { 57 RkAiqHandle::deInit(); 58 }; 59 60 private: 61 #ifndef DISABLE_HANDLE_ATTRIB 62 // TODO 63 rk_aiq_ynr_attrib_v2_t mCurAtt; 64 rk_aiq_ynr_attrib_v2_t mNewAtt; 65 rk_aiq_ynr_IQPara_V2_t mCurIQPara; 66 rk_aiq_ynr_IQPara_V2_t mNewIQPara; 67 float mCurStrength; 68 float mNewStrength; 69 bool updateIQpara = false; 70 bool updateStrength = false; 71 #endif 72 private: 73 DECLARE_HANDLE_REGISTER_TYPE(RkAiqAynrV2HandleInt); 74 }; 75 #endif 76 } // namespace RkCam 77 78 #endif 79