10 #ifndef LIBREALSENSE_RS_H 11 #define LIBREALSENSE_RS_H 17 #define RS_API_MAJOR_VERSION 1 18 #define RS_API_MINOR_VERSION 12 19 #define RS_API_PATCH_VERSION 4 21 #define STRINGIFY(arg) #arg 22 #define VAR_ARG_STRING(arg) STRINGIFY(arg) 28 #define RS_API_VERSION (((RS_API_MAJOR_VERSION) * 10000) + ((RS_API_MINOR_VERSION) * 100) + (RS_API_PATCH_VERSION)) 30 #define RS_API_VERSION_STR (VAR_ARG_STRING(RS_API_MAJOR_VERSION.RS_API_MINOR_VERSION.RS_API_PATCH_VERSION)) 320 float noise_variances[3];
321 float bias_variances[3];
335 float translation[3];
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 i...
void timestamp_callback(rs_device *, rs_timestamp_data, void *)
int rs_supports(rs_device *device, rs_capabilities capability, rs_error **error)
Determines device capabilities.
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. ...
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.
rs_timestamp_data timestamp_data
const char * rs_stream_to_string(rs_stream stream)
void rs_start_source(rs_device *device, rs_source source, rs_error **error)
Begins streaming on all enabled streams for this device.
rs_event_source source_id
void rs_disable_motion_tracking(rs_device *device, rs_error **error)
Disables motion-tracking handlers.
void rs_log_to_callback_cpp(rs_log_severity min_severity, rs_log_callback *callback, rs_error **error)
Starts logging to user-provided callback.
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.
const char * rs_source_to_string(rs_source source)
void on_timestamp_event(rs::timestamp_data entry)
int rs_supports_frame_metadata(const rs_frame_ref *frame, rs_frame_metadata frame_metadata, rs_error **error)
Determines device metadata.
void(* rs_frame_callback_ptr)(rs_device *dev, rs_frame_ref *frame, void *user)
const char * rs_camera_info_to_string(rs_camera_info info)
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
frame_metadata
Types of value provided from the device with each frame.
GLint GLint GLsizei GLsizei height
rs_blob_type
Proprietary formats for direct communication with device firmware.
void rs_log_to_console(rs_log_severity min_severity, rs_error **error)
Starts logging to console.
struct rs_intrinsics rs_intrinsics
Video stream intrinsics.
rs_format rs_get_detached_frame_format(const rs_frame_ref *frame, rs_error **error)
Retrieves frame format.
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.
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...
void motion_callback(rs_device *, rs_motion_data, void *)
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...
rs_timestamp_domain rs_get_detached_frame_timestamp_domain(const rs_frame_ref *frame, rs_error **error)
Retrieves timestamp domain from frame reference.
GLuint GLsizei const GLchar * message
void(* rs_motion_callback_ptr)(rs_device *, rs_motion_data, void *)
unsigned long long rs_get_detached_frame_number(const rs_frame_ref *frame, rs_error **error)
Retrieves frame number from frame reference.
struct rs_frameset rs_frameset
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.
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.
int rs_is_device_streaming(const rs_device *device, rs_error **error)
Determines if the device is currently streaming.
const char * rs_frame_metadata_to_string(rs_frame_metadata md)
const char * rs_distortion_to_string(rs_distortion distortion)
struct rs_timestamp_data rs_timestamp_data
Timestamp data from the motion microcontroller.
void rs_delete_context(rs_context *context, rs_error **error)
Frees the relevant context object.
void(* rs_log_callback_ptr)(rs_log_severity min_severity, const char *message, void *user)
void rs_set_device_option(rs_device *device, rs_option option, double value, rs_error **error)
Sets the current value of a single option.
const char * rs_get_device_name(const rs_device *device, rs_error **error)
Retrieves human-readable device model string.
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.
Motion device intrinsics: scale, bias, and variances.
rs_option
Defines general configuration controls.
const char * rs_get_error_message(const rs_error *error)
Returns static pointer to error message.
float rs_get_device_depth_scale(const rs_device *device, rs_error **error)
Retrieves mapping between the units of the depth image and meters.
const char * rs_blob_type_to_string(rs_blob_type type)
rs_output_buffer_format
Output buffer format: sets how librealsense works with frame memory.
const char * rs_get_device_usb_port_id(const rs_device *device, rs_error **error)
Retrieves the USB port number of the device.
rs_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
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)
void rs_log_to_file(rs_log_severity min_severity, const char *file_path, rs_error **error)
Starts logging to file.
rs_stream rs_get_detached_frame_stream_type(const rs_frame_ref *frame, rs_error **error)
Retrieves frame stream type.
struct rs_extrinsics rs_extrinsics
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
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.
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.
int rs_poll_for_frames(rs_device *device, rs_error **error)
Checks if new frames are available, without blocking.
const char * rs_get_failed_function(const rs_error *error)
Returns static pointer to name of a failing function in case of 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.
rs_context * rs_create_context(int api_version, rs_error **error)
Creates RealSense context that is required for the rest of the API.
const char * rs_capabilities_to_string(rs_capabilities capability)
double rs_get_device_option(rs_device *device, rs_option option, rs_error **error)
Retrieves the current value of a single option.
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.
int rs_get_detached_frame_bpp(const rs_frame_ref *frame, rs_error **error)
Retrieves frame bits per pixel.
void rs_disable_stream(rs_device *device, rs_stream stream, rs_error **error)
Disables a specific stream.
int rs_get_detached_framerate(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic frame rate.
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 synchronizati...
void rs_release_frame(rs_device *device, rs_frame_ref *frame, rs_error **error)
Releases frame handle.
GLuint GLuint GLsizei count
Motion data from gyroscope and accelerometer from the microcontroller.
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.
rs_camera_info
Read-only strings that can be queried from the device.
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.
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_d...
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.
int rs_get_detached_frame_height(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic height.
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.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * data
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.
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.
const char * rs_get_failed_args(const rs_error *error)
Returns static pointer to arguments of a failing function in case of error.
rs_format
Formats: defines how each stream can be encoded.
const char * rs_event_to_string(rs_event_source event)
double rs_get_detached_frame_timestamp(const rs_frame_ref *frame, rs_error **error)
Retrieves timestamp from frame reference.
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.
void rs_stop_source(rs_device *device, rs_source source, rs_error **error)
Ends data acquisition for the specified source providers.
int rs_get_detached_frame_width(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic width in pixels.
Timestamp data from the motion microcontroller.
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...
unsigned long long rs_get_frame_number(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves frame number.
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.
void rs_free_error(rs_error *error)
Frees memory of an error object.
GLsizei const GLfloat * value
void(* rs_timestamp_callback_ptr)(rs_device *, rs_timestamp_data, void *)
struct rs_motion_device_intrinsic rs_motion_device_intrinsic
Motion device intrinsics: scale, bias, and variances.
int rs_get_api_version(rs_error **error)
Retrieves API version from the source code. Evaluate that the value is conformant to the established ...
rs_source
Source: allows you to choose between available hardware subdevices.
struct rs_motion_intrinsics rs_motion_intrinsics
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_d...
int rs_is_motion_tracking_active(rs_device *device, rs_error **error)
Checks if data acquisition is active.
typedef void(APIENTRYP PFNGLDRAWRANGEELEMENTSPROC)(GLenum mode
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
const char * rs_timestamp_domain_to_string(rs_timestamp_domain info)
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.
const char * rs_preset_to_string(rs_preset preset)
rs_motion_device_intrinsic acc
rs_preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS...
int rs_get_stream_framerate(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the frame rate for a specific stream.
GLenum GLsizei GLsizei GLint * values
const char * rs_format_to_string(rs_format format)
distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
rs_stream
Streams are different types of data provided by RealSense devices.
GLint GLint GLsizei width
const char * rs_option_to_string(rs_option option)
struct rs_motion_data rs_motion_data
Motion data from gyroscope and accelerometer from the microcontroller.
GLsizei GLsizei GLchar * source
unsigned long long frame_number
rs_log_severity
Severity of the librealsense logger.
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.
rs_capabilities
Specifies various capabilities of a RealSense device.
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 synchronizati...
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
const char * rs_get_device_serial(const rs_device *device, rs_error **error)
Retrieves unique serial number of the device.
void rs_wait_for_frames(rs_device *device, rs_error **error)
Blocks until new frames are available.
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.
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
rs_motion_device_intrinsic gyro
rs_distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
void rs_start_device(rs_device *device, rs_error **error)
Begins streaming on all enabled streams for this device.
void rs_stop_device(rs_device *device, rs_error **error)
Ends data acquisition for the specified source providers.
rs_frame_metadata
Types of value provided from the device with each frame.
void on_motion_event(rs::motion_data entry)
int rs_is_stream_enabled(const rs_device *device, rs_stream stream, rs_error **error)
Determines if a specific stream is enabled.
rs_ivcam_preset
For SR300 devices: provides optimized settings (presets) for specific types of usage.
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...
rs_event_source
Source device that triggered a specific timestamp event from the motion module.
const void * rs_get_detached_frame_data(const rs_frame_ref *frame, rs_error **error)
Retrieves data from frame reference.
void rs_get_motion_intrinsics(const rs_device *device, rs_motion_intrinsics *intrinsic, rs_error **error)
Retrieves intrinsic camera parameters for a motion module.
GLuint GLuint GLsizei GLenum type
preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS...
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.
GLenum GLenum const GLfloat * coeffs