#include <functional>
#include <climits>
#include "context.h"
#include "device.h"
#include "sync.h"
#include "archive.h"
Go to the source code of this file.
Classes | |
struct | rs_error |
Namespaces | |
rsimpl | |
Macros | |
#define | HANDLE_EXCEPTIONS_AND_RETURN(R, ...) catch(...) { std::ostringstream ss; rsimpl::stream_args(ss, #__VA_ARGS__, __VA_ARGS__); rsimpl::translate_exception(__FUNCTION__, ss.str(), error); return R; } |
#define | VALIDATE_ENUM(ARG) if(!rsimpl::is_valid(ARG)) { std::ostringstream ss; ss << "bad enum value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
#define | VALIDATE_LE(ARG, MAX) if((ARG) > (MAX)) { std::ostringstream ss; ss << "out of range value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
#define | VALIDATE_NATIVE_STREAM(ARG) VALIDATE_ENUM(ARG); if(ARG >= RS_STREAM_NATIVE_COUNT) { std::ostringstream ss; ss << "argument \"" #ARG "\" must be a native stream"; throw std::runtime_error(ss.str()); } |
#define | VALIDATE_NOT_NULL(ARG) if(!(ARG)) throw std::runtime_error("null pointer passed for argument \"" #ARG "\""); |
#define | VALIDATE_RANGE(ARG, MIN, MAX) if((ARG) < (MIN) || (ARG) > (MAX)) { std::ostringstream ss; ss << "out of range value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
Functions | |
std::string | api_version_to_string (int version) |
int | major (int version) |
int | minor (int version) |
int | patch (int version) |
void | report_version_mismatch (int runtime, int compiletime) |
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 *ts_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, 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... | |
const char * | rs_get_capabilities_name (rs_capabilities capability, rs_error **error) |
int | rs_get_detached_frame_bpp (const rs_frame_ref *frame_ref, rs_error **error) |
Retrieves frame bits per pixel. More... | |
const void * | rs_get_detached_frame_data (const rs_frame_ref *frame_ref, rs_error **error) |
Retrieves data from frame reference. More... | |
rs_format | rs_get_detached_frame_format (const rs_frame_ref *frame_ref, rs_error **error) |
Retrieves frame format. More... | |
int | rs_get_detached_frame_height (const rs_frame_ref *frame_ref, 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_ref, rs_error **error) |
Retrieves frame stream type. More... | |
int | rs_get_detached_frame_stride (const rs_frame_ref *frame_ref, 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_ref, rs_error **error) |
Retrieves timestamp from frame reference. More... | |
rs_timestamp_domain | rs_get_detached_frame_timestamp_domain (const rs_frame_ref *frame_ref, rs_error **error) |
Retrieves timestamp domain from frame reference. More... | |
int | rs_get_detached_frame_width (const rs_frame_ref *frame_ref, rs_error **error) |
Retrieves frame intrinsic width in pixels. More... | |
int | rs_get_detached_framerate (const rs_frame_ref *frame_ref, 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, rs_stream to, 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) |
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_distortion_name (rs_distortion distortion, rs_error **error) |
const char * | rs_get_error_message (const rs_error *error) |
Returns static pointer to error message. More... | |
const char * | rs_get_event_name (rs_event_source event, rs_error **error) |
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 char * | rs_get_format_name (rs_format format, rs_error **error) |
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... | |
const char * | rs_get_option_name (rs_option option, rs_error **error) |
const char * | rs_get_preset_name (rs_preset preset, rs_error **error) |
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... | |
const char * | rs_get_stream_name (rs_stream stream, rs_error **error) |
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) |
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... | |
template<class T > | |
void | rsimpl::stream_args (std::ostream &out, const char *names, const T &last) |
template<class T , class... U> | |
void | rsimpl::stream_args (std::ostream &out, const char *names, const T &first, const U &...rest) |
static void | rsimpl::translate_exception (const char *name, std::string args, rs_error **error) |
#define HANDLE_EXCEPTIONS_AND_RETURN | ( | R, | |
... | |||
) | catch(...) { std::ostringstream ss; rsimpl::stream_args(ss, #__VA_ARGS__, __VA_ARGS__); rsimpl::translate_exception(__FUNCTION__, ss.str(), error); return R; } |
#define VALIDATE_ENUM | ( | ARG | ) | if(!rsimpl::is_valid(ARG)) { std::ostringstream ss; ss << "bad enum value for argument \"" #ARG "\""; throw std::runtime_error(ss.str()); } |
#define VALIDATE_NATIVE_STREAM | ( | ARG | ) | VALIDATE_ENUM(ARG); if(ARG >= RS_STREAM_NATIVE_COUNT) { std::ostringstream ss; ss << "argument \"" #ARG "\" must be a native stream"; throw std::runtime_error(ss.str()); } |
#define VALIDATE_NOT_NULL | ( | ARG | ) | if(!(ARG)) throw std::runtime_error("null pointer passed for argument \"" #ARG "\""); |
std::string api_version_to_string | ( | int | version | ) |
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. |
const char* rs_get_capabilities_name | ( | rs_capabilities | capability, |
rs_error ** | error | ||
) |
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. |
const char* rs_get_distortion_name | ( | rs_distortion | distortion, |
rs_error ** | error | ||
) |
const char* rs_get_error_message | ( | const rs_error * | error | ) |
const char* rs_get_event_name | ( | rs_event_source | event, |
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_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 | ) |