#ifndef IVREYEDEVICE_H #define IVREYEDEVICE_H #include // #include "VrEyeDevice_global.h" #include "VZNL_Common.h" // #VREYEDEVICE_EXPORT class IVrEyeDevice { public: virtual ~IVrEyeDevice() = default; // 初始化对象 static int CreateObject(IVrEyeDevice** ppEyeDevice); /** * 初始化设备 */ virtual int InitDevice() = 0; /** * 设置状态回调函数 */ virtual int SetStatusCallback(VzNL_OnNotifyStatusCBEx fNotify, void *param) = 0; /** * Open设备 */ virtual int OpenDevice(const char* sIP, bool bRGBD = false, bool bSwing = true, bool bFillLaser = true) = 0; /** * 获取版本信息 * @return 版本信息 */ virtual int GetVersion(SVzNLVersionInfo& sVersionInfo) = 0; /** * 获取设备信息 * @return */ virtual int GetDevInfo(SVzNLEyeDeviceInfoEx& sDeviceInfo) = 0; /** * Close设备 */ virtual int CloseDevice() = 0; /** * 开始自动检测 * @return 错误代码 0表示成功 */ virtual int StartDetect(VzNL_AutoOutputLaserLineExCB fCallFunc, EVzResultDataType eDataType, void *param) = 0; /** * 是否正在检测 * @return */ virtual bool IsDetectIng() = 0; /** * 停止自动检测 * @return 错误代码 0表示成功 */ virtual int StopDetect() = 0; /** * 开始连续采集图像(左右目) * @param fCallback 图像回调函数 * @param param 回调参数 * @return 错误代码 0表示成功 */ virtual int StartCapture(VzNL_OutputImageCB fCallback, void* param) = 0; /** * 停止采集图像 * @return 错误代码 0表示成功 */ virtual int StopCapture() = 0; /** * 是否正在采集图像 * @return true表示正在采集 */ virtual bool IsCapturing() = 0; /** * 获取单帧左右目图像(同步阻塞) * @param ppLeftImage 输出左目图像,使用后需调用 ReleaseImage 释放 * @param ppRightImage 输出右目图像,使用后需调用 ReleaseImage 释放 * @param nTimeOut 超时时间(ms) * @return 错误代码 0表示成功 */ virtual int GetEyeImage(SVzNLImageData** ppLeftImage, SVzNLImageData** ppRightImage, unsigned int nTimeOut = 3000) = 0; /** * 释放图像数据 * @param ppImageData 待释放的图像指针 * @return 错误代码 0表示成功 */ virtual int ReleaseImage(SVzNLImageData** ppImageData) = 0; /** * ROI设置 * @param leftROI * @param rightROI * @return */ virtual int SetDetectROI(SVzNLRect& leftROI, SVzNLRect& rightROI) = 0; virtual int GetDetectROI(SVzNLRect& leftROI, SVzNLRect& rightROI) = 0; /** * 曝光设置&获取 * @return */ virtual int SetEyeExpose(unsigned int& exposeTime) = 0; virtual int GetEyeExpose(unsigned int& exposeTime) = 0; /** * 增益设置&获取 * @param gain * @return */ virtual int SetEyeGain(unsigned int& gain) = 0; virtual int GetEyeGain(unsigned int& gain) = 0; /** * 帧率设置&获取 * @param frame * @return */ virtual int SetFrame(int& frame) = 0; virtual int GetFrame(int& frame) = 0; /** * 是否支持RGBD * @return */ virtual bool IsSupport() = 0; /** * 设置彩色Sensor期望值 * @param value * @return */ virtual int SetRGBDExposeThres(float& value) = 0; virtual int GetRGBDExposeThres(float& value) = 0; /** * 设置过滤高度 * @param dHeight * @return */ virtual int SetFilterHeight(double& dHeight) = 0; virtual int GetFilterHeight(double& dHeight) = 0; /** * 配置摆动机构速度 * @return */ virtual int GetSwingSpeed(float& fSpeed) = 0; virtual int SetSwingSpeed(float& fSpeed) = 0; /** * 设置工作角度 * @param nMin * @param nMax * @return */ virtual int SetSwingAngle(float& fMin, float& fMax) = 0; virtual int GetSwingAngle(float& fMin, float& fMax) = 0; /** * 设置工作距离 * @param nMin * @param nMax * @return */ virtual int SetWorkRange(double& dMin, double& dMax) = 0; virtual int GetWorkRange(double& dMin, double& dMax) = 0; }; #endif // CVREYEDEVICE_H