157 lines
6.6 KiB
C
157 lines
6.6 KiB
C
#ifndef __SENSOR_SDK_API_H__
|
||
#define __SENSOR_SDK_API_H__
|
||
|
||
enum {
|
||
SENSOR_SDK_SUCC = 0,
|
||
SENSOR_SDK_INVALID_INPARAM, //参数非法
|
||
SENSOR_SDK_NOT_INIT, //未初始化
|
||
SENSOR_SDK_LICENSE_INIT_FAIL, //license 库初始化失败
|
||
SENSOR_SDK_NOT_AUTH, //未授权
|
||
SENSOR_SDK_MUTI_PROCESS_INIT, //多个實例初始化
|
||
SENSOR_SDK_AUTOLENS_GET_PARAM, //获取参数失败
|
||
SENSOR_SDK_AUTOLENS_SET_PARAM, //设置参数失败
|
||
SENSOR_SDK_AUTOLENS_SET_AF_PARAM,//设置AF参数失败
|
||
SENSOR_SDK_ERROR, //其他错误
|
||
|
||
}SENSOR_SDK_ERROR_TYPE;
|
||
//autolens
|
||
enum {
|
||
|
||
SensorSDK_AutoLens_Type_ZeroCheck=0x0, //零点矫正, 无参数
|
||
SensorSDK_AutoLens_Type_ZoomIn , // 参数 1-10为速度 ,-1 为停止 ,以下无特殊时同此
|
||
SensorSDK_AutoLens_Type_ZoomOut ,
|
||
SensorSDK_AutoLens_Type_FocusNear ,
|
||
SensorSDK_AutoLens_Type_FocusFar ,
|
||
SensorSDK_AutoLens_Type_FocusAuto , //自动聚焦
|
||
SensorSDK_AutoLens_Type_EnableAuto , // 设置是否启用自动聚焦
|
||
SensorSDK_AutoLens_Type_ZoomFocus , // 精确定位到指定的位置,
|
||
SensorSDK_AutoLens_Type_ZoomPos , // int 精确定位
|
||
SensorSDK_AutoLens_Type_ZoomRange , // int 定位范围
|
||
SensorSDK_AutoLens_Type_FocusPos , // int 精确定位
|
||
SensorSDK_AutoLens_Type_FocusRange , // int 获取 取值范围,精确定位时用
|
||
SensorSDK_AutoLens_Type_ZoomRate , // int 300 代表3.00倍
|
||
SensorSDK_AutoLens_Type_IRCUT , // 0 全波段, 1 可见光模式, 2 红外模式
|
||
|
||
//new
|
||
SensorSDK_AutoLens_Type_Iris_OPEN, // 光圈大 //需要带步长参数1-64 光圈范围固定0-0X3FF
|
||
SensorSDK_AutoLens_Type_Iris_CLOSE, // 光圈小 //需要带步长参数1-64
|
||
SensorSDK_AutoLens_Type_IrisPos, // 获取光圈位置
|
||
|
||
SensorSDK_AutoLens_Type_Fov, //获取对角线视场角精确到0.01度 60度 6000(表示60度)
|
||
SensorSDK_AutoLens_Type_Auto_Check, //设置镜头曲线校准
|
||
SensorSDK_AutoLens_Type_AF_Status, //获取 AF状态
|
||
SensorSDK_AutoLens_Type_ZoomPos_By_Fov, //获取 输入FOV输出ZOOMPOS 调用get接口
|
||
SensorSDK_AutoLens_Type_Fov_By_ZoomPos, //获取 输入ZOOMPOS的值输出FOV 调用get接口
|
||
SensorSDK_AutoLens_Type_Efi, //获取焦距
|
||
SensorSDK_AutoLens_Type_Lens_Offset, //获取镜头中心点偏移量输出水平偏移量和垂直偏移量(**保留暂不使用**)
|
||
SensorSDK_AutoLens_Type_Check_Offset, //设置镜头中心偏移量校准
|
||
SensorSDK_AutoLens_Type_IRCUTLensAuto=0x100, //设置 0 :夜晚1:白天
|
||
SensorSDK_AutoLens_Type_Motor_Hysteresis=0x101, //马达间隙(1-100)步(**保留暂不使用**)
|
||
|
||
|
||
}SENSORSDK_AUTOLENS_TYPE_E;
|
||
|
||
typedef struct
|
||
{
|
||
int nStop; // 1- 停止
|
||
int nSpeed; // 速度 1-10, nStop==0时有效
|
||
|
||
}SensorSDK_AutoLens_Param_Base_T;
|
||
|
||
|
||
|
||
typedef struct
|
||
{
|
||
union
|
||
{
|
||
|
||
SensorSDK_AutoLens_Param_Base_T Param_Base;
|
||
int nZoomRate; // 300 代表 3.00倍
|
||
int nIrCut; // 0-全波段,1-可见光,2红外模式
|
||
int nZoomPos; // 定位, 先获取范围,再定位,定位必须是有效范围内
|
||
int nZoomRange; // 范围
|
||
int nFocusPos; // 定位
|
||
int nFocusRange; // 聚焦定位取值范围
|
||
int nEnableAuto; // 使能 自动 聚焦功能
|
||
int nZoomFocusPos[2]; // nZoomFocusPos[0]:focuspos,nZoomFocusPos[1]:zoompos
|
||
int nIrStep; // 光圈步长1-64
|
||
int nIrPos; // 定位
|
||
int nFOV; // 对角线视场角[ 1, 6000]表示 0.01度到60度
|
||
int nEFI; // 焦距
|
||
int nAFStatus; // 自动镜头状态
|
||
int nFOVZoomPos; // nFOVZoomPos 输入输出
|
||
int nIRCUTLensAuto; // 0-夜晚 1-白天
|
||
int ress[4];
|
||
}Params;
|
||
}SENSOR_SDK_AUTOLENS_PARAM_T;
|
||
|
||
enum SENSOR_SDK_AF_STATUS_E
|
||
{
|
||
SENSOR_SDK_AF_STATUS_IDLE = 0x1,
|
||
SENSOR_SDK_AF_STATUS_DO_ZOOM,
|
||
SENSOR_SDK_AF_STATUS_DO_FOCUS,
|
||
SENSOR_SDK_AF_STATUS_DO_AUTO_FOCUS,
|
||
SENSOR_SDK_AF_STATUS_ZOOM_ING,
|
||
SENSOR_SDK_AF_STATUS_FOCUS_ING,
|
||
SENSOR_SDK_AF_STATUS_AUTO_FOCUS_ING,
|
||
SENSOR_SDK_AF_STATUS_DETECT,
|
||
SENSOR_SDK_AF_STATUS_TEST,
|
||
};
|
||
|
||
typedef struct _SensorSDK_CameraLens
|
||
{
|
||
int AFControlModel; //对焦控制方式 0----自动 1----半自动 2----手动
|
||
int AFArea; //对焦区域选择 (保留)0----全区域对焦 1----中心对焦
|
||
int AFSearchModel; //对焦区搜索方式 0 --- 全景, 1 --- 1.5m, 2 --- 3m, 3 --- 6m, 4 --- 无穷远
|
||
int AFSensitivity; //对焦灵敏度 0 ~255
|
||
int DigitZoomEnable; //数字ZOOM允许
|
||
int IrisControl; //光圈调节0 自动 1手动
|
||
} SensorSDK_CameraLens;
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
// SDK 初始化接口
|
||
// nFlashPartIdx : 软件授权信息存放的分区索引号,注意分区需要自己提前创建好
|
||
// 例如分区为/dev/mmcblk0p5,此处参数取值为5
|
||
// 分区为/dev/mtd6,此处参数取值为6
|
||
// BoardLine 板接口定义,000,第一位代表zoomfocus顺序,后面两个代表两个电机方向;每位取值为 0或者1
|
||
// szLensType 镜头型号,可取值如下
|
||
/*
|
||
"MUXIA_5X",
|
||
"RICOM_AF3610_4K","YS_15_3_XM02","RICOM_3312_4K","RICOM_27135_6MP", "RICOM_2812_5MP","RICOM_2812_2MP",
|
||
"YT_6022_3MP","YT_3610_3MP","YT_3611_4K","YT_27135_HD","YT_27135_4MP","YT_2712_HD","YT_2812_4MP","YT_2812_2MP","RICOM_2812_3MP",
|
||
"YT_550_2MP","RICOM_5M_50MM_1_27F","YT6022","YT3013","YT2712","YT3610","3.6-10mm","YT2812","YT3015","RICON2814","RICON2812","YT2808",
|
||
"2.8-8mm","RICOM_4K_AF2710DC","RICOM_4K_33_120MM_14F","RICOM_3M_28_120MM_14F","RICOM_5M_38_100MM","RICOM_2M_22_120MM_14F","RICOM_3M_28_80MM"
|
||
*/
|
||
// szAutoLensParmPath: 保存当前变焦状态用的路径,路径必须可写
|
||
// pCameralens: 自动聚焦镜头参数
|
||
|
||
//return 错误码见 SENSOR_SDK_ERROR_TYPE
|
||
|
||
//初始化接口
|
||
int SensorSdk_Init(int nFlashPartIdx,char *szBoardLine,char *szLensType ,
|
||
char *szAutoLensParmPath /* 保存当前变焦状态用的路径 */, SensorSDK_CameraLens *pCameralens = 0);
|
||
|
||
//获取授权状态 SENSOR_SDK_SUCC-授权成功
|
||
int SensorSdk_GetAuthStatus();
|
||
|
||
// 镜头变焦变倍 接口
|
||
// 设置 动作
|
||
// nType : 见 SensorSDK_AutoLens_Type_XXX 宏定义
|
||
// nParam : SENSOR_SDK_AUTOLENS_PARAM_T
|
||
int SensorSdk_AutoLens_SetParam(int nDev,int nType,SENSOR_SDK_AUTOLENS_PARAM_T *pParam);
|
||
// 获取当前 信息
|
||
int SensorSdk_AutoLens_GetParam(int nDev,int nType,SENSOR_SDK_AUTOLENS_PARAM_T *pParam);
|
||
//設置自动聚焦镜头参数
|
||
int SensorSdk_AutoLens_SetAFParam(SensorSDK_CameraLens *pCameralens);
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
|
||
|
||
#endif
|
||
|