xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/IspFec/include_prv/RkIspFecGenMesh.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  *  Copyright (c) 2022 Rockchip Corporation
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * Licensed under the Apache License, Version 2.0 (the "License");
5*4882a593Smuzhiyun  * you may not use this file except in compliance with the License.
6*4882a593Smuzhiyun  * You may obtain a copy of the License at
7*4882a593Smuzhiyun  *
8*4882a593Smuzhiyun  *      http://www.apache.org/licenses/LICENSE-2.0
9*4882a593Smuzhiyun  *
10*4882a593Smuzhiyun  * Unless required by applicable law or agreed to in writing, software
11*4882a593Smuzhiyun  * distributed under the License is distributed on an "AS IS" BASIS,
12*4882a593Smuzhiyun  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*4882a593Smuzhiyun  * See the License for the specific language governing permissions and
14*4882a593Smuzhiyun  * limitations under the License.
15*4882a593Smuzhiyun  *
16*4882a593Smuzhiyun  */
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun #ifndef _RK_ISPFEC_GEN_MESH_MANAGER_H_
19*4882a593Smuzhiyun #define _RK_ISPFEC_GEN_MESH_MANAGER_H_
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun #include "genMesh.h"
22*4882a593Smuzhiyun #include "rk_ispfec_api.h"
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun #include <stdint.h>
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun namespace RKISPFEC {
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun class RkIspFecGenMesh {
29*4882a593Smuzhiyun public:
30*4882a593Smuzhiyun     RkIspFecGenMesh() = default;
31*4882a593Smuzhiyun     virtual ~RkIspFecGenMesh() = default;
32*4882a593Smuzhiyun 
33*4882a593Smuzhiyun     int32_t init(int32_t srcWidth, int32_t srcHeight, int32_t dstWidth, int32_t dstHeight,
34*4882a593Smuzhiyun                  const double *lightCenter, const double *coeff,
35*4882a593Smuzhiyun                  enum rk_ispfec_correct_direction direction, enum rk_ispfec_correct_style style);
36*4882a593Smuzhiyun     int32_t deinit();
37*4882a593Smuzhiyun     int32_t genMesh(int32_t level);
38*4882a593Smuzhiyun 
39*4882a593Smuzhiyun     /*
40*4882a593Smuzhiyun      * Warning: the direction/style take effect when configured before init
41*4882a593Smuzhiyun      */
setCorrectDirection(enum rk_ispfec_correct_direction direction)42*4882a593Smuzhiyun     void setCorrectDirection(enum rk_ispfec_correct_direction direction) {
43*4882a593Smuzhiyun 		mDirection = direction;
44*4882a593Smuzhiyun 	};
45*4882a593Smuzhiyun 
setCorrectStyle(enum rk_ispfec_correct_style style)46*4882a593Smuzhiyun     void setCorrectStyle(enum rk_ispfec_correct_style style) {
47*4882a593Smuzhiyun 		mStyle = style;
48*4882a593Smuzhiyun 	};
49*4882a593Smuzhiyun 
setMeshBuf(void * meshXi,void * meshYi,void * meshXf,void * meshYf)50*4882a593Smuzhiyun     void setMeshBuf(void* meshXi, void* meshYi, void* meshXf, void* meshYf) {
51*4882a593Smuzhiyun         mMeshXi = meshXi;
52*4882a593Smuzhiyun         mMeshYi = meshYi;
53*4882a593Smuzhiyun         mMeshXf = meshXf;
54*4882a593Smuzhiyun         mMeshYf = meshYf;
55*4882a593Smuzhiyun     };
56*4882a593Smuzhiyun 
57*4882a593Smuzhiyun private:
58*4882a593Smuzhiyun     bool                				mInited {false};
59*4882a593Smuzhiyun 
60*4882a593Smuzhiyun     enum rk_ispfec_correct_direction 	mDirection {RK_ISPFEC_CORRECT_DIRECTION_XY};
61*4882a593Smuzhiyun     enum rk_ispfec_correct_style 	    mStyle {RK_ISPFEC_KEEP_ASPECT_RATIO_REDUCE_FOV};
62*4882a593Smuzhiyun     int32_t                     		mLevel {100};
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun     struct CameraCoeff          		mCoeff;
65*4882a593Smuzhiyun     struct FecParams            		mParams;
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun     void*                       		mMeshXi;
68*4882a593Smuzhiyun     void*                       		mMeshYi;
69*4882a593Smuzhiyun     void*                       		mMeshXf;
70*4882a593Smuzhiyun     void*                       		mMeshYf;
71*4882a593Smuzhiyun 
72*4882a593Smuzhiyun };
73*4882a593Smuzhiyun 
74*4882a593Smuzhiyun };
75*4882a593Smuzhiyun #endif
76