Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rs_types.h
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. */
3 
9 #ifndef LIBREALSENSE_RS2_TYPES_H
10 #define LIBREALSENSE_RS2_TYPES_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
28 
30 typedef enum rs2_exception_type
31 {
43 
45 typedef enum rs2_distortion
46 {
55 const char* rs2_distortion_to_string(rs2_distortion distortion);
56 
58 typedef struct rs2_intrinsics
59 {
60  int width;
61  int height;
62  float ppx;
63  float ppy;
64  float fx;
65  float fy;
67  float coeffs[5];
69 
73 typedef struct rs2_dsm_params
74 {
75  unsigned long long timestamp;
76  unsigned short version;
77  unsigned char model;
78  unsigned char flags[5];
79  float h_scale;
80  float v_scale;
81  float h_offset;
82  float v_offset;
83  float rtd_offset;
84  unsigned char temp_x2;
85  unsigned char reserved[11];
87 
89 {
95 
98 {
99  /* \internal
100  * Scale X cross axis cross axis Bias X \n
101  * cross axis Scale Y cross axis Bias Y \n
102  * cross axis cross axis Scale Z Bias Z */
103  float data[3][4];
105  float noise_variances[3];
106  float bias_variances[3];
108 
111 typedef struct rs2_vertex
112 {
113  float xyz[3];
114 } rs2_vertex;
115 
117 typedef struct rs2_pixel
118 {
119  int ij[2];
120 } rs2_pixel;
121 
123 typedef struct rs2_vector
124 {
125  float x, y, z;
126 }rs2_vector;
127 
129 typedef struct rs2_quaternion
130 {
131  float x, y, z, w;
133 
134 typedef struct rs2_pose
135 {
142  unsigned int tracker_confidence;
143  unsigned int mapper_confidence;
144 } rs2_pose;
145 
147 typedef enum rs2_log_severity {
158 
160 typedef enum rs2_extension
161 {
216 } rs2_extension;
218 const char* rs2_extension_to_string(rs2_extension type);
219 
221 typedef enum rs2_matchers
222 {
223  RS2_MATCHER_DI, //compare depth and ir based on frame number
224 
225  RS2_MATCHER_DI_C, //compare depth and ir based on frame number,
226  //compare the pair of corresponding depth and ir with color based on closest timestamp,
227  //commonly used by SR300
228 
229  RS2_MATCHER_DLR_C, //compare depth, left and right ir based on frame number,
230  //compare the set of corresponding depth, left and right with color based on closest timestamp,
231  //commonly used by RS415, RS435
232 
233  RS2_MATCHER_DLR, //compare depth, left and right ir based on frame number,
234  //commonly used by RS400, RS405, RS410, RS420, RS430
235 
236  RS2_MATCHER_DIC, //compare depth, ir and confidence based on frame number used by RS500
237 
238  RS2_MATCHER_DIC_C, //compare depth, ir and confidence based on frame number,
239  //compare the set of corresponding depth, ir and confidence with color based on closest timestamp,
240  //commonly used by RS515
241 
242  RS2_MATCHER_DEFAULT, //the default matcher compare all the streams based on closest timestamp
243 
245 }rs2_matchers;
246 
248 typedef struct rs2_device rs2_device;
249 typedef struct rs2_error rs2_error;
252 typedef struct rs2_frame rs2_frame;
254 typedef struct rs2_pipeline rs2_pipeline;
256 typedef struct rs2_config rs2_config;
263 typedef struct rs2_syncer rs2_syncer;
265 typedef struct rs2_source rs2_source;
270 typedef struct rs2_context rs2_context;
273 typedef struct rs2_sensor rs2_sensor;
274 typedef struct rs2_options rs2_options;
283 typedef void (*rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void * arg);
287 typedef void (*rs2_frame_callback_ptr)(rs2_frame*, void*);
289 typedef void(*rs2_update_progress_callback_ptr)(const float, void*);
290 
291 typedef double rs2_time_t;
292 typedef long long rs2_metadata_type;
294 rs2_error * rs2_create_error(const char* what, const char* name, const char* args, rs2_exception_type type);
296 const char* rs2_get_failed_function (const rs2_error* error);
297 const char* rs2_get_failed_args (const rs2_error* error);
298 const char* rs2_get_error_message (const rs2_error* error);
299 void rs2_free_error (rs2_error* error);
300 
301 #ifdef __cplusplus
302 }
303 #endif
304 #endif
struct rs2_processing_block_list rs2_processing_block_list
Definition: rs_types.h:259
Definition: rs_types.h:151
struct rs2_device_serializer rs2_device_serializer
Definition: rs_types.h:264
Definition: rs_types.hpp:25
struct rs2_vertex rs2_vertex
3D coordinates with origin at topmost left corner of the lense, with positive Z pointing away from th...
Definition: rs_types.h:242
float rtd_offset
Definition: rs_types.h:83
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:251
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.
rs2_exception_type
Exception types are the different categories of errors that RealSense API might return.
Definition: rs_types.h:30
float y
Definition: rs_types.h:131
float v_offset
Definition: rs_types.h:82
void rs2_free_error(rs2_error *error)
rs2_vector angular_acceleration
Definition: rs_types.h:141
Definition: rs_types.h:191
Definition: rs_types.h:165
Definition: rs_types.h:198
Definition: rs_types.h:189
float z
Definition: rs_types.h:125
unsigned int tracker_confidence
Definition: rs_types.h:142
Definition: rs_types.h:190
Definition: rs_types.h:204
Definition: rs_types.hpp:39
Definition: rs_types.h:48
void(* rs2_frame_processor_callback_ptr)(rs2_frame *, rs2_source *, void *)
Definition: rs_types.h:288
Definition: rs_types.h:192
Definition: rs_types.h:171
struct rs2_frame_queue rs2_frame_queue
Definition: rs_types.h:253
rs2_distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition: rs_types.h:45
Definition: rs_types.h:37
Definition: rs_types.h:93
Video DSM (Digital Sync Module) parameters for calibration (same layout as in FW ac_depth_params) Thi...
Definition: rs_types.h:73
Definition: rs_types.h:201
float v_scale
Definition: rs_types.h:80
Definition: rs_types.h:92
const char * rs2_distortion_to_string(rs2_distortion distortion)
struct rs2_pipeline rs2_pipeline
Definition: rs_types.h:254
struct rs2_dsm_params rs2_dsm_params
Video DSM (Digital Sync Module) parameters for calibration (same layout as in FW ac_depth_params) Thi...
Definition: rs_types.h:155
float h_scale
Definition: rs_types.h:79
struct rs2_context rs2_context
Definition: rs_types.h:270
struct rs2_device_info rs2_device_info
Definition: rs_types.h:247
rs2_vector translation
Definition: rs_types.h:136
Definition: rs_types.h:150
struct rs2_sensor_list rs2_sensor_list
Definition: rs_types.h:272
Definition: rs_types.h:173
Definition: rs_types.h:238
Definition: rs_types.h:236
Definition: rs_types.h:53
float data[3][4]
Definition: rs_types.h:103
Definition: rs_types.h:52
Definition: rs_types.hpp:76
Definition: rs_types.h:51
float coeffs[5]
Definition: rs_types.h:67
3D coordinates with origin at topmost left corner of the lense, with positive Z pointing away from th...
Definition: rs_types.h:111
Definition: rs_types.h:32
unsigned long long timestamp
Definition: rs_types.h:75
Definition: rs_types.h:185
const char * rs2_extension_to_string(rs2_extension type)
unsigned char model
Definition: rs_types.h:77
Definition: rs_types.h:169
Definition: rs_types.h:175
float x
Definition: rs_types.h:131
struct rs2_firmware_log_parser rs2_firmware_log_parser
Definition: rs_types.h:281
rs2_vector angular_velocity
Definition: rs_types.h:140
Definition: rs_types.h:91
unsigned char temp_x2
Definition: rs_types.h:84
void(* rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void *arg)
Definition: rs_types.h:283
struct rs2_sensor rs2_sensor
Definition: rs_types.h:273
Definition: rs_types.hpp:55
Definition: rs_types.h:148
void(* rs2_update_progress_callback_ptr)(const float, void *)
Definition: rs_types.h:289
Definition: rs_types.h:181
float ppx
Definition: rs_types.h:62
const char * rs2_exception_type_to_string(rs2_exception_type type)
unsigned int mapper_confidence
Definition: rs_types.h:143
Quaternion used to represent rotation.
Definition: rs_types.h:129
Definition: rs_types.h:162
float y
Definition: rs_types.h:125
Definition: rs_types.h:186
struct rs2_pipeline_profile rs2_pipeline_profile
Definition: rs_types.h:255
unsigned short version
Definition: rs_types.h:76
float noise_variances[3]
Definition: rs_types.h:105
struct rs2_config rs2_config
Definition: rs_types.h:256
struct rs2_notification rs2_notification
Definition: rs_types.h:277
Definition: rs_types.h:210
rs2_vector velocity
Definition: rs_types.h:137
Definition: rs_types.h:47
Definition: rs_types.h:40
Definition: rs_types.h:39
struct rs2_device_hub rs2_device_hub
Definition: rs_types.h:271
Definition: rs_types.h:223
Definition: rs_types.h:174
unsigned char flags[5]
Definition: rs_types.h:78
Definition: rs_types.h:168
Definition: rs_types.h:34
Definition: rs_types.hpp:32
Definition: rs_types.h:179
Definition: rs_types.h:205
const char * rs2_get_error_message(const rs2_error *error)
rs2_matchers
Specifies types of different matchers.
Definition: rs_types.h:221
const char * rs2_extension_type_to_string(rs2_extension type)
Definition: rs_types.h:166
Definition: rs_types.h:50
Definition: rs_types.h:172
Definition: rs_types.h:134
Definition: rs_types.h:206
struct rs2_motion_device_intrinsic rs2_motion_device_intrinsic
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:214
int ij[2]
Definition: rs_types.h:119
struct rs2_stream_profile_list rs2_stream_profile_list
Definition: rs_types.h:258
Definition: rs_types.h:180
void(* rs2_devices_changed_callback_ptr)(rs2_device_list *, rs2_device_list *, void *)
Definition: rs_types.h:286
rs2_quaternion rotation
Definition: rs_types.h:139
struct rs2_log_message rs2_log_message
Definition: rs_types.h:250
Definition: rs_types.h:202
int width
Definition: rs_types.h:60
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:260
Definition: rs_types.h:153
Definition: rs_types.h:199
Definition: rs_types.h:207
Definition: rs_types.h:176
rs2_exception_type rs2_get_librealsense_exception_type(const rs2_error *error)
struct rs2_options rs2_options
Definition: rs_types.h:274
struct rs2_syncer rs2_syncer
Definition: rs_types.h:263
struct rs2_vector rs2_vector
3D vector in Euclidean coordinate space
Definition: rs_types.h:49
float x
Definition: rs_types.h:125
Definition: rs_types.h:167
struct rs2_source rs2_source
Definition: rs_types.h:265
Definition: rs_types.h:244
struct rs2_terminal_parser rs2_terminal_parser
Definition: rs_types.h:282
Definition: rs_types.h:152
Definition: rs_types.h:187
Definition: rs_types.h:195
float h_offset
Definition: rs_types.h:81
Definition: rs_types.h:154
Definition: rs_types.h:215
Definition: rs_types.h:184
Definition: rs_types.h:170
Definition: rs_types.h:149
Definition: rs_types.h:25
struct rs2_intrinsics rs2_intrinsics
Video stream intrinsics.
unsigned char reserved[11]
Definition: rs_types.h:85
void(* rs2_software_device_destruction_callback_ptr)(void *)
Definition: rs_types.h:285
Definition: rs_types.h:203
3D vector in Euclidean coordinate space
Definition: rs_types.h:123
Definition: rs_types.h:197
Definition: rs_types.h:90
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:66
float w
Definition: rs_types.h:131
Definition: rs_types.hpp:83
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:266
Definition: rs_types.h:163
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:160
rs2_notification_category
Category of the librealsense notification.
Definition: rs_types.h:17
void(* rs2_notification_callback_ptr)(rs2_notification *, void *)
Definition: rs_types.h:284
long long rs2_metadata_type
Definition: rs_types.h:292
Definition: rs_types.h:208
Definition: rs_types.h:177
float fy
Definition: rs_types.h:65
float fx
Definition: rs_types.h:64
Definition: rs_types.h:164
Definition: rs_types.h:211
struct rs2_device rs2_device
Definition: rs_types.h:248
struct rs2_firmware_log_parsed_message rs2_firmware_log_parsed_message
Definition: rs_types.h:280
Definition: rs_types.h:194
Video stream intrinsics.
Definition: rs_types.h:58
Definition: rs_types.h:200
Definition: rs_types.h:212
Definition: rs_types.h:209
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:97
rs2_vector acceleration
Definition: rs_types.h:138
void(* rs2_frame_callback_ptr)(rs2_frame *, void *)
Definition: rs_types.h:287
Definition: rs_types.h:196
int height
Definition: rs_types.h:61
Definition: rs_types.h:225
struct rs2_device_list rs2_device_list
Definition: rs_types.h:257
struct rs2_pose rs2_pose
const char * rs2_notification_category_to_string(rs2_notification_category category)
Definition: rs_types.h:188
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:279
Definition: rs_types.hpp:69
Definition: rs_types.h:182
Definition: rs_types.h:183
struct rs2_error rs2_error
Definition: rs_types.h:249
double rs2_time_t
Definition: rs_types.h:291
rs2_dsm_correction_model
Definition: rs_types.h:88
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:147
Definition: rs_types.h:233
Definition: rs_types.h:178
struct rs2_options_list rs2_options_list
Definition: rs_types.h:275
const char * rs2_get_failed_function(const rs2_error *error)
const char * rs2_get_failed_args(const rs2_error *error)
Definition: rs_types.h:229
float bias_variances[3]
Definition: rs_types.h:106
float xyz[3]
Definition: rs_types.h:113
Definition: rs_types.h:35
float z
Definition: rs_types.h:131
struct rs2_frame rs2_frame
Definition: rs_types.h:252
float ppy
Definition: rs_types.h:63
Pixel location within 2D image. (0,0) is the topmost, left corner. Positive X is right, positive Y is down.
Definition: rs_types.h:117
Definition: rs_types.h:213
Definition: rs_types.h:193