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