Intel® RealSense™ Cross Platform API
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:
27  stream_profile() : _profile(nullptr) {}
28 
33  int stream_index() const { return _index; }
38  rs2_stream stream_type() const { return _type; }
43  rs2_format format() const { return _format; }
48  int fps() const { return _framerate; }
53  int unique_id() const { return _uid; }
54 
63  {
64  rs2_error* e = nullptr;
65  auto ref = rs2_clone_stream_profile(_profile, type, index, format, &e);
66  error::handle(e);
67  stream_profile res(ref);
68  res._clone = std::shared_ptr<rs2_stream_profile>(ref, [](rs2_stream_profile* r) { rs2_delete_stream_profile(r); });
69 
70  return res;
71  }
72 
78  bool operator==(const stream_profile& rhs)
79  {
80  return stream_index() == rhs.stream_index()&&
81  stream_type() == rhs.stream_type()&&
82  format() == rhs.format()&&
83  fps() == rhs.fps();
84  }
85 
90  template<class T>
91  bool is() const
92  {
93  T extension(*this);
94  return extension;
95  }
96 
101  template<class T>
102  T as() const
103  {
104  T extension(*this);
105  return extension;
106  }
107 
112  std::string stream_name() const
113  {
114  std::stringstream ss;
116  if (stream_index() != 0) ss << " " << stream_index();
117  return ss.str();
118  }
119 
124  bool is_default() const { return _default; }
125 
130  operator bool() const { return _profile != nullptr; }
131 
136  const rs2_stream_profile* get() const { return _profile; }
137 
142  operator const rs2_stream_profile*()
143  {
144  return _profile;
145  }
152  {
153  rs2_error* e = nullptr;
154  rs2_extrinsics res;
155  rs2_get_extrinsics(get(), to.get(), &res, &e);
156  error::handle(e);
157  return res;
158  }
166  {
167  rs2_error* e = nullptr;
168  rs2_register_extrinsics(get(), to.get(), extrinsics, &e);
169  error::handle(e);
170  }
171 
172  protected:
173  friend class rs2::sensor;
174  friend class rs2::frame;
175  friend class rs2::pipeline_profile;
176  friend class software_sensor;
177 
178  explicit stream_profile(const rs2_stream_profile* profile) : _profile(profile)
179  {
180  rs2_error* e = nullptr;
182  error::handle(e);
183 
185  error::handle(e);
186 
187  }
188 
190  std::shared_ptr<rs2_stream_profile> _clone;
191 
192  int _index = 0;
193  int _uid = 0;
194  int _framerate = 0;
197 
198  bool _default = false;
199  };
200 
202  {
203  public:
209  : stream_profile(sp)
210  {
211  rs2_error* e = nullptr;
212  if ((rs2_stream_profile_is(sp.get(), RS2_EXTENSION_VIDEO_PROFILE, &e) == 0 && !e))
213  {
214  _profile = nullptr;
215  }
216  error::handle(e);
217 
218  if (_profile)
219  {
220  rs2_get_video_stream_resolution(_profile, &_width, &_height, &e);
221  error::handle(e);
222  }
223  }
224 
225  int width() const
226  {
227  return _width;
228  }
229 
230  int height() const
231  {
232  return _height;
233  }
239  {
240  rs2_error* e = nullptr;
241  rs2_intrinsics intr;
243  error::handle(e);
244  return intr;
245  }
246 
247  private:
248  int _width = 0;
249  int _height = 0;
250  };
251 
252 
254  {
255  public:
261  : stream_profile(sp)
262  {
263  rs2_error* e = nullptr;
264  if ((rs2_stream_profile_is(sp.get(), RS2_EXTENSION_MOTION_PROFILE, &e) == 0 && !e))
265  {
266  _profile = nullptr;
267  }
268  error::handle(e);
269  }
270 
276 
277  {
278  rs2_error* e = nullptr;
280  rs2_get_motion_intrinsics(_profile, &intrin, &e);
281  error::handle(e);
282  return intrin;
283  }
284  };
285 
286  class frame
287  {
288  public:
292  frame() : frame_ref(nullptr) {}
297  frame(rs2_frame* frame_ref) : frame_ref(frame_ref)
298  {
299 #ifdef _DEBUG
300  if (frame_ref)
301  {
302  rs2_error* e = nullptr;
303  auto r = rs2_get_frame_number(frame_ref, &e);
304  if (!e)
305  frame_number = r;
306  auto s = rs2_get_frame_stream_profile(frame_ref, &e);
307  if (!e)
308  profile = stream_profile(s);
309  }
310  else
311  {
312  frame_number = 0;
313  profile = stream_profile();
314  }
315 #endif
316  }
321  frame(frame&& other) noexcept : frame_ref(other.frame_ref)
322  {
323  other.frame_ref = nullptr;
324 #ifdef _DEBUG
325  frame_number = other.frame_number;
326  profile = other.profile;
327 #endif
328  }
334  {
335  swap(other);
336  return *this;
337  }
342  frame(const frame& other)
343  : frame_ref(other.frame_ref)
344  {
345  if (frame_ref) add_ref();
346 #ifdef _DEBUG
347  frame_number = other.frame_number;
348  profile = other.profile;
349 #endif
350  }
355  void swap(frame& other)
356  {
357  std::swap(frame_ref, other.frame_ref);
358 
359 #ifdef _DEBUG
360  std::swap(frame_number, other.frame_number);
361  std::swap(profile, other.profile);
362 #endif
363  }
364 
369  {
370  if (frame_ref)
371  {
372  rs2_release_frame(frame_ref);
373  }
374  }
375 
379  void keep() { rs2_keep_frame(frame_ref); }
380 
385  operator bool() const { return frame_ref != nullptr; }
386 
391  double get_timestamp() const
392  {
393  rs2_error* e = nullptr;
394  auto r = rs2_get_frame_timestamp(frame_ref, &e);
395  error::handle(e);
396  return r;
397  }
398 
403  {
404  rs2_error* e = nullptr;
405  auto r = rs2_get_frame_timestamp_domain(frame_ref, &e);
406  error::handle(e);
407  return r;
408  }
409 
415  {
416  rs2_error* e = nullptr;
417  auto r = rs2_get_frame_metadata(frame_ref, frame_metadata, &e);
418  error::handle(e);
419  return r;
420  }
421 
427  {
428  rs2_error* e = nullptr;
429  auto r = rs2_supports_frame_metadata(frame_ref, frame_metadata, &e);
430  error::handle(e);
431  return r != 0;
432  }
433 
438  unsigned long long get_frame_number() const
439  {
440  rs2_error* e = nullptr;
441  auto r = rs2_get_frame_number(frame_ref, &e);
442  error::handle(e);
443  return r;
444  }
445 
450  const void* get_data() const
451  {
452  rs2_error* e = nullptr;
453  auto r = rs2_get_frame_data(frame_ref, &e);
454  error::handle(e);
455  return r;
456  }
457 
463  {
464  rs2_error* e = nullptr;
465  auto s = rs2_get_frame_stream_profile(frame_ref, &e);
466  error::handle(e);
467  return stream_profile(s);
468  }
469 
474  template<class T>
475  bool is() const
476  {
477  T extension(*this);
478  return extension;
479  }
484  template<class T>
485  T as() const
486  {
487  T extension(*this);
488  return extension;
489  }
490 
495  rs2_frame* get() const { return frame_ref; }
496 
497  protected:
503  void add_ref() const
504  {
505  rs2_error* e = nullptr;
506  rs2_frame_add_ref(frame_ref, &e);
507  error::handle(e);
508  }
509 
510  void reset()
511  {
512  if (frame_ref)
513  {
514  rs2_release_frame(frame_ref);
515  }
516  frame_ref = nullptr;
517  }
518 
519  private:
520  friend class rs2::frame_source;
521  friend class rs2::frame_queue;
522  friend class rs2::syncer;
523  friend class rs2::processing_block;
524  friend class rs2::pointcloud;
525  friend class rs2::points;
526 
527  rs2_frame* frame_ref;
528 
529 #ifdef _DEBUG
530  stream_profile profile;
531  unsigned long long frame_number = 0;
532 #endif
533  };
534 
535  class video_frame : public frame
536  {
537  public:
542  video_frame(const frame& f)
543  : frame(f)
544  {
545  rs2_error* e = nullptr;
546  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_VIDEO_FRAME, &e) == 0 && !e))
547  {
548  reset();
549  }
550  error::handle(e);
551  }
552 
553 
558  int get_width() const
559  {
560  rs2_error* e = nullptr;
561  auto r = rs2_get_frame_width(get(), &e);
562  error::handle(e);
563  return r;
564  }
565 
570  int get_height() const
571  {
572  rs2_error* e = nullptr;
573  auto r = rs2_get_frame_height(get(), &e);
574  error::handle(e);
575  return r;
576  }
577 
583  {
584  rs2_error* e = nullptr;
585  auto r = rs2_get_frame_stride_in_bytes(get(), &e);
586  error::handle(e);
587  return r;
588  }
589 
594  int get_bits_per_pixel() const
595  {
596  rs2_error* e = nullptr;
597  auto r = rs2_get_frame_bits_per_pixel(get(), &e);
598  error::handle(e);
599  return r;
600  }
601 
606  int get_bytes_per_pixel() const { return get_bits_per_pixel() / 8; }
607  };
608 
609  struct vertex {
610  float x, y, z;
611  operator const float*() const { return &x; }
612  };
614  float u, v;
615  operator const float*() const { return &u; }
616  };
617 
618  class points : public frame
619  {
620  public:
624  points() : frame(), _size(0) {}
625 
630  points(const frame& f)
631  : frame(f), _size(0)
632  {
633  rs2_error* e = nullptr;
634  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_POINTS, &e) == 0 && !e))
635  {
636  reset();
637  }
638  error::handle(e);
639 
640  if (get())
641  {
642  rs2_error* e = nullptr;
643  _size = rs2_get_frame_points_count(get(), &e);
644  error::handle(e);
645  }
646  }
651  const vertex* get_vertices() const
652  {
653  rs2_error* e = nullptr;
654  auto res = rs2_get_frame_vertices(get(), &e);
655  error::handle(e);
656  return (const vertex*)res;
657  }
658 
664  void export_to_ply(const std::string& fname, video_frame texture)
665  {
666  rs2_frame* ptr = nullptr;
667  std::swap(texture.frame_ref, ptr);
668  rs2_error* e = nullptr;
669  rs2_export_to_ply(get(), fname.c_str(), ptr, &e);
670  error::handle(e);
671  }
677  {
678  rs2_error* e = nullptr;
679  auto res = rs2_get_frame_texture_coordinates(get(), &e);
680  error::handle(e);
681  return (const texture_coordinate*)res;
682  }
683 
684  size_t size() const
685  {
686  return _size;
687  }
688 
689  private:
690  size_t _size;
691  };
692 
693  class depth_frame : public video_frame
694  {
695  public:
700  depth_frame(const frame& f)
701  : video_frame(f)
702  {
703  rs2_error* e = nullptr;
704  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_DEPTH_FRAME, &e) == 0 && !e))
705  {
706  reset();
707  }
708  error::handle(e);
709  }
710 
717  float get_distance(int x, int y) const
718  {
719  rs2_error * e = nullptr;
720  auto r = rs2_depth_frame_get_distance(get(), x, y, &e);
721  error::handle(e);
722  return r;
723  }
724  };
725 
727  {
728  public:
734  : depth_frame(f)
735  {
736  rs2_error* e = nullptr;
737  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_DISPARITY_FRAME, &e) == 0 && !e))
738  {
739  reset();
740  }
741  error::handle(e);
742  }
747  float get_baseline(void) const
748  {
749  rs2_error * e = nullptr;
750  auto r = rs2_depth_stereo_frame_get_baseline(get(), &e);
751  error::handle(e);
752  return r;
753  }
754  };
755 
756  class motion_frame : public frame
757  {
758  public:
763  motion_frame(const frame& f)
764  : frame(f)
765  {
766  rs2_error* e = nullptr;
767  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_MOTION_FRAME, &e) == 0 && !e))
768  {
769  reset();
770  }
771  error::handle(e);
772  }
778  {
779  auto data = reinterpret_cast<const float*>(get_data());
780  return rs2_vector{data[0], data[1], data[2]};
781  }
782  };
783 
784  class pose_frame : public frame
785  {
786  public:
791  pose_frame(const frame& f)
792  : frame(f)
793  {
794  rs2_error* e = nullptr;
795  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_POSE_FRAME, &e) == 0 && !e))
796  {
797  reset();
798  }
799  error::handle(e);
800  }
806  {
807  rs2_pose pose_data;
808  rs2_error* e = nullptr;
809  rs2_pose_frame_get_pose_data(get(), &pose_data, &e);
810  error::handle(e);
811  return pose_data;
812  }
813  };
814 
815  class frameset : public frame
816  {
817  public:
821  frameset() :_size(0) {};
826  frameset(const frame& f)
827  : frame(f), _size(0)
828  {
829  rs2_error* e = nullptr;
830  if (!f || (rs2_is_frame_extendable_to(f.get(), RS2_EXTENSION_COMPOSITE_FRAME, &e) == 0 && !e))
831  {
832  reset();
833  // TODO - consider explicit constructor to move resultion to compile time
834  }
835  error::handle(e);
836 
837  if (get())
838  {
839  rs2_error* e = nullptr;
840  _size = rs2_embedded_frames_count(get(), &e);
841  error::handle(e);
842  }
843  }
844 
851  {
852  frame result;
853  foreach([&result, s](frame f) {
854  if (!result && f.get_profile().stream_type() == s)
855  {
856  result = std::move(f);
857  }
858  });
859  return result;
860  }
867  {
868  auto f = first_or_default(s);
869  if (!f) throw error("Frame of requested stream type was not found!");
870  return f;
871  }
872 
878  {
880  return f.as<depth_frame>();
881  }
887  {
889 
890  if (!f)
891  {
893  if (ir && ir.get_profile().format() == RS2_FORMAT_RGB8)
894  f = ir;
895  }
896  return f;
897  }
903  video_frame get_infrared_frame(const size_t index = 0) const
904  {
905  frame f;
906  if (!index)
907  {
909  }
910  else
911  {
912  foreach([&f, index](const frame& frame) {
914  f = frame;
915  });
916  }
917  return f;
918  }
923  size_t size() const
924  {
925  return _size;
926  }
927 
932  template<class T>
933  void foreach(T action) const
934  {
935  rs2_error* e = nullptr;
936  auto count = size();
937  for (size_t i = 0; i < count; i++)
938  {
939  auto fref = rs2_extract_frame(get(), (int)i, &e);
940  error::handle(e);
941 
942  action(frame(fref));
943  }
944  }
950  frame operator[](size_t index) const
951  {
952  rs2_error* e = nullptr;
953  if (index < size())
954  {
955  auto fref = rs2_extract_frame(get(), (int)index, &e);
956  error::handle(e);
957  return frame(fref);
958  }
959 
960  throw error("Requested index is out of range!");
961  }
962 
963  class iterator
964  {
965  public:
966  iterator(const frameset* owner, size_t index = 0) : _index(index), _owner(owner) {}
967  iterator& operator++() { ++_index; return *this; }
968  bool operator==(const iterator& other) const { return _index == other._index; }
969  bool operator!=(const iterator& other) const { return !(*this == other); }
970 
971  frame operator*() { return (*_owner)[_index]; }
972  private:
973  size_t _index = 0;
974  const frameset* _owner;
975  };
976 
977  iterator begin() const { return iterator(this); }
978  iterator end() const { return iterator(this, size()); }
979  private:
980  size_t _size;
981  };
982 
983 
984 }
985 #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:253
iterator begin() const
Definition: rs_frame.hpp:977
Definition: rs_frame.hpp:21
int get_bytes_per_pixel() const
Definition: rs_frame.hpp:606
depth_frame(const frame &f)
Definition: rs_frame.hpp:700
Definition: rs_frame.hpp:535
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:286
void add_ref() const
Definition: rs_frame.hpp:503
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:805
rs2_motion_device_intrinsic get_motion_intrinsics() const
Definition: rs_frame.hpp:275
int _uid
Definition: rs_frame.hpp:193
rs2_vector get_motion_data()
Definition: rs_frame.hpp:777
stream_profile()
Definition: rs_frame.hpp:27
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:43
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:618
void register_extrinsics_to(const stream_profile &to, rs2_extrinsics extrinsics)
Definition: rs_frame.hpp:165
frame operator*()
Definition: rs_frame.hpp:971
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:112
frameset()
Definition: rs_frame.hpp:821
float y
Definition: rs_frame.hpp:610
int _index
Definition: rs_frame.hpp:192
Definition: rs_types.h:107
frame(frame &&other) noexcept
Definition: rs_frame.hpp:321
Definition: rs_frame.hpp:815
bool is() const
Definition: rs_frame.hpp:91
void export_to_ply(const std::string &fname, video_frame texture)
Definition: rs_frame.hpp:664
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:391
bool is() const
Definition: rs_frame.hpp:475
size_t size() const
Definition: rs_frame.hpp:684
float u
Definition: rs_frame.hpp:614
video_frame get_color_frame() const
Definition: rs_frame.hpp:886
int rs2_supports_frame_metadata(const rs2_frame *frame, rs2_frame_metadata_value frame_metadata, rs2_error **error)
Definition: rs_processing.hpp:107
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:610
int fps() const
Definition: rs_frame.hpp:48
frame first(rs2_stream s) const
Definition: rs_frame.hpp:866
void reset()
Definition: rs_frame.hpp:510
iterator & operator++()
Definition: rs_frame.hpp:967
Definition: rs_sensor.h:42
rs2_extrinsics get_extrinsics_to(const stream_profile &to) const
Definition: rs_frame.hpp:151
int rs2_get_frame_height(const rs2_frame *frame, rs2_error **error)
std::shared_ptr< rs2_stream_profile > _clone
Definition: rs_frame.hpp:190
pose_frame(const frame &f)
Definition: rs_frame.hpp:791
void swap(frame &other)
Definition: rs_frame.hpp:355
Definition: rs_types.h:115
Definition: rs_frame.hpp:963
frame & operator=(frame other)
Definition: rs_frame.hpp:333
Definition: rs_sensor.h:62
Definition: rs_frame.hpp:756
int rs2_get_frame_stride_in_bytes(const rs2_frame *frame, rs2_error **error)
const rs2_stream_profile * _profile
Definition: rs_frame.hpp:189
video_frame(const frame &f)
Definition: rs_frame.hpp:542
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:624
float get_distance(int x, int y) const
Definition: rs_frame.hpp:717
Definition: rs_processing.hpp:17
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:194
Definition: rs_types.h:108
motion_frame(const frame &f)
Definition: rs_frame.hpp:763
~frame()
Definition: rs_frame.hpp:368
int rs2_get_frame_width(const rs2_frame *frame, rs2_error **error)
Definition: rs_internal.hpp:73
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:950
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:195
void rs2_delete_stream_profile(rs2_stream_profile *mode)
motion_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:260
Definition: rs_types.h:114
rs2_timestamp_domain get_frame_timestamp_domain() const
Definition: rs_frame.hpp:402
T as() const
Definition: rs_frame.hpp:102
T as() const
Definition: rs_frame.hpp:485
video_stream_profile(const stream_profile &sp)
Definition: rs_frame.hpp:208
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:277
bool is_default() const
Definition: rs_frame.hpp:124
void keep()
Definition: rs_frame.hpp:379
unsigned long long rs2_get_frame_number(const rs2_frame *frame, rs2_error **error)
int stream_index() const
Definition: rs_frame.hpp:33
video_frame get_infrared_frame(const size_t index=0) const
Definition: rs_frame.hpp:903
const texture_coordinate * get_texture_coordinates() const
Definition: rs_frame.hpp:676
int get_bits_per_pixel() const
Definition: rs_frame.hpp:594
bool operator==(const iterator &other) const
Definition: rs_frame.hpp:968
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:570
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:136
bool _default
Definition: rs_frame.hpp:198
Definition: rs_frame.hpp:726
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:438
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:978
iterator(const frameset *owner, size_t index=0)
Definition: rs_frame.hpp:966
3D vector in Euclidean coordinate space
Definition: rs_frame.h:79
int get_width() const
Definition: rs_frame.hpp:558
const void * get_data() const
Definition: rs_frame.hpp:450
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:630
Definition: rs_types.h:111
int get_stride_in_bytes() const
Definition: rs_frame.hpp:582
rs2_vertex * rs2_get_frame_vertices(const rs2_frame *frame, rs2_error **error)
disparity_frame(const frame &f)
Definition: rs_frame.hpp:733
frame first_or_default(rs2_stream s) const
Definition: rs_frame.hpp:850
int width() const
Definition: rs_frame.hpp:225
void rs2_frame_add_ref(rs2_frame *frame, rs2_error **error)
Video stream intrinsics.
Definition: rs_types.h:56
Definition: rs_processing.hpp:368
int height() const
Definition: rs_frame.hpp:230
bool operator!=(const iterator &other) const
Definition: rs_frame.hpp:969
bool operator==(const stream_profile &rhs)
Definition: rs_frame.hpp:78
Motion device intrinsics: scale, bias, and variances.
Definition: rs_types.h:69
depth_frame get_depth_frame() const
Definition: rs_frame.hpp:877
Definition: rs_processing.hpp:187
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:178
void rs2_release_frame(rs2_frame *frame)
rs2_metadata_type get_frame_metadata(rs2_frame_metadata_value frame_metadata) const
Definition: rs_frame.hpp:414
frameset(const frame &f)
Definition: rs_frame.hpp:826
Definition: rs_frame.hpp:613
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
size_t size() const
Definition: rs_frame.hpp:923
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:426
rs2_stream stream_type() const
Definition: rs_frame.hpp:38
float x
Definition: rs_frame.hpp:610
Definition: rs_frame.hpp:201
Definition: rs_frame.hpp:784
frame(const frame &other)
Definition: rs_frame.hpp:342
rs2_intrinsics get_intrinsics() const
Definition: rs_frame.hpp:238
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:297
rs2_frame * get() const
Definition: rs_frame.hpp:495
void rs2_pose_frame_get_pose_data(const rs2_frame *frame, rs2_pose *pose, rs2_error **error)
frame()
Definition: rs_frame.hpp:292
float v
Definition: rs_frame.hpp:614
stream_profile clone(rs2_stream type, int index, rs2_format format) const
Definition: rs_frame.hpp:62
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:747
rs2_stream _type
Definition: rs_frame.hpp:196
Definition: rs_frame.hpp:609
stream_profile get_profile() const
Definition: rs_frame.hpp:462
const vertex * get_vertices() const
Definition: rs_frame.hpp:651
Definition: rs_frame.hpp:693
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:53