C++ API reference¶
-
using SendFileCallback = std::function<void(OBFileTranState state, const char *message, uint8_t percent)>¶
file transfer callbacks
- Param state
file transfer status
- Param message
status information
-
using DeviceUpgradeCallback = std::function<void(OBUpgradeState state, const char *message, uint8_t percent)>¶
device upgrade callback
- Param state
upgrade status
- Param message
status information
-
using DeviceStateChangedCallback = std::function<void(OBDeviceState state, const char *message)>¶
device status callback
- Param state
device status
- Param message
status information
-
using GetDataCallback = std::function<void(OBDataTranState state, OBDataChunk *dataChunk)>¶
get raw data property data when data and progress callbacks
- Param dataChunk
data chunk
- Param state
get the data status
-
using SetDataCallback = std::function<void(OBDataTranState state, uint8_t percent)>¶
set the raw data property when the progress callback is made
- Param percent
progress percentage
- Param state
set the data status
-
namespace ob¶
Typedefs
-
typedef std::function<void(void *buffer, void *context)> BufferDestroyCallback¶
-
using MediaStateCallback = std::function<void(OBMediaState state)>¶
-
class AccelFrame : public ob::Frame¶
Public Functions
-
OBAccelValue value()¶
Accelerometer frame data.
- Returns
-
float temperature()¶
Get the temperature when the frame is sampled.
- Returns
float temperature value
-
OBAccelValue value()¶
-
class AccelStreamProfile : public ob::StreamProfile¶
Public Functions
-
OBAccelFullScaleRange fullScaleRange()¶
Get full scale range.
- Returns
OBAccelFullScaleRange returns the scale range value
-
OBAccelSampleRate sampleRate()¶
Get sampling frequency.
- Returns
OBAccelFullScaleRange returns the sampling frequency
-
OBAccelFullScaleRange fullScaleRange()¶
-
class CameraParamList¶
Public Functions
-
uint32_t count()¶
Number of camera parameter groups.
- Returns
uint32_t returns the number of camera parameter groups
-
OBCameraParam getCameraParam(uint32_t index)¶
Get camera parameters.
- Parameters
index – parameter index
- Returns
OBCameraParam returns the corresponding group parameters
-
uint32_t count()¶
-
class ColorFrame : public ob::VideoFrame¶
-
class Config¶
Public Functions
Configure the stream to be enabled.
- Parameters
streamProfile – Stream configuration
-
void enableAllStream()¶
Configure all streams to be enabled .
-
void disableStream(OBStreamType streamType)¶
Configure the stream to be disabled.
- Parameters
streamType – Stream configuration
-
void disableAllStream()¶
Configure all streams to be disabled .
-
void setAlignMode(OBAlignMode mode)¶
Set the alignment mode.
- Parameters
mode – Align State Mode
-
void setDepthScaleRequire(bool enable)¶
Whether the depth needs to be scaled after setting D2C.
- Parameters
enable – Whether scaling is required
-
void setD2CTargetResolution(uint32_t d2cTargetWidth, uint32_t d2cTargetHeight)¶
Set the D2C target resolution, which is applicable to cases where the Color stream is not enabled using the OrbbecSDK and the depth needs to be D2C Note: When you use OrbbecSDK to enable the Color stream, you also use this interface to set the D2C target resolution. The configuration of the enabled Color stream is preferred for D2C.
-
class Context¶
Public Functions
-
Context(const char *configPath =
"")¶ Context is a management class that describes the runtime of the SDK. It is responsible for the applying and releasing of resources for the SDK. The context has the ability to manage multiple devices, is responsible for enumerating devices, monitoring device callbacks, and enabling functions such as multi-device synchronization..
-
std::shared_ptr<DeviceList> queryDeviceList()¶
Query enumerated device list.
- Returns
std::shared_ptr<DeviceList> returns a pointer to the device list class
-
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port)¶
创建网络设备对象
- Parameters
address – ip 地址
port – 端口号
- Returns
std::shared_ptr<Device> 返回创建好的设备对象
-
void setDeviceChangedCallback(DeviceChangedCallback callback)¶
Set device plug-in callback function.
- Parameters
callback – function triggered when the device is plugged and unplugged
-
void enableMultiDeviceSync(uint64_t repeatInterval)¶
Activate the multi-device synchronization function to synchronize the clock of the created device(the device needs support this function)
- Parameters
repeatInterval – synchronization time interval (unit: ms; if repeatInterval=0, it means that it will only be synchronized once and will not be executed regularly)
Public Static Functions
-
static void setLoggerSeverity(OBLogSeverity severity)¶
Set the level of the global log will affect both the log level output to the terminal and output to the file.
- Parameters
severity – log output level
-
static void setLoggerToFile(OBLogSeverity severity, const char *directory)¶
Set log output to file.
- Parameters
severity – log level output to file
directory – The log file output path. If the path is empty, the existing settings will continue to be used (if the existing configuration is also empty, the log will not be output to the file)
-
static void setLoggerToConsole(OBLogSeverity severity)¶
Set log output to terminal.
- Parameters
severity – log level output to the terminal
-
Context(const char *configPath =
-
class DepthFrame : public ob::VideoFrame¶
Public Functions
-
float getValueScale()¶
Get the value scale of the depth frame, the unit is mm/step, such as valueScale=0.1, and a certain coordinate pixel value is pixelValue=10000, then the depth value is: value = pixelValue*valueScale = 10000*0.1=1000mm.
- Returns
float
-
float getValueScale()¶
-
class Device¶
Public Functions
-
Device(std::unique_ptr<DeviceImpl> impl)¶
Describe the entity of the RGBD camera, representing a specific model of RGBD camera .
-
std::shared_ptr<DeviceInfo> getDeviceInfo()¶
Get device information.
- Returns
std::shared_ptr<DeviceInfo> returns device information
-
std::shared_ptr<SensorList> getSensorList()¶
Get device sensor list.
- Returns
std::shared_ptr<SensorList> returns the sensor list
-
std::shared_ptr<Sensor> getSensor(OBSensorType type)¶
Get specific type of sensor if device not open, SDK will automatically open the connected device and return to the instance.
- Returns
std::shared_ptr<Sensor> eturns the sensor example, if the device does not have the device,returns nullptr
-
void setIntProperty(OBPropertyID propertyId, int32_t property)¶
Set int type of device property.
- Parameters
propertyId – Property id
property – Property to be set
-
void setFloatProperty(OBPropertyID propertyId, float property)¶
Set float type of device property.
- Parameters
propertyId – Property id
property – Property to be set
-
void setBoolProperty(OBPropertyID propertyId, bool property)¶
Set bool type of device property.
- Parameters
propertyId – Property id
property – Property to be set
-
int32_t getIntProperty(OBPropertyID propertyId)¶
Get int type of device property.
- Parameters
propertyId – Property id
- Returns
int32_t Property to get
-
float getFloatProperty(OBPropertyID propertyId)¶
Get float type of device property.
- Parameters
propertyId – Property id
- Returns
float Property to get
-
bool getBoolProperty(OBPropertyID propertyId)¶
Get bool type of device property.
- Parameters
propertyId – Property id
- Returns
bool Property to get
-
OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId)¶
Get int type device property range (ncluding current valueand default value)
- Parameters
propertyId – Property id
- Returns
OBIntPropertyRange Property range
-
OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId)¶
Get float type device property range((including current valueand default value)
- Parameters
propertyId – Property id
- Returns
OBFloatPropertyRange Property range
-
OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId)¶
Get bool type device property range (including current value anddefault value)
- Parameters
propertyId – Property id
- Returns
OBBoolPropertyRange Property range
-
void writeAHB(uint32_t reg, uint32_t mask, uint32_t value)¶
AHB register write.
- Parameters
reg – Register to be written
mask – The mask to be writen
value – The value to be written
-
void readAHB(uint32_t reg, uint32_t mask, uint32_t *value)¶
AHB AHB register read.
- Parameters
reg – Register to be read
mask – The mask to be read
value – The value to be returned
-
void writeI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value)¶
I2C register write.
- Parameters
reg – I2C module ID to be written
reg – Register to be written
mask – The mask to be written
value – he value to be written
-
void readI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value)¶
I2C registers read.
- Parameters
reg – I2C module ID to be read
reg – Register to be read
mask – The mask to be read
value – The value to be returned
-
void writeFlash(uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false)¶
Set the properties of writing to Flash.
- Parameters
offset – flash offset address
data – Property data to be written
dataSize – The size of the property to be written
callback – Write flash progress callback
async – Whether to execute asynchronously
-
void readFlash(uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async = false)¶
Read Flash property.
- Parameters
offset – flash offset address
data – Property data to be read
dataSize – The size of the property to get
callback – Read data returned by flash and progress callback
async – Whether to execute asynchronously
-
void setRawData(OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false)¶
Set raw data type of device property [Asynchronous callback].
- Parameters
propertyId – Property id
data – Property data to be set
dataSize – The size of the property data to be set
callback – rawdata set progress callback
async – Whether to execute asynchronously
-
void getRawData(OBPropertyID propertyId, GetDataCallback callback, bool async = false)¶
Get raw data type of device property [Asynchronous callback].
- Parameters
propertyId – Property id
data – Property data obtained
dataSize – Get the size of the property
callback – Get the returned data and progress callback
async – Whether to execute asynchronously
-
void setStructuredData(OBPropertyID propertyId, const void *data, uint32_t dataSize)¶
Set structured data type of device property.
- Parameters
propertyId – Property id
data – Property data to be set
dataSize – The size of the attribute to be set
-
void getStructuredData(OBPropertyID propertyId, void *data, uint32_t *dataSize)¶
Get structured data type of device property.
- Parameters
propertyId – Property id
data – Property data obtained
dataSize – Get the size of the attribute
-
uint32_t getSupportedPropertyCount()¶
Get number of devices supported property.
- Returns
uint32_t returns the number of supported attributes
-
OBPropertyItem getSupportedProperty(uint32_t index)¶
Get device supported properties.
- Parameters
uint32_t – Property index
- Returns
OBPropertyItem returns the type of supported properties
-
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission)¶
Judge property permission support.
- Parameters
propertyId – Property id
permission – Types of read and write permissions that need to be interpreted
- Returns
bool returns whether it is supported
-
uint64_t syncDeviceTime()¶
Synchronize device time (synchronize local systemtime to device)
-
void deviceUpgrade(const char *filePath, DeviceUpgradeCallback callback, bool async = true)¶
Upgrade the device firmware.
- Parameters
filePath – Firmware path
callback – Firmware upgrade progress and status callback
async – Whether to execute asynchronously
-
void sendFile(const char *filePath, const char *dstPath, SendFileCallback callback, bool async = true)¶
Send files to the specified path on the device side [Asynchronouscallback].
- Parameters
filePath – Original file path
dstPath – Accept the save path on the device side
callback – File transfer callback
async – Whether to execute asynchronously
-
OBDeviceState getDeviceState()¶
Get the current state.
-
void setDeviceStateChangedCallback(DeviceStateChangedCallback callback)¶
Set the device state changed callbacks.
- Parameters
callback – The callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the stream is closed due to high temperature, etc.)
-
bool activateAuthorization(const char *authCode)¶
Verify device authorization code.
-
void writeAuthorizationCode(const char *authCodeStr)¶
Write authorization code.
-
std::shared_ptr<CameraParamList> getCalibrationCameraParamList()¶
Get the original parameter list of camera calibration saved in the device. The parameters in the list do not correspond to the current open-current configuration. You need to select the parameters according to the actual situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the Pipeline::getCameraParam() interface.
- Returns
std::shared_ptr<CameraParamList> camera parameter list
-
Device(std::unique_ptr<DeviceImpl> impl)¶
-
class DeviceInfo¶
- #include <Device.hpp>
A class describing device information, representing the name, id, serial number and other basic information of an RGBD camera. .
Public Functions
-
const char *name()¶
Get device name.
- Returns
const char * returns the device name
-
int pid()¶
Get the pid of the device.
- Returns
int returns the pid of the device
-
int vid()¶
Get the vid of the device.
- Returns
int returns the vid of the device
-
const char *uid()¶
Get system assigned uid for distinguishing between different devices.
- Returns
const char * returns the uid of the device
-
const char *serialNumber()¶
Get the serial number of the device.
- Returns
const char * returns the serial number of the device
-
const char *firmwareVersion()¶
Get the version number of the firmware.
- Returns
const char* returns the version number of the firmware
- DEPRECATED const char * usbType ()
Get usb connection type (DEPRECATED)
- Returns
const char* returns usb connection type
-
const char *connectionType()¶
Get device connection type.
- Returns
const char* returns connection type
-
const char *hardwareVersion()¶
Get the version number of the hardware.
- Returns
const char* returns the version number of the hardware
-
const char *supportedMinSdkVersion()¶
Get the minimum version number of the SDK supported by the device.
- Returns
const char* returns the minimum SDK version number supported by the device
-
const char *asicName()¶
Get chip type name.
- Returns
const char* returns the chip type name
-
OBDeviceType deviceType()¶
Get device type.
- Returns
OBDeviceType returns the device type
-
const char *name()¶
-
class DeviceList¶
Public Functions
-
uint32_t deviceCount()¶
Get device count.
- Returns
uint32_t returns the number of devices
- DEPRECATED const char * name (uint32_t index)
Get the name of the specified device (DEPRECATED)
- Parameters
index – Device index
- Returns
int returns the name of the device
-
int pid(uint32_t index)¶
Get the pid of the specified device.
- Parameters
index – Device index
- Returns
int returns the pid of the device
-
int vid(uint32_t index)¶
Get the vid of the specified device.
- Parameters
index – Device index
- Returns
int returns the vid of the device
-
const char *uid(uint32_t index)¶
Get the uid of the specified device.
- Parameters
index – Device index
- Returns
const char * returns the uid of the device
-
const char *serialNumber(uint32_t index)¶
Get the serial number of the specified device.
- Parameters
index – device index
- Returns
const char * returns the serial number of the device
-
std::shared_ptr<Device> getDevice(uint32_t index)¶
Get the specified device object from the device list.
-
uint32_t deviceCount()¶
-
class Error¶
Public Functions
-
const char *getMessage() const noexcept¶
Obtain detailed error logs of SDK internal exceptions. .
-
OBExceptionType getExceptionType() const noexcept¶
Get the exception type of the error, and determine which module is abnormal.
-
const char *getName() const noexcept¶
Get the name of the error function. .
-
const char *getArgs() const noexcept¶
Get the parameter passed in to the error interface. .
-
const char *getMessage() const noexcept¶
-
class Filter¶
Subclassed by ob::FormatConvertFilter, ob::PointCloudFilter
Public Functions
-
virtual void reset()¶
filter reset, free the internal cache, stop the processing thread and clear the pending buffer frame when asynchronous processing
Processing frames (synchronous interface)
- Parameters
frame – frame to be processed
- Returns
std::shared_ptr< Frame > processed frame
Push the pending frame into the cache (asynchronous callback interface)
- Parameters
frame – The pending frame processing result is returned by the callback function
-
virtual void setCallBack(FilterCallback callback)¶
Set the callback function (asynchronous callback interface)
- Parameters
callback – Processing result callback
-
virtual void reset()¶
-
class FormatConvertFilter : public ob::Filter¶
Public Functions
-
void setFormatConvertType(OBConvertFormat type)¶
Set format conversion type.
- Parameters
type – Format conversion type
-
void setFormatConvertType(OBConvertFormat type)¶
-
class Frame : public std::enable_shared_from_this<Frame>¶
Subclassed by ob::AccelFrame, ob::FrameSet, ob::GyroFrame, ob::PointsFrame, ob::VideoFrame
Public Functions
-
virtual OBFrameType type()¶
Get the type of frame.
- Returns
OBFrameType returns the type of frame
-
virtual OBFormat format()¶
Get the format of the frame.
- Returns
OBFormat returns the format of the frame
-
virtual uint64_t index()¶
Get the sequence number of the frame.
- Returns
uint64_t returns the sequence number of the frame
-
virtual void *data()¶
Get frame data.
- Returns
void* returns frame data
-
virtual uint32_t dataSize()¶
Get the frame data size.
- Returns
uint32_t returns the frame data size If it is point cloud data, it returns the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide the dataSize by the structure size of the corresponding point type.
-
uint64_t timeStamp()¶
Get the hardware timestamp of the frame.
- Returns
uint64_t returns the time stamp of the frame hardware
-
uint64_t timeStampUs()¶
Get the hardware timestamp of the frame us.
- Returns
uint64_t returns the time stamp of the frame hardware, unit us
-
uint64_t systemTimeStamp()¶
Get frame system timestamp.
- Returns
uint64_t returns the time stamp of the frame hardware
-
template<typename T>
bool is()¶ Check if the runtime type of the frame object is compatible with a given type.
- Template Parameters
T – Given type
- Returns
bool returns result
Frame object type conversion.
- Template Parameters
T – Target type
- Returns
std::shared_ptr<T> returns the result, if it cannot be converted, an exception will be thrown
-
virtual OBFrameType type()¶
-
class FrameHelper¶
Public Static Functions
-
static std::shared_ptr<Frame> createFrameFromBuffer(OBFormat format, uint32_t frameWidth, uint32_t frameHeight, uint8_t *buffer, uint32_t bufferSize, BufferDestroyCallback destroyCallback, void *destroyCallbackContext)¶
Create a frame object based on an externally created Buffer.
-
static std::shared_ptr<Frame> createFrameSet()¶
Creates an empty frame collection object.
- Returns
std::shared_ptr<Frame> returns a frame collection object
Populate the frame collection with frames of the corresponding type.
Sets the system timestamp of the frame.
Sets the device timestamp for the frame.
Sets the device timestamp for the frame.
-
static std::shared_ptr<Frame> createFrameFromBuffer(OBFormat format, uint32_t frameWidth, uint32_t frameHeight, uint8_t *buffer, uint32_t bufferSize, BufferDestroyCallback destroyCallback, void *destroyCallbackContext)¶
-
class FrameSet : public ob::Frame¶
Public Functions
-
uint32_t frameCount()¶
Get frame count.
- Returns
uint32_t returns the number of frames
-
std::shared_ptr<DepthFrame> depthFrame()¶
Get depth frame.
- Returns
std::shared_ptr<DepthFrame> returns the depth frame
-
std::shared_ptr<ColorFrame> colorFrame()¶
Get color frame.
- Returns
std::shared_ptr<ColorFrame> returns the color frame
-
std::shared_ptr<IRFrame> irFrame()¶
Get infrared frame.
- Returns
std::shared_ptr<IRFrame> returns infrared frame
-
std::shared_ptr<PointsFrame> pointsFrame()¶
Get point cloud frame.
- Returns
std::shared_ptr<PointsFrame> returns the point cloud data frame
-
std::shared_ptr<Frame> getFrame(OBSensorType sensorType)¶
Get frame by sensor type.
- Parameters
frameType – Type of sensor
- Returns
std::shared_ptr<Frame> returns the corresponding type of frame
-
uint32_t frameCount()¶
-
class GyroFrame : public ob::Frame¶
Public Functions
-
OBGyroValue value()¶
Get gyro frame data.
- Returns
-
float temperature()¶
Get temperature when the frame is sampled.
- Returns
float temperature value
-
OBGyroValue value()¶
-
class GyroStreamProfile : public ob::StreamProfile¶
Public Functions
-
OBGyroFullScaleRange fullScaleRange()¶
Get full scale range.
- Returns
OBAccelFullScaleRange returns the scale range value
-
OBGyroSampleRate sampleRate()¶
Get sampling frequency.
- Returns
OBAccelFullScaleRange returns the sampling frequency
-
OBGyroFullScaleRange fullScaleRange()¶
-
class IRFrame : public ob::VideoFrame¶
-
class Pipeline¶
Public Functions
-
Pipeline()¶
Pipeline is a high-level interface for applications, algorithms related RGBD data streams. Pipeline can provide alignment inside and synchronized FrameSet. Pipeline() no parameter version, which opens the first device in the list of devices connected to the OS by default. If the application has obtained the device through the DeviceList, opening the Pipeline() at this time will throw an exception that the device has been created..
Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices need to be obtained through DeviceList, and the device and pipeline are bound through this interface..
-
Pipeline(const char *filename)¶
Create a pipeline for playback of recorded stream files.
- Parameters
filename – Playback file path
Start the pipeline with configuration parameters.
- Parameters
config – Parameter configuration of pipeline
Start the pipeline and set the frameset data callback.
- Parameters
config – parameter configuration of pipeline
callback – Set the callback to be triggered when all frame data in the frame set arrives
-
void stop()¶
Stop pipeline .
-
std::shared_ptr<Config> getConfig()¶
Get pipeline configuration parameters.
- Returns
std::shared_ptr<Config> returns the configured parameters
-
std::shared_ptr<FrameSet> waitForFrames(uint32_t timeout_ms)¶
Waiting for frame set data.
- Parameters
timeout_ms – Waiting timeout (ms)
- Returns
std::shared_ptr<FrameSet> returns the waiting frame set data
-
std::shared_ptr<Device> getDevice()¶
Get device object.
- Returns
std::shared_ptr<Device> returns the device object
-
std::shared_ptr<Playback> getPlayback()¶
Get playback object.
- Returns
std::shared_ptr<Playback> returns the playback object
-
std::shared_ptr<StreamProfileList> getStreamProfileList(OBSensorType sensorType)¶
Get the stream profile of specified sensor.
- Parameters
sensorType – Type of sensor
- Returns
std::shared_ptr<StreamProfileList> returns the stream configuration list
-
void enableFrameSync()¶
Turn on frame synchronization .
-
void disableFrameSync()¶
Turn off frame synchronization .
-
OBCameraParam getCameraParam()¶
Get camera parameters.
Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution.
-
OBRect getD2CValidArea(uint32_t minimumDistance, uint32_t maximumDistance = 0)¶
Get valid area between minimum distance and maximum distance after D2C.
- Parameters
minimumDistance – minimum working distance
maximumDistance – maximum working distance
- Returns
OBRect returns the area information valid after D2C at the working distance
Dynamically switch the corresponding config configuration.
- Parameters
config – Updated config configuration
-
void startRecord(const char *filename)¶
start recording
- Parameters
filename – Record file name
-
void stopRecord()¶
Stop recording .
-
Pipeline()¶
-
class Playback¶
Public Functions
-
Playback(const char *filename)¶
Create playback object.
-
void start(PlaybackCallback callback, OBMediaType type = OB_MEDIA_ALL)¶
Start playback, the playback data is returned from the callback, and an exception is thrown after failure.
-
void stop()¶
Stop playback and throw an exception if it fails .
-
void setPlaybackStateCallback(MediaStateCallback state)¶
Set playback state.
-
std::shared_ptr<DeviceInfo> getDeviceInfo()¶
Get the device information in the recording file.
- Returns
DeviceInfo returns device information
-
OBCameraParam getCameraParam()¶
Get the intrinsic and extrinsic parameter information in the recording file.
- Returns
OBCameraParam returns internal and external parameter information
-
Playback(const char *filename)¶
-
class PointCloudFilter : public ob::Filter¶
Public Functions
-
void setCreatePointFormat(OBFormat type)¶
Set point cloud type parameters.
- Parameters
type – Point cloud type depth point cloud or RGBD point cloud
-
void setCameraParam(OBCameraParam param)¶
Set camera parameters.
- Parameters
param – Camera internal and external parameters
-
void setFrameAlignState(bool state)¶
Set the frame alignment state that will be input to generate point cloud (it needs to be enabled in D2C mode, as the basis for the algorithm to select the set of camera internal parameters)
- Parameters
state – Alignment status, True: enable alignment; False: disable alignment
-
void setPositionDataScaled(float scale)¶
Set the point cloud coordinate data zoom factor.
- Parameters
scale – Zoom factor
-
void setColorDataNormalization(bool state)¶
Set point cloud color data normalization.
- Parameters
state – Whether normalization is required
-
void setCreatePointFormat(OBFormat type)¶
-
class Recorder¶
Public Functions
-
Recorder()¶
Create a recorder for data recording .
Create a recorder for data recording.
-
void start(const char *filename, bool async = false)¶
Enable the recorder, throw an exception after failure.
- Parameters
filename – Recorded file name
async – Whether to execute asynchronously
-
void stop()¶
Stop the recorder, throw an exception on failure .
Write frame data to the recorder.
- Parameters
frame – Write frame data
-
Recorder()¶
-
class Sensor¶
Public Functions
-
OBSensorType type()¶
sensor type
- Returns
OBSensorType returns the sensor type
-
const std::shared_ptr<StreamProfileList> getStreamProfileList()¶
Get the list of stream profiles.
- Returns
std::shared_ptr<StreamProfileList> returns the stream configuration list
Open frame data stream and set up a callback.
- Parameters
streamProfile – Stream configuration
callback – Set the callback when frame data arrives
-
void stop()¶
Stop stream .
Dynamically switch resolutions.
- Parameters
streamProfile – Resolution to switch
-
OBSensorType type()¶
-
class SensorList¶
Public Functions
-
uint32_t count()¶
Get sensor count.
- Returns
uint32_t returns the number of Sensors
-
OBSensorType type(uint32_t index)¶
Get the type of the specified Sensor.
-
uint32_t count()¶
-
class StreamProfile : public std::enable_shared_from_this<StreamProfile>¶
Subclassed by ob::AccelStreamProfile, ob::GyroStreamProfile, ob::VideoStreamProfile
Public Functions
-
OBStreamType type()¶
Get the type of stream.
- Returns
OBStreamType returns the type of the stream
-
template<typename T>
bool is()¶ Check if frame object is compatible with the given type.
- Template Parameters
T – Given type
- Returns
bool return result
Object type conversion.
- Template Parameters
T – Target type
- Returns
std::shared_ptr<T> returns the result, if it cannot be converted, an exception will be thrown
-
OBStreamType type()¶
-
class StreamProfileList¶
Public Functions
-
uint32_t count()¶
Get stream profile count.
- Returns
uint32_t returns the number of StreamProfile
-
const std::shared_ptr<StreamProfile> getProfile(uint32_t index)¶
Get StreamProfile by index number.
- Parameters
index – Device index to be created,the range is [0, count-1],if the index exceeds the range, an exception will be thrown
- Returns
std::shared_ptr<StreamProfile> returns StreamProfile object
-
const std::shared_ptr<VideoStreamProfile> getVideoStreamProfile(int width = 0, int height = 0, OBFormat format = OB_FORMAT_UNKNOWN, int fps = 0)¶
Match the corresponding stream profile through the passed in parameters. If there are multiple matches, the first one in the list will be returned by default. If no matched profile found, will throw exception!
- Parameters
width – Width. If no matching condition is required, it can be passed to 0
height – Height. If no matching condition is required, it can be passed to 0
format – Type. If no matching condition is required, it can be passed to OB_FORMAT_UNKNOWN
fps – Frame rate. If no matching condition is required, it can be passed to 0
- Returns
std::shared_ptr<StreamProfile> Returns the matching resolution
-
uint32_t count()¶
-
class Version¶
Public Static Functions
-
static int getMajor()¶
Get the SDK major version number.
- Returns
int returns the SDK major version number
-
static int getMinor()¶
Get the SDK minor version number.
- Returns
int returns the SDK minor version number
-
static int getPatch()¶
Get the SDK revision number.
- Returns
int returns the SDK revision number
-
static int getVersion()¶
Get the SDK version number.
- Returns
int returns the SDK version number
-
static int getMajor()¶
-
class VideoFrame : public ob::Frame¶
Subclassed by ob::ColorFrame, ob::DepthFrame, ob::IRFrame
Public Functions
-
uint32_t width()¶
Get frame width.
- Returns
uint32_t returns the width of the frame
-
uint32_t height()¶
Get frame height.
- Returns
uint32_t returns the height of the frame
-
void *metadata()¶
Get the metadata of the frame.
- Returns
void* returns the metadata of the frame
-
uint32_t metadataSize()¶
Get the metadata size of the frame.
- Returns
uint32_t returns the metadata size of the frame
-
uint8_t pixelAvailableBitSize()¶
Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are valid bits, and the upper 6 bits are filled with 0)
-
uint32_t width()¶
-
class VideoStreamProfile : public ob::StreamProfile¶
-
typedef std::function<void(void *buffer, void *context)> BufferDestroyCallback¶