Intel® RealSense™ Cross Platform API  2.13.0
Intel Realsense Cross-platform API
rs_frame.hpp
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 
4 #ifndef LIBREALSENSE_RS2_FRAME_HPP
5 #define LIBREALSENSE_RS2_FRAME_HPP
6 
7 #include "rs_types.hpp"
8 
9 namespace rs2
10 {
11  class frame_source;
12  class frame_queue;
13  class syncer;
14  class processing_block;
15  class pointcloud;
16  class sensor;
17  class frame;
18  class pipeline_profile;
19  class points;
20 
22  {
23  public:
24  stream_profile() : _profile(nullptr) {}
25 
26  int stream_index() const { return _index; }
27  rs2_stream stream_type() const { return _type; }
28  rs2_format format() const { return _format; }
29 
30  int fps() const { return _framerate; }
31 
32  int unique_id() const { return _uid; }
33 
35  {
36  rs2_error* e = nullptr;
37  auto ref = rs2_clone_stream_profile(_profile, type, index, format, &e);
38  error::handle(e);
39  stream_profile res(ref);
40  res._clone = std::shared_ptr<rs2_stream_profile>(ref, [](rs2_stream_profile* r) { rs2_delete_stream_profile(r); });
41 
42  return res;
43  }
44 
45  bool operator==(const stream_profile& rhs)
46  {
47  return stream_index() == rhs.stream_index()&&
48  stream_type() == rhs.stream_type()&&
49  format() == rhs.format()&&
50  fps() == rhs.fps();
51  }
52 
53  template<class T>
54  bool is() const
55  {
56  T extension(*this);
57  return extension;
58  }
59 
60  template<class T>
61  T as() const
62  {
63  T extension(*this);
64  return extension;
65  }
66 
67  std::string stream_name() const
68  {
69  std::stringstream ss;
71  if (stream_index() != 0) ss << " " << stream_index();
72  return ss.str();
73  }
74 
75  bool is_default() const { return _default; }
76 
77  operator bool() const { return _profile != nullptr; }
78 
79  const rs2_stream_profile* get() const { return _profile; }
80 
81  operator const rs2_stream_profile*()
82  {
83  return _profile;
84  }
86  {
87  rs2_error* e = nullptr;
88  rs2_extrinsics res;
89  rs2_get_extrinsics(get(), to.get(), &res, &e);
90  error::handle(e);
91  return res;
92  }
94  {
95  rs2_error* e = nullptr;
96  rs2_register_extrinsics(get(), to.get(), extrinsics, &e);
97  error::handle(e);
98  }
99 
100  protected:
101  friend class rs2::sensor;
102  friend class rs2::frame;
103  friend class rs2::pipeline_profile;
104  friend class software_sensor;
105 
106  explicit stream_profile(const rs2_stream_profile* profile) : _profile(profile)
107  {
108  rs2_error* e = nullptr;
110  error::handle(e);
111 
113  error::handle(e);
114 
115  }
116 
118  std::shared_ptr<rs2_stream_profile> _clone;
119 
120  int _index = 0;
121  int _uid = 0;
122  int _framerate = 0;
125 
126  bool _default = false;
127  };
128 
130  {
131  public:
133  : stream_profile(sp)
134  {
135  rs2_error* e = nullptr;
136  if ((rs2_stream_profile_is(sp.get(), RS2_EXTENSION_VIDEO_PROFILE, &e) == 0 && !e))
137  {
138  _profile = nullptr;
139  }
140  error::handle(e);
141 
142  if (_profile)
143  {
144  rs2_get_video_stream_resolution(_profile, &_width, &_height, &e);
145  error::handle(e);
146  }
147  }
148 
149  int width() const
150  {
151  return _width;
152  }
153 
154  int height() const
155  {
156  return _height;
157  }
158 
160  {
161  rs2_error* e = nullptr;
162  rs2_intrinsics intr;
164  error::handle(e);
165  return intr;
166  }
167 
168  private:
169  int _width = 0;
170  int _height = 0;
171  };
172 
173 
175  {
176  public:
178  : stream_profile(sp)
179  {
180  rs2_error* e = nullptr;
181  if ((rs2_stream_profile_is(sp.get(), RS2_EXTENSION_MOTION_PROFILE, &e) == 0 && !e))
182  {
183  _profile = nullptr;
184  }
185  error::handle(e);
186  }
187 
192 
193  {
194  rs2_error* e = nullptr;
196  rs2_get_motion_intrinsics(_profile, &intrin, &e);
197  error::handle(e);
198  return intrin;
199  }
200  };
201 
202  class frame
203  {
204  public:
205  frame() : frame_ref(nullptr) {}
206  frame(rs2_frame* frame_ref) : frame_ref(frame_ref)
207  {
208 #ifdef _DEBUG
209  if (frame_ref)
210  {
211  rs2_error* e = nullptr;
212  auto r = rs2_get_frame_number(frame_ref, &e);
213  if (!e)
214  frame_number = r;
215  auto s = rs2_get_frame_stream_profile(frame_ref, &e);
216  if (!e)
217  profile = stream_profile(s);
218  }
219  else
220  {
221  frame_number = 0;
222  profile = stream_profile();
223  }
224 #endif
225  }
226 
227  frame(frame&& other) noexcept : frame_ref(other.frame_ref)
228  {
229  other.frame_ref = nullptr;
230 #ifdef _DEBUG
231  frame_number = other.frame_number;
232  profile = other.profile;
233 #endif
234  }
236  {
237  swap(other);
238  return *this;
239  }
240  frame(const frame& other)
241  : frame_ref(other.frame_ref)
242  {
243  if (frame_ref) add_ref();
244 #ifdef _DEBUG
245  frame_number = other.frame_number;
246  profile = other.profile;
247 #endif
248  }
249  void swap(frame& other)
250  {
251  std::swap(frame_ref, other.frame_ref);
252 
253 #ifdef _DEBUG
254  std::swap(frame_number, other.frame_number);
255  std::swap(profile, other.profile);
256 #endif
257  }
258 
263  {
264  if (frame_ref)
265  {
266  rs2_release_frame(frame_ref);
267  }
268  }
269 
270  void keep() { rs2_keep_frame(frame_ref); }
271 
272  operator bool() const { return frame_ref != nullptr; }
273 
278  double get_timestamp() const
279  {
280  rs2_error* e = nullptr;
281  auto r = rs2_get_frame_timestamp(frame_ref, &e);
282  error::handle(e);
283  return r;
284  }
285 
290  {
291  rs2_error* e = nullptr;
292  auto r = rs2_get_frame_timestamp_domain(frame_ref, &e);
293  error::handle(e);
294  return r;
295  }
296 
302  {
303  rs2_error* e = nullptr;
304  auto r = rs2_get_frame_metadata(frame_ref, frame_metadata, &e);
305  error::handle(e);
306  return r;
307  }
308 
314  {
315  rs2_error* e = nullptr;
316  auto r = rs2_supports_frame_metadata(frame_ref, frame_metadata, &e);
317  error::handle(e);
318  return r != 0;
319  }
320 
325  unsigned long long get_frame_number() const
326  {
327  rs2_error* e = nullptr;
328  auto r = rs2_get_frame_number(frame_ref, &e);
329  error::handle(e);
330  return r;
331  }
332 
337  const void* get_data() const
338  {
339  rs2_error* e = nullptr;
340  auto r = rs2_get_frame_data(frame_ref, &e);
341  error::handle(e);
342  return r;
343  }
344 
346  {
347  rs2_error* e = nullptr;
348  auto s = rs2_get_frame_stream_profile(frame_ref, &e);
349  error::handle(e);
350  return stream_profile(s);
351  }
352 
353  template<class T>
354  bool is() const
355  {
356  T extension(*this);
357  return extension;
358  }
359 
360  template<class T>
361  T as() const
362  {
363  T extension(*this);
364  return extension;
365  }
366 
367  rs2_frame* get() const { return frame_ref; }
368 
369  protected:
375  void add_ref() const
376  {
377  rs2_error* e = nullptr;
378  rs2_frame_add_ref(frame_ref, &e);
379  error::handle(e);
380  }
381 
382  void reset()
383  {
384  if (frame_ref)
385  {
386  rs2_release_frame(frame_ref);
387  }
388  frame_ref = nullptr;
389  }
390 
391  private:
392  friend class rs2::frame_source;
393  friend class rs2::frame_queue;
394  friend class rs2::syncer;
395  friend class rs2::processing_block;
396  friend class rs2::pointcloud;
397  friend class rs2::points;
398 
399  rs2_frame* frame_ref;
400 
401 #ifdef _DEBUG
402  stream_profile profile;
403  unsigned long long frame_number = 0;
404 #endif
405  };
406 
407  class video_frame : public frame
408  {
409  public:
410  video_frame(const frame& f)
411  : frame(f)
412  {
413  rs2_error* e = nullptr;
414  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_VIDEO_FRAME, &e) == 0 && !e))
415  {
416  reset();
417  }
418  error::handle(e);
419  }
420 
421 
426  int get_width() const
427  {
428  rs2_error* e = nullptr;
429  auto r = rs2_get_frame_width(get(), &e);
430  error::handle(e);
431  return r;
432  }
433 
438  int get_height() const
439  {
440  rs2_error* e = nullptr;
441  auto r = rs2_get_frame_height(get(), &e);
442  error::handle(e);
443  return r;
444  }
445 
451  {
452  rs2_error* e = nullptr;
453  auto r = rs2_get_frame_stride_in_bytes(get(), &e);
454  error::handle(e);
455  return r;
456  }
457 
462  int get_bits_per_pixel() const
463  {
464  rs2_error* e = nullptr;
465  auto r = rs2_get_frame_bits_per_pixel(get(), &e);
466  error::handle(e);
467  return r;
468  }
469 
470  int get_bytes_per_pixel() const { return get_bits_per_pixel() / 8; }
471  };
472 
473  struct vertex {
474  float x, y, z;
475  operator const float*() const { return &x; }
476  };
478  float u, v;
479  operator const float*() const { return &u; }
480  };
481 
482  class points : public frame
483  {
484  public:
485  points() : frame(), _size(0) {}
486 
487  points(const frame& f)
488  : frame(f), _size(0)
489  {
490  rs2_error* e = nullptr;
491  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_POINTS, &e) == 0 && !e))
492  {
493  reset();
494  }
495  error::handle(e);
496 
497  if (get())
498  {
499  rs2_error* e = nullptr;
500  _size = rs2_get_frame_points_count(get(), &e);
501  error::handle(e);
502  }
503  }
504 
505  const vertex* get_vertices() const
506  {
507  rs2_error* e = nullptr;
508  auto res = rs2_get_frame_vertices(get(), &e);
509  error::handle(e);
510  return (const vertex*)res;
511  }
512 
513  void export_to_ply(const std::string& fname, video_frame texture)
514  {
515  rs2_frame* ptr = nullptr;
516  std::swap(texture.frame_ref, ptr);
517  rs2_error* e = nullptr;
518  rs2_export_to_ply(get(), fname.c_str(), ptr, &e);
519  error::handle(e);
520  }
521 
523  {
524  rs2_error* e = nullptr;
525  auto res = rs2_get_frame_texture_coordinates(get(), &e);
526  error::handle(e);
527  return (const texture_coordinate*)res;
528  }
529 
530  size_t size() const
531  {
532  return _size;
533  }
534 
535  private:
536  size_t _size;
537  };
538 
539  class depth_frame : public video_frame
540  {
541  public:
542  depth_frame(const frame& f)
543  : video_frame(f)
544  {
545  rs2_error* e = nullptr;
546  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_DEPTH_FRAME, &e) == 0 && !e))
547  {
548  reset();
549  }
550  error::handle(e);
551  }
552 
553  float get_distance(int x, int y) const
554  {
555  rs2_error * e = nullptr;
556  auto r = rs2_depth_frame_get_distance(get(), x, y, &e);
557  error::handle(e);
558  return r;
559  }
560  };
561 
563  {
564  public:
566  : depth_frame(f)
567  {
568  rs2_error* e = nullptr;
569  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_DISPARITY_FRAME, &e) == 0 && !e))
570  {
571  reset();
572  }
573  error::handle(e);
574  }
575 
576  float get_baseline(void) const
577  {
578  rs2_error * e = nullptr;
579  auto r = rs2_depth_stereo_frame_get_baseline(get(), &e);
580  error::handle(e);
581  return r;
582  }
583  };
584 
585  class motion_frame : public frame
586  {
587  public:
588  motion_frame(const frame& f)
589  : frame(f)
590  {
591  rs2_error* e = nullptr;
592  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_MOTION_FRAME, &e) == 0 && !e))
593  {
594  reset();
595  }
596  error::handle(e);
597  }
598 
600  {
601  auto data = reinterpret_cast<const float*>(get_data());
602  return rs2_vector{data[0], data[1], data[2]};
603  }
604  };
605 
606  class pose_frame : public frame
607  {
608  public:
609  pose_frame(const frame& f)
610  : frame(f)
611  {
612  rs2_error* e = nullptr;
613  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_POSE_FRAME, &e) == 0 && !e))
614  {
615  reset();
616  }
617  error::handle(e);
618  }
619 
621  {
622  rs2_pose pose_data;
623  rs2_error* e = nullptr;
624  rs2_pose_frame_get_pose_data(get(), &pose_data, &e);
625  error::handle(e);
626  return pose_data;
627  }
628  };
629 
630  class frameset : public frame
631  {
632  public:
633  frameset() :_size(0) {};
634  frameset(const frame& f)
635  : frame(f), _size(0)
636  {
637  rs2_error* e = nullptr;
638  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_COMPOSITE_FRAME, &e) == 0 && !e))
639  {
640  reset();
641  // TODO - consider explicit constructor to move resultion to compile time
642  }
643  error::handle(e);
644 
645  if (get())
646  {
647  rs2_error* e = nullptr;
648  _size = rs2_embedded_frames_count(get(), &e);
649  error::handle(e);
650  }
651  }
652 
654  {
655  frame result;
656  foreach([&result, s](frame f) {
657  if (!result && f.get_profile().stream_type() == s)
658  {
659  result = std::move(f);
660  }
661  });
662  return result;
663  }
664 
666  {
667  auto f = first_or_default(s);
668  if (!f) throw error("Frame of requested stream type was not found!");
669  return f;
670  }
671 
673  {
675  return f.as<depth_frame>();
676  }
677 
679  {
681 
682  if (!f)
683  {
685  if (ir && ir.get_profile().format() == RS2_FORMAT_RGB8)
686  f = ir;
687  }
688  return f;
689  }
690 
691  video_frame get_infrared_frame(const size_t index = 0) const
692  {
693  frame f;
694  if (!index)
695  {
697  }
698  else
699  {
700  foreach([&f, index](const frame& frame) {
702  f = frame;
703  });
704  }
705  return f;
706  }
707 
708  size_t size() const
709  {
710  return _size;
711  }
712 
713  template<class T>
714  void foreach(T action) const
715  {
716  rs2_error* e = nullptr;
717  auto count = size();
718  for (size_t i = 0; i < count; i++)
719  {
720  auto fref = rs2_extract_frame(get(), (int)i, &e);
721  error::handle(e);
722 
723  action(frame(fref));
724  }
725  }
726 
727  frame operator[](size_t index) const
728  {
729  rs2_error* e = nullptr;
730  if (index < size())
731  {
732  auto fref = rs2_extract_frame(get(), (int)index, &e);
733  error::handle(e);
734  return frame(fref);
735  }
736 
737  throw error("Requested index is out of range!");
738  }
739 
740  class iterator
741  {
742  public:
743  iterator(const frameset* owner, size_t index = 0) : _index(index), _owner(owner) {}
744  iterator& operator++() { ++_index; return *this; }
745  bool operator==(const iterator& other) const { return _index == other._index; }
746  bool operator!=(const iterator& other) const { return !(*this == other); }
747 
748  frame operator*() { return (*_owner)[_index]; }
749  private:
750  size_t _index = 0;
751  const frameset* _owner;
752  };
753 
754  iterator begin() const { return iterator(this); }
755  iterator end() const { return iterator(this, size()); }
756  private:
757  size_t _size;
758  };
759 
760 
761 }
762 #endif // LIBREALSENSE_RS2_FRAME_HPP
Definition: rs_types.hpp:69
void rs2_register_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics extrin, rs2_error **error)
Definition: rs_frame.hpp:174
iterator begin() const
Definition: rs_frame.hpp:754
Definition: rs_frame.hpp:21
int get_bytes_per_pixel() const
Definition: rs_frame.hpp:470
depth_frame(const frame &f)
Definition: rs_frame.hpp:542
Definition: rs_frame.hpp:407
void rs2_export_to_ply(const rs2_frame *frame, const char *fname, rs2_frame *texture, rs2_error **error)
Definition: rs_sensor.hpp:232
Definition: rs_frame.hpp:202
void add_ref() const
Definition: rs_frame.hpp:375
int rs2_get_frame_points_count(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * rs2_get_frame_stream_profile(const rs2_frame *frame, rs2_error **error)
rs2_pose get_pose_data()
Definition: rs_frame.hpp:620
rs2_motion_device_intrinsic get_motion_intrinsics() const
Definition: rs_frame.hpp:191
int _uid
Definition: rs_frame.hpp:121
rs2_vector get_motion_data()
Definition: rs_frame.hpp:599
stream_profile()
Definition: rs_frame.hpp:24
Definition: rs_pipeline.hpp:18
int rs2_is_frame_extendable_to(const rs2_frame *frame, rs2_extension extension_type, rs2_error **error)
rs2_format format() const
Definition: rs_frame.hpp:28
Definition: rs_types.h:105
void rs2_get_video_stream_resolution(const rs2_stream_profile *mode, int *width, int *height, rs2_error **error)
Definition: rs_frame.hpp:482
void register_extrinsics_to(const stream_profile &to, rs2_extrinsics extrinsics)
Definition: rs_frame.hpp:93
frame operator*()
Definition: rs_frame.hpp:748
void rs2_keep_frame(rs2_frame *frame)
void rs2_get_extrinsics(const rs2_stream_profile *from, const rs2_stream_profile *to, rs2_extrinsics *extrin, rs2_error **error)
std::string stream_name() const
Definition: rs_frame.hpp:67
frameset()
Definition: rs_frame.hpp:633
float y
Definition: rs_frame.hpp:474
int _index
Definition: rs_frame.hpp:120
Definition: rs_types.h:107
frame(frame &&other) noexcept
Definition: rs_frame.hpp:227
Definition: rs_frame.hpp:630
bool is() const
Definition: rs_frame.hpp:54
void export_to_ply(const std::string &fname, video_frame texture)
Definition: rs_frame.hpp:513
rs2_time_t rs2_get_frame_timestamp(const rs2_frame *frame, rs2_error **error)
int rs2_stream_profile_is(const rs2_stream_profile *mode, rs2_extension type, rs2_error **error)
Definition: rs_context.hpp:11
rs2_pixel * rs2_get_frame_texture_coordinates(const rs2_frame *frame, rs2_error **error)
double get_timestamp() const
Definition: rs_frame.hpp:278
bool is() const
Definition: rs_frame.hpp:354
size_t size() const
Definition: rs_frame.hpp:530
float u
Definition: rs_frame.hpp:478
video_frame get_color_frame() const
Definition: rs_frame.hpp:678
int rs2_supports_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
Definition: rs_processing.hpp:79
rs2_stream_profile * rs2_clone_stream_profile(const rs2_stream_profile *mode, rs2_stream stream, int index, rs2_format format, rs2_error **error)
float z
Definition: rs_frame.hpp:474
int fps() const
Definition: rs_frame.hpp:30
frame first(rs2_stream s) const
Definition: rs_frame.hpp:665
void reset()
Definition: rs_frame.hpp:382
iterator & operator++()
Definition: rs_frame.hpp:744
Definition: rs_sensor.h:42
rs2_extrinsics get_extrinsics_to(const stream_profile &to) const
Definition: rs_frame.hpp:85
int rs2_get_frame_height(const rs2_frame *frame, rs2_error **error)
std::shared_ptr< rs2_stream_profile > _clone
Definition: rs_frame.hpp:118
pose_frame(const frame &f)
Definition: rs_frame.hpp:609
void swap(frame &other)
Definition: rs_frame.hpp:249
Definition: rs_types.h:115
Definition: rs_frame.hpp:740
frame & operator=(frame other)
Definition: rs_frame.hpp:235
Definition: rs_sensor.h:62
Definition: rs_frame.hpp:585
int rs2_get_frame_stride_in_bytes(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * _profile
Definition: rs_frame.hpp:117
video_frame(const frame &f)
Definition: rs_frame.hpp:410
void rs2_get_stream_profile_data(const rs2_stream_profile *mode, rs2_stream *stream, rs2_format *format, int *index, int *unique_id, int *framerate, rs2_error **error)
points()
Definition: rs_frame.hpp:485
float get_distance(int x, int y) const
Definition: rs_frame.hpp:553
Definition: rs_processing.hpp:13
int rs2_embedded_frames_count(rs2_frame *composite, rs2_error **error)
int rs2_is_stream_profile_default(const rs2_stream_profile *mode, rs2_error **error)
int _framerate
Definition: rs_frame.hpp:122
Definition: rs_types.h:108
motion_frame(const frame &f)
Definition: rs_frame.hpp:588
~frame()
Definition: rs_frame.hpp:262
int rs2_get_frame_width(const rs2_frame *frame, rs2_error **error)
Definition: rs_internal.hpp:72
float rs2_depth_frame_get_distance(const rs2_frame *frame_ref, int x, int y, rs2_error **error)
frame operator[](size_t index) const
Definition: rs_frame.hpp:727
Definition: rs_types.h:106
rs2_timestamp_domain rs2_get_frame_timestamp_domain(const rs2_frame *frameset, rs2_error **error)
Definition: rs_frame.h:90
rs2_format _format
Definition: rs_frame.hpp:123
void rs2_delete_stream_profile(rs2_stream_profile *mode)
motion_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:177
Definition: rs_types.h:114
rs2_timestamp_domain get_frame_timestamp_domain() const
Definition: rs_frame.hpp:289
T as() const
Definition: rs_frame.hpp:61
T as() const
Definition: rs_frame.hpp:361
video_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:132
struct rs2_stream_profile rs2_stream_profile
Definition: rs_types.h:158
Definition: rs_sensor.h:57
rs2_format
Format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:55
Definition: rs_processing.hpp:204
bool is_default() const
Definition: rs_frame.hpp:75
void keep()
Definition: rs_frame.hpp:270
unsigned long long rs2_get_frame_number(const rs2_frame *frame, rs2_error **error)
int stream_index() const
Definition: rs_frame.hpp:26
video_frame get_infrared_frame(const size_t index=0) const
Definition: rs_frame.hpp:691
const texture_coordinate * get_texture_coordinates() const
Definition: rs_frame.hpp:522
int get_bits_per_pixel() const
Definition: rs_frame.hpp:462
bool operator==(const iterator &other) const
Definition: rs_frame.hpp:745
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
Definition: rs_sensor.h:41
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
int get_height() const
Definition: rs_frame.hpp:438
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:79
bool _default
Definition: rs_frame.hpp:126
Definition: rs_frame.hpp:562
void rs2_get_video_stream_intrinsics(const rs2_stream_profile *mode, rs2_intrinsics *intrinsics, rs2_error **error)
Definition: rs_sensor.h:43
unsigned long long get_frame_number() const
Definition: rs_frame.hpp:325
Cross-stream extrinsics: encode the topology describing how the different devices are connected...
Definition: rs_sensor.h:82
Definition: rs_types.h:104
iterator end() const
Definition: rs_frame.hpp:755
iterator(const frameset *owner, size_t index=0)
Definition: rs_frame.hpp:743
3D vector in Euclidean coordinate space
Definition: rs_frame.h:79
int get_width() const
Definition: rs_frame.hpp:426
const void * get_data() const
Definition: rs_frame.hpp:337
const char * rs2_stream_to_string(rs2_stream stream)
Definition: rs_sensor.h:40
long long rs2_metadata_type
Definition: rs_types.h:181
points(const frame &f)
Definition: rs_frame.hpp:487
Definition: rs_types.h:111
int get_stride_in_bytes() const
Definition: rs_frame.hpp:450
rs2_vertex * rs2_get_frame_vertices(const rs2_frame *frame, rs2_error **error)
disparity_frame(const frame &f)
Definition: rs_frame.hpp:565
frame first_or_default(rs2_stream s) const
Definition: rs_frame.hpp:653
int width() const
Definition: rs_frame.hpp:149
void rs2_frame_add_ref(rs2_frame *frame, rs2_error **error)
Video stream intrinsics.
Definition: rs_types.h:56
Definition: rs_processing.hpp:273
int height() const
Definition: rs_frame.hpp:154
bool operator!=(const iterator &other) const
Definition: rs_frame.hpp:746
bool operator==(const stream_profile &rhs)
Definition: rs_frame.hpp:45
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:69
depth_frame get_depth_frame() const
Definition: rs_frame.hpp:672
Definition: rs_processing.hpp:134
float rs2_depth_stereo_frame_get_baseline(const rs2_frame *frame_ref, rs2_error **error)
stream_profile(const rs2_stream_profile *profile)
Definition: rs_frame.hpp:106
void rs2_release_frame(rs2_frame *frame)
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:301
frameset(const frame &f)
Definition: rs_frame.hpp:634
Definition: rs_frame.hpp:477
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
size_t size() const
Definition: rs_frame.hpp:708
Definition: rs_types.h:116
rs2_metadata_type rs2_get_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
struct rs2_error rs2_error
Definition: rs_types.h:149
bool supports_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:313
rs2_stream stream_type() const
Definition: rs_frame.hpp:27
float x
Definition: rs_frame.hpp:474
Definition: rs_frame.hpp:129
Definition: rs_frame.hpp:606
frame(const frame &other)
Definition: rs_frame.hpp:240
rs2_intrinsics get_intrinsics() const
Definition: rs_frame.hpp:159
void rs2_get_motion_intrinsics(const rs2_stream_profile *mode, rs2_motion_device_intrinsic *intrinsics, rs2_error **error)
frame(rs2_frame *frame_ref)
Definition: rs_frame.hpp:206
rs2_frame * get() const
Definition: rs_frame.hpp:367
void rs2_pose_frame_get_pose_data(const rs2_frame *frame, rs2_pose *pose, rs2_error **error)
frame()
Definition: rs_frame.hpp:205
float v
Definition: rs_frame.hpp:478
stream_profile clone(rs2_stream type, int index, rs2_format format) const
Definition: rs_frame.hpp:34
int rs2_get_frame_bits_per_pixel(const rs2_frame *frame, rs2_error **error)
rs2_frame_metadata_value
Per-Frame-Metadata are set of read-only properties that might be exposed for each individual frame...
Definition: rs_frame.h:28
struct rs2_frame rs2_frame
Definition: rs_types.h:151
const void * rs2_get_frame_data(const rs2_frame *frame, rs2_error **error)
float get_baseline(void) const
Definition: rs_frame.hpp:576
rs2_stream _type
Definition: rs_frame.hpp:124
Definition: rs_frame.hpp:473
stream_profile get_profile() const
Definition: rs_frame.hpp:345
const vertex * get_vertices() const
Definition: rs_frame.hpp:505
Definition: rs_frame.hpp:539
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19
int unique_id() const
Definition: rs_frame.hpp:32