Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rs.hpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2015 Intel Corporation. All Rights Reserved.
3 
7 
8 #ifndef LIBREALSENSE_RS_HPP
9 #define LIBREALSENSE_RS_HPP
10 
11 #include "rsutil.h"
12 #include "rscore.hpp"
13 #include <cmath>
14 #include <cstdint>
15 #include <cstring>
16 #include <sstream>
17 #include <stdexcept>
18 #include <functional>
19 #include <vector>
20 
21 namespace rs
22 {
24  enum class stream : int32_t
25  {
26  depth ,
27  color ,
28  infrared ,
29  infrared2 ,
30  fisheye ,
31  points ,
38  };
39 
42  enum class format : int32_t
43  {
44  any ,
45  z16 ,
46  disparity16 ,
47  xyz32f ,
48  yuyv ,
49  rgb8 ,
50  bgr8 ,
51  rgba8 ,
52  bgra8 ,
53  y8 ,
54  y16 ,
55  raw10 ,
56  raw16 ,
57  raw8
58  };
59 
61  enum class output_buffer_format : int32_t
62  {
63  continous ,
64  native
65  };
66 
68  enum class preset : int32_t
69  {
70  best_quality ,
73  };
74 
76  enum class distortion : int32_t
77  {
78  none ,
82  };
83 
87  enum class option : int32_t
88  {
93  color_gain ,
94  color_gamma ,
95  color_hue ,
102  f200_accuracy ,
118  r200_lr_gain ,
146  fisheye_gain ,
147  fisheye_strobe ,
157  };
158 
160  enum class frame_metadata
161  {
163  actual_fps
164  };
165 
169  enum class capabilities : int32_t
170  {
171  depth,
172  color,
173  infrared,
174  infrared2,
175  fish_eye,
176  motion_events,
178  adapter_board,
179  enumeration,
180  };
181 
183  enum class blob_type
184  {
186  };
187 
192  enum class camera_info {
193  device_name ,
194  serial_number ,
198  camera_type ,
199  oem_id ,
200  isp_fw_version ,
201  content_version ,
202  module_version ,
204  build_date ,
206  program_date ,
208  emitter_type ,
209  focus_value ,
210  lens_type ,
211  third_lens_type ,
216  };
217 
219  enum class source : uint8_t
220  {
221  video ,
222  motion_data,
223  all_sources,
224  };
225 
227  enum class event : uint8_t
228  {
229  event_imu_accel ,
230  event_imu_gyro ,
236  };
237 
239 
242  enum class timestamp_domain
243  {
244  camera,
246  };
247 
248  struct float2 { float x,y; };
249  struct float3 { float x,y,z; };
250 
253  {
254  float hfov() const { return (atan2f(ppx + 0.5f, fx) + atan2f(width - (ppx + 0.5f), fx)) * 57.2957795f; }
255  float vfov() const { return (atan2f(ppy + 0.5f, fy) + atan2f(height - (ppy + 0.5f), fy)) * 57.2957795f; }
257 
258  // Helpers for mapping between pixel coordinates and texture coordinates
259  float2 pixel_to_texcoord(const float2 & pixel) const { return {(pixel.x+0.5f)/width, (pixel.y+0.5f)/height}; }
260  float2 texcoord_to_pixel(const float2 & coord) const { return {coord.x*width - 0.5f, coord.y*height - 0.5f}; }
261 
262  // Helpers for mapping from image coordinates into 3D space
263  float3 deproject(const float2 & pixel, float depth) const { float3 point = {}; rs_deproject_pixel_to_point(&point.x, this, &pixel.x, depth); return point; }
264  float3 deproject_from_texcoord(const float2 & coord, float depth) const { return deproject(texcoord_to_pixel(coord), depth); }
265 
266  // Helpers for mapping from 3D space into image coordinates
267  float2 project(const float3 & point) const { float2 pixel = {}; rs_project_point_to_pixel(&pixel.x, this, &point.x); return pixel; }
268  float2 project_to_texcoord(const float3 & point) const { return pixel_to_texcoord(project(point)); }
269 
270  bool operator == (const intrinsics & r) const { return memcmp(this, &r, sizeof(r)) == 0; }
271 
272  };
273 
276  {
278  };
279 
282  {
283  bool is_identity() const { return (rotation[0] == 1) && (rotation[4] == 1) && (translation[0] == 0) && (translation[1] == 0) && (translation[2] == 0); }
284  float3 transform(const float3 & point) const { float3 p = {}; rs_transform_point_to_point(&p.x, this, &point.x); return p; }
285  };
286 
289  {
292  };
293 
296  {
299  };
300 
301  class context;
302  class device;
303 
304  class error : public std::runtime_error
305  {
306  std::string function, args;
307  public:
308  error(rs_error * err) : std::runtime_error(rs_get_error_message(err))
309  {
310  function = (nullptr != rs_get_failed_function(err)) ? rs_get_failed_function(err) : std::string();
311  args = (nullptr != rs_get_failed_args(err)) ? rs_get_failed_args(err) : std::string();
312  rs_free_error(err);
313  }
314  const std::string & get_failed_function() const { return function; }
315  const std::string & get_failed_args() const { return args; }
316  static void handle(rs_error * e) { if(e) throw error(e); }
317  };
319  class context
320  {
321  rs_context * handle;
322  context(const context &) = delete;
323  context & operator = (const context &) = delete;
324  public:
325 
328  {
329  rs_error * e = nullptr;
330  handle = rs_create_context(RS_API_VERSION, &e);
331  error::handle(e);
332  }
333 
334  explicit context(rs_context * handle) : handle(handle) {}
335 
337  {
338  rs_delete_context(handle, nullptr);
339  }
340 
343  int get_device_count() const
344  {
345  rs_error * e = nullptr;
346  auto r = rs_get_device_count(handle, &e);
347  error::handle(e);
348  return r;
349  }
350 
354  device * get_device(int index)
355  {
356  rs_error * e = nullptr;
357  auto r = rs_get_device(handle, index, &e);
358  error::handle(e);
359  return (device *)r;
360  }
361  };
362 
364  {
365  std::function<void(motion_data)> on_event_function;
366  public:
367  explicit motion_callback(std::function<void(motion_data)> on_event) : on_event_function(on_event) {}
368 
369  void on_event(rs_motion_data e) override
370  {
371  on_event_function(motion_data(e));
372  }
373 
374  void release() override { delete this; }
375  };
376 
378  {
379  std::function<void(timestamp_data)> on_event_function;
380  public:
381  explicit timestamp_callback(std::function<void(timestamp_data)> on_event) : on_event_function(on_event) {}
382 
383  void on_event(rs_timestamp_data data) override
384  {
385  on_event_function(std::move(data));
386  }
387 
388  void release() override { delete this; }
389  };
390 
392  class frame
393  {
394  rs_device * device;
395  rs_frame_ref * frame_ref;
396 
397  frame(const frame &) = delete;
398 
399  public:
400  frame() : device(nullptr), frame_ref(nullptr) {}
401  frame(rs_device * device, rs_frame_ref * frame_ref) : device(device), frame_ref(frame_ref) {}
402  frame(frame&& other) : device(other.device), frame_ref(other.frame_ref) { other.frame_ref = nullptr; }
404  {
405  swap(other);
406  return *this;
407  }
408  void swap(frame& other)
409  {
410  std::swap(device, other.device);
411  std::swap(frame_ref, other.frame_ref);
412  }
413 
415  {
416  if (device && frame_ref)
417  {
418  rs_error * e = nullptr;
419  rs_release_frame(device, frame_ref, &e);
420  error::handle(e);
421  }
422  }
423 
426  double get_timestamp() const
427  {
428  rs_error * e = nullptr;
429  auto r = rs_get_detached_frame_timestamp(frame_ref, &e);
430  error::handle(e);
431  return r;
432  }
433 
437  {
438  rs_error * e = nullptr;
439  auto r = rs_get_detached_frame_timestamp_domain(frame_ref, &e);
440  error::handle(e);
441  return static_cast<timestamp_domain>(r);
442  }
443 
448  {
449  rs_error * e = nullptr;
451  error::handle(e);
452  return r;
453  }
454 
459  {
460  rs_error * e = nullptr;
461  auto r = rs_supports_frame_metadata(frame_ref, frame_metadata, &e);
462  error::handle(e);
463  return r != 0;
464  }
465 
468  unsigned long long get_frame_number() const
469  {
470  rs_error * e = nullptr;
471  auto r = rs_get_detached_frame_number(frame_ref, &e);
472  error::handle(e);
473  return r;
474  }
475 
478  const void * get_data() const
479  {
480  rs_error * e = nullptr;
481  auto r = rs_get_detached_frame_data(frame_ref, &e);
482  error::handle(e);
483  return r;
484  }
485 
487  int get_width() const
488  {
489  rs_error * e = nullptr;
490  auto r = rs_get_detached_frame_width(frame_ref, &e);
491  error::handle(e);
492  return r;
493  }
494 
496  int get_height() const
497  {
498  rs_error * e = nullptr;
499  auto r = rs_get_detached_frame_height(frame_ref, &e);
500  error::handle(e);
501  return r;
502  }
503 
505  int get_framerate() const
506  {
507  rs_error * e = nullptr;
508  auto r = rs_get_detached_framerate(frame_ref, &e);
509  error::handle(e);
510  return r;
511  }
512 
514  int get_stride() const
515  {
516  rs_error * e = nullptr;
517  auto r = rs_get_detached_frame_stride(frame_ref, &e);
518  error::handle(e);
519  return r;
520  }
521 
524  int get_bpp() const
525  {
526  rs_error * e = nullptr;
527  auto r = rs_get_detached_frame_bpp(frame_ref, &e);
528  error::handle(e);
529  return r;
530  }
531 
535  {
536  rs_error * e = nullptr;
537  auto r = rs_get_detached_frame_format(frame_ref, &e);
538  error::handle(e);
539  return static_cast<format>(r);
540  }
541 
545  {
546  rs_error * e = nullptr;
547  auto s = rs_get_detached_frame_stream_type(frame_ref, &e);
548  error::handle(e);
549  return static_cast<stream>(s);
550  }
551  };
552 
554  {
555  std::function<void(frame)> on_frame_function;
556  public:
557  explicit frame_callback(std::function<void(frame)> on_frame) : on_frame_function(on_frame) {}
558 
559  void on_frame(rs_device * device, rs_frame_ref * fref) override
560  {
561  on_frame_function(std::move(frame(device, fref)));
562  }
563 
564  void release() override { delete this; }
565  };
567  class device
568  {
569  device() = delete;
570  device(const device &) = delete;
571  device & operator = (const device &) = delete;
572  ~device() = delete;
573 
574 
575  public:
578  const char * get_name() const
579  {
580  rs_error * e = nullptr;
581  auto r = rs_get_device_name((const rs_device *)this, &e);
582  error::handle(e);
583  return r;
584  }
585 
588  const char * get_serial() const
589  {
590  rs_error * e = nullptr;
591  auto r = rs_get_device_serial((const rs_device *)this, &e);
592  error::handle(e);
593  return r;
594  }
595 
598  const char * get_usb_port_id() const
599  {
600  rs_error * e = nullptr;
601  auto r = rs_get_device_usb_port_id((const rs_device *)this, &e);
602  error::handle(e);
603  return r;
604  }
605 
608  const char * get_firmware_version() const
609  {
610  rs_error * e = nullptr;
611  auto r = rs_get_device_firmware_version((const rs_device *)this, &e);
612  error::handle(e);
613  return r;
614  }
615 
618  const char * get_info(camera_info info) const
619  {
620  rs_error * e = nullptr;
621  auto r = rs_get_device_info((const rs_device *)this, (rs_camera_info)info, &e);
622  error::handle(e);
623  return r;
624  }
625 
630  extrinsics get_extrinsics(stream from_stream, stream to_stream) const
631  {
632  rs_error * e = nullptr;
633  extrinsics extrin;
634  rs_get_device_extrinsics((const rs_device *)this, (rs_stream)from_stream, (rs_stream)to_stream, &extrin, &e);
635  error::handle(e);
636  return extrin;
637  }
638 
643  {
644  rs_error * e = nullptr;
645  extrinsics extrin;
646  rs_get_motion_extrinsics_from((const rs_device *)this, (rs_stream)from_stream, &extrin, &e);
647  error::handle(e);
648  return extrin;
649  }
650 
653  float get_depth_scale() const
654  {
655  rs_error * e = nullptr;
656  auto r = rs_get_device_depth_scale((const rs_device *)this, &e);
657  error::handle(e);
658  return r;
659  }
660 
665  {
666  rs_error * e = nullptr;
667  auto r = rs_device_supports_option((const rs_device *)this, (rs_option)option, &e);
668  error::handle(e);
669  return r != 0;
670  }
671 
676  {
677  rs_error * e = nullptr;
678  auto r = rs_get_stream_mode_count((const rs_device *)this, (rs_stream)stream, &e);
679  error::handle(e);
680  return r;
681  }
682 
690  void get_stream_mode(stream stream, int index, int & width, int & height, format & format, int & framerate) const
691  {
692  rs_error * e = nullptr;
693  rs_get_stream_mode((const rs_device *)this, (rs_stream)stream, index, &width, &height, (rs_format *)&format, &framerate, &e);
694  error::handle(e);
695  }
696 
704  void enable_stream(stream stream, int width, int height, format format, int framerate, output_buffer_format output_buffer_type = output_buffer_format::continous)
705  {
706  rs_error * e = nullptr;
707  rs_enable_stream_ex((rs_device *)this, (rs_stream)stream, width, height, (rs_format)format, framerate, (rs_output_buffer_format)output_buffer_type, &e);
708  error::handle(e);
709  }
710 
715  {
716  rs_error * e = nullptr;
718  error::handle(e);
719  }
720 
724  {
725  rs_error * e = nullptr;
727  error::handle(e);
728  }
729 
734  {
735  rs_error * e = nullptr;
736  auto r = rs_is_stream_enabled((const rs_device *)this, (rs_stream)stream, &e);
737  error::handle(e);
738  return r != 0;
739  }
740 
745  {
746  rs_error * e = nullptr;
747  auto r = rs_get_stream_width((const rs_device *)this, (rs_stream)stream, &e);
748  error::handle(e);
749  return r;
750  }
751 
756  {
757  rs_error * e = nullptr;
758  auto r = rs_get_stream_height((const rs_device *)this, (rs_stream)stream, &e);
759  error::handle(e);
760  return r;
761  }
762 
767  {
768  rs_error * e = nullptr;
769  auto r = rs_get_stream_format((const rs_device *)this, (rs_stream)stream, &e);
770  error::handle(e);
771  return (format)r;
772  }
773 
778  {
779  rs_error * e = nullptr;
780  auto r = rs_get_stream_framerate((const rs_device *)this, (rs_stream)stream, &e);
781  error::handle(e);
782  return r;
783  }
784 
789  {
790  rs_error * e = nullptr;
791  intrinsics intrin;
792  rs_get_stream_intrinsics((const rs_device *)this, (rs_stream)stream, &intrin, &e);
793  error::handle(e);
794  return intrin;
795  }
796 
800  {
801  rs_error * e = nullptr;
803  rs_get_motion_intrinsics((const rs_device *)this, &intrinsics, &e);
804  error::handle(e);
805  return intrinsics;
806  }
807 
817  void set_frame_callback(rs::stream stream, std::function<void(frame)> frame_handler)
818  {
819  rs_error * e = nullptr;
820  rs_set_frame_callback_cpp((rs_device *)this, (rs_stream)stream, new frame_callback(frame_handler), &e);
821  error::handle(e);
822  }
823 
837 
841  void enable_motion_tracking(std::function<void(motion_data)> motion_handler, std::function<void(timestamp_data)> timestamp_handler)
842  {
843  rs_error * e = nullptr;
844  rs_enable_motion_tracking_cpp((rs_device *)this, new motion_callback(motion_handler), new timestamp_callback(timestamp_handler), &e);
845  error::handle(e);
846  }
847 
853  void enable_motion_tracking(std::function<void(motion_data)> motion_handler)
854  {
855  rs_error * e = nullptr;
856  rs_enable_motion_tracking_cpp((rs_device *)this, new motion_callback(motion_handler), new timestamp_callback([](rs::timestamp_data data) {}), &e);
857  error::handle(e);
858  }
859 
862  {
863  rs_error * e = nullptr;
865  error::handle(e);
866  }
867 
870  {
871  rs_error * e = nullptr;
872  auto result = rs_is_motion_tracking_active((rs_device *)this,&e);
873  error::handle(e);
874  return result;
875  }
876 
877 
880  {
881  rs_error * e = nullptr;
882  rs_start_source((rs_device *)this, (rs_source)source, &e);
883  error::handle(e);
884  }
885 
888  {
889  rs_error * e = nullptr;
890  rs_stop_source((rs_device *)this, (rs_source)source, &e);
891  error::handle(e);
892  }
893 
896  bool is_streaming() const
897  {
898  rs_error * e = nullptr;
899  auto r = rs_is_device_streaming((const rs_device *)this, &e);
900  error::handle(e);
901  return r != 0;
902  }
903 
909  void get_option_range(option option, double & min, double & max, double & step)
910  {
911  rs_error * e = nullptr;
912  rs_get_device_option_range((rs_device *)this, (rs_option)option, &min, &max, &step, &e);
913  error::handle(e);
914  }
915 
922  void get_option_range(option option, double & min, double & max, double & step, double & def)
923  {
924  rs_error * e = nullptr;
925  rs_get_device_option_range_ex((rs_device *)this, (rs_option)option, &min, &max, &step, &def, &e);
926  error::handle(e);
927  }
928 
933  void get_options(const option * options, size_t count, double * values)
934  {
935  rs_error * e = nullptr;
936  rs_get_device_options((rs_device *)this, (const rs_option *)options, (unsigned int)count, values, &e);
937  error::handle(e);
938  }
939 
944  void set_options(const option * options, size_t count, const double * values)
945  {
946  rs_error * e = nullptr;
947  rs_set_device_options((rs_device *)this, (const rs_option *)options, (unsigned int)count, values, &e);
948  error::handle(e);
949  }
950 
955  {
956  rs_error * e = nullptr;
957  auto r = rs_get_device_option((rs_device *)this, (rs_option)option, &e);
958  error::handle(e);
959  return r;
960  }
961 
966  {
967  rs_error * e = nullptr;
969  error::handle(e);
970  return r;
971  }
972 
976  void set_option(option option, double value)
977  {
978  rs_error * e = nullptr;
979  rs_set_device_option((rs_device *)this, (rs_option)option, value, &e);
980  error::handle(e);
981  }
982 
986  {
987  rs_error * e = nullptr;
988  rs_wait_for_frames((rs_device *)this, &e);
989  error::handle(e);
990  }
991 
995  {
996  rs_error * e = nullptr;
997  auto r = rs_poll_for_frames((rs_device *)this, &e);
998  error::handle(e);
999  return r != 0;
1000  }
1001 
1005  bool supports(capabilities capability) const
1006  {
1007  rs_error * e = nullptr;
1008  auto r = rs_supports((rs_device *)this, (rs_capabilities)capability, &e);
1009  error::handle(e);
1010  return r? true: false;
1011  }
1012 
1013 
1017  bool supports(camera_info info_param) const
1018  {
1019  rs_error * e = nullptr;
1020  auto r = rs_supports_camera_info((rs_device *)this, (rs_camera_info)info_param, &e);
1021  error::handle(e);
1022  return r ? true : false;
1023  }
1024 
1029  {
1030  rs_error * e = nullptr;
1031  auto r = rs_get_frame_timestamp((const rs_device *)this, (rs_stream)stream, &e);
1032  error::handle(e);
1033  return r;
1034  }
1035 
1039  unsigned long long get_frame_number(stream stream) const
1040  {
1041  rs_error * e = nullptr;
1042  auto r = rs_get_frame_number((const rs_device *)this, (rs_stream)stream, &e);
1043  error::handle(e);
1044  return r;
1045  }
1046 
1050  const void * get_frame_data(stream stream) const
1051  {
1052  rs_error * e = nullptr;
1053  auto r = rs_get_frame_data((const rs_device *)this, (rs_stream)stream, &e);
1054  error::handle(e);
1055  return r;
1056  }
1057 
1062  void send_blob_to_device(rs::blob_type type, void * data, int size)
1063  {
1064  rs_error * e = nullptr;
1065  rs_send_blob_to_device((rs_device *)this, (rs_blob_type)type, data, size, &e);
1066  error::handle(e);
1067  }
1068  };
1069 
1070  inline std::ostream & operator << (std::ostream & o, stream stream) { return o << rs_stream_to_string((rs_stream)stream); }
1071  inline std::ostream & operator << (std::ostream & o, format format) { return o << rs_format_to_string((rs_format)format); }
1072  inline std::ostream & operator << (std::ostream & o, preset preset) { return o << rs_preset_to_string((rs_preset)preset); }
1073  inline std::ostream & operator << (std::ostream & o, distortion distortion) { return o << rs_distortion_to_string((rs_distortion)distortion); }
1074  inline std::ostream & operator << (std::ostream & o, option option) { return o << rs_option_to_string((rs_option)option); }
1075  inline std::ostream & operator << (std::ostream & o, capabilities capability) { return o << rs_capabilities_to_string((rs_capabilities)capability); }
1076  inline std::ostream & operator << (std::ostream & o, source src) { return o << rs_source_to_string((rs_source)src); }
1077  inline std::ostream & operator << (std::ostream & o, event evt) { return o << rs_event_to_string((rs_event_source)evt); }
1078 
1080  enum class log_severity : int32_t
1081  {
1082  debug = 0,
1083  info = 1,
1084  warn = 2,
1085  error = 3,
1086  fatal = 4,
1087  none = 5,
1088  };
1089 
1091  {
1092  std::function<void(log_severity, const char *)> on_event_function;
1093  public:
1094  explicit log_callback(std::function<void(log_severity, const char *)> on_event) : on_event_function(on_event) {}
1095 
1096  void on_event(rs_log_severity severity, const char * message) override
1097  {
1098  on_event_function((log_severity)severity, message);
1099  }
1100 
1101  void release() override { delete this; }
1102  };
1103 
1104  inline void log_to_console(log_severity min_severity)
1105  {
1106  rs_error * e = nullptr;
1107  rs_log_to_console((rs_log_severity)min_severity, &e);
1108  error::handle(e);
1109  }
1110 
1111  inline void log_to_file(log_severity min_severity, const char * file_path)
1112  {
1113  rs_error * e = nullptr;
1114  rs_log_to_file((rs_log_severity)min_severity, file_path, &e);
1115  error::handle(e);
1116  }
1117 
1118  inline void log_to_callback(log_severity min_severity, std::function<void(log_severity, const char *)> callback)
1119  {
1120  rs_error * e = nullptr;
1121  rs_log_to_callback_cpp((rs_log_severity)min_severity, new log_callback(callback), &e);
1122  error::handle(e);
1123  }
1124 
1125  // Additional utilities
1126  inline void apply_depth_control_preset(device * device, int preset) { rs_apply_depth_control_preset((rs_device *)device, preset); }
1127  inline void apply_ivcam_preset(device * device, rs_ivcam_preset preset) { rs_apply_ivcam_preset((rs_device *)device, preset); }
1128  inline void apply_ivcam_preset(device * device, int preset) { rs_apply_ivcam_preset((rs_device *)device, (rs_ivcam_preset)preset); } // duplicate for better backward compatibility with existing applications
1129 }
1130 #endif
rs::option::fisheye_color_auto_exposure
@ fisheye_color_auto_exposure
rs::device::get_option
double get_option(option option)
Retrieves current value of single option.
Definition: rs.hpp:954
rs_context
Definition: rscore.hpp:118
rs::log_callback::on_event
void on_event(rs_log_severity severity, const char *message) override
Definition: rs.hpp:1096
rs::option::r200_auto_exposure_bottom_edge
@ r200_auto_exposure_bottom_edge
rs::device::get_frame_number
unsigned long long get_frame_number(stream stream) const
Retrieves frame number.
Definition: rs.hpp:1039
rs_option_to_string
const char * rs_option_to_string(rs_option option)
rs::camera_info::focus_alignment_date
@ focus_alignment_date
rs::device::start
void start(rs::source source=rs::source::video)
Begins streaming on all enabled streams for this device.
Definition: rs.hpp:879
rs::device::get_info
const char * get_info(camera_info info) const
Retrieves camera-specific information such as versions of various components.
Definition: rs.hpp:618
rs::frame::get_frame_timestamp_domain
timestamp_domain get_frame_timestamp_domain() const
Definition: rs.hpp:436
rs::option::f200_dynamic_fps
@ f200_dynamic_fps
rs_get_frame_timestamp
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.
rs::source::video
@ video
rs::option::sr300_auto_range_max_laser
@ sr300_auto_range_max_laser
rs::log_callback::log_callback
log_callback(std::function< void(log_severity, const char *)> on_event)
Definition: rs.hpp:1094
rs::event::event_imu_g0_sync
@ event_imu_g0_sync
rs::option::r200_depth_control_texture_difference_threshold
@ r200_depth_control_texture_difference_threshold
rs::output_buffer_format::continous
@ continous
rs::timestamp_data
Timestamp data from the motion microcontroller.
Definition: rs.hpp:288
rs_camera_info
rs_camera_info
Read-only strings that can be queried from the device.
Definition: rs.h:237
rs_supports_frame_metadata
int rs_supports_frame_metadata(const rs_frame_ref *frame, rs_frame_metadata frame_metadata, rs_error **error)
Determines device metadata.
rs_get_device_option_description
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.
rs::option::f200_accuracy
@ f200_accuracy
rs_get_device_name
const char * rs_get_device_name(const rs_device *device, rs_error **error)
Retrieves human-readable device model string.
rs_stream
rs_stream
Streams are different types of data provided by RealSense devices.
Definition: rs.h:33
rs_frame_metadata
rs_frame_metadata
Types of value provided from the device with each frame.
Definition: rs.h:203
rs::option::r200_depth_units
@ r200_depth_units
rs::stream
stream
Streams are different types of data provided by RealSense devices.
Definition: rs.hpp:24
rs::event::event_imu_depth_cam
@ event_imu_depth_cam
rs::preset
preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS.
Definition: rs.hpp:68
rs_get_detached_frame_stride
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...
rs::timestamp_callback::release
void release() override
Definition: rs.hpp:388
rs::float2::y
float y
Definition: rs.hpp:248
rs::frame_callback
Definition: rs.hpp:553
rs::output_buffer_format
output_buffer_format
Output buffer format: sets how librealsense works with frame memory.
Definition: rs.hpp:61
rs::float3
Definition: rs.hpp:249
rs_get_device_firmware_version
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.
rs::device::wait_for_frames
void wait_for_frames()
Blocks until new frames are available.
Definition: rs.hpp:985
rs_get_motion_extrinsics_from
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.
rs::frame::get_bpp
int get_bpp() const
Retrieves bits per pixel.
Definition: rs.hpp:524
rs_free_error
void rs_free_error(rs_error *error)
Frees memory of an error object.
rs::capabilities::adapter_board
@ adapter_board
rsutil.h
rs::camera_info::serial_number
@ serial_number
rs::format::raw10
@ raw10
rs::frame::frame
frame(frame &&other)
Definition: rs.hpp:402
rs_log_to_console
void rs_log_to_console(rs_log_severity min_severity, rs_error **error)
Starts logging to console.
rs_log_severity
rs_log_severity
Severity of the librealsense logger.
Definition: rs.h:265
rs::device::is_motion_tracking_active
int is_motion_tracking_active()
Checks if data acquisition is active
Definition: rs.hpp:869
rs_log_to_file
void rs_log_to_file(rs_log_severity min_severity, const char *file_path, rs_error **error)
Starts logging to file.
rs::option::r200_auto_exposure_right_edge
@ r200_auto_exposure_right_edge
rs_get_stream_width
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...
rs::stream::color
@ color
rs::device::get_option_range
void get_option_range(option option, double &min, double &max, double &step)
Retrieves available range of values of supported option.
Definition: rs.hpp:909
rs::format::raw16
@ raw16
rs::option::r200_depth_control_estimate_median_decrement
@ r200_depth_control_estimate_median_decrement
rs::option::r200_lr_gain
@ r200_lr_gain
rs::camera_info::third_lens_type
@ third_lens_type
rs_source_to_string
const char * rs_source_to_string(rs_source source)
rs::error::get_failed_args
const std::string & get_failed_args() const
Definition: rs.hpp:315
rs_get_stream_height
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::camera_info::lens_type
@ lens_type
rs::motion_data::motion_data
motion_data()
Definition: rs.hpp:298
rs::option::f200_laser_power
@ f200_laser_power
rs_extrinsics::rotation
float rotation[9]
Definition: rs.h:334
rs::device::get_serial
const char * get_serial() const
Retrieves unique serial number of device.
Definition: rs.hpp:588
rs_get_detached_frame_data
const void * rs_get_detached_frame_data(const rs_frame_ref *frame, rs_error **error)
Retrieves data from frame reference.
rs::camera_info::build_date
@ build_date
rs::camera_info::imager_model_number
@ imager_model_number
rs::device::get_extrinsics
extrinsics get_extrinsics(stream from_stream, stream to_stream) const
Retrieves extrinsic transformation between viewpoints of two different streams.
Definition: rs.hpp:630
rs::extrinsics
Cross-stream extrinsics: encode the topology describing how the different devices are connected.
Definition: rs.hpp:281
rs::stream::depth_aligned_to_color
@ depth_aligned_to_color
rs::device::supports
bool supports(capabilities capability) const
Determines device capabilities.
Definition: rs.hpp:1005
rs::distortion
distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition: rs.hpp:76
rs::option::color_exposure
@ color_exposure
rs::intrinsics::deproject
float3 deproject(const float2 &pixel, float depth) const
Definition: rs.hpp:263
rs_release_frame
void rs_release_frame(rs_device *device, rs_frame_ref *frame, rs_error **error)
Releases frame handle.
rs::capabilities::infrared2
@ infrared2
rs::intrinsics::deproject_from_texcoord
float3 deproject_from_texcoord(const float2 &coord, float depth) const
Definition: rs.hpp:264
rs::intrinsics::operator==
bool operator==(const intrinsics &r) const
Definition: rs.hpp:270
rs_intrinsics::model
rs_distortion model
Definition: rs.h:308
rs::error::get_failed_function
const std::string & get_failed_function() const
Definition: rs.hpp:314
rs_stream_to_string
const char * rs_stream_to_string(rs_stream stream)
rs::device::supports
bool supports(camera_info info_param) const
Determines device capabilities.
Definition: rs.hpp:1017
rs::option::r200_auto_exposure_kp_dark_threshold
@ r200_auto_exposure_kp_dark_threshold
rs::float3::y
float y
Definition: rs.hpp:249
rs::float2::x
float x
Definition: rs.hpp:248
rs::option::fisheye_external_trigger
@ fisheye_external_trigger
rs::intrinsics
Video stream intrinsics.
Definition: rs.hpp:252
rs::camera_info::lens_coating_type
@ lens_coating_type
rs::option::fisheye_exposure
@ fisheye_exposure
rs::option::color_hue
@ color_hue
rs_intrinsics::fy
float fy
Definition: rs.h:307
rs_get_detached_frame_width
int rs_get_detached_frame_width(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic width in pixels.
rs::frame::get_stride
int get_stride() const
Retrieves frame stride, meaning the actual line width in memory in bytes (not the logical image width...
Definition: rs.hpp:514
rs::option::r200_depth_control_median_threshold
@ r200_depth_control_median_threshold
rs::source::all_sources
@ all_sources
rs_get_device_usb_port_id
const char * rs_get_device_usb_port_id(const rs_device *device, rs_error **error)
Retrieves the USB port number of the device.
rs::frame::get_framerate
int get_framerate() const
Returns configured frame rate.
Definition: rs.hpp:505
rs_capabilities_to_string
const char * rs_capabilities_to_string(rs_capabilities capability)
rs::device::get_option_description
const char * get_option_description(option option)
Retrieves device-specific option description.
Definition: rs.hpp:965
rs::option::sr300_auto_range_start_motion_versus_range
@ sr300_auto_range_start_motion_versus_range
rscore.hpp
rs_get_detached_frame_bpp
int rs_get_detached_frame_bpp(const rs_frame_ref *frame, rs_error **error)
Retrieves frame bits per pixel.
rs_intrinsics::ppx
float ppx
Definition: rs.h:304
rs::option::f200_motion_range
@ f200_motion_range
rs::context::context
context(rs_context *handle)
Definition: rs.hpp:334
rs::intrinsics::texcoord_to_pixel
float2 texcoord_to_pixel(const float2 &coord) const
Definition: rs.hpp:260
rs::device::get_usb_port_id
const char * get_usb_port_id() const
Retrieves USB port number of device.
Definition: rs.hpp:598
rs::device::send_blob_to_device
void send_blob_to_device(rs::blob_type type, void *data, int size)
Sends device-specific data to device.
Definition: rs.hpp:1062
rs::preset::best_quality
@ best_quality
rs::intrinsics::hfov
float hfov() const
Definition: rs.hpp:254
rs_get_device_serial
const char * rs_get_device_serial(const rs_device *device, rs_error **error)
Retrieves unique serial number of the device.
rs_intrinsics::ppy
float ppy
Definition: rs.h:305
rs::format::rgba8
@ rgba8
rs::stream::rectified_color
@ rectified_color
rs::frame::get_data
const void * get_data() const
Definition: rs.hpp:478
rs::timestamp_data::timestamp_data
timestamp_data(rs_timestamp_data orig)
Definition: rs.hpp:290
rs_get_detached_framerate
int rs_get_detached_framerate(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic frame rate.
rs::capabilities::fish_eye
@ fish_eye
rs::option::sr300_auto_range_upper_threshold
@ sr300_auto_range_upper_threshold
rs::option::r200_depth_control_lr_threshold
@ r200_depth_control_lr_threshold
rs_get_stream_format
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_preset
rs_preset
Presets: general preferences that are translated by librealsense into concrete resolution and FPS.
Definition: rs.h:81
rs_distortion
rs_distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition: rs.h:99
rs::apply_depth_control_preset
void apply_depth_control_preset(device *device, int preset)
Definition: rs.hpp:1126
rs::motion_intrinsics
Motion device intrinsics: scale, bias, and variances.
Definition: rs.hpp:275
rs_enable_stream_ex
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.
rs::option::color_gamma
@ color_gamma
rs_motion_data
Motion data from gyroscope and accelerometer from the microcontroller.
Definition: rs.h:347
rs::option::fisheye_gain
@ fisheye_gain
rs::device::poll_for_frames
bool poll_for_frames()
Checks if new frames are available, without blocking.
Definition: rs.hpp:994
rs::distortion::distortion_ftheta
@ distortion_ftheta
rs::device::enable_motion_tracking
void enable_motion_tracking(std::function< void(motion_data)> motion_handler)
Sets the callback for motion module event.
Definition: rs.hpp:853
rs::option::color_contrast
@ color_contrast
rs_motion_intrinsics
Motion module intrinsics: includes accelerometer and gyroscope intrinsics structs of type rs_motion_d...
Definition: rs.h:325
rs::option::sr300_auto_range_min_laser
@ sr300_auto_range_min_laser
rs::option::fisheye_color_auto_exposure_rate
@ fisheye_color_auto_exposure_rate
rs::stream::fisheye
@ fisheye
rs_intrinsics::fx
float fx
Definition: rs.h:306
rs::camera_info::oem_id
@ oem_id
rs::option::r200_depth_control_neighbor_threshold
@ r200_depth_control_neighbor_threshold
rs::intrinsics::model
distortion model() const
Definition: rs.hpp:256
rs::stream::depth
@ depth
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 synchronizati...
rs_delete_context
void rs_delete_context(rs_context *context, rs_error **error)
Frees the relevant context object.
rs::timestamp_callback::timestamp_callback
timestamp_callback(std::function< void(timestamp_data)> on_event)
Definition: rs.hpp:381
rs::capabilities::enumeration
@ enumeration
rs_get_detached_frame_height
int rs_get_detached_frame_height(const rs_frame_ref *frame, rs_error **error)
Retrieves frame intrinsic height.
rs::option::color_backlight_compensation
@ color_backlight_compensation
rs::frame::get_height
int get_height() const
Returns image height in pixels.
Definition: rs.hpp:496
rs::option::r200_lr_auto_exposure_enabled
@ r200_lr_auto_exposure_enabled
rs_get_stream_framerate
int rs_get_stream_framerate(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the frame rate for a specific stream.
rs_set_device_options
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::option::color_saturation
@ color_saturation
rs::context
Context.
Definition: rs.hpp:319
rs::format::bgra8
@ bgra8
rs_get_device
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
rs::device::set_frame_callback
void set_frame_callback(rs::stream stream, std::function< void(frame)> frame_handler)
Sets callback for frame arrival event.
Definition: rs.hpp:817
rs::capabilities::color
@ color
rs::option::r200_disparity_multiplier
@ r200_disparity_multiplier
rs::device::get_options
void get_options(const option *options, size_t count, double *values)
Efficiently retrieves value of arbitrary number of options, using minimal hardware IO.
Definition: rs.hpp:933
rs_enable_stream_preset
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.
rs::event
event
Source device that triggered specific timestamp event from the motion module.
Definition: rs.hpp:227
rs::device::set_option
void set_option(option option, double value)
Sets current value of single option.
Definition: rs.hpp:976
rs::log_to_file
void log_to_file(log_severity min_severity, const char *file_path)
Definition: rs.hpp:1111
rs::device::get_frame_data
const void * get_frame_data(stream stream) const
Retrieves contents of latest frame on a stream.
Definition: rs.hpp:1050
rs::format::any
@ any
rs::option::r200_auto_exposure_bright_ratio_set_point
@ r200_auto_exposure_bright_ratio_set_point
rs::stream::infrared2
@ infrared2
rs_get_stream_mode_count
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.
rs::option::color_sharpness
@ color_sharpness
rs_get_frame_number
unsigned long long rs_get_frame_number(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves frame number.
rs::device::get_depth_scale
float get_depth_scale() const
Retrieves mapping between units of depth image and meters.
Definition: rs.hpp:653
rs::device::is_stream_enabled
bool is_stream_enabled(stream stream) const
Determines if specific stream is enabled.
Definition: rs.hpp:733
rs_get_detached_frame_format
rs_format rs_get_detached_frame_format(const rs_frame_ref *frame, rs_error **error)
Retrieves frame format.
rs_start_source
void rs_start_source(rs_device *device, rs_source source, rs_error **error)
Begins streaming on all enabled streams for this device.
rs::error::error
error(rs_error *err)
Definition: rs.hpp:308
rs::option::r200_emitter_enabled
@ r200_emitter_enabled
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.
rs_error
struct rs_error rs_error
Definition: rs.h:357
rs_get_device_count
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
rs::log_to_console
void log_to_console(log_severity min_severity)
Definition: rs.hpp:1104
rs::option::sr300_auto_range_lower_threshold
@ sr300_auto_range_lower_threshold
rs_supports
int rs_supports(rs_device *device, rs_capabilities capability, rs_error **error)
Determines device capabilities.
rs::frame::get_format
format get_format() const
Retrieves frame format.
Definition: rs.hpp:534
rs::float2
Definition: rs.hpp:248
rs::timestamp_domain::camera
@ camera
rs::device::get_frame_timestamp
double get_frame_timestamp(stream stream) const
Retrieves time at which the latest frame on a stream was captured.
Definition: rs.hpp:1028
rs::capabilities::motion_module_fw_update
@ motion_module_fw_update
rs::log_to_callback
void log_to_callback(log_severity min_severity, std::function< void(log_severity, const char *)> callback)
Definition: rs.hpp:1118
rs_poll_for_frames
int rs_poll_for_frames(rs_device *device, rs_error **error)
Checks if new frames are available, without blocking.
rs::format::raw8
@ raw8
rs::timestamp_callback
Definition: rs.hpp:377
rs::option::r200_depth_clamp_max
@ r200_depth_clamp_max
rs::option::r200_depth_control_second_peak_threshold
@ r200_depth_control_second_peak_threshold
rs::camera_info::camera_type
@ camera_type
rs_is_stream_enabled
int rs_is_stream_enabled(const rs_device *device, rs_stream stream, rs_error **error)
Determines if a specific stream is enabled.
rs::device::is_streaming
bool is_streaming() const
Determines if device is currently streaming.
Definition: rs.hpp:896
rs_get_device_info
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.
rs::device::stop
void stop(rs::source source=rs::source::video)
Ends streaming on all streams for this device.
Definition: rs.hpp:887
rs::frame::supports_frame_metadata
bool supports_frame_metadata(rs_frame_metadata frame_metadata) const
Definition: rs.hpp:458
rs::device::get_motion_extrinsics_from
extrinsics get_motion_extrinsics_from(stream from_stream) const
Retrieves extrinsic transformation between viewpoints of specific stream and motion module.
Definition: rs.hpp:642
rs_get_failed_args
const char * rs_get_failed_args(const rs_error *error)
Returns static pointer to arguments of a failing function in case of error.
rs_get_stream_intrinsics
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::source
source
Allows the user to choose between available hardware subdevices.
Definition: rs.hpp:219
rs::context::get_device
device * get_device(int index)
Definition: rs.hpp:354
rs::option::r200_auto_exposure_left_edge
@ r200_auto_exposure_left_edge
rs::device::get_stream_framerate
int get_stream_framerate(stream stream) const
Retrieves frame rate for specific stream.
Definition: rs.hpp:777
rs::option::f200_filter_option
@ f200_filter_option
rs::timestamp_callback::on_event
void on_event(rs_timestamp_data data) override
Definition: rs.hpp:383
rs::option::fisheye_strobe
@ fisheye_strobe
rs::capabilities::depth
@ depth
rs::frame::operator=
frame & operator=(frame other)
Definition: rs.hpp:403
rs::motion_callback::on_event
void on_event(rs_motion_data e) override
Definition: rs.hpp:369
rs::stream::infrared
@ infrared
rs::device::enable_stream
void enable_stream(stream stream, int width, int height, format format, int framerate, output_buffer_format output_buffer_type=output_buffer_format::continous)
Enables specific stream and requests specific properties.
Definition: rs.hpp:704
rs_get_device_option_range_ex
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.
rs::distortion::inverse_brown_conrady
@ inverse_brown_conrady
rs_get_failed_function
const char * rs_get_failed_function(const rs_error *error)
Returns static pointer to name of a failing function in case of error.
rs::frame::swap
void swap(frame &other)
Definition: rs.hpp:408
rs::error
Definition: rs.hpp:304
rs::distortion::none
@ none
rs::context::context
context()
Creates RealSense context that is required for the rest of the API.
Definition: rs.hpp:327
rs::stream::infrared2_aligned_to_depth
@ infrared2_aligned_to_depth
rs::log_severity::info
@ info
rs::capabilities::infrared
@ infrared
rs::frame::frame
frame()
Definition: rs.hpp:400
rs::motion_callback::motion_callback
motion_callback(std::function< void(motion_data)> on_event)
Definition: rs.hpp:367
rs::option::r200_auto_exposure_kp_exposure
@ r200_auto_exposure_kp_exposure
rs::option::r200_lr_exposure
@ r200_lr_exposure
rs::error::handle
static void handle(rs_error *e)
Definition: rs.hpp:316
rs::option::r200_disparity_shift
@ r200_disparity_shift
rs::format::y16
@ y16
rs_create_context
rs_context * rs_create_context(int api_version, rs_error **error)
Creates RealSense context that is required for the rest of the API.
rs::context::~context
~context()
Definition: rs.hpp:336
rs_get_device_extrinsics
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_device
Definition: rscore.hpp:64
rs::frame::get_timestamp
double get_timestamp() const
Definition: rs.hpp:426
rs::option::fisheye_color_auto_exposure_skip_frames
@ fisheye_color_auto_exposure_skip_frames
rs::camera_info::content_version
@ content_version
rs::option::color_enable_auto_white_balance
@ color_enable_auto_white_balance
rs::frame
Frame.
Definition: rs.hpp:392
rs::log_severity::none
@ none
rs::device::get_stream_mode
void get_stream_mode(stream stream, int index, int &width, int &height, format &format, int &framerate) const
Determines properties of specific streaming mode.
Definition: rs.hpp:690
rs::frame_callback::release
void release() override
Definition: rs.hpp:564
rs_extrinsics
Cross-stream extrinsics: encode the topology describing how the different devices are connected.
Definition: rs.h:332
rs_format
rs_format
Formats: defines how each stream can be encoded.
Definition: rs.h:53
rs::timestamp_data::timestamp_data
timestamp_data()
Definition: rs.hpp:291
rs::format::bgr8
@ bgr8
rs_event_to_string
const char * rs_event_to_string(rs_event_source event)
rs::output_buffer_format::native
@ native
rs::log_severity::warn
@ warn
rs::blob_type::motion_module_firmware_update
@ motion_module_firmware_update
rs::option::color_white_balance
@ color_white_balance
rs::device::get_option_range
void get_option_range(option option, double &min, double &max, double &step, double &def)
Retrieves available range of values of supported option.
Definition: rs.hpp:922
rs::option::r200_depth_clamp_min
@ r200_depth_clamp_min
rs_get_device_options
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.
rs::format
format
Formats: defines how each stream can be encoded. rs_format specifies how a frame is represented in me...
Definition: rs.hpp:42
rs::format::y8
@ y8
rs_source
rs_source
Source: allows you to choose between available hardware subdevices.
Definition: rs.h:90
rs::option::r200_auto_exposure_top_edge
@ r200_auto_exposure_top_edge
rs_get_frame_data
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.
rs::option::f200_confidence_threshold
@ f200_confidence_threshold
rs::preset::highest_framerate
@ highest_framerate
rs::option::r200_depth_control_texture_count_threshold
@ r200_depth_control_texture_count_threshold
rs::device::supports_option
bool supports_option(option option) const
Determines if device allows specific option to be queried and set.
Definition: rs.hpp:664
rs::camera_info::calibration_date
@ calibration_date
rs::frame_metadata
frame_metadata
Types of value provided from the device with each frame.
Definition: rs.hpp:160
rs::option::sr300_auto_range_min_motion_versus_range
@ sr300_auto_range_min_motion_versus_range
rs::stream::depth_aligned_to_rectified_color
@ depth_aligned_to_rectified_color
rs::option::total_frame_drops
@ total_frame_drops
rs::preset::largest_image
@ largest_image
rs::camera_info::module_version
@ module_version
rs::option::fisheye_color_auto_exposure_sample_rate
@ fisheye_color_auto_exposure_sample_rate
rs::apply_ivcam_preset
void apply_ivcam_preset(device *device, rs_ivcam_preset preset)
Definition: rs.hpp:1127
rs_get_device_option
double rs_get_device_option(rs_device *device, rs_option option, rs_error **error)
Retrieves the current value of a single option.
rs::frame::get_frame_metadata
double get_frame_metadata(rs_frame_metadata frame_metadata) const
Definition: rs.hpp:447
rs::option
option
Defines general configuration controls.
Definition: rs.hpp:87
rs::device::get_stream_intrinsics
intrinsics get_stream_intrinsics(stream stream) const
Retrieves intrinsic camera parameters for specific stream.
Definition: rs.hpp:788
rs::log_severity::debug
@ debug
rs::event::event_imu_motion_cam
@ event_imu_motion_cam
rs_format_to_string
const char * rs_format_to_string(rs_format format)
rs::extrinsics::transform
float3 transform(const float3 &point) const
Definition: rs.hpp:284
rs::device::get_name
const char * get_name() const
Retrieves human-readable device model string.
Definition: rs.hpp:578
rs_capabilities
rs_capabilities
Specifies various capabilities of a RealSense device.
Definition: rs.h:213
rs_log_to_callback_cpp
void rs_log_to_callback_cpp(rs_log_severity min_severity, rs_log_callback *callback, rs_error **error)
Starts logging to user-provided callback.
rs_blob_type
rs_blob_type
Proprietary formats for direct communication with device firmware.
Definition: rs.h:228
rs::motion_intrinsics::motion_intrinsics
motion_intrinsics()
Definition: rs.hpp:277
rs::motion_data::motion_data
motion_data(rs_motion_data orig)
Definition: rs.hpp:297
rs::event::event_imu_g1_sync
@ event_imu_g1_sync
rs::intrinsics::vfov
float vfov() const
Definition: rs.hpp:255
rs_supports_camera_info
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.
rs_intrinsics
Video stream intrinsics.
Definition: rs.h:300
rs::option::sr300_auto_range_enable_laser
@ sr300_auto_range_enable_laser
rs::camera_info::emitter_type
@ emitter_type
rs::device::get_stream_width
int get_stream_width(stream stream) const
Retrieves width, in pixels, of a specific stream, equivalent to the width field from the stream's int...
Definition: rs.hpp:744
rs::intrinsics::pixel_to_texcoord
float2 pixel_to_texcoord(const float2 &pixel) const
Definition: rs.hpp:259
rs_option
rs_option
Defines general configuration controls.
Definition: rs.h:128
rs_timestamp_callback
Definition: rscore.hpp:139
rs::log_severity::fatal
@ fatal
rs_get_detached_frame_number
unsigned long long rs_get_detached_frame_number(const rs_frame_ref *frame, rs_error **error)
Retrieves frame number from frame reference.
rs::timestamp_domain::microcontroller
@ microcontroller
rs::device::get_firmware_version
const char * get_firmware_version() const
Retrieves version of firmware currently installed on device.
Definition: rs.hpp:608
rs_intrinsics::width
int width
Definition: rs.h:302
RS_API_VERSION
#define RS_API_VERSION
Definition: rs.h:28
rs::extrinsics::is_identity
bool is_identity() const
Definition: rs.hpp:283
rs_timestamp_data
Timestamp data from the motion microcontroller.
Definition: rs.h:339
rs::camera_info::lens_nominal_baseline
@ lens_nominal_baseline
rs::context::get_device_count
int get_device_count() const
Definition: rs.hpp:343
rs::option::frames_queue_size
@ frames_queue_size
rs_get_detached_frame_stream_type
rs_stream rs_get_detached_frame_stream_type(const rs_frame_ref *frame, rs_error **error)
Retrieves frame stream type.
rs::camera_info::focus_value
@ focus_value
rs::capabilities::motion_events
@ motion_events
rs::log_callback::release
void release() override
Definition: rs.hpp:1101
rs_get_device_depth_scale
float rs_get_device_depth_scale(const rs_device *device, rs_error **error)
Retrieves mapping between the units of the depth image and meters.
rs::camera_info::device_name
@ device_name
rs_stop_source
void rs_stop_source(rs_device *device, rs_source source, rs_error **error)
Ends data acquisition for the specified source providers.
rs_get_stream_mode
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.
rs::stream::color_aligned_to_depth
@ color_aligned_to_depth
rs::frame::get_frame_number
unsigned long long get_frame_number() const
Definition: rs.hpp:468
rs_disable_stream
void rs_disable_stream(rs_device *device, rs_stream stream, rs_error **error)
Disables a specific stream.
rs::device::enable_stream
void enable_stream(stream stream, preset preset)
Enables specific stream and requests properties using preset.
Definition: rs.hpp:714
rs_distortion_to_string
const char * rs_distortion_to_string(rs_distortion distortion)
rs_get_detached_frame_metadata
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_extrinsics::translation
float translation[3]
Definition: rs.h:335
rs::device::disable_stream
void disable_stream(stream stream)
Disables specific stream.
Definition: rs.hpp:723
rs::option::sr300_auto_range_max_motion_versus_range
@ sr300_auto_range_max_motion_versus_range
rs_motion_callback
Definition: rscore.hpp:125
rs::intrinsics::project_to_texcoord
float2 project_to_texcoord(const float3 &point) const
Definition: rs.hpp:268
rs::frame_callback::frame_callback
frame_callback(std::function< void(frame)> on_frame)
Definition: rs.hpp:557
rs::event::event_imu_gyro
@ event_imu_gyro
rs::camera_info::third_lens_coating_type
@ third_lens_coating_type
rs::event::event_imu_g2_sync
@ event_imu_g2_sync
rs_intrinsics::height
int height
Definition: rs.h:303
rs::camera_info::isp_fw_version
@ isp_fw_version
rs_device_supports_option
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.
rs::motion_data
Motion data from gyroscope and accelerometer from the microcontroller.
Definition: rs.hpp:295
rs::option::r200_depth_control_score_maximum_threshold
@ r200_depth_control_score_maximum_threshold
rs::option::r200_depth_control_score_minimum_threshold
@ r200_depth_control_score_minimum_threshold
rs::device
Provides convenience methods relating to devices.
Definition: rs.hpp:567
rs_get_detached_frame_timestamp_domain
rs_timestamp_domain rs_get_detached_frame_timestamp_domain(const rs_frame_ref *frame, rs_error **error)
Retrieves timestamp domain from frame reference.
rs::frame::frame
frame(rs_device *device, rs_frame_ref *frame_ref)
Definition: rs.hpp:401
rs::frame_metadata::actual_fps
@ actual_fps
rs::option::r200_auto_exposure_kp_gain
@ r200_auto_exposure_kp_gain
rs_is_motion_tracking_active
int rs_is_motion_tracking_active(rs_device *device, rs_error **error)
Checks if data acquisition is active.
rs_frame_ref
Definition: rscore.hpp:44
rs::device::get_motion_intrinsics
motion_intrinsics get_motion_intrinsics() const
Retrieves intrinsic camera parameters for motion module.
Definition: rs.hpp:799
rs::format::rgb8
@ rgb8
rs::option::color_brightness
@ color_brightness
rs::device::set_options
void set_options(const option *options, size_t count, const double *values)
Efficiently sets value of arbitrary number of options, using minimal hardware IO.
Definition: rs.hpp:944
rs_is_device_streaming
int rs_is_device_streaming(const rs_device *device, rs_error **error)
Determines if the device is currently streaming.
rs::device::get_stream_height
int get_stream_height(stream stream) const
Retrieves height, in pixels, of a specific stream, equivalent to the height field from the stream's i...
Definition: rs.hpp:755
rs::option::color_gain
@ color_gain
rs::device::get_stream_format
format get_stream_format(stream stream) const
Retrieves pixel format for specific stream.
Definition: rs.hpp:766
rs::stream::points
@ points
rs::frame::~frame
~frame()
Definition: rs.hpp:414
rs::float3::x
float x
Definition: rs.hpp:249
rs_frame_callback
Definition: rscore.hpp:132
rs::intrinsics::project
float2 project(const float3 &point) const
Definition: rs.hpp:267
rs::camera_info::camera_firmware_version
@ camera_firmware_version
rs::frame_metadata::actual_exposure
@ actual_exposure
rs_preset_to_string
const char * rs_preset_to_string(rs_preset preset)
rs::option::sr300_auto_range_enable_motion_versus_range
@ sr300_auto_range_enable_motion_versus_range
rs::option::sr300_auto_range_start_laser
@ sr300_auto_range_start_laser
rs_get_error_message
const char * rs_get_error_message(const rs_error *error)
Returns static pointer to error message.
rs::frame::get_width
int get_width() const
Returns image width in pixels.
Definition: rs.hpp:487
rs::option::r200_depth_control_estimate_median_increment
@ r200_depth_control_estimate_median_increment
rs_ivcam_preset
rs_ivcam_preset
For SR300 devices: provides optimized settings (presets) for specific types of usage.
Definition: rs.h:109
rs::camera_info::motion_module_firmware_version
@ motion_module_firmware_version
rs::source::motion_data
@ motion_data
rs::camera_info
camera_info
Read-only strings that can be queried from the device.
Definition: rs.hpp:192
rs::frame_callback::on_frame
void on_frame(rs_device *device, rs_frame_ref *fref) override
Definition: rs.hpp:559
rs_get_motion_intrinsics
void rs_get_motion_intrinsics(const rs_device *device, rs_motion_intrinsics *intrinsic, rs_error **error)
Retrieves intrinsic camera parameters for a motion module.
rs::option::hardware_logger_enabled
@ hardware_logger_enabled
rs::operator<<
std::ostream & operator<<(std::ostream &o, stream stream)
Definition: rs.hpp:1070
rs::motion_callback
Definition: rs.hpp:363
rs_send_blob_to_device
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.
rs::option::r200_auto_exposure_mean_intensity_set_point
@ r200_auto_exposure_mean_intensity_set_point
rs::event::event_imu_accel
@ event_imu_accel
rs::log_callback
Definition: rs.hpp:1090
rs_log_callback
Definition: rscore.hpp:146
rs::option::fisheye_color_auto_exposure_mode
@ fisheye_color_auto_exposure_mode
rs::device::enable_motion_tracking
void enable_motion_tracking(std::function< void(motion_data)> motion_handler, std::function< void(timestamp_data)> timestamp_handler)
Sets callback for motion module event.
Definition: rs.hpp:841
rs
Definition: rs.hpp:21
rs_event_source
rs_event_source
Source device that triggered a specific timestamp event from the motion module.
Definition: rs.h:276
rs_set_device_option
void rs_set_device_option(rs_device *device, rs_option option, double value, rs_error **error)
Sets the current value of a single option.
rs::camera_info::adapter_board_firmware_version
@ adapter_board_firmware_version
rs::device::disable_motion_tracking
void disable_motion_tracking(void)
Disables events polling.
Definition: rs.hpp:861
rs::camera_info::program_date
@ program_date
rs::option::color_enable_auto_exposure
@ color_enable_auto_exposure
rs_disable_motion_tracking
void rs_disable_motion_tracking(rs_device *device, rs_error **error)
Disables motion-tracking handlers.
rs::timestamp_domain
timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs.hpp:242
rs::distortion::modified_brown_conrady
@ modified_brown_conrady
rs::frame::get_stream_type
stream get_stream_type() const
Retrieves frame stream type.
Definition: rs.hpp:544
rs_wait_for_frames
void rs_wait_for_frames(rs_device *device, rs_error **error)
Blocks until new frames are available.
rs::device::get_stream_mode_count
int get_stream_mode_count(stream stream) const
Determines number of streaming modes available for given stream.
Definition: rs.hpp:675
rs::camera_info::third_lens_nominal_baseline
@ third_lens_nominal_baseline
rs::stream::depth_aligned_to_infrared2
@ depth_aligned_to_infrared2
rs_output_buffer_format
rs_output_buffer_format
Output buffer format: sets how librealsense works with frame memory.
Definition: rs.h:73
rs::format::yuyv
@ yuyv
rs::format::disparity16
@ disparity16
rs::format::xyz32f
@ xyz32f
rs::blob_type
blob_type
Proprietary formats for direct communication with device firmware.
Definition: rs.hpp:183
rs::motion_callback::release
void release() override
Definition: rs.hpp:374
rs::format::z16
@ z16
rs::capabilities
capabilities
Specifies various capabilities of a RealSense device.
Definition: rs.hpp:169
rs_get_detached_frame_timestamp
double rs_get_detached_frame_timestamp(const rs_frame_ref *frame, rs_error **error)
Retrieves timestamp from frame reference.
rs::log_severity
log_severity
Severity of the librealsense logger.
Definition: rs.hpp:1080
rs::float3::z
float z
Definition: rs.hpp:249
rs_get_device_option_range
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.