Intel® RealSense™ Cross Platform API
2.13.0
Intel Realsense Cross-platform API
|
Exposes RealSense sensor functionality for C compilers. More...
#include "rs_types.h"
Go to the source code of this file.
Classes | |
struct | rs2_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected. More... | |
Typedefs | |
typedef enum rs2_camera_info | rs2_camera_info |
Read-only strings that can be queried from the device. Not all information attributes are available on all camera types. This information is mainly available for camera debug and troubleshooting and should not be used in applications. More... | |
typedef enum rs2_stream | rs2_stream |
Streams are different types of data provided by RealSense devices. More... | |
typedef enum rs2_format | rs2_format |
Format identifies how binary data is encoded within a frame. More... | |
typedef struct rs2_extrinsics | rs2_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected. More... | |
Exposes RealSense sensor functionality for C compilers.
typedef enum rs2_camera_info rs2_camera_info |
Read-only strings that can be queried from the device. Not all information attributes are available on all camera types. This information is mainly available for camera debug and troubleshooting and should not be used in applications.
typedef struct rs2_extrinsics rs2_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected.
typedef enum rs2_format rs2_format |
Format identifies how binary data is encoded within a frame.
typedef enum rs2_stream rs2_stream |
Streams are different types of data provided by RealSense devices.
enum rs2_camera_info |
Read-only strings that can be queried from the device. Not all information attributes are available on all camera types. This information is mainly available for camera debug and troubleshooting and should not be used in applications.
enum rs2_format |
Format identifies how binary data is encoded within a frame.
Enumerator | |
---|---|
RS2_FORMAT_ANY | When passed to enable stream, librealsense will try to provide best suited format |
RS2_FORMAT_Z16 | 16-bit linear depth values. The depth is meters is equal to depth scale * pixel value. |
RS2_FORMAT_DISPARITY16 | 16-bit linear disparity values. The depth in meters is equal to depth scale / pixel value. |
RS2_FORMAT_XYZ32F | 32-bit floating point 3D coordinates. |
RS2_FORMAT_YUYV | 32-bit y0, u, y1, v data for every two pixels. Similar to YUV422 but packed in a different order - https://en.wikipedia.org/wiki/YUV |
RS2_FORMAT_RGB8 | 8-bit red, green and blue channels |
RS2_FORMAT_BGR8 | 8-bit blue, green, and red channels – suitable for OpenCV |
RS2_FORMAT_RGBA8 | 8-bit red, green and blue channels + constant alpha channel equal to FF |
RS2_FORMAT_BGRA8 | 8-bit blue, green, and red channels + constant alpha channel equal to FF |
RS2_FORMAT_Y8 | 8-bit per-pixel grayscale image |
RS2_FORMAT_Y16 | 16-bit per-pixel grayscale image |
RS2_FORMAT_RAW10 | Four 10-bit luminance values encoded into a 5-byte macropixel |
RS2_FORMAT_RAW16 | 16-bit raw image |
RS2_FORMAT_RAW8 | 8-bit raw image |
RS2_FORMAT_UYVY | Similar to the standard YUYV pixel format, but packed in a different order |
RS2_FORMAT_MOTION_RAW | Raw data from the motion sensor |
RS2_FORMAT_MOTION_XYZ32F | Motion data packed as 3 32-bit float values, for X, Y, and Z axis |
RS2_FORMAT_GPIO_RAW | Raw data from the external sensors hooked to one of the GPIO's |
RS2_FORMAT_6DOF | Pose data packed as floats array, containing translation vector, rotation quaternion and prediction velocities and accelerations vectors |
RS2_FORMAT_DISPARITY32 | 32-bit float-point disparity values. Depth->Disparity conversion : Disparity = Baseline*FocalLength/Depth |
RS2_FORMAT_COUNT | Number of enumeration values. Not a valid input: intended to be used in for-loops. |
enum rs2_stream |
Streams are different types of data provided by RealSense devices.
const char* rs2_camera_info_to_string | ( | rs2_camera_info | info | ) |
rs2_stream_profile* rs2_clone_stream_profile | ( | const rs2_stream_profile * | mode, |
rs2_stream | stream, | ||
int | index, | ||
rs2_format | format, | ||
rs2_error ** | error | ||
) |
Creates a copy of stream profile, assigning new values to some of the fields
[in] | mode | input stream profile |
[in] | stream | stream type for the profile |
[in] | format | binary data format of the profile |
[in] | index | stream index the profile in case there are multiple streams of the same type |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_close | ( | const rs2_sensor * | sensor, |
rs2_error ** | error | ||
) |
stop any streaming from specified subdevice
[in] | sensor | RealSense device |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_device* rs2_create_device_from_sensor | ( | const rs2_sensor * | sensor, |
rs2_error ** | error | ||
) |
This is a helper function allowing the user to discover the device from one of its sensors
[in] | sensor | Pointer to a sensor |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_sensor* rs2_create_sensor | ( | const rs2_sensor_list * | list, |
int | index, | ||
rs2_error ** | error | ||
) |
create sensor by index
[in] | index | the zero based index of sensor to retrieve |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_delete_sensor | ( | rs2_sensor * | sensor | ) |
delete relasense sensor
[in] | sensor | realsense sensor to delete |
void rs2_delete_sensor_list | ( | rs2_sensor_list * | info_list | ) |
Deletes sensors list, any sensors created from this list will remain unaffected
[in] | info_list | list to delete |
void rs2_delete_stream_profile | ( | rs2_stream_profile * | mode | ) |
Delete stream profile allocated by rs2_clone_stream_profile Should not be called on stream profiles returned by the device
[in] | mode | input stream profile |
void rs2_delete_stream_profiles_list | ( | rs2_stream_profile_list * | list | ) |
delete stream profiles list
[in] | list | the list of supported profiles returned by rs2_get_supported_profiles |
Retrieve the stereoscopic baseline value. Applicable to stereo-based depth modules
[out] | float | Stereoscopic baseline in millimeters |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_format_to_string | ( | rs2_format | format | ) |
float rs2_get_depth_scale | ( | rs2_sensor * | sensor, |
rs2_error ** | error | ||
) |
When called on a depth sensor, this method will return the number of meters represented by a single depth unit
[in] | sensor | depth sensor |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_extrinsics | ( | const rs2_stream_profile * | from, |
const rs2_stream_profile * | to, | ||
rs2_extrinsics * | extrin, | ||
rs2_error ** | error | ||
) |
[in] | from | origin stream profile |
[in] | to | target stream profile |
[out] | extrin | extrinsics from origin to target |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_motion_intrinsics | ( | const rs2_stream_profile * | mode, |
rs2_motion_device_intrinsic * | intrinsics, | ||
rs2_error ** | error | ||
) |
Obtain the intrinsics of a specific stream configuration from the device.
[in] | mode | input stream profile |
[out] | intrinsics | Pointer to the struct to store the data in |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_notification_category rs2_get_notification_category | ( | rs2_notification * | notification, |
rs2_error ** | error | ||
) |
retrieve category from notification handle
[in] | notification | handle returned from a callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_get_notification_description | ( | rs2_notification * | notification, |
rs2_error ** | error | ||
) |
retrieve description from notification handle
[in] | notification | handle returned from a callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_get_notification_serialized_data | ( | rs2_notification * | notification, |
rs2_error ** | error | ||
) |
retrieve serialized data from notification handle
[in] | notification | handle returned from a callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_log_severity rs2_get_notification_severity | ( | rs2_notification * | notification, |
rs2_error ** | error | ||
) |
retrieve severity from notification handle
[in] | notification | handle returned from a callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_time_t rs2_get_notification_timestamp | ( | rs2_notification * | notification, |
rs2_error ** | error | ||
) |
retrieve timestamp from notification handle
[in] | notification | handle returned from a callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_region_of_interest | ( | const rs2_sensor * | sensor, |
int * | min_x, | ||
int * | min_y, | ||
int * | max_x, | ||
int * | max_y, | ||
rs2_error ** | error | ||
) |
gets the active region of interest to be used by auto-exposure algorithm
[in] | sensor | the RealSense sensor |
[out] | min_x | lower horizontal bound in pixels |
[out] | min_y | lower vertical bound in pixels |
[out] | max_x | upper horizontal bound in pixels |
[out] | max_y | upper vertical bound in pixels |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_get_sensor_info | ( | const rs2_sensor * | sensor, |
rs2_camera_info | info, | ||
rs2_error ** | error | ||
) |
retrieve sensor specific information, like versions of various internal components
[in] | sensor | the RealSense sensor |
[in] | info | camera info type to retrieve |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_get_sensors_count | ( | const rs2_sensor_list * | info_list, |
rs2_error ** | error | ||
) |
Determines number of sensors in a list
[in] | info_list | The list of connected sensors captured using rs2_query_sensors |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const rs2_stream_profile* rs2_get_stream_profile | ( | const rs2_stream_profile_list * | list, |
int | index, | ||
rs2_error ** | error | ||
) |
Get pointer to specific stream profile
[in] | list | the list of supported profiles returned by rs2_get_supported_profiles |
[in] | index | the zero based index of the streaming mode |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_stream_profile_data | ( | const rs2_stream_profile * | mode, |
rs2_stream * | stream, | ||
rs2_format * | format, | ||
int * | index, | ||
int * | unique_id, | ||
int * | framerate, | ||
rs2_error ** | error | ||
) |
Extract common parameters of a stream profiles
[in] | mode | input stream profile |
[out] | stream | stream type of the input profile |
[out] | format | binary data format of the input profile |
[out] | index | stream index the input profile in case there are multiple streams of the same type |
[out] | unique_id | identifier for the stream profile, unique within the application |
[out] | framerate | expected rate for data frames to arrive, meaning expected number of frames per second |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
rs2_stream_profile_list* rs2_get_stream_profiles | ( | rs2_sensor * | device, |
rs2_error ** | error | ||
) |
check if physical subdevice is supported
[in] | device | input RealSense device |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_get_stream_profiles_count | ( | const rs2_stream_profile_list * | list, |
rs2_error ** | error | ||
) |
get the number of supported stream profiles
[in] | list | the list of supported profiles returned by rs2_get_supported_profiles |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_video_stream_intrinsics | ( | const rs2_stream_profile * | mode, |
rs2_intrinsics * | intrinsics, | ||
rs2_error ** | error | ||
) |
When called on a video profile, returns the intrinsics of specific stream configuration
[in] | mode | input stream profile |
[out] | intrinsics | resulting intrinsics for the video profile |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_get_video_stream_resolution | ( | const rs2_stream_profile * | mode, |
int * | width, | ||
int * | height, | ||
rs2_error ** | error | ||
) |
When called on a video stream profile, will return the width and the height of the stream
[in] | mode | input stream profile |
[out] | width | width in pixels of the video stream |
[out] | height | height in pixels of the video stream |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_is_sensor_extendable_to | ( | const rs2_sensor * | sensor, |
rs2_extension | extension, | ||
rs2_error ** | error | ||
) |
Test if the given sensor can be extended to the requested extension
[in] | sensor | Realsense sensor |
[in] | extension | The extension to which the sensor should be tested if it is extendable |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_is_stream_profile_default | ( | const rs2_stream_profile * | mode, |
rs2_error ** | error | ||
) |
Returns non-zero if selected profile is recommended for the sensor This is an optional hint we offer to suggest profiles with best performance-quality tradeof
[in] | mode | input stream profile |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_open | ( | rs2_sensor * | device, |
const rs2_stream_profile * | profile, | ||
rs2_error ** | error | ||
) |
open subdevice for exclusive access, by committing to a configuration
[in] | device | relevant RealSense device |
[in] | profile | stream profile that defines single stream configuration |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_open_multiple | ( | rs2_sensor * | device, |
const rs2_stream_profile ** | profiles, | ||
int | count, | ||
rs2_error ** | error | ||
) |
open subdevice for exclusive access, by committing to composite configuration, specifying one or more stream profiles this method should be used for interdependent streams, such as depth and infrared, that have to be configured together
[in] | device | relevant RealSense device |
[in] | profiles | list of stream profiles discovered by get_stream_profiles |
[in] | count | number of simultaneous stream profiles to configure |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_register_extrinsics | ( | const rs2_stream_profile * | from, |
const rs2_stream_profile * | to, | ||
rs2_extrinsics | extrin, | ||
rs2_error ** | error | ||
) |
[in] | from | origin stream profile |
[in] | to | target stream profile |
[out] | extrin | extrinsics from origin to target |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_set_notifications_callback | ( | const rs2_sensor * | sensor, |
rs2_notification_callback_ptr | on_notification, | ||
void * | user, | ||
rs2_error ** | error | ||
) |
set callback to get notifications from specified sensor
[in] | sensor | RealSense device |
[in] | on_notification | function pointer to register as per-notifications callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_set_notifications_callback_cpp | ( | const rs2_sensor * | sensor, |
rs2_notifications_callback * | callback, | ||
rs2_error ** | error | ||
) |
set callback to get notifications from specified device
[in] | sensor | RealSense sensor |
[in] | callback | callback object created from c++ application. ownership over the callback object is moved into the relevant subdevice lock |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_set_region_of_interest | ( | const rs2_sensor * | sensor, |
int | min_x, | ||
int | min_y, | ||
int | max_x, | ||
int | max_y, | ||
rs2_error ** | error | ||
) |
sets the active region of interest to be used by auto-exposure algorithm
[in] | sensor | the RealSense sensor |
[in] | min_x | lower horizontal bound in pixels |
[in] | min_y | lower vertical bound in pixels |
[in] | max_x | upper horizontal bound in pixels |
[in] | max_y | upper vertical bound in pixels |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_set_stream_profile_data | ( | rs2_stream_profile * | mode, |
rs2_stream | stream, | ||
int | index, | ||
rs2_format | format, | ||
rs2_error ** | error | ||
) |
Override some of the parameters of the stream profile
[in] | mode | input stream profile |
[in] | stream | stream type for the profile |
[in] | format | binary data format of the profile |
[in] | index | stream index the profile in case there are multiple streams of the same type |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_start | ( | const rs2_sensor * | sensor, |
rs2_frame_callback_ptr | on_frame, | ||
void * | user, | ||
rs2_error ** | error | ||
) |
start streaming from specified configured sensor
[in] | sensor | RealSense device |
[in] | on_frame | function pointer to register as per-frame callback |
[in] | user | auxiliary data the user wishes to receive together with every frame callback |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_start_cpp | ( | const rs2_sensor * | sensor, |
rs2_frame_callback * | callback, | ||
rs2_error ** | error | ||
) |
start streaming from specified configured sensor
[in] | sensor | RealSense device |
[in] | callback | callback object created from c++ application. ownership over the callback object is moved into the relevant streaming lock |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_start_queue | ( | const rs2_sensor * | sensor, |
rs2_frame_queue * | queue, | ||
rs2_error ** | error | ||
) |
start streaming from specified configured sensor of specific stream to frame queue
[in] | sensor | RealSense Sensor |
[in] | queue | frame-queue to store new frames into |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
void rs2_stop | ( | const rs2_sensor * | sensor, |
rs2_error ** | error | ||
) |
stops streaming from specified configured device
[in] | sensor | RealSense sensor |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
int rs2_stream_profile_is | ( | const rs2_stream_profile * | mode, |
rs2_extension | type, | ||
rs2_error ** | error | ||
) |
Try to extend stream profile to an extension type
[in] | mode | input stream profile |
[in] | type | extension type, for example RS2_EXTENSION_VIDEO_STREAM_PROFILE |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs2_stream_to_string | ( | rs2_stream | stream | ) |
int rs2_supports_sensor_info | ( | const rs2_sensor * | sensor, |
rs2_camera_info | info, | ||
rs2_error ** | error | ||
) |
check if specific sensor info is supported
[in] | info | the parameter to check for support |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |