GrabBag/Device/EpicEyeDevice/Inc/IEpicEyeDevice.h

203 lines
6.1 KiB
C
Raw Normal View History

2025-12-10 00:01:32 +08:00
#ifndef IEPICEYEDEVICE_H
#define IEPICEYEDEVICE_H
#include <iostream>
#include <string>
#include <vector>
#include <functional>
// 设备信息结构
struct EpicEyeDeviceInfo
{
std::string serialNumber; // 序列号
std::string ipAddress; // IP地址
std::string modelName; // 型号名称
std::string alias; // 别名
unsigned int width; // 图像宽度
unsigned int height; // 图像高度
};
// 点云数据结构
struct PointCloudData
{
float* pData; // 点云数据指针 (x, y, z 交替存储)
unsigned int width; // 点云宽度
unsigned int height; // 点云高度
unsigned int pointCount; // 点数 (width * height)
std::string frameID; // 帧ID
};
// 2D图像数据结构
struct ImageData2D
{
unsigned char* pData; // 图像数据指针
unsigned int width; // 图像宽度
unsigned int height; // 图像高度
unsigned int dataSize; // 数据大小
int pixelByteSize; // 像素字节大小
std::string frameID; // 帧ID
};
// 深度图数据结构
struct DepthData
{
float* pData; // 深度数据指针
unsigned int width; // 深度图宽度
unsigned int height; // 深度图高度
unsigned int dataSize; // 数据大小
std::string frameID; // 帧ID
};
// 相机内参结构
struct CameraIntrinsics
{
std::vector<float> cameraMatrix; // 相机矩阵 3x3
std::vector<float> distortion; // 畸变参数
};
/**
* @brief IEpicEyeDevice
* EpicEye SDK 3D C++
*/
class IEpicEyeDevice
{
public:
virtual ~IEpicEyeDevice() = default;
/**
* @brief
* @param ppDevice
* @return 0--
*/
static int CreateObject(IEpicEyeDevice** ppDevice);
/**
* @brief SDK
* @param version SDK版本字符串
* @return 0--
*/
virtual int GetSDKVersion(std::string& version) = 0;
/**
* @brief EpicEye
* @param deviceList
* @return 0--
*/
virtual int SearchCameras(std::vector<EpicEyeDeviceInfo>& deviceList) = 0;
/**
* @brief IP
* @param ipAddress IP
* @return 0--
*/
virtual int Connect(const std::string& ipAddress) = 0;
/**
* @brief
* @return 0--
*/
virtual int Disconnect() = 0;
/**
* @brief
* @return true-false-
*/
virtual bool IsConnected() = 0;
/**
* @brief
* @param deviceInfo
* @return 0--
*/
virtual int GetDeviceInfo(EpicEyeDeviceInfo& deviceInfo) = 0;
/**
* @brief 2D图像
* @param frameID ID
* @param withPointCloud true
* @return 0--
*/
virtual int TriggerCapture(std::string& frameID, bool withPointCloud = true) = 0;
/**
* @brief
* @param frameID ID TriggerCapture
* @param pointCloud
* @return 0--
* @note
*/
virtual int GetPointCloud(const std::string& frameID, PointCloudData& pointCloud) = 0;
/**
* @brief 2D图像数据
* @param frameID ID TriggerCapture
* @param image
* @return 0--
* @note
*/
virtual int GetImage(const std::string& frameID, ImageData2D& image) = 0;
/**
* @brief
* @param frameID ID TriggerCapture
* @param depth
* @return 0--
* @note
*/
virtual int GetDepth(const std::string& frameID, DepthData& depth) = 0;
/**
* @brief +
* @param pointCloud
* @param timeout 5000ms
* @return 0--
* @note 便 TriggerCapture GetPointCloud
*/
virtual int CapturePointCloud(PointCloudData& pointCloud, unsigned int timeout = 5000) = 0;
/**
* @brief 2D图像+
* @param image
* @param timeout 5000ms
* @return 0--
*/
virtual int CaptureImage(ImageData2D& image, unsigned int timeout = 5000) = 0;
/**
* @brief
* @param intrinsics
* @return 0--
*/
virtual int GetCameraIntrinsics(CameraIntrinsics& intrinsics) = 0;
/**
* @brief JSON格式
* @param configJson JSON字符串
* @return 0--
*/
virtual int GetConfig(std::string& configJson) = 0;
/**
* @brief JSON格式
* @param configJson JSON字符串
* @return 0--
*/
virtual int SetConfig(const std::string& configJson) = 0;
/**
* @brief
* @param width
* @return 0--
*/
virtual int GetWidth(unsigned int& width) = 0;
/**
* @brief
* @param height
* @return 0--
*/
virtual int GetHeight(unsigned int& height) = 0;
};
#endif // IEPICEYEDEVICE_H