1 /* 2 * Copyright (c) 2022 Rockchip Corporation 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 */ 17 18 #ifndef _RK_ISPFEC_GEN_MESH_MANAGER_H_ 19 #define _RK_ISPFEC_GEN_MESH_MANAGER_H_ 20 21 #include "genMesh.h" 22 #include "rk_ispfec_api.h" 23 24 #include <stdint.h> 25 26 namespace RKISPFEC { 27 28 class RkIspFecGenMesh { 29 public: 30 RkIspFecGenMesh() = default; 31 virtual ~RkIspFecGenMesh() = default; 32 33 int32_t init(int32_t srcWidth, int32_t srcHeight, int32_t dstWidth, int32_t dstHeight, 34 const double *lightCenter, const double *coeff, 35 enum rk_ispfec_correct_direction direction, enum rk_ispfec_correct_style style); 36 int32_t deinit(); 37 int32_t genMesh(int32_t level); 38 39 /* 40 * Warning: the direction/style take effect when configured before init 41 */ setCorrectDirection(enum rk_ispfec_correct_direction direction)42 void setCorrectDirection(enum rk_ispfec_correct_direction direction) { 43 mDirection = direction; 44 }; 45 setCorrectStyle(enum rk_ispfec_correct_style style)46 void setCorrectStyle(enum rk_ispfec_correct_style style) { 47 mStyle = style; 48 }; 49 setMeshBuf(void * meshXi,void * meshYi,void * meshXf,void * meshYf)50 void setMeshBuf(void* meshXi, void* meshYi, void* meshXf, void* meshYf) { 51 mMeshXi = meshXi; 52 mMeshYi = meshYi; 53 mMeshXf = meshXf; 54 mMeshYf = meshYf; 55 }; 56 57 private: 58 bool mInited {false}; 59 60 enum rk_ispfec_correct_direction mDirection {RK_ISPFEC_CORRECT_DIRECTION_XY}; 61 enum rk_ispfec_correct_style mStyle {RK_ISPFEC_KEEP_ASPECT_RATIO_REDUCE_FOV}; 62 int32_t mLevel {100}; 63 64 struct CameraCoeff mCoeff; 65 struct FecParams mParams; 66 67 void* mMeshXi; 68 void* mMeshYi; 69 void* mMeshXf; 70 void* mMeshYf; 71 72 }; 73 74 }; 75 #endif 76