Exposes librealsense functionality for C compilers. More...
Go to the source code of this file.
Classes | |
struct | rs_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected. More... | |
struct | rs_intrinsics |
Video stream intrinsics. More... | |
struct | rs_motion_data |
Motion data from gyroscope and accelerometer from the microcontroller. More... | |
struct | rs_motion_device_intrinsic |
Motion device intrinsics: scale, bias, and variances. More... | |
struct | rs_motion_intrinsics |
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_device_intrinsic . More... | |
struct | rs_timestamp_data |
Timestamp data from the motion microcontroller. More... | |
Macros | |
#define | RS_API_MAJOR_VERSION 1 |
#define | RS_API_MINOR_VERSION 12 |
#define | RS_API_PATCH_VERSION 4 |
#define | RS_API_VERSION (((RS_API_MAJOR_VERSION) * 10000) + ((RS_API_MINOR_VERSION) * 100) + (RS_API_PATCH_VERSION)) |
#define | RS_API_VERSION_STR (VAR_ARG_STRING(RS_API_MAJOR_VERSION.RS_API_MINOR_VERSION.RS_API_PATCH_VERSION)) |
#define | STRINGIFY(arg) #arg |
#define | VAR_ARG_STRING(arg) STRINGIFY(arg) |
Typedefs | |
typedef enum rs_blob_type | rs_blob_type |
Proprietary formats for direct communication with device firmware. More... | |
typedef enum rs_camera_info | rs_camera_info |
Read-only strings that can be queried from the device. More... | |
typedef enum rs_capabilities | rs_capabilities |
Specifies various capabilities of a RealSense device. More... | |
typedef struct rs_context | rs_context |
typedef struct rs_device | rs_device |
typedef enum rs_distortion | rs_distortion |
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates. More... | |
typedef struct rs_error | rs_error |
typedef enum rs_event_source | rs_event_source |
Source device that triggered a specific timestamp event from the motion module. More... | |
typedef struct rs_extrinsics | rs_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected. More... | |
typedef enum rs_format | rs_format |
Formats: defines how each stream can be encoded. More... | |
typedef struct rs_frame_callback | rs_frame_callback |
typedef void(* | rs_frame_callback_ptr) (rs_device *dev, rs_frame_ref *frame, void *user) |
typedef enum rs_frame_metadata | rs_frame_metadata |
Types of value provided from the device with each frame. More... | |
typedef struct rs_frame_ref | rs_frame_ref |
typedef struct rs_frameset | rs_frameset |
typedef struct rs_intrinsics | rs_intrinsics |
Video stream intrinsics. More... | |
typedef enum rs_ivcam_preset | rs_ivcam_preset |
For SR300 devices: provides optimized settings (presets) for specific types of usage. More... | |
typedef struct rs_log_callback | rs_log_callback |
typedef void(* | rs_log_callback_ptr) (rs_log_severity min_severity, const char *message, void *user) |
typedef enum rs_log_severity | rs_log_severity |
Severity of the librealsense logger. More... | |
typedef struct rs_motion_callback | rs_motion_callback |
typedef void(* | rs_motion_callback_ptr) (rs_device *, rs_motion_data, void *) |
typedef struct rs_motion_data | rs_motion_data |
Motion data from gyroscope and accelerometer from the microcontroller. More... | |
typedef struct rs_motion_device_intrinsic | rs_motion_device_intrinsic |
Motion device intrinsics: scale, bias, and variances. More... | |
typedef struct rs_motion_intrinsics | rs_motion_intrinsics |
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_device_intrinsic . More... | |
typedef enum rs_option | rs_option |
Defines general configuration controls. More... | |
typedef enum rs_output_buffer_format | rs_output_buffer_format |
Output buffer format: sets how librealsense works with frame memory. More... | |
typedef enum rs_preset | rs_preset |
Presets: general preferences that are translated by librealsense into concrete resolution and FPS. More... | |
typedef enum rs_source | rs_source |
Source: allows you to choose between available hardware subdevices. More... | |
typedef enum rs_stream | rs_stream |
Streams are different types of data provided by RealSense devices. More... | |
typedef struct rs_timestamp_callback | rs_timestamp_callback |
typedef void(* | rs_timestamp_callback_ptr) (rs_device *, rs_timestamp_data, void *) |
typedef struct rs_timestamp_data | rs_timestamp_data |
Timestamp data from the motion microcontroller. More... | |
typedef enum rs_timestamp_domain | rs_timestamp_domain |
Specifies the clock in relation to which the frame timestamp was measured. More... | |
Functions | |
const char * | rs_blob_type_to_string (rs_blob_type type) |
const char * | rs_camera_info_to_string (rs_camera_info info) |
const char * | rs_capabilities_to_string (rs_capabilities capability) |
rs_context * | rs_create_context (int api_version, rs_error **error) |
Creates RealSense context that is required for the rest of the API. More... | |
void | rs_delete_context (rs_context *context, rs_error **error) |
Frees the relevant context object. More... | |
int | rs_device_supports_option (const rs_device *device, rs_option option, rs_error **error) |
Determines if the device allows a specific option to be queried and set. More... | |
void | rs_disable_motion_tracking (rs_device *device, rs_error **error) |
Disables motion-tracking handlers. More... | |
void | rs_disable_stream (rs_device *device, rs_stream stream, rs_error **error) |
Disables a specific stream. More... | |
const char * | rs_distortion_to_string (rs_distortion distortion) |
void | rs_enable_motion_tracking (rs_device *device, rs_motion_callback_ptr on_motion_event, void *motion_handler, rs_timestamp_callback_ptr on_timestamp_event, void *timestamp_handler, rs_error **error) |
Enables and configures motion-tracking data handlers. More... | |
void | rs_enable_motion_tracking_cpp (rs_device *device, rs_motion_callback *motion_callback, rs_timestamp_callback *timestamp_callback, rs_error **error) |
Enables and configures motion-tracking data handlers. More... | |
void | rs_enable_stream (rs_device *device, rs_stream stream, int width, int height, rs_format format, int framerate, rs_error **error) |
Enables a specific stream and requests specific properties. More... | |
void | rs_enable_stream_ex (rs_device *device, rs_stream stream, int width, int height, rs_format format, int framerate, rs_output_buffer_format output_format, rs_error **error) |
Enables a specific stream and requests specific properties. More... | |
void | rs_enable_stream_preset (rs_device *device, rs_stream stream, rs_preset preset, rs_error **error) |
Enables a specific stream and requests properties using a preset. More... | |
const char * | rs_event_to_string (rs_event_source event) |
const char * | rs_format_to_string (rs_format format) |
const char * | rs_frame_metadata_to_string (rs_frame_metadata md) |
void | rs_free_error (rs_error *error) |
Frees memory of an error object. More... | |
int | rs_get_api_version (rs_error **error) |
Retrieves API version from the source code. Evaluate that the value is conformant to the established policies. More... | |
int | rs_get_detached_frame_bpp (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame bits per pixel. More... | |
const void * | rs_get_detached_frame_data (const rs_frame_ref *frame, rs_error **error) |
Retrieves data from frame reference. More... | |
rs_format | rs_get_detached_frame_format (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame format. More... | |
int | rs_get_detached_frame_height (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame intrinsic height. More... | |
double | rs_get_detached_frame_metadata (const rs_frame_ref *frame, rs_frame_metadata frame_metadata, rs_error **error) |
Retrieves metadata from a frame reference. More... | |
unsigned long long | rs_get_detached_frame_number (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame number from frame reference. More... | |
rs_stream | rs_get_detached_frame_stream_type (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame stream type. More... | |
int | rs_get_detached_frame_stride (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame stride, meaning the actual line width in memory in bytes (not the logical image width) More... | |
double | rs_get_detached_frame_timestamp (const rs_frame_ref *frame, rs_error **error) |
Retrieves timestamp from frame reference. More... | |
rs_timestamp_domain | rs_get_detached_frame_timestamp_domain (const rs_frame_ref *frame, rs_error **error) |
Retrieves timestamp domain from frame reference. More... | |
int | rs_get_detached_frame_width (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame intrinsic width in pixels. More... | |
int | rs_get_detached_framerate (const rs_frame_ref *frame, rs_error **error) |
Retrieves frame intrinsic frame rate. More... | |
rs_device * | rs_get_device (rs_context *context, int index, rs_error **error) |
Retrieves connected device by index. More... | |
int | rs_get_device_count (const rs_context *context, rs_error **error) |
Determines number of connected devices. More... | |
float | rs_get_device_depth_scale (const rs_device *device, rs_error **error) |
Retrieves mapping between the units of the depth image and meters. More... | |
void | rs_get_device_extrinsics (const rs_device *device, rs_stream from_stream, rs_stream to_stream, rs_extrinsics *extrin, rs_error **error) |
Retrieves extrinsic transformation between the viewpoints of two different streams. More... | |
const char * | rs_get_device_firmware_version (const rs_device *device, rs_error **error) |
Retrieves the version of the firmware currently installed on the device. More... | |
const char * | rs_get_device_info (const rs_device *device, rs_camera_info info, rs_error **error) |
Retrieves camera specific information, such as versions of various internal componnents. More... | |
const char * | rs_get_device_name (const rs_device *device, rs_error **error) |
Retrieves human-readable device model string. More... | |
double | rs_get_device_option (rs_device *device, rs_option option, rs_error **error) |
Retrieves the current value of a single option. More... | |
const char * | rs_get_device_option_description (rs_device *device, rs_option option, rs_error **error) |
Retrieves a static description of what a particular option does on given device. More... | |
void | rs_get_device_option_range (rs_device *device, rs_option option, double *min, double *max, double *step, rs_error **error) |
Retrieves the available range of values for a supported option. More... | |
void | rs_get_device_option_range_ex (rs_device *device, rs_option option, double *min, double *max, double *step, double *def, rs_error **error) |
Retrieves the available range of values for a supported option. More... | |
void | rs_get_device_options (rs_device *device, const rs_option *options, unsigned int count, double *values, rs_error **error) |
Efficiently retrieves the value of an arbitrary number of options, using minimal hardware IO. More... | |
const char * | rs_get_device_serial (const rs_device *device, rs_error **error) |
Retrieves unique serial number of the device. More... | |
const char * | rs_get_device_usb_port_id (const rs_device *device, rs_error **error) |
Retrieves the USB port number of the device. More... | |
const char * | rs_get_error_message (const rs_error *error) |
Returns static pointer to error message. More... | |
const char * | rs_get_failed_args (const rs_error *error) |
Returns static pointer to arguments of a failing function in case of error. More... | |
const char * | rs_get_failed_function (const rs_error *error) |
Returns static pointer to name of a failing function in case of error. More... | |
const void * | rs_get_frame_data (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves the contents of the latest frame on a stream. More... | |
unsigned long long | rs_get_frame_number (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves frame number. More... | |
double | rs_get_frame_timestamp (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves time at which the latest frame on a stream was captured. More... | |
void | rs_get_motion_extrinsics_from (const rs_device *device, rs_stream from, rs_extrinsics *extrin, rs_error **error) |
Retrieves extrinsic transformation between specific stream and the motion module. More... | |
void | rs_get_motion_intrinsics (const rs_device *device, rs_motion_intrinsics *intrinsic, rs_error **error) |
Retrieves intrinsic camera parameters for a motion module. More... | |
rs_format | rs_get_stream_format (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves the pixel format for a specific stream. More... | |
int | rs_get_stream_framerate (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves the frame rate for a specific stream. More... | |
int | rs_get_stream_height (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves the height in pixels of a specific stream, equivalent to the height field from the stream's intrinsic. More... | |
void | rs_get_stream_intrinsics (const rs_device *device, rs_stream stream, rs_intrinsics *intrin, rs_error **error) |
Retrieves intrinsic camera parameters for a specific stream. More... | |
void | rs_get_stream_mode (const rs_device *device, rs_stream stream, int index, int *width, int *height, rs_format *format, int *framerate, rs_error **error) |
Determines the properties of a specific streaming mode. More... | |
int | rs_get_stream_mode_count (const rs_device *device, rs_stream stream, rs_error **error) |
Determines the number of streaming modes available for a given stream. More... | |
int | rs_get_stream_width (const rs_device *device, rs_stream stream, rs_error **error) |
Retrieves the width in pixels of a specific stream, equivalent to the width field from the stream's intrinsic. More... | |
int | rs_is_device_streaming (const rs_device *device, rs_error **error) |
Determines if the device is currently streaming. More... | |
int | rs_is_motion_tracking_active (rs_device *device, rs_error **error) |
Checks if data acquisition is active. More... | |
int | rs_is_stream_enabled (const rs_device *device, rs_stream stream, rs_error **error) |
Determines if a specific stream is enabled. More... | |
void | rs_log_to_callback (rs_log_severity min_severity, rs_log_callback_ptr on_log, void *user, rs_error **error) |
Starts logging to user-provided callback (C version) More... | |
void | rs_log_to_callback_cpp (rs_log_severity min_severity, rs_log_callback *callback, rs_error **error) |
Starts logging to user-provided callback. More... | |
void | rs_log_to_console (rs_log_severity min_severity, rs_error **error) |
Starts logging to console. More... | |
void | rs_log_to_file (rs_log_severity min_severity, const char *file_path, rs_error **error) |
Starts logging to file. More... | |
const char * | rs_option_to_string (rs_option option) |
int | rs_poll_for_frames (rs_device *device, rs_error **error) |
Checks if new frames are available, without blocking. More... | |
const char * | rs_preset_to_string (rs_preset preset) |
void | rs_release_frame (rs_device *device, rs_frame_ref *frame, rs_error **error) |
Releases frame handle. More... | |
void | rs_reset_device_options_to_default (rs_device *device, const rs_option *options, int count, rs_error **error) |
Efficiently resets the value of an arbitrary number of options to default. More... | |
void | rs_send_blob_to_device (rs_device *device, rs_blob_type type, void *data, int size, rs_error **error) |
Sends arbitrary binary data to the device. More... | |
void | rs_set_device_option (rs_device *device, rs_option option, double value, rs_error **error) |
Sets the current value of a single option. More... | |
void | rs_set_device_options (rs_device *device, const rs_option *options, unsigned int count, const double *values, rs_error **error) |
Efficiently sets the value of an arbitrary number of options, using minimal hardware IO. More... | |
void | rs_set_frame_callback (rs_device *device, rs_stream stream, rs_frame_callback_ptr on_frame, void *user, rs_error **error) |
Sets up a frame callback that is called immediately when an image is available, with no synchronization logic applied. More... | |
void | rs_set_frame_callback_cpp (rs_device *device, rs_stream stream, rs_frame_callback *callback, rs_error **error) |
Sets up a frame callback that is called immediately when an image is available, with no synchronization logic applied. More... | |
const char * | rs_source_to_string (rs_source source) |
void | rs_start_device (rs_device *device, rs_error **error) |
Begins streaming on all enabled streams for this device. More... | |
void | rs_start_source (rs_device *device, rs_source source, rs_error **error) |
Begins streaming on all enabled streams for this device. More... | |
void | rs_stop_device (rs_device *device, rs_error **error) |
Ends data acquisition for the specified source providers. More... | |
void | rs_stop_source (rs_device *device, rs_source source, rs_error **error) |
Ends data acquisition for the specified source providers. More... | |
const char * | rs_stream_to_string (rs_stream stream) |
int | rs_supports (rs_device *device, rs_capabilities capability, rs_error **error) |
Determines device capabilities. More... | |
int | rs_supports_camera_info (rs_device *device, rs_camera_info info_param, rs_error **error) |
Returns true if given camera information parameter is supported by the device. More... | |
int | rs_supports_frame_metadata (const rs_frame_ref *frame, rs_frame_metadata frame_metadata, rs_error **error) |
Determines device metadata. More... | |
const char * | rs_timestamp_domain_to_string (rs_timestamp_domain info) |
void | rs_wait_for_frames (rs_device *device, rs_error **error) |
Blocks until new frames are available. More... | |
Exposes librealsense functionality for C compilers.
Definition in file rs.h.
#define RS_API_VERSION (((RS_API_MAJOR_VERSION) * 10000) + ((RS_API_MINOR_VERSION) * 100) + (RS_API_PATCH_VERSION)) |
#define RS_API_VERSION_STR (VAR_ARG_STRING(RS_API_MAJOR_VERSION.RS_API_MINOR_VERSION.RS_API_PATCH_VERSION)) |
typedef enum rs_blob_type rs_blob_type |
Proprietary formats for direct communication with device firmware.
typedef enum rs_camera_info rs_camera_info |
Read-only strings that can be queried from the device.
Not all information fields are available on all camera types. This information is mainly available for camera debug and troubleshooting and should not be used in applications.
typedef enum rs_capabilities rs_capabilities |
Specifies various capabilities of a RealSense device.
To check if a certain capability is supported by a particular device, at runtime call dev->supports(capability)
.
typedef struct rs_context rs_context |
typedef enum rs_distortion rs_distortion |
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
typedef enum rs_event_source rs_event_source |
Source device that triggered a specific timestamp event from the motion module.
typedef struct rs_extrinsics rs_extrinsics |
Cross-stream extrinsics: encode the topology describing how the different devices are connected.
Formats: defines how each stream can be encoded.
rs_format
specifies how a frame is represented in memory (similar to the V4L pixel format).
typedef struct rs_frame_callback rs_frame_callback |
typedef void(* rs_frame_callback_ptr) (rs_device *dev, rs_frame_ref *frame, void *user) |
typedef enum rs_frame_metadata rs_frame_metadata |
Types of value provided from the device with each frame.
typedef struct rs_frame_ref rs_frame_ref |
typedef struct rs_frameset rs_frameset |
typedef struct rs_intrinsics rs_intrinsics |
Video stream intrinsics.
typedef enum rs_ivcam_preset rs_ivcam_preset |
For SR300 devices: provides optimized settings (presets) for specific types of usage.
typedef struct rs_log_callback rs_log_callback |
typedef void(* rs_log_callback_ptr) (rs_log_severity min_severity, const char *message, void *user) |
typedef enum rs_log_severity rs_log_severity |
Severity of the librealsense logger.
typedef struct rs_motion_callback rs_motion_callback |
typedef void(* rs_motion_callback_ptr) (rs_device *, rs_motion_data, void *) |
typedef struct rs_motion_data rs_motion_data |
Motion data from gyroscope and accelerometer from the microcontroller.
typedef struct rs_motion_device_intrinsic rs_motion_device_intrinsic |
Motion device intrinsics: scale, bias, and variances.
typedef struct rs_motion_intrinsics rs_motion_intrinsics |
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_device_intrinsic
.
Defines general configuration controls.
These can generally be mapped to camera UVC controls, and unless stated otherwise, can be set/queried at any time.
typedef enum rs_output_buffer_format rs_output_buffer_format |
Output buffer format: sets how librealsense works with frame memory.
Presets: general preferences that are translated by librealsense into concrete resolution and FPS.
Source: allows you to choose between available hardware subdevices.
typedef struct rs_timestamp_callback rs_timestamp_callback |
typedef void(* rs_timestamp_callback_ptr) (rs_device *, rs_timestamp_data, void *) |
typedef struct rs_timestamp_data rs_timestamp_data |
Timestamp data from the motion microcontroller.
typedef enum rs_timestamp_domain rs_timestamp_domain |
Specifies the clock in relation to which the frame timestamp was measured.
When working with a motion microcontroller, motion data timestamps are always in the microcontroller timestamp domain. Some frames, however, might not succesfully receive microcontroller timestamp and will be marked as camera domain.
enum rs_blob_type |
enum rs_camera_info |
Read-only strings that can be queried from the device.
Not all information fields are available on all camera types. This information is mainly available for camera debug and troubleshooting and should not be used in applications.
enum rs_capabilities |
Specifies various capabilities of a RealSense device.
To check if a certain capability is supported by a particular device, at runtime call dev->supports(capability)
.
enum rs_distortion |
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
enum rs_event_source |
Source device that triggered a specific timestamp event from the motion module.
enum rs_format |
Formats: defines how each stream can be encoded.
rs_format
specifies how a frame is represented in memory (similar to the V4L pixel format).
Enumerator | |
---|---|
RS_FORMAT_ANY |
When passed to enable stream, librealsense will try to provide best suited format |
RS_FORMAT_Z16 |
16-bit linear depth values. The depth is meters is equal to depth scale * pixel value. |
RS_FORMAT_DISPARITY16 |
16-bit linear disparity values. The depth in meters is equal to depth scale / pixel value. |
RS_FORMAT_XYZ32F |
32-bit floating point 3D coordinates. |
RS_FORMAT_YUYV |
Standard YUV pixel format as described in https://en.wikipedia.org/wiki/YUV |
RS_FORMAT_RGB8 |
8-bit red, green and blue channels |
RS_FORMAT_BGR8 |
8-bit blue, green, and red channels – suitable for OpenCV |
RS_FORMAT_RGBA8 |
8-bit red, green and blue channels + constant alpha channel equal to FF |
RS_FORMAT_BGRA8 |
8-bit blue, green, and red channels + constant alpha channel equal to FF |
RS_FORMAT_Y8 |
8-bit per-pixel grayscale image |
RS_FORMAT_Y16 |
16-bit per-pixel grayscale image |
RS_FORMAT_RAW10 |
Four 10-bit luminance values encoded into a 5-byte macropixel |
RS_FORMAT_RAW16 |
16-bit raw image |
RS_FORMAT_RAW8 |
8-bit raw image |
RS_FORMAT_COUNT |
Number of enumeration values. Not a valid input: intended to be used in for-loops. |
enum rs_frame_metadata |
Types of value provided from the device with each frame.
enum rs_ivcam_preset |
For SR300 devices: provides optimized settings (presets) for specific types of usage.
enum rs_log_severity |
Severity of the librealsense logger.
enum rs_option |
Defines general configuration controls.
These can generally be mapped to camera UVC controls, and unless stated otherwise, can be set/queried at any time.
Output buffer format: sets how librealsense works with frame memory.
enum rs_preset |
Presets: general preferences that are translated by librealsense into concrete resolution and FPS.
enum rs_source |
Source: allows you to choose between available hardware subdevices.
enum rs_stream |
Streams are different types of data provided by RealSense devices.
enum rs_timestamp_domain |
Specifies the clock in relation to which the frame timestamp was measured.
When working with a motion microcontroller, motion data timestamps are always in the microcontroller timestamp domain. Some frames, however, might not succesfully receive microcontroller timestamp and will be marked as camera domain.
const char* rs_blob_type_to_string | ( | rs_blob_type | type | ) |
const char * rs_camera_info_to_string | ( | rs_camera_info | info | ) |
const char* rs_capabilities_to_string | ( | rs_capabilities | capability | ) |
rs_context* rs_create_context | ( | int | api_version, |
rs_error ** | error | ||
) |
Creates RealSense context that is required for the rest of the API.
[in] | api_version | Users are expected to pass their version of RS_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_delete_context | ( | rs_context * | context, |
rs_error ** | error | ||
) |
Frees the relevant context object.
This action might invalidate rs_device
pointers created from this context.
[in] | context | Object that is no longer needed |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Determines if the device allows a specific option to be queried and set.
[in] | device | Relevant RealSense device |
[in] | option | Option |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
const char* rs_distortion_to_string | ( | rs_distortion | distortion | ) |
void rs_enable_motion_tracking | ( | rs_device * | device, |
rs_motion_callback_ptr | on_motion_event, | ||
void * | motion_handler, | ||
rs_timestamp_callback_ptr | on_timestamp_event, | ||
void * | timestamp_handler, | ||
rs_error ** | error | ||
) |
Enables and configures motion-tracking data handlers.
[in] | device | Relevant RealSense device |
[in] | on_motion_event | User-defined routine to be invoked when a motion data arrives |
[in] | motion_handler | User data point to be passed to the motion event callback |
[in] | on_timestamp_event | User-defined routine to be invoked on timestamp |
[in] | timestamp_handler | User data point to be passed to the motion event callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
rs_enable_motion_tracking_cpp()
void rs_enable_motion_tracking_cpp | ( | rs_device * | device, |
rs_motion_callback * | motion_callback, | ||
rs_timestamp_callback * | timestamp_callback, | ||
rs_error ** | error | ||
) |
Enables and configures motion-tracking data handlers.
Note:
The rs_enable_motion_tracking_cpp()
method is responsible for activating the motion module on-board the device. One of the services it provides is to produce shared and high-resolution timestamps for all components that are connected to it. For Depth, IR, Color and Fisheye sensors, librealsense takes care of that and copies the timestamps on the relevant frames.
However, when you have an external device (such as a compass, magnetometer, light sensor, or other) and wish to synchronize it precisely with image and motion streams, you can connect that sensor to a GPIO that is available on some devices. Every time the sensor signals, you get a timestamp callback with a frame number, source ID, and a timestamp. This timestamp callback allows advanced users to synchronize compass events (presumably coming though I2C or some other method) with RealSense data.
This variant of rs_enable_motion_tracking()
is provided specifically to enable passing lambdas with capture lists safely into the library.
[in] | device | Relevant RealSense device |
[in] | motion_callback | User-defined routine to be invoked when motion data arrives |
[in] | timestamp_callback | User-defined routine to be invoked on timestamp |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
rs_enable_motion_tracking()
void rs_enable_stream | ( | rs_device * | device, |
rs_stream | stream, | ||
int | width, | ||
int | height, | ||
rs_format | format, | ||
int | framerate, | ||
rs_error ** | error | ||
) |
Enables a specific stream and requests specific properties.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | width | Desired width of a frame image in pixels, or 0 if any width is acceptable |
[in] | height | Desired height of a frame image in pixels, or 0 if any height is acceptable |
[in] | format | Pixel format of a frame image, or ANY if any format is acceptable |
[in] | framerate | Number of frames that will be streamed per second, or 0 if any frame rate is acceptable |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_enable_stream_ex | ( | rs_device * | device, |
rs_stream | stream, | ||
int | width, | ||
int | height, | ||
rs_format | format, | ||
int | framerate, | ||
rs_output_buffer_format | output_format, | ||
rs_error ** | error | ||
) |
Enables a specific stream and requests specific properties.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | width | Desired width of a frame image in pixels, or 0 if any width is acceptable |
[in] | height | Desired height of a frame image in pixels, or 0 if any height is acceptable |
[in] | format | Pixel format of a frame image, or ANY if any format is acceptable |
[in] | framerate | Number of frames that will be streamed per second, or 0 if any frame rate is acceptable |
[in] | output_format | Output buffer format (contious in memory / native with pitch) |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_enable_stream_preset | ( | rs_device * | device, |
rs_stream | stream, | ||
rs_preset | preset, | ||
rs_error ** | error | ||
) |
Enables a specific stream and requests properties using a preset.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | preset | Preset to use to enable the stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
const char* rs_event_to_string | ( | rs_event_source | event | ) |
const char* rs_frame_metadata_to_string | ( | rs_frame_metadata | md | ) |
Retrieves API version from the source code. Evaluate that the value is conformant to the established policies.
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
int rs_get_detached_frame_bpp | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
const void* rs_get_detached_frame_data | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
rs_format rs_get_detached_frame_format | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
int rs_get_detached_frame_height | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
double rs_get_detached_frame_metadata | ( | const rs_frame_ref * | frame, |
rs_frame_metadata | frame_metadata, | ||
rs_error ** | error | ||
) |
unsigned long long rs_get_detached_frame_number | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
rs_stream rs_get_detached_frame_stream_type | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
int rs_get_detached_frame_stride | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
Retrieves frame stride, meaning the actual line width in memory in bytes (not the logical image width)
[in] | frame | Current frame reference |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
double rs_get_detached_frame_timestamp | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
Retrieves timestamp from frame reference.
[in] | frame | Current frame reference |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
rs_timestamp_domain rs_get_detached_frame_timestamp_domain | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
Retrieves timestamp domain from frame reference.
This method is used to check if two timestamp values are comparable (meaning, are generated from the same clock).
[in] | frame | Current frame reference |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
int rs_get_detached_frame_width | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
int rs_get_detached_framerate | ( | const rs_frame_ref * | frame, |
rs_error ** | error | ||
) |
rs_device* rs_get_device | ( | rs_context * | context, |
int | index, | ||
rs_error ** | error | ||
) |
Retrieves connected device by index.
context | Object representing librealsense session | |
[in] | index | Zero-based index of device to retrieve |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
int rs_get_device_count | ( | const rs_context * | context, |
rs_error ** | error | ||
) |
Retrieves mapping between the units of the depth image and meters.
[in] | device | Relevant RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_device_extrinsics | ( | const rs_device * | device, |
rs_stream | from_stream, | ||
rs_stream | to_stream, | ||
rs_extrinsics * | extrin, | ||
rs_error ** | error | ||
) |
Retrieves extrinsic transformation between the viewpoints of two different streams.
[in] | device | Relevant RealSense device |
[in] | from_stream | Stream whose coordinate space to transform from |
[in] | to_stream | Stream whose coordinate space to transform to |
[out] | extrin | Transformation between the two streams |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Retrieves the version of the firmware currently installed on the device.
[in] | device | Relevant RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored |
const char* rs_get_device_info | ( | const rs_device * | device, |
rs_camera_info | info, | ||
rs_error ** | error | ||
) |
Retrieves camera specific information, such as versions of various internal componnents.
[in] | device | Relevant RealSense device |
[out] | info | Information that is retrieved |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Retrieves human-readable device model string.
[in] | device | Relevant RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
const char* rs_get_device_option_description | ( | rs_device * | device, |
rs_option | option, | ||
rs_error ** | error | ||
) |
Retrieves a static description of what a particular option does on given device.
[in] | device | Relevant RealSense device |
[in] | option | Option |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_device_option_range | ( | rs_device * | device, |
rs_option | option, | ||
double * | min, | ||
double * | max, | ||
double * | step, | ||
rs_error ** | error | ||
) |
Retrieves the available range of values for a supported option.
[in] | device | Relevant RealSense device |
[in] | option | Option |
[out] | min | Minimum value that is acceptable for this option |
[out] | max | Maximum value that is acceptable for this option |
[out] | step | Granularity of options that accept discrete values, or zero if the option accepts continuous values |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_device_option_range_ex | ( | rs_device * | device, |
rs_option | option, | ||
double * | min, | ||
double * | max, | ||
double * | step, | ||
double * | def, | ||
rs_error ** | error | ||
) |
Retrieves the available range of values for a supported option.
[in] | device | Relevant RealSense device |
[in] | option | Option |
[out] | min | Minimum value that is acceptable for this option |
[out] | max | Maximum value that is acceptable for this option |
[out] | step | Granularity of options that accept discrete values, or zero if the option accepts continuous values |
[out] | def | Default value of the option |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_device_options | ( | rs_device * | device, |
const rs_option * | options, | ||
unsigned int | count, | ||
double * | values, | ||
rs_error ** | error | ||
) |
Efficiently retrieves the value of an arbitrary number of options, using minimal hardware IO.
[in] | device | Relevant RealSense device |
[in] | options | Array of options that should be queried |
[in] | count | Length of options and values arrays |
[out] | values | Array that receives the values of the queried options |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
const char* rs_get_error_message | ( | const rs_error * | error | ) |
const char* rs_get_failed_args | ( | const rs_error * | error | ) |
const char* rs_get_failed_function | ( | const rs_error * | error | ) |
Retrieves the contents of the latest frame on a stream.
[in] | device | Relevant RealSense device |
[in] | stream | Stream whose latest frame is of interest |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Retrieves time at which the latest frame on a stream was captured.
[in] | device | Relevant RealSense device |
[in] | stream | Stream whose latest frame is of interest |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_motion_extrinsics_from | ( | const rs_device * | device, |
rs_stream | from, | ||
rs_extrinsics * | extrin, | ||
rs_error ** | error | ||
) |
Retrieves extrinsic transformation between specific stream and the motion module.
[in] | device | Relevant RealSense device |
[in] | from | Stream |
[out] | extrin | Transformation between the specific stream and motion module |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_motion_intrinsics | ( | const rs_device * | device, |
rs_motion_intrinsics * | intrinsic, | ||
rs_error ** | error | ||
) |
Retrieves the frame rate for a specific stream.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Retrieves the height in pixels of a specific stream, equivalent to the height field from the stream's intrinsic.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_stream_intrinsics | ( | const rs_device * | device, |
rs_stream | stream, | ||
rs_intrinsics * | intrin, | ||
rs_error ** | error | ||
) |
Retrieves intrinsic camera parameters for a specific stream.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[out] | intrin | Intrinsic parameters of the stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_get_stream_mode | ( | const rs_device * | device, |
rs_stream | stream, | ||
int | index, | ||
int * | width, | ||
int * | height, | ||
rs_format * | format, | ||
int * | framerate, | ||
rs_error ** | error | ||
) |
Determines the properties of a specific streaming mode.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | index | Zero-based index of the streaming mode |
[out] | width | Width of a frame image in pixels |
[out] | height | Height of a frame image in pixels |
[out] | format | Pixel format of a frame image |
[out] | framerate | Number of frames that will be streamed per second |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Determines the number of streaming modes available for a given stream.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Retrieves the width in pixels of a specific stream, equivalent to the width field from the stream's intrinsic.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_log_to_callback | ( | rs_log_severity | min_severity, |
rs_log_callback_ptr | on_log, | ||
void * | user, | ||
rs_error ** | error | ||
) |
Starts logging to user-provided callback (C version)
[in] | on_log | Callback function pointer |
[in] | min_severity | Minimum severity to be logged |
[in] | user | Custom pointer for the callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_log_to_callback_cpp | ( | rs_log_severity | min_severity, |
rs_log_callback * | callback, | ||
rs_error ** | error | ||
) |
Starts logging to user-provided callback.
[in] | callback | Pointer to log into (must be created and used from C++) |
[in] | min_severity | Minimum severity to be logged |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_log_to_console | ( | rs_log_severity | min_severity, |
rs_error ** | error | ||
) |
void rs_log_to_file | ( | rs_log_severity | min_severity, |
const char * | file_path, | ||
rs_error ** | error | ||
) |
Starts logging to file.
[in] | file_path | Relative filename to log to. In case file exists, it will be appended to. |
[in] | min_severity | Minimum severity to be logged |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Checks if new frames are available, without blocking.
[in] | device | Relevant RealSense device |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_release_frame | ( | rs_device * | device, |
rs_frame_ref * | frame, | ||
rs_error ** | error | ||
) |
Releases frame handle.
[in] | device | Relevant RealSense device |
[in] | frame | Handle returned either detach, clone_ref or from frame callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_reset_device_options_to_default | ( | rs_device * | device, |
const rs_option * | options, | ||
int | count, | ||
rs_error ** | error | ||
) |
Efficiently resets the value of an arbitrary number of options to default.
[in] | device | Relevant RealSense device |
[in] | options | Array of options that should be set to default |
[in] | count | Length of the options array |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_send_blob_to_device | ( | rs_device * | device, |
rs_blob_type | type, | ||
void * | data, | ||
int | size, | ||
rs_error ** | error | ||
) |
Sends arbitrary binary data to the device.
[in] | device | Relevant RealSense device |
[in] | type | Type of raw data to send to the device |
[in] | data | Raw data pointer to send |
[in] | size | Size, in bytes of the raw data to send |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
Sets the current value of a single option.
[in] | device | Relevant RealSense device |
[in] | option | Option whose value should be set |
[in] | value | Value of the option |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_set_device_options | ( | rs_device * | device, |
const rs_option * | options, | ||
unsigned int | count, | ||
const double * | values, | ||
rs_error ** | error | ||
) |
Efficiently sets the value of an arbitrary number of options, using minimal hardware IO.
[in] | device | Relevant RealSense device |
[in] | options | Array of options that should be set |
[in] | count | Length of options and values arrays |
[in] | values | Array of values to which the options should be set |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
void rs_set_frame_callback | ( | rs_device * | device, |
rs_stream | stream, | ||
rs_frame_callback_ptr | on_frame, | ||
void * | user, | ||
rs_error ** | error | ||
) |
Sets up a frame callback that is called immediately when an image is available, with no synchronization logic applied.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | on_frame | Callback that will receive the frame data and timestamp |
[in] | user | User data point to be passed to the callback |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
rs_set_frame_callback_cpp()
void rs_set_frame_callback_cpp | ( | rs_device * | device, |
rs_stream | stream, | ||
rs_frame_callback * | callback, | ||
rs_error ** | error | ||
) |
Sets up a frame callback that is called immediately when an image is available, with no synchronization logic applied.
This variant of rs_set_frame_callback()
is provided specifically to enable passing lambdas with capture lists safely into the library.
[in] | device | Relevant RealSense device |
[in] | stream | Stream |
[in] | callback | Callback that will receive the frame data and timestamp |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
rs_set_frame_callback()
int rs_supports | ( | rs_device * | device, |
rs_capabilities | capability, | ||
rs_error ** | error | ||
) |
int rs_supports_camera_info | ( | rs_device * | device, |
rs_camera_info | info_param, | ||
rs_error ** | error | ||
) |
Returns true if given camera information parameter is supported by the device.
[in] | device | Relevant RealSense device |
[in] | info_param | Parameter to check |
[out] | error | If non-null, receives any error that occurs during this call, otherwise, errors are ignored. |
int rs_supports_frame_metadata | ( | const rs_frame_ref * | frame, |
rs_frame_metadata | frame_metadata, | ||
rs_error ** | error | ||
) |
const char* rs_timestamp_domain_to_string | ( | rs_timestamp_domain | info | ) |