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_NR_HANDLE_INT_H_ 17 #define _RK_AIQ_NR_HANDLE_INT_H_ 18 19 #include "RkAiqHandle.h" 20 #include "anr/rk_aiq_uapi_anr_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_ANR_V1 27 28 class RkAiqAnrHandleInt : virtual public RkAiqHandle { 29 public: RkAiqAnrHandleInt(RkAiqAlgoDesComm * des,RkAiqCore * aiqCore)30 explicit RkAiqAnrHandleInt(RkAiqAlgoDesComm* des, RkAiqCore* aiqCore) 31 : RkAiqHandle(des, aiqCore) { 32 #ifndef DISABLE_HANDLE_ATTRIB 33 memset(&mCurAtt, 0, sizeof(rk_aiq_nr_attrib_t)); 34 memset(&mNewAtt, 0, sizeof(rk_aiq_nr_attrib_t)); 35 #endif 36 }; ~RkAiqAnrHandleInt()37 virtual ~RkAiqAnrHandleInt() { 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_nr_attrib_t* att); 48 XCamReturn getAttrib(rk_aiq_nr_attrib_t* att); 49 XCamReturn setLumaSFStrength(float fPercent); 50 XCamReturn setLumaTFStrength(float fPercent); 51 XCamReturn getLumaSFStrength(float* pPercent); 52 XCamReturn getLumaTFStrength(float* pPercent); 53 XCamReturn setChromaSFStrength(float fPercent); 54 XCamReturn setChromaTFStrength(float fPercent); 55 XCamReturn getChromaSFStrength(float* pPercent); 56 XCamReturn getChromaTFStrength(float* pPercent); 57 XCamReturn setRawnrSFStrength(float fPercent); 58 XCamReturn getRawnrSFStrength(float* pPercent); 59 XCamReturn setIQPara(rk_aiq_nr_IQPara_t* pPara); 60 XCamReturn getIQPara(rk_aiq_nr_IQPara_t* pPara); 61 62 protected: 63 virtual void init(); deInit()64 virtual void deInit() { 65 RkAiqHandle::deInit(); 66 }; 67 68 private: 69 #ifndef DISABLE_HANDLE_ATTRIB 70 // TODO 71 rk_aiq_nr_attrib_t mCurAtt; 72 rk_aiq_nr_attrib_t mNewAtt; 73 rk_aiq_nr_IQPara_t mCurIQpara; 74 rk_aiq_nr_IQPara_t mNewIQpara; 75 bool UpdateIQpara = false; 76 #endif 77 78 private: 79 DECLARE_HANDLE_REGISTER_TYPE(RkAiqAnrHandleInt); 80 }; 81 #endif 82 } // namespace RkCam 83 84 #endif 85