1 /* 2 * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef __FISHEYE_CALIBRATE_H__ 16 #define __FISHEYE_CALIBRATE_H__ 17 18 #include "hi_comm_video.h" 19 #include "hi_errno.h" 20 21 #ifdef __cplusplus 22 #if __cplusplus 23 extern "C" { 24 #endif 25 #endif /* __cplusplus */ 26 27 #define FISHEYE_EN_ERR_ILLEGAL_PARAM (EN_ERR_ILLEGAL_PARAM + 30) /* 30 : errno inteval from gdc */ 28 #define FISHEYE_EN_ERR_NULL_PTR (EN_ERR_NULL_PTR + 30) /* 30 : errno inteval from gdc */ 29 #define FISHEYE_EN_ERR_NOT_SUPPORT (EN_ERR_NOT_SUPPORT + 30) /* 30 : errno inteval from gdc */ 30 #define FISHEYE_EN_ERR_NOMEM (EN_ERR_NOMEM + 30) /* 30 : errno inteval from gdc */ 31 #define FISHEYE_EN_ERR_BUSY (EN_ERR_BUSY + 30) /* 30 : errno inteval from gdc */ 32 33 #define HI_ERR_FISHEYE_CALIBRATE_ILLEGAL_PARAM HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, FISHEYE_EN_ERR_ILLEGAL_PARAM) 34 #define HI_ERR_FISHEYE_CALIBRATE_NULL_PTR HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, FISHEYE_EN_ERR_NULL_PTR) 35 #define HI_ERR_FISHEYE_CALIBRATE_NOT_SUPPORT HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, FISHEYE_EN_ERR_NOT_SUPPORT) 36 #define HI_ERR_FISHEYE_CALIBRATE_NOMEM HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, FISHEYE_EN_ERR_NOMEM) 37 #define HI_ERR_FISHEYE_CALIBRATE_BUSY HI_DEF_ERR(HI_ID_GDC, EN_ERR_LEVEL_ERROR, FISHEYE_EN_ERR_BUSY) 38 39 typedef enum { 40 LEVEL_0 = 0, /* calibrate level 0 */ 41 LEVEL_1 = 1, /* calibrate level 1 */ 42 LEVEL_2 = 2, /* calibrate level 2 */ 43 44 LEVEL_BUTT 45 } FISHEYE_CALIBRATE_LEVEL_E; 46 47 typedef struct { 48 HI_S32 s32OffsetV; /* the horizontal offset between image center and physical center of len */ 49 HI_S32 s32OffsetH; /* the vertical offset between image center and physical center of len */ 50 HI_S32 s32Radius_X; /* the X coordinate of physical center of len */ 51 HI_S32 s32Radius_Y; /* the Y coordinate of physical center of len */ 52 HI_U32 u32Radius; /* the radius of len */ 53 } FISHEYE_CALIBTATE_RESULT_S; 54 55 typedef struct { 56 FISHEYE_CALIBTATE_RESULT_S stCalibrateResult; /* the output of result */ 57 } CALIBTATE_OUTPUT_S; 58 59 hi_s32 HI_FISHEYE_ComputeCalibrateResult(const VIDEO_FRAME_S *pstVFramIn, FISHEYE_CALIBRATE_LEVEL_E enLevel, 60 CALIBTATE_OUTPUT_S *pOutCalibrate); 61 62 hi_s32 HI_FISHEYE_MarkCalibrateResult(const VIDEO_FRAME_S *pstPicIn, VIDEO_FRAME_S *pstPicOut, 63 const FISHEYE_CALIBTATE_RESULT_S *pCalibrateResult); 64 65 #ifdef __cplusplus 66 #if __cplusplus 67 } 68 #endif 69 #endif /* __cplusplus */ 70 71 #endif /* __FISHEYE_CALIBRATE_H__ */ 72