Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 #include <stdint.h>
32 typedef enum rs2_exception_type
33 {
47 typedef enum rs2_distortion
48 {
57 const char* rs2_distortion_to_string(rs2_distortion distortion);
60 typedef struct rs2_intrinsics
61 {
62  int width;
63  int height;
64  float ppx;
65  float ppy;
66  float fx;
67  float fy;
69  float coeffs[5];
74 {
75  /* \internal
76  * Scale X cross axis cross axis Bias X \n
77  * cross axis Scale Y cross axis Bias Y \n
78  * cross axis cross axis Scale Z Bias Z */
79  float data[3][4];
81  float noise_variances[3];
82  float bias_variances[3];
87 typedef struct rs2_vertex
88 {
89  float xyz[3];
90 } rs2_vertex;
93 typedef struct rs2_pixel
94 {
95  int ij[2];
96 } rs2_pixel;
99 typedef struct rs2_vector
100 {
101  float x, y, z;
102 }rs2_vector;
105 typedef struct rs2_quaternion
106 {
107  float x, y, z, w;
110 typedef struct rs2_pose
111 {
118  unsigned int tracker_confidence;
119  unsigned int mapper_confidence;
120 } rs2_pose;
123 typedef enum rs2_log_severity {
136 typedef enum rs2_extension
137 {
195 } rs2_extension;
197 const char* rs2_extension_to_string(rs2_extension type);
200 typedef enum rs2_matchers
201 {
202  RS2_MATCHER_DI, //compare depth and ir based on frame number
204  RS2_MATCHER_DI_C, //compare depth and ir based on frame number,
205  //compare the pair of corresponding depth and ir with color based on closest timestamp,
207  RS2_MATCHER_DLR_C, //compare depth, left and right ir based on frame number,
208  //compare the set of corresponding depth, left and right with color based on closest timestamp,
209  //commonly used by RS415, RS435
211  RS2_MATCHER_DLR, //compare depth, left and right ir based on frame number,
212  //commonly used by RS400, RS405, RS410, RS420, RS430
214  RS2_MATCHER_DIC, //compare depth, ir and confidence based on frame number used by RS500
216  RS2_MATCHER_DIC_C, //compare depth, ir and confidence based on frame number,
217  //compare the set of corresponding depth, ir and confidence with color based on closest timestamp,
218  //commonly used by RS515
220  RS2_MATCHER_DEFAULT, //the default matcher compare all the streams based on closest timestamp
223 } rs2_matchers;
224 const char* rs2_matchers_to_string(rs2_matchers stream);
228 typedef struct rs2_device rs2_device;
229 typedef struct rs2_error rs2_error;
232 typedef struct rs2_frame rs2_frame;
234 typedef struct rs2_pipeline rs2_pipeline;
236 typedef struct rs2_config rs2_config;
243 typedef struct rs2_syncer rs2_syncer;
245 typedef struct rs2_source rs2_source;
250 typedef struct rs2_context rs2_context;
253 typedef struct rs2_sensor rs2_sensor;
254 typedef struct rs2_options rs2_options;
264 typedef void (*rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void * arg);
268 typedef void (*rs2_frame_callback_ptr)(rs2_frame*, void*);
270 typedef void (*rs2_update_progress_callback_ptr)(const float, void*);
273 typedef double rs2_time_t;
274 typedef long long rs2_metadata_type;
276 rs2_error * rs2_create_error(const char* what, const char* name, const char* args, rs2_exception_type type);
278 const char* rs2_get_failed_function (const rs2_error* error);
279 const char* rs2_get_failed_args (const rs2_error* error);
280 const char* rs2_get_error_message (const rs2_error* error);
281 void rs2_free_error (rs2_error* error);
283 #pragma pack(push, 1)
284 /* rs2_calibration_roi - Array of four corners in Deph Frame Coordinate system that define a closed simple quadrangle (non-intersecting)*/
285 typedef struct rs2_calibration_roi
286 {
287  uint16_t mask_pixel[4][2];
290 typedef struct float3_row_major { float x, y, z; } float3_row_major;
294 {
295  float3x3_row_major rotation; // Rotation matrix
296  float3_row_major translation; // Metric units
300 {
301  uint8_t calib_roi_num_of_segments; // Within 0-4 range: 0 - Default.No limitations.Full FOV can be used in TC
302  // 1 - 4: Segments defined.The segment must be sequential
303  rs2_calibration_roi roi[4]; // Segment 0 = convex tetragon - The vertices of the tetragon are ordered clockwise
304  // Vertex = [x, y] = pixel coordinates in the reference depth map
305  // 0 - based coordinates : [0, 0] = center of the top - left pixel
306  // Segments 1-3 - structured identical to segment_#0 (reserved)
307  // The ROI segments can intersect, but each must be convex(angles <= 180 degrees).
308  uint8_t reserved1[12];
310  uint8_t reserved2[300];
311  uint8_t crypto_signature[32];
312  uint8_t reserved3[39];
316 {
317  uint16_t version; // major.minor. Big-endian
318  uint16_t table_type; // type
319  uint32_t table_size; // full size including: header footer
320  uint32_t calib_version; // major.minor.index
321  uint32_t crc32; // crc of all the data in table excluding this header/CRC
325 {
329 #pragma pack(pop)
331 #ifdef __cplusplus
332 }
333 #endif
334 #endif
struct rs2_processing_block_list rs2_processing_block_list
Definition: rs_types.h:239
float3_row_major x
Definition: rs_types.h:291
Definition: rs_types.h:127
struct rs2_device_serializer rs2_device_serializer
Definition: rs_types.h:244
Definition: rs_types.hpp:26
struct rs2_vertex rs2_vertex
3D coordinates with origin at topmost left corner of the lense, with positive Z pointing away from th...
uint16_t version
Definition: rs_types.h:317
Definition: rs_types.h:220
Definition: rs_types.hpp:100
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:231
struct rs2_calibration_config rs2_calibration_config
struct rs2_pixel rs2_pixel
Pixel location within 2D image. (0,0) is the topmost, left corner. Positive X is right, positive Y is down.
Exception types are the different categories of errors that RealSense API might return.
Definition: rs_types.h:32
Definition: rs_types.h:193
float y
Definition: rs_types.h:107
void rs2_free_error(rs2_error *error)
rs2_vector angular_acceleration
Definition: rs_types.h:117
Definition: rs_types.h:167
Definition: rs_types.h:141
const char * rs2_matchers_to_string(rs2_matchers stream)
Definition: rs_types.h:174
Definition: rs_types.h:165
float z
Definition: rs_types.h:101
unsigned int tracker_confidence
Definition: rs_types.h:118
Definition: rs_types.h:166
Definition: rs_types.h:180
Definition: rs_types.hpp:42
Definition: rs_types.h:50
uint8_t crypto_signature[32]
Definition: rs_types.h:311
void(* rs2_frame_processor_callback_ptr)(rs2_frame *, rs2_source *, void *)
Definition: rs_types.h:269
Definition: rs_types.h:168
Definition: rs_types.h:147
struct rs2_frame_queue rs2_frame_queue
Definition: rs_types.h:233
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition: rs_types.h:47
Definition: rs_types.h:39
uint16_t mask_pixel[4][2]
Definition: rs_types.h:287
Definition: rs_types.h:177
const char * rs2_distortion_to_string(rs2_distortion distortion)
struct rs2_pipeline rs2_pipeline
Definition: rs_types.h:234
Definition: rs_types.h:131
struct rs2_context rs2_context
Definition: rs_types.h:250
struct rs2_device_info rs2_device_info
Definition: rs_types.h:227
rs2_vector translation
Definition: rs_types.h:112
Definition: rs_types.h:126
struct rs2_sensor_list rs2_sensor_list
Definition: rs_types.h:252
Definition: rs_types.h:149
uint16_t table_type
Definition: rs_types.h:318
Definition: rs_types.h:290
Definition: rs_types.h:216
Definition: rs_types.h:214
struct float3x3_row_major float3x3_row_major
float3_row_major z
Definition: rs_types.h:291
Definition: rs_types.h:55
float data[3][4]
Definition: rs_types.h:79
Definition: rs_types.h:54
Definition: rs_types.hpp:84
Definition: rs_types.h:53
float coeffs[5]
Definition: rs_types.h:69
3D coordinates with origin at topmost left corner of the lense, with positive Z pointing away from th...
Definition: rs_types.h:87
Definition: rs_types.h:34
Definition: rs_types.h:161
const char * rs2_extension_to_string(rs2_extension type)
Definition: rs_types.h:145
Definition: rs_types.h:151
float x
Definition: rs_types.h:107
struct rs2_firmware_log_parser rs2_firmware_log_parser
Definition: rs_types.h:262
rs2_vector angular_velocity
Definition: rs_types.h:116
uint8_t reserved2[300]
Definition: rs_types.h:310
void(* rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void *arg)
Definition: rs_types.h:264
struct rs2_sensor rs2_sensor
Definition: rs_types.h:253
Definition: rs_types.hpp:60
Definition: rs_types.h:124
void(* rs2_update_progress_callback_ptr)(const float, void *)
Definition: rs_types.h:270
Definition: rs_types.h:157
float ppx
Definition: rs_types.h:64
const char * rs2_exception_type_to_string(rs2_exception_type type)
unsigned int mapper_confidence
Definition: rs_types.h:119
uint32_t crc32
Definition: rs_types.h:321
Quaternion used to represent rotation.
Definition: rs_types.h:105
Definition: rs_types.h:191
Definition: rs_types.h:138
float y
Definition: rs_types.h:101
Definition: rs_types.h:162
struct rs2_pipeline_profile rs2_pipeline_profile
Definition: rs_types.h:235
float noise_variances[3]
Definition: rs_types.h:81
struct rs2_config rs2_config
Definition: rs_types.h:236
struct rs2_notification rs2_notification
Definition: rs_types.h:258
Definition: rs_types.h:186
rs2_vector velocity
Definition: rs_types.h:113
Definition: rs_types.h:293
Definition: rs_types.h:49
Definition: rs_types.h:42
void(* rs2_options_changed_callback_ptr)(const rs2_options_list *)
Definition: rs_types.h:271
Definition: rs_types.h:41
struct rs2_device_hub rs2_device_hub
Definition: rs_types.h:251
Definition: rs_types.h:202
Definition: rs_types.h:150
float3x3_row_major rotation
Definition: rs_types.h:295
rs2_calibration_config payload
Definition: rs_types.h:327
Definition: rs_types.h:144
Definition: rs_types.h:36
uint32_t table_size
Definition: rs_types.h:319
Definition: rs_types.hpp:34
Definition: rs_types.h:155
Definition: rs_types.h:181
const char * rs2_get_error_message(const rs2_error *error)
Specifies types of different matchers.
Definition: rs_types.h:200
uint8_t reserved3[39]
Definition: rs_types.h:312
const char * rs2_extension_type_to_string(rs2_extension type)
Definition: rs_types.h:142
Definition: rs_types.h:52
Definition: rs_types.h:148
Definition: rs_types.h:110
Definition: rs_types.h:182
struct rs2_motion_device_intrinsic rs2_motion_device_intrinsic
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:190
int ij[2]
Definition: rs_types.h:95
struct rs2_stream_profile_list rs2_stream_profile_list
Definition: rs_types.h:238
Definition: rs_types.h:285
Definition: rs_types.h:156
void(* rs2_devices_changed_callback_ptr)(rs2_device_list *, rs2_device_list *, void *)
Definition: rs_types.h:267
rs2_quaternion rotation
Definition: rs_types.h:115
struct rs2_log_message rs2_log_message
Definition: rs_types.h:230
float z
Definition: rs_types.h:290
Definition: rs_types.h:299
Definition: rs_types.h:178
int width
Definition: rs_types.h:62
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:240
struct rs2_calibration_config_with_header rs2_calibration_config_with_header
Definition: rs_types.h:129
Definition: rs_types.h:175
Definition: rs_types.h:324
Definition: rs_types.h:183
Definition: rs_types.h:152
rs2_exception_type rs2_get_librealsense_exception_type(const rs2_error *error)
struct rs2_options rs2_options
Definition: rs_types.h:254
float x
Definition: rs_types.h:290
struct rs2_syncer rs2_syncer
Definition: rs_types.h:243
struct rs2_vector rs2_vector
3D vector in Euclidean coordinate space
struct rs2_extrinsics_row_major rs2_extrinsics_row_major
Definition: rs_types.h:51
float x
Definition: rs_types.h:101
Definition: rs_types.h:143
struct rs2_source rs2_source
Definition: rs_types.h:245
uint32_t calib_version
Definition: rs_types.h:320
Definition: rs_types.h:222
struct rs2_calibration_roi rs2_calibration_roi
struct rs2_terminal_parser rs2_terminal_parser
Definition: rs_types.h:263
Definition: rs_types.h:128
Definition: rs_types.h:163
Definition: rs_types.h:171
struct rs2_calibration_config_header rs2_calibration_config_header
Definition: rs_types.h:130
Definition: rs_types.h:194
Definition: rs_types.h:160
Definition: rs_types.h:146
Definition: rs_types.h:291
Definition: rs_types.h:125
Definition: rs_types.h:27
struct rs2_intrinsics rs2_intrinsics
Video stream intrinsics.
float y
Definition: rs_types.h:290
void(* rs2_software_device_destruction_callback_ptr)(void *)
Definition: rs_types.h:266
Definition: rs_types.h:179
3D vector in Euclidean coordinate space
Definition: rs_types.h:99
Definition: rs_types.h:173
rs2_error * rs2_create_error(const char *what, const char *name, const char *args, rs2_exception_type type)
rs2_distortion model
Definition: rs_types.h:68
float w
Definition: rs_types.h:107
Definition: rs_types.hpp:92
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:246
uint8_t reserved1[12]
Definition: rs_types.h:308
Definition: rs_types.h:139
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:136
Category of the librealsense notification.
Definition: rs_types.h:19
rs2_calibration_roi roi[4]
Definition: rs_types.h:303
void(* rs2_notification_callback_ptr)(rs2_notification *, void *)
Definition: rs_types.h:265
long long rs2_metadata_type
Definition: rs_types.h:274
Definition: rs_types.h:184
Definition: rs_types.h:153
float fy
Definition: rs_types.h:67
float fx
Definition: rs_types.h:66
Definition: rs_types.h:192
Definition: rs_types.h:140
Definition: rs_types.h:187
struct rs2_device rs2_device
Definition: rs_types.h:228
Definition: rs_types.h:315
struct rs2_firmware_log_parsed_message rs2_firmware_log_parsed_message
Definition: rs_types.h:261
Definition: rs_types.h:170
Video stream intrinsics.
Definition: rs_types.h:60
Definition: rs_types.h:176
Definition: rs_types.h:188
uint8_t calib_roi_num_of_segments
Definition: rs_types.h:301
Definition: rs_types.h:185
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:73
rs2_vector acceleration
Definition: rs_types.h:114
rs2_extrinsics_row_major camera_position
Definition: rs_types.h:309
rs2_calibration_config_header header
Definition: rs_types.h:326
void(* rs2_frame_callback_ptr)(rs2_frame *, void *)
Definition: rs_types.h:268
Definition: rs_types.h:172
int height
Definition: rs_types.h:63
struct float3_row_major float3_row_major
Definition: rs_types.h:204
struct rs2_device_list rs2_device_list
Definition: rs_types.h:237
struct rs2_pose rs2_pose
float3_row_major y
Definition: rs_types.h:291
const char * rs2_notification_category_to_string(rs2_notification_category category)
Definition: rs_types.h:164
const char * rs2_log_severity_to_string(rs2_log_severity info)
struct rs2_quaternion rs2_quaternion
Quaternion used to represent rotation.
struct rs2_firmware_log_message rs2_firmware_log_message
Definition: rs_types.h:260
Definition: rs_types.hpp:76
Definition: rs_types.h:158
Definition: rs_types.h:159
struct rs2_error rs2_error
Definition: rs_types.h:229
double rs2_time_t
Definition: rs_types.h:273
Severity of the librealsense logger.
Definition: rs_types.h:123
Definition: rs_types.h:211
Definition: rs_types.h:154
struct rs2_options_list rs2_options_list
Definition: rs_types.h:255
const char * rs2_get_failed_function(const rs2_error *error)
const char * rs2_get_failed_args(const rs2_error *error)
Definition: rs_types.h:207
float bias_variances[3]
Definition: rs_types.h:82
float xyz[3]
Definition: rs_types.h:89
Definition: rs_types.h:37
float z
Definition: rs_types.h:107
struct rs2_frame rs2_frame
Definition: rs_types.h:232
float ppy
Definition: rs_types.h:65
float3_row_major translation
Definition: rs_types.h:296
Pixel location within 2D image. (0,0) is the topmost, left corner. Positive X is right, positive Y is down.
Definition: rs_types.h:93
Definition: rs_types.h:189
Definition: rs_types.h:169