yangsy
About 757 wordsAbout 3 min
2024-06-06
// Error codes
enum SYErrorCode
{
// Success
SYERRORCODE_SUCCESS = 0,
// Failure
SYERRORCODE_FAILED = 1,
// Device does not exist
SYERRORCODE_DEVICENOTEXIST = 2,
// Device not opened
SYERRORCODE_DEVICENOTOPENED = 3,
// Unsupported resolution
SYERRORCODE_UNKOWNRESOLUTION = 4,
// Device pointer handle is empty
SYERRORCODE_DEVICEHANDLEEMPTY = 5,
// Failed to set device output data format
SYERRORCODE_SETOUTPUTFORMATFAILED = 6,
// Failed to get video stream control pointer
SYERRORCODE_GETSTREAMCTRLFAILED = 7,
// Failed to start video stream
SYERRORCODE_STARTSTREAMINGFAILED = 8,
// Communication pointer is empty
SYERRORCODE_COMMUNICATEOBJECTEMPTY = 9,
// Invalid SN number
SYERRORCODE_UNKOWNSN = 10,
// String length out of range
SYERRORCODE_STRINGLENGTHOUTRANGE = 11,
// Invalid frame type
SYERRORCODE_UNKOWNFRAMETYPE = 12,
// Invalid device type
SYERRORCODE_UNKOWNDEVICETYPE = 13,
// Device object pointer is empty
SYERRORCODE_DEVICEOBJECTEMPTY = 14,
// Observer object pointer is empty
SYERRORCODE_OBSERVEREMPTY = 15,
// Observer object not found
SYERRORCODE_OBSERVERNOTFOUND = 16,
// Count out of range
SYERRORCODE_COUNTOUTRANGE = 17,
// UVC initialization failed
SYERRORCODE_UVCINITFAILED = 18,
// UVC device search failed
SYERRORCODE_UVCFINDDEVICEFAILED = 19,
// No data frame
SYERRORCODE_NOFRAME = 20,
// Failed to get application folder path
SYERRORCODE_GETAPPFOLDERPATHFAILED = 21,
// Video stream not started
SYERRORCODE_NOSTREAMING = 22,
// Algorithm pointer is empty
SYERRORCODE_RECONSTRUCTIONEMPTY = 23,
// Video stream already started
SYERRORCODE_STREAMINGEXIST = 24,
// Unknown stream type
SYERRORCODE_UNKOWNSTREAMTYPE = 25,
// Data pointer is empty
SYERRORCODE_DATABUFFEREMPTY = 26,
// Repeated operation
SYERRORCODE_REPEATED = 27,
// Firmware version too low, does not support this feature
SYERRORCODE_FIRMWARE_VERSION_TOO_LOW = 28,
};
// Device types
enum SYDeviceType
{
// Invalid
SYDEVICETYPE_NULL = 0,
// CS30 Dual Frequency
SYDEVICETYPE_CS30_DUAL,
// CS30 Single Frequency
SYDEVICETYPE_CS30_SINGLE,
// CS20 Dual Frequency
SYDEVICETYPE_CS20_DUAL,
// CS20 Single Frequency
SYDEVICETYPE_CS20_SINGLE,
// CS20_P
SYDEVICETYPE_CS20_P,
// CS40
SYDEVICETYPE_CS40,
// CS40PRO
SYDEVICETYPE_CS40PRO,
};
// Data stream types
enum SYStreamType
{
// Invalid
SYSTREAMTYPE_NULL = 0,
// RAW
SYSTREAMTYPE_RAW,
// Depth
SYSTREAMTYPE_DEPTH,
// RGB
SYSTREAMTYPE_RGB,
// Depth + IR
SYSTREAMTYPE_DEPTHIR,
// Depth + RGB
SYSTREAMTYPE_DEPTHRGB,
// Depth + IR + RGB
SYSTREAMTYPE_DEPTHIRRGB,
// RGBD (mapped depth + RGB)
SYSTREAMTYPE_RGBD,
// RAW_RGB
SYSTREAMTYPE_RAWRGB,
// RGBD_AI - Not open
SYSTREAMTYPE_RGBDAI,
};
// Resolution enumeration
enum SYResolution
{
// Invalid
SYRESOLUTION_NULL = 0,
// 320*240
SYRESOLUTION_320_240,
// 640*480
SYRESOLUTION_640_480,
// 960*540
SYRESOLUTION_960_540,
// 1920*1080
SYRESOLUTION_1920_1080,
// 1600*1200
SYRESOLUTION_1600_1200,
};
// Data frame types
enum SYFrameType
{
// Invalid
SYFRAMETYPE_NULL = 0,
// RAW
SYFRAMETYPE_RAW,
// Depth
SYFRAMETYPE_DEPTH,
// IR
SYFRAMETYPE_IR,
// RGB
SYFRAMETYPE_RGB,
// AI - Not open
SYFRAMETYPE_AI,
};
// Supported types
enum SYSupportType
{
// Invalid
SYSUPPORTTYPE_NULL = 0,
// Depth
SYSUPPORTTYPE_DEPTH,
// RGB
SYSUPPORTTYPE_RGB,
// RGBD
SYSUPPORTTYPE_RGBD,
// RGBDAI - Not open
SYSUPPORTTYPE_RGBDAI,
};
// Event types
enum SYEventType
{
// Invalid
SYEVENTTYPE_NULL = 0,
// Device connection
SYEVENTTYPE_DEVICECONNECT,
// Device disconnection
SYEVENTTYPE_DEVICEDISCONNECT,
};
// Filter types
enum SYFilterType
{
// Invalid
SYFILTERTYPE_NULL = 0,
// Median
SYFILTERTYPE_MEDIAN,
// Amplitude
SYFILTERTYPE_AMPLITUDE,
// Edge
SYFILTERTYPE_EDGE,
// Speckle
SYFILTERTYPE_SPECKLE,
// Okada
SYFILTERTYPE_OKADA,
// Edge MAD
SYFILTERTYPE_EDGE_MAD,
// Gaussian
SYFILTERTYPE_GAUSS,
// Extra
SYFILTERTYPE_EXTRA,
// Extra 2
SYFILTERTYPE_EXTRA2,
// Edge Sobel
SYFILTERTYPE_EDGE_SOBEL,
// IR
SYFILTERTYPE_IR,
};
// Device information
struct SYDeviceInfo
{
// Unique device ID
unsigned int m_nDeviceID = 0;
// Device type
SYDeviceType m_deviceType = SYDEVICETYPE_NULL;
// USB bus
unsigned int m_nUsbBus = 0;
// USB ports
unsigned int m_nUsbPorts[7] = {0};
unsigned int m_nUsbPortsNumber = 0;
// USB device address
unsigned int m_nUsbDeviceAddress = 0;
// IP
unsigned int m_nIPAddress = 0;
};
// Event information
struct SYEventInfo
{
// Event type
SYEventType m_eventType = SYEVENTTYPE_NULL;
// Event information data
void* m_pEventInfo = nullptr;
// Data length
int m_nLength = 0;
};
// Data frame information
struct SYFrameInfo
{
// Frame type
SYFrameType m_frameType = SYFRAMETYPE_NULL;
// Height (pixels)
int m_nFrameHeight = 0;
// Width (pixels)
int m_nFrameWidth = 0;
};
// Data frame
struct SYFrameData
{
// Number of frames
int m_nFrameCount = 0;
// Frame information
SYFrameInfo* m_pFrameInfo = nullptr;
// Frame data
void* m_pData = nullptr;
// Data length
int m_nBuffferLength = 0;
};
// Point cloud data structure
struct SYPointCloudData
{
// X
float m_fltX = 0.f;
// Y
float m_fltY = 0.f;
// Z
float m_fltZ = 0.f;
};
// Camera parameters structure
struct SYIntrinsics
{
// Lens field of view
float m_fltFOV[2];
// Distortion coefficients
float m_fltCoeffs[5];
// Focal distance in x direction
float m_fltFocalDistanceX;
// Focal distance in y direction
float m_fltFocalDistanceY;
// Imaging center point in x direction, i.e., cx
float m_fltCenterPointX;
//
Imaging center point in y direction, i.e., cy
float m_fltCenterPointY;
// Width
int m_nWidth;
// Height
int m_nHeight;
};
// AI model types
enum SYAIModelType
{
// Invalid
SYAIMODELTYPE_NULL = 0,
// Object detection
SYAIMODELTYPE_DETECT,
// Face recognition
SYAIMODELTYPE_FACE,
// Pose recognition
SYAIMODELTYPE_POSE,
};
struct SYAIModelInfo
{
// AI model type
SYAIModelType m_modelType = SYAIMODELTYPE_NULL;
// AMS threshold
float m_fltAMS = 0.5;
// Box threshold
float m_fltBox = 0.5;
// Model file data
void* m_pFileData = nullptr;
// Data length
int m_nFileLength = 0;
};