Retrieve SDK Version Information
作者:yangsy
2024/06/06 11:24:35
Global Interfaces
Get SDK Version
//Get the SDK version number
//@ param [in/out] nLength Character length
//@ param [in/out] pstrSDKVersion SDK version number string pointer
//@ return Error code
SYErrorCode GetSDKVersion(int& nLength, char* pstrSDKVersion = nullptr);Initialize SDK
//Initialize the SDK
//@ return Error code
SYErrorCode InitSDK();Uninitialize SDK, release resources
//Uninitialize the SDK, release resources
//@ return Error code
SYErrorCode UnInitSDK();Find Devices
//Find devices
//@ param [in/out] nCount Number of devices
//@ param [in/out] pDevice Device information, allocate memory externally, pass nullptr to pDevice to only get nCount
//@ return Error code
SYErrorCode FindDevice(int& nCount, SYDeviceInfo* pDevice = nullptr);Open Device
//Open device
//@ param [in] deviceInfo Device information
//@ return Error code
SYErrorCode OpenDevice(const SYDeviceInfo& deviceInfo);Close Device
//Close device
//@ param [in] nDeviceID Device ID
//@ return Error code
SYErrorCode CloseDevice(unsigned int nDeviceID);Query Device Support Types
//Query device support types
//@ param [in] nDeviceID Device ID
//@ param [in/out] nCount Number of supported data frame types, pSupportType is used for returning the count when it's nullptr, otherwise it's for verifying the memory allocation size
//@ param [in/out] pSupportType Supported types, allocate memory externally, pass nullptr to pSupportType to only get nCount
//@ return Error code
SYErrorCode QueryDeviceSupportFrameType(unsigned int nDeviceID, int& nCount, SYSupportType * pSupportType = nullptr);Query Device Supported Frame Resolutions
//Query device supported frame resolutions
//@ param [in] nDeviceID Device ID
//@ param [in] supportType Frame type
//@ param [in/out] nCount Number of supported resolutions, pResolution is used for returning the count when it's nullptr, otherwise it's for verifying the memory allocation size
//@ param [in/out] pResolution Supported resolution types, allocate memory externally, pass nullptr to pResolution to only get nCount
//@ return Error code
SYErrorCode QueryDeviceSupportResolution(unsigned int nDeviceID, SYSupportType supportType, int& nCount, SYResolution* pResolution = nullptr);Get Current Stream Type
//Get current stream type
//@ param [in] nDeviceID Device ID
//@ return Current stream type
SYStreamType GetCurrentStreamType(unsigned int nDeviceID);Start Data Stream
//Start data stream
//@ param [in] nDeviceID Device ID
//@ param [in] streamType Data stream type
//@ return Error code
SYErrorCode StartStreaming(unsigned int nDeviceID, SYStreamType streamType);Stop Data Stream
//Stop data stream
//@ param [in] nDeviceID Device ID
//@ return Error code
SYErrorCode StopStreaming(unsigned int nDeviceID);Change Data Stream
//Change data stream
//@ param [in] nDeviceID Device ID
//@ param [in] streamType Data stream type
//@ return Error code
SYErrorCode ChangeStreaming(unsigned int nDeviceID, SYStreamType streamType);Set Resolution (If the data stream has been started, the internal process will close the stream -> set resolution -> reopen the stream)
//Set resolution (If the data stream has been started, the internal process will close the stream -> set resolution -> reopen the stream)
//@ param [in] nDeviceID Device ID
//@ param [in] frameType Frame type
//@ param [in] resolution Frame resolution
//@ return Error code
SYErrorCode SetFrameResolution(unsigned int nDeviceID, SYFrameType frameType, SYResolution resolution);Get Device Frame Resolution
//Get device frame resolution
//@ param [in] nDeviceID Device ID
//@ param [in] frameType Frame type
//@ param [out] resolution Frame resolution
//@ return Error code
SYErrorCode GetFrameResolution(unsigned int nDeviceID, SYFrameType frameType, SYResolution& resolution);Get Depth Corresponding Pseudo Color
//Get depth corresponding pseudo color
//@ param [in] nDeviceID Device ID
//@ param [in] nCount Data count (memory space pDepth needs nCount*2 bytes, pColor needs nCount*3 bytes)
//@ param [in] pDepth Depth data
//@ param [in/out] pColor Depth corresponding pseudo color (24-bit RGB format)
//@ return Error code
SYErrorCode GetDepthColor(unsigned int nDeviceID, int nCount, const unsigned short* pDepth, unsigned char* pColor);Get Depth Corresponding Point Cloud Data
//Get depth corresponding point cloud data
//@ param [in] nDeviceID Device ID
//@ param [in] nWidth Width
//@ param [in] nHeight Height
//@ param [in] pDepth Depth data
//@ param [in/out] pPointCloud Depth corresponding point cloud data, allocate memory externally
//@ param [in] bUndistort Cropping flag, true-cropping false-no cropping
//@ return Error code
SYErrorCode GetDepthPointCloud(unsigned int nDeviceID, int nWidth, int nHeight, const unsigned short* pDepth, SYPointCloudData* pPointCloud, bool bUndistort = false);Get RGBD
//Get RGBD
//@ param [in] nDeviceID Device ID
//@ param [in] nSourceDepthWidth Source depth data width
//@ param [in] nSourceDepthHeight Source depth data height
//@ param [in] pSourceDepth Source depth data
//@ param [in] nSourceRGBWidth Source RGB data width
//@ param [in] nSourceRGBHeight Source RGB data height
//@ param [in] pSourceRGB Source RGB data
//@ param [in] nTargetWidth RGBD data width
//@ param [in] nTargetHeight RGBD data height
//@ param [in/out] pTargetDepth Depth data in RGBD, allocate memory externally, data length is consistent with source RGB length
//@ param [in/out] pTargetRGB RGB data in RGBD, allocate memory externally, data length is consistent with source RGB length
//@ param [in/out] bTOFtoRGB Alignment: true- Align based on RGB; false- Align based on TOF
//@ return Error code
SYErrorCode GetRGBD(unsigned int nDeviceID, int nSourceDepthWidth, int nSourceDepthHeight, unsigned short* pSourceDepth, int nSourceRGBWidth, int nSourceRGBHeight, unsigned char* pSourceRGB, int nTargetWidth, int nTargetHeight, unsigned short* pTargetDepth, unsigned char* pTargetRGB,bool bTOFtoRGB = true);Get the Latest Frame Data
//Get the latest frame data
//@ param [in] nDeviceID Device ID
//@ param [in/out] pFrameData The latest frame data
//@ return Error code
SYErrorCode GetLastFrameData(unsigned int nDeviceID, SYFrameData*& pFrameData);Filtering Related Interfaces
Get Filtering Status
//Get filtering status
//@ param [in] nDeviceID Device ID
//@ param [out] bFilter Filtering status, true-filtering is enabled, false-filtering is not enabled
//@ return Error code
SYErrorCode GetFilter(unsigned int nDeviceID, bool& bFilter);Enable/Disable Filtering
//Enable/disable filtering
//@ param [in] nDeviceID Device ID
//@ param [in] bFilter Filtering switch, true-enable filtering, false-disable filtering
//@ return Error code
SYErrorCode SetFilter(unsigned int nDeviceID, bool bFilter);Get Hardware Filtering Mode Status
//Get hardware filtering mode status
//@ param [in] nDeviceID Device ID
//@ param [out] bHardwareFilterMode Hardware filtering mode status, true-hardware filtering mode is enabled, false-hardware filtering mode is not enabled
//@ return Error code
SYErrorCode GetHardWareFilterMode(unsigned int nDeviceID, bool& bHardwareFilterMode);Enable/Disable Hardware Filtering Mode
//Enable/disable hardware filtering mode
//@ param [in] nDeviceID Device ID
//@ param [in] bHardwareFilterMode Hardware filtering mode status, true-enable hardware filtering mode, false-disable hardware filtering mode
//@ return Error code
SYErrorCode SetHardWareFilterMode(unsigned int nDeviceID, bool bHardwareFilterMode);Hardware Filtering Mode Availability
//Hardware filtering mode availability
//@ param [in] nDeviceID Device ID
//@ param [in] bHaveHardwareFilterMode Hardware filtering mode availability flag, true-available, false-unavailable
//@ return Error code
SYErrorCode HaveHardWareFilterMode(unsigned int nDeviceID, bool& bHaveHardwareFilterMode);Get Filtering List
//Get filtering list
//@ param [in] nDeviceID Device ID
//@ param [in/out] nCount Filtering list length
//@ param [in/out] pFilterType Filtering list
//@ return Error code
SYErrorCode GetFilterList(unsigned int nDeviceID, int& nCount, SYFilterType* pFilterType = nullptr);Set Default Filtering
//Set default filtering
//@ param [in] nDeviceID Device ID
//@ return Error code
SYErrorCode SetDefaultFilter(unsigned int nDeviceID);Add Filtering
//Add filtering
//@ param [in] nDeviceID Device ID
//@ param [in] filterType Filtering type
//@ return Error code
SYErrorCode AddFilter(unsigned int nDeviceID, SYFilterType filterType);Remove Filtering
//Remove filtering
//@ param [in] nDeviceID Device ID
//@ param [in] nIndex Filtering list index
//@ return Error code
SYErrorCode DeleteFilter(unsigned int nDeviceID, int nIndex);Clear Filtering
//Clear filtering
//@ param [in] nDeviceID Device ID
//@ return Error code
SYErrorCode ClearFilter(unsigned int nDeviceID);Set Filtering Parameters
//Set filtering parameters
//@ param [in] nDeviceID Device ID
//@ param [in] filterType Filtering type
//@ param [in] nParamCount Number of filtering parameters
//@ param [in] pFilterParam Filtering parameters
//@ return Error code
SYErrorCode SetFilterParam(unsigned int nDeviceID, SYFilterType filterType, int nParamCount, float* pFilterParam);Get Filtering Parameters
//Get filtering parameters
//@ param [in] nDeviceID Device ID
//@ param [in] filterType Filtering type
//@ param [in/out] nParamCount Number of filtering parameters
//@ param [in/out] pFilterParam Filtering parameters
//@ return Error code
SYErrorCode GetFilterParam(unsigned int nDeviceID, SYFilterType filterType, int& nParamCount, float* pFilterParam = nullptr);Get Trail Filtering Status
//Get trail filtering status
//@ param [in] nDeviceID Device ID
//@ param [out] bFilter Trail filtering status, true-filtering is enabled, false-filtering is not enabled
//@ return Error code
SYErrorCode GetTrailFilter(unsigned int nDeviceID, bool& bFilter);Enable/Disable Trail Filtering
//Enable/disable trail filtering
//@ param [in] nDeviceID Device ID
//@ param [in] bFilter Trail filtering switch, true-enable filtering, false-disable filtering
//@ return Error code
SYErrorCode SetTrailFilter(unsigned int nDeviceID, bool bFilter);Use IR to Filter Depth Data
Info
Supported after SDK version v4.2.3.0
//Use IR to filter depth data
//@ param [in] nDeviceID Device ID
//@ param [in/out] pDepth Depth data pointer
//@ param [in] pIR IR data pointer
//@ param [in] nWidth Data width
//@ param [in] nHeight Data height
//@ param [in] nThreshold IR threshold
SYErrorCode IRFilter(unsigned int nDeviceID, unsigned short* pDepth, unsigned short* pIR, int nWidth, int nHeight, int nThreshold);Extended Function Interfaces
Get Horizontal Mirror Status
//Get horizontal mirror status
//@ param [in] nDeviceID Device ID
//@ param [out] bMirror Horizontal mirror status, true-horizontal mirror is enabled, false-horizontal mirror is not enabled
//@ return Error code
SYErrorCode GetMirror(unsigned int nDeviceID, bool& bMirror);Enable/Disable Horizontal Mirror
//Enable/disable horizontal mirror
//@ param [in] nDeviceID Device ID
//@ param [in] bMirror Horizontal mirror switch, true-enable horizontal mirror, false-disable horizontal mirror
//@ return Error code
SYErrorCode SetMirror(unsigned int nDeviceID, bool bMirror);Get Vertical Flip Status
//Get vertical flip status
//@ param [in] nDeviceID Device ID
//@ param [out] bFlip Vertical flip status, true-vertical flip is enabled, false-vertical flip is not enabled
//@ return Error code
SYErrorCode GetFlip(unsigned int nDeviceID, bool& bFlip);Enable/Disable Vertical Flip
//Enable/disable vertical flip
//@ param [in] nDeviceID Device ID
//@ param [in] bFlip Vertical flip switch, true-enable vertical flip, false-disable vertical flip
//@ return Error code
SYErrorCode SetFlip(unsigned int nDeviceID, bool bFlip);Get Integration Time
//Get integration time
//@ param [in] nDeviceID Device ID
//@ param [out] nIntegralTime Integration time
//@ return Error code
SYErrorCode GetIntegralTime(unsigned int nDeviceID, int& nIntegralTime);Set Integration Time
//Set integration time
//@ param [in] nDeviceID Device ID
//@ param [in] nIntegralTime Integration time
//@ return Error code
SYErrorCode SetIntegralTime(unsigned int nDeviceID, int nIntegralTime);Get Integration Time Range
//Get integration time range
//@ param [in] nDeviceID Device ID
//@ param [in] depthResolution Depth resolution
//@ param [out] nMin Minimum integration time
//@ param [out] nMax Maximum integration time
//@ return Error code
SYErrorCode GetIntegralTimeRange(unsigned int nDeviceID, SYResolution depthResolution, int& nMin, int& nMax);Get Ranging Measure Range
//Get ranging measure range
//@ param [in] nDeviceID Device ID
//@ param [out] nMin Minimum ranging value
//@ param [out] nMax Maximum ranging value
//@ return Error code
SYErrorCode GetDistanceMeasureRange(unsigned int nDeviceID, int& nMin, int& nMax);Get User Ranging Range
//Get user ranging range
//@ param [in] nDeviceID Device ID
//@ param [out] nMin Minimum user ranging value
//@ param [out] nMax Maximum user ranging value
//@ return Error code
SYErrorCode GetDistanceUserRange(unsigned int nDeviceID, int& nMin, int& nMax);Set User Ranging Range
//Set user ranging range
//@ param [in] nDeviceID Device ID
//@ param [in] nMin Minimum user ranging value
//@ param [in] nMax Maximum user ranging value
//@ return Error code
SYErrorCode SetDistanceUserRange(unsigned int nDeviceID, int nMin, int nMax);Read Device SN Number
//Read device SN number
//@ param [in] nDeviceID Device ID
//@ param [in/out] nLength Character length
//@ param [in/out] pstrSN Device SN number string pointer, allocate memory externally, pass nullptr to pstrSN to only get nLength
//@ return Error code
SYErrorCode GetDeviceSN(unsigned int nDeviceID, int& nLength, char* pstrSN = nullptr);Write Device SN Number
//Write device SN number
//@ param [in] nDeviceID Device ID
//@ param [in] nLength Character length
//@ param [in] pstrSN Device SN number string pointer
//@ return Error code
SYErrorCode SetDeviceSN(unsigned int nDeviceID, int nLength, const char* pstrSN);Read Device Firmware Version
//Read device firmware version
//@ param [in] nDeviceID Device ID
//@ param [in/out] nLength Character length
//@ param [in/out] pstrHWVersion Firmware version string pointer, allocate memory externally, pass nullptr to pstrHWVersion to only get nLength
//@ return Error code
SYErrorCode GetDeviceHWVersion(unsigned int nDeviceID, int& nLength, char* pstrHWVersion = nullptr);Undistort
//Undistort
//@ param [in] nDeviceID Device ID
//@ param [in] pSource Undistorted data pointer
//@ param [in] nWidth Image width
//@ param [in] nHeight Image height
//@ param [in] bDepth Whether it is depth data/RGB data
//@ param [out] pTarget Undistorted result data pointer, allocate memory externally, data length is consistent with the length of undistorted data pointer
SYErrorCode Undistort(unsigned int nDeviceID, const unsigned short* pSource, int nWidth, int nHeight, bool bDepth, unsigned short* pTarget);Get Camera Parameters
Info
Currently , only TOF camera intrinsic parameters can be obtained, RGB camera intrinsic parameters are not supported at present.
//Get camera parameters
//@ param [in] nDeviceID Device ID
//@ param [in] resolution Resolution
//@ param [in/out] intrinsics Camera parameters
SYErrorCode GetIntric(unsigned int nDeviceID, SYResolution resolution, SYIntrinsics& intrinsics);Change Device IP
Info
Supported devices:
CS20-P Firmware version: v4.2.3.0+
CS40 Firmware version: v4.2.3.0+
CS40Pro Firmware version: v4.2.3.0+
Supported after SDKv4.2.3.0
//Change device IP
//@ param [in] nDeviceID Device ID
//@ param [in] nIP Device IP to be written
SYErrorCode ChangeDeviceIP(unsigned int nDeviceID, unsigned int nIP);Set Frame Rate
// Set frame rate
//@ param [in] nDeviceID Device ID
//@ param [in] nFrameRate Frame rate
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode SetFrameRate(unsigned int nDeviceID, unsigned int nFrameRate);Get Frame Rate
// Get frame rate
//@ param [in] nDeviceID Device ID
//@ param [in/out] nFrameRate Frame rate
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode GetFrameRate(unsigned int nDeviceID, unsigned int& nFrameRate);Get Temperature
// Get temperature
//@ param [in] nDeviceID Device ID
//@ param [in/out] fltTemperature Temperature
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode GetTemperature(unsigned int nDeviceID, float& fltTemperature);Check Whether Frame Rate is Adjustable
// Check whether frame rate is adjustable
//@ param [in] nDeviceID Device ID
//@ param [in/out] bEnabled Flag indicating whether the frame rate is adjustable
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode IsFrameRateEnabled(unsigned int nDeviceID, bool& bEnabled);Parse Configuration File
// Parse configuration file
//@ param [in] nStringLength Length of the path string
//@ param [in] pFileName Full path of the configuration file
//@ param [in/out] configuration Configuration data
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode ParseConfiguration(int nStringLength, const char* pFileName, SYConfiguration & configuration);Start Streaming with Configuration
// Start streaming with configuration
//@ param [in] nDeviceID Device ID
//@ param [in] configuration Configuration data
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode StartStreamingWithConfiguration(unsigned int nDeviceID, const SYConfiguration & configuration);Export Configuration File
// Export configuration file
//@ param [in] nDeviceID Device ID
//@ param [in] nStringLength Length of the path string
//@ param [in] pFileName Full path of the configuration file
//@ return Error code
extern "C" SYSDK_DLL SYErrorCode ExportConfiguration(unsigned int nDeviceID, int nStringLength, char* pFileName);Event Related Interfaces
Register Error Message Notification Object Pointer
//Register error message notification object pointer
//@ param [in] pObserver Error message notification object pointer
//@ return Error code
SYErrorCode RegisterErrorObserver(ISYErrorObserver* pObserver);Register Event Notification Object Pointer
//Register event notification object pointer
//@ param [in] pObserver Event notification object pointer
//@ return Error code
SYErrorCode RegisterEventObserver(ISYEventObserver* pObserver);Register Frame Notification Object Pointer
//Register frame notification object pointer
//@ param [in] pObserver Frame notification object pointer
//@ return Error code
SYErrorCode RegisterFrameObserver(ISYFrameObserver* pObserver);Unregister Error Message Notification Object Pointer
//Unregister error message notification object pointer
//@ param [in] pObserver Error message notification object pointer
//@ return Error code
SYErrorCode UnRegisterErrorObserver(ISYErrorObserver* pObserver);Unregister Event Notification Object Pointer
//Unregister event notification object pointer
//@ param [in] pObserver Event notification object pointer
//@ return Error code
SYErrorCode UnRegisterEventObserver(ISYEventObserver* pObserver);Unregister Frame Notification Object Pointer
//Unregister frame notification object pointer
//@ param [in] pObserver Frame notification object pointer
//@ return Error code
SYErrorCode UnRegisterFrameObserver(ISYFrameObserver* pObserver);