rs_processing.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_PROCESSING_HPP
5 #define LIBREALSENSE_RS2_PROCESSING_HPP
6 
7 #include "rs_types.hpp"
8 #include "rs_frame.hpp"
9 #include "rs_options.hpp"
10 
11 namespace rs2
12 {
19  {
20  public:
34  const frame& original,
35  int new_bpp = 0,
36  int new_width = 0,
37  int new_height = 0,
38  int new_stride = 0,
39  rs2_extension frame_type = RS2_EXTENSION_VIDEO_FRAME) const
40  {
41  rs2_error* e = nullptr;
43  original.get(), new_bpp, new_width, new_height, new_stride, frame_type, &e);
44  error::handle(e);
45  return result;
46  }
47 
57  const frame& original,
58  rs2_extension frame_type = RS2_EXTENSION_MOTION_FRAME) const
59  {
60  rs2_error* e = nullptr;
62  original.get(), frame_type, &e);
63  error::handle(e);
64  return result;
65  }
66 
68  const frame& original) const
69  {
70  rs2_error* e = nullptr;
71  auto result = rs2_allocate_points(_source, profile.get(), original.get(), &e);
72  error::handle(e);
73  return result;
74  }
75 
82  frame allocate_composite_frame(std::vector<frame> frames) const
83  {
84  rs2_error* e = nullptr;
85 
86  std::vector<rs2_frame*> refs(frames.size(), (rs2_frame*)nullptr);
87  for (size_t i = 0; i < frames.size(); i++)
88  std::swap(refs[i], frames[i].frame_ref);
89 
90  auto result = rs2_allocate_composite_frame(_source, refs.data(), (int)refs.size(), &e);
91  error::handle(e);
92  return result;
93  }
99  void frame_ready(frame result) const
100  {
101  rs2_error* e = nullptr;
102  rs2_synthetic_frame_ready(_source, result.get(), &e);
103  error::handle(e);
104  result.frame_ref = nullptr;
105  }
106 
108  private:
109  template<class T>
111 
112  frame_source(rs2_source* source) : _source(source) {}
113  frame_source(const frame_source&) = delete;
114 
115  };
116 
117  template<class T>
119  {
121  public:
122  explicit frame_processor_callback(T on_frame) : on_frame_function(on_frame) {}
123 
124  void on_frame(rs2_frame* f, rs2_source * source) override
125  {
126  frame_source src(source);
127  frame frm(f);
128  on_frame_function(std::move(frm), src);
129  }
130 
131  void release() override { delete this; }
132  };
133 
135  {
136  public:
143  explicit frame_queue(unsigned int capacity, bool keep_frames = false) : _capacity(capacity), _keep(keep_frames)
144  {
145  rs2_error* e = nullptr;
146  _queue = std::shared_ptr<rs2_frame_queue>(
147  rs2_create_frame_queue(capacity, &e),
149  error::handle(e);
150  }
151 
153 
158  void enqueue(frame f) const
159  {
160  if (_keep) f.keep();
161  rs2_enqueue_frame(f.frame_ref, _queue.get()); // noexcept
162  f.frame_ref = nullptr; // frame has been essentially moved from
163  }
164 
169  frame wait_for_frame(unsigned int timeout_ms = 5000) const
170  {
171  rs2_error* e = nullptr;
172  auto frame_ref = rs2_wait_for_frame(_queue.get(), timeout_ms, &e);
173  error::handle(e);
174  return{ frame_ref };
175  }
176 
182  template<typename T>
184  {
185  rs2_error* e = nullptr;
186  rs2_frame* frame_ref = nullptr;
187  auto res = rs2_poll_for_frame(_queue.get(), &frame_ref, &e);
188  error::handle(e);
189  frame f{ frame_ref };
190  if (res) *output = f;
191  return res > 0;
192  }
193 
194  template<typename T>
195  typename std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type try_wait_for_frame(T* output, unsigned int timeout_ms = 5000) const
196  {
197  rs2_error* e = nullptr;
198  rs2_frame* frame_ref = nullptr;
199  auto res = rs2_try_wait_for_frame(_queue.get(), timeout_ms, &frame_ref, &e);
200  error::handle(e);
201  frame f{ frame_ref };
202  if (res) *output = f;
203  return res > 0;
204  }
208  void operator()(frame f) const
209  {
210  enqueue(std::move(f));
211  }
216  size_t capacity() const { return _capacity; }
217 
222  bool keep_frames() const { return _keep; }
223 
224  private:
225  std::shared_ptr<rs2_frame_queue> _queue;
226  size_t _capacity;
227  bool _keep;
228  };
229 
233  class processing_block : public options
234  {
235  public:
236  using options::supports;
237 
243  template<class S>
244  void start(S on_frame)
245  {
246  rs2_error* e = nullptr;
247  rs2_start_processing(get(), new frame_callback<S>(on_frame), &e);
248  error::handle(e);
249  }
256  template<class S>
258  {
259  start(on_frame);
260  return on_frame;
261  }
267  void invoke(frame f) const
268  {
269  rs2_frame* ptr = nullptr;
270  std::swap(f.frame_ref, ptr);
271 
272  rs2_error* e = nullptr;
273  rs2_process_frame(get(), ptr, &e);
274  error::handle(e);
275  }
281  processing_block(std::shared_ptr<rs2_processing_block> block)
282  : options((rs2_options*)block.get()), _block(block)
283  {
284  }
285 
291  template<class S>
292  processing_block(S processing_function)
293  {
294  rs2_error* e = nullptr;
295  _block = std::shared_ptr<rs2_processing_block>(
296  rs2_create_processing_block(new frame_processor_callback<S>(processing_function), &e),
298  options::operator=(_block);
299  error::handle(e);
300  }
301 
302  operator rs2_options*() const { return (rs2_options*)get(); }
303  rs2_processing_block* get() const { return _block.get(); }
304 
311  {
312  rs2_error* e = nullptr;
313  auto is_supported = rs2_supports_processing_block_info(_block.get(), info, &e);
314  error::handle(e);
315  return is_supported > 0;
316  }
317 
323  const char* get_info(rs2_camera_info info) const
324  {
325  rs2_error* e = nullptr;
326  auto result = rs2_get_processing_block_info(_block.get(), info, &e);
327  error::handle(e);
328  return result;
329  }
330  protected:
332  rs2_error * e = nullptr;
333  rs2_processing_block_register_simple_option(_block.get(), option_id,
334  range.min, range.max, range.step, range.def, &e);
335  error::handle(e);
336  }
337  std::shared_ptr<rs2_processing_block> _block;
338  };
339 
343  class filter : public processing_block, public filter_interface
344  {
345  public:
353  {
354  invoke(frame);
355  rs2::frame f;
356  if (!_queue.poll_for_frame(&f))
357  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
358  return f;
359  }
360 
366  filter(std::shared_ptr<rs2_processing_block> block, int queue_size = 1)
367  : processing_block(block),
368  _queue(queue_size)
369  {
370  start(_queue);
371  }
372 
378  template<class S>
379  filter(S processing_function, int queue_size = 1) :
380  processing_block(processing_function),
381  _queue(queue_size)
382  {
383  start(_queue);
384  }
385 
386 
387  frame_queue get_queue() { return _queue; }
388  rs2_processing_block* get() const { return _block.get(); }
389 
390  template<class T>
391  bool is() const
392  {
393  T extension(*this);
394  return extension;
395  }
396 
397  template<class T>
398  T as() const
399  {
400  T extension(*this);
401  return extension;
402  }
403 
404  operator bool() const { return _block.get() != nullptr; }
405  protected:
407  };
408 
412  class pointcloud : public filter
413  {
414  public:
418  pointcloud() : filter(init(), 1) {}
419 
421  {
422  set_option(RS2_OPTION_STREAM_FILTER, float(stream));
423  set_option(RS2_OPTION_STREAM_INDEX_FILTER, float(index));
424  }
432  {
433  auto res = process(depth);
434  if (res.as<points>())
435  return res;
436 
437  if (auto set = res.as <frameset>())
438  {
439  for (auto f : set)
440  {
441  if(f.as<points>())
442  return f;
443  }
444  }
445  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
446  }
452  void map_to(frame mapped)
453  {
454  set_option(RS2_OPTION_STREAM_FILTER, float(mapped.get_profile().stream_type()));
455  set_option(RS2_OPTION_STREAM_FORMAT_FILTER, float(mapped.get_profile().format()));
456  set_option(RS2_OPTION_STREAM_INDEX_FILTER, float(mapped.get_profile().stream_index()));
457  process(mapped);
458  }
459 
460  protected:
461  pointcloud(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
462 
463  private:
464  friend class context;
465 
466  std::shared_ptr<rs2_processing_block> init()
467  {
468  rs2_error* e = nullptr;
469 
470  auto block = std::shared_ptr<rs2_processing_block>(
473 
474  error::handle(e);
475 
476  // Redirect options API to the processing block
477  //options::operator=(pb);
478  return block;
479  }
480  };
481 
482  class yuy_decoder : public filter
483  {
484  public:
493  yuy_decoder() : filter(init(), 1) { }
494 
495  protected:
496  yuy_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
497 
498  private:
499  std::shared_ptr<rs2_processing_block> init()
500  {
501  rs2_error* e = nullptr;
502  auto block = std::shared_ptr<rs2_processing_block>(
505  error::handle(e);
506 
507  return block;
508  }
509  };
510 
511  class threshold_filter : public filter
512  {
513  public:
519  threshold_filter(float min_dist = 0.15f, float max_dist = 4.f)
520  : filter(init(), 1)
521  {
522  set_option(RS2_OPTION_MIN_DISTANCE, min_dist);
523  set_option(RS2_OPTION_MAX_DISTANCE, max_dist);
524  }
525 
527  {
528  rs2_error* e = nullptr;
530  {
531  _block.reset();
532  }
533  error::handle(e);
534  }
535 
536  protected:
537  threshold_filter(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
538 
539  private:
540  std::shared_ptr<rs2_processing_block> init()
541  {
542  rs2_error* e = nullptr;
543  auto block = std::shared_ptr<rs2_processing_block>(
546  error::handle(e);
547 
548  return block;
549  }
550  };
551 
552  class units_transform : public filter
553  {
554  public:
559 
560  protected:
561  units_transform(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
562 
563  private:
564  std::shared_ptr<rs2_processing_block> init()
565  {
566  rs2_error* e = nullptr;
567  auto block = std::shared_ptr<rs2_processing_block>(
570  error::handle(e);
571 
572  return block;
573  }
574  };
575 
577  {
578  public:
583 
584  private:
585  std::shared_ptr<rs2_processing_block> init()
586  {
587  rs2_error* e = nullptr;
588  auto block = std::shared_ptr<rs2_processing_block>(
591 
592  error::handle(e);
593  return block;
594  }
595  };
596 
597  class syncer
598  {
599  public:
603  syncer(int queue_size = 1)
604  :_results(queue_size)
605  {
606  _sync.start(_results);
607  }
608 
614  frameset wait_for_frames(unsigned int timeout_ms = 5000) const
615  {
616  return frameset(_results.wait_for_frame(timeout_ms));
617  }
618 
624  bool poll_for_frames(frameset* fs) const
625  {
626  frame result;
627  if (_results.poll_for_frame(&result))
628  {
629  *fs = frameset(result);
630  return true;
631  }
632  return false;
633  }
634 
641  bool try_wait_for_frames(frameset* fs, unsigned int timeout_ms = 5000) const
642  {
643  frame result;
644  if (_results.try_wait_for_frame(&result, timeout_ms))
645  {
646  *fs = frameset(result);
647  return true;
648  }
649  return false;
650  }
651 
652  void operator()(frame f) const
653  {
654  _sync.invoke(std::move(f));
655  }
656  private:
659  };
660 
664  class align : public filter
665  {
666  public:
676  align(rs2_stream align_to) : filter(init(align_to), 1) {}
677 
678  using filter::process;
679 
687  {
688  return filter::process(frames);
689  }
690 
691  protected:
692  align(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
693 
694  private:
695  friend class context;
696  std::shared_ptr<rs2_processing_block> init(rs2_stream align_to)
697  {
698  rs2_error* e = nullptr;
699  auto block = std::shared_ptr<rs2_processing_block>(
700  rs2_create_align(align_to, &e),
702  error::handle(e);
703 
704  return block;
705  }
706  };
707 
708  class colorizer : public filter
709  {
710  public:
715  colorizer() : filter(init(), 1) { }
731  colorizer(float color_scheme) : filter(init(), 1)
732  {
733  set_option(RS2_OPTION_COLOR_SCHEME, float(color_scheme));
734  }
741  {
742  return process(depth);
743  }
744 
745  protected:
746  colorizer(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
747 
748  private:
749  std::shared_ptr<rs2_processing_block> init()
750  {
751  rs2_error* e = nullptr;
752  auto block = std::shared_ptr<rs2_processing_block>(
755  error::handle(e);
756 
757  // Redirect options API to the processing block
758  //options::operator=(pb);
759 
760  return block;
761  }
762  };
763 
764  class decimation_filter : public filter
765  {
766  public:
777  decimation_filter(float magnitude) : filter(init(), 1)
778  {
779  set_option(RS2_OPTION_FILTER_MAGNITUDE, magnitude);
780  }
781 
783  {
784  rs2_error* e = nullptr;
786  {
787  _block.reset();
788  }
789  error::handle(e);
790  }
791 
792  private:
793  friend class context;
794 
795  std::shared_ptr<rs2_processing_block> init()
796  {
797  rs2_error* e = nullptr;
798  auto block = std::shared_ptr<rs2_processing_block>(
801  error::handle(e);
802 
803  // Redirect options API to the processing block
804  //options::operator=(this);
805 
806  return block;
807  }
808  };
809 
810  class temporal_filter : public filter
811  {
812  public:
837  temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control) : filter(init(), 1)
838  {
839  set_option(RS2_OPTION_HOLES_FILL, float(persistence_control));
840  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
841  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
842  }
843 
845  {
846  rs2_error* e = nullptr;
848  {
849  _block.reset();
850  }
851  error::handle(e);
852  }
853  private:
854  friend class context;
855 
856  std::shared_ptr<rs2_processing_block> init()
857  {
858  rs2_error* e = nullptr;
859  auto block = std::shared_ptr<rs2_processing_block>(
862  error::handle(e);
863 
864  // Redirect options API to the processing block
865  //options::operator=(pb);
866 
867  return block;
868  }
869  };
870 
871  class spatial_filter : public filter
872  {
873  public:
881  spatial_filter() : filter(init(), 1) { }
882 
892  spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill) : filter(init(), 1)
893  {
894  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
895  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
896  set_option(RS2_OPTION_FILTER_MAGNITUDE, magnitude);
897  set_option(RS2_OPTION_HOLES_FILL, hole_fill);
898  }
899 
901  {
902  rs2_error* e = nullptr;
904  {
905  _block.reset();
906  }
907  error::handle(e);
908  }
909  private:
910  friend class context;
911 
912  std::shared_ptr<rs2_processing_block> init()
913  {
914  rs2_error* e = nullptr;
915  auto block = std::shared_ptr<rs2_processing_block>(
918  error::handle(e);
919 
920  // Redirect options API to the processing block
921  //options::operator=(pb);
922 
923  return block;
924  }
925  };
926 
928  {
929  public:
934  disparity_transform(bool transform_to_disparity = true) : filter(init(transform_to_disparity), 1) { }
935 
937  {
938  rs2_error* e = nullptr;
940  {
941  _block.reset();
942  }
943  error::handle(e);
944  }
945  private:
946  friend class context;
947  std::shared_ptr<rs2_processing_block> init(bool transform_to_disparity)
948  {
949  rs2_error* e = nullptr;
950  auto block = std::shared_ptr<rs2_processing_block>(
951  rs2_create_disparity_transform_block(uint8_t(transform_to_disparity), &e),
953  error::handle(e);
954 
955  // Redirect options API to the processing block
956  //options::operator=(pb);
957 
958  return block;
959  }
960  };
961 
963  {
964  public:
970  {}
971 
973  {
974  rs2_error* e = nullptr;
976  {
977  _block.reset();
978  }
979  error::handle(e);
980  }
981 
982  private:
983  friend class context;
984 
985  std::shared_ptr<rs2_processing_block> init()
986  {
987  rs2_error* e = nullptr;
988  auto block = std::shared_ptr<rs2_processing_block>(
991  error::handle(e);
992 
993  return block;
994  }
995  };
996 
998  {
999  public:
1004  {}
1005 
1007  {
1008  rs2_error* e = nullptr;
1010  {
1011  _block.reset();
1012  }
1013  error::handle(e);
1014  }
1015 
1016  private:
1017  friend class context;
1018 
1019  std::shared_ptr<rs2_processing_block> init()
1020  {
1021  rs2_error* e = nullptr;
1022  auto block = std::shared_ptr<rs2_processing_block>(
1025  error::handle(e);
1026 
1027  return block;
1028  }
1029  };
1030 
1032  {
1033  public:
1039 
1049  {
1050  set_option(RS2_OPTION_HOLES_FILL, float(mode));
1051  }
1052 
1054  {
1055  rs2_error* e = nullptr;
1057  {
1058  _block.reset();
1059  }
1060  error::handle(e);
1061  }
1062  private:
1063  friend class context;
1064 
1065  std::shared_ptr<rs2_processing_block> init()
1066  {
1067  rs2_error* e = nullptr;
1068  auto block = std::shared_ptr<rs2_processing_block>(
1071  error::handle(e);
1072 
1073  // Redirect options API to the processing block
1074  //options::operator=(_block);
1075 
1076  return block;
1077  }
1078  };
1079 
1080  class rates_printer : public filter
1081  {
1082  public:
1088 
1089  private:
1090  friend class context;
1091 
1092  std::shared_ptr<rs2_processing_block> init()
1093  {
1094  rs2_error* e = nullptr;
1095  auto block = std::shared_ptr<rs2_processing_block>(
1098  error::handle(e);
1099 
1100  return block;
1101  }
1102  };
1103 
1104  class hdr_merge : public filter
1105  {
1106  public:
1113 
1115  {
1116  rs2_error* e = nullptr;
1118  {
1119  _block.reset();
1120  }
1121  error::handle(e);
1122  }
1123 
1124  private:
1125  friend class context;
1126 
1127  std::shared_ptr<rs2_processing_block> init()
1128  {
1129  rs2_error* e = nullptr;
1130  auto block = std::shared_ptr<rs2_processing_block>(
1133  error::handle(e);
1134 
1135  return block;
1136  }
1137  };
1138 
1140  {
1141  public:
1147 
1153  sequence_id_filter(float sequence_id) : filter(init(), 1)
1154  {
1155  set_option(RS2_OPTION_SEQUENCE_ID, sequence_id);
1156  }
1157 
1159  {
1160  rs2_error* e = nullptr;
1162  {
1163  _block.reset();
1164  }
1165  error::handle(e);
1166  }
1167 
1168  private:
1169  friend class context;
1170 
1171  std::shared_ptr<rs2_processing_block> init()
1172  {
1173  rs2_error* e = nullptr;
1174  auto block = std::shared_ptr<rs2_processing_block>(
1177  error::handle(e);
1178 
1179  return block;
1180  }
1181  };
1182 }
1183 #endif // LIBREALSENSE_RS2_PROCESSING_HPP
std::shared_ptr< rs2_processing_block > init()
std::shared_ptr< rs2_processing_block > init(bool transform_to_disparity)
rs2_processing_block * rs2_create_decimation_filter_block(rs2_error **error)
Definition: rs.cpp:2232
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
Definition: rs_sensor.h:22
frame allocate_motion_frame(const stream_profile &profile, const frame &original, rs2_extension frame_type=RS2_EXTENSION_MOTION_FRAME) const
threshold_filter(std::shared_ptr< rs2_processing_block > block)
rs2_processing_block * rs2_create_threshold(rs2_error **error)
Definition: rs.cpp:2199
bool try_wait_for_frames(frameset *fs, unsigned int timeout_ms=5000) const
std::shared_ptr< rs2_processing_block > _block
rs2_frame * rs2_allocate_composite_frame(rs2_source *source, rs2_frame **frames, int count, rs2_error **error)
Definition: rs.cpp:2127
rs2_frame * get() const
Definition: rs_frame.hpp:590
asynchronous_syncer _sync
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
rs2_processing_block * rs2_create_zero_order_invalidation_block(rs2_error **error)
Definition: rs.cpp:2280
rs2_frame * rs2_allocate_points(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, rs2_error **error)
Definition: rs.cpp:1732
rs2_processing_block * rs2_create_units_transform(rs2_error **error)
Definition: rs.cpp:2205
void rs2_start_processing(rs2_processing_block *block, rs2_frame_callback *on_frame, rs2_error **error)
Definition: rs.cpp:2070
std::shared_ptr< rs2_processing_block > init()
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
Definition: rs.cpp:1058
std::shared_ptr< rs2_processing_block > init()
align(std::shared_ptr< rs2_processing_block > block)
void on_frame(rs2_frame *f, rs2_source *source) override
size_t capacity() const
rs2_processing_block * rs2_create_hole_filling_filter_block(rs2_error **error)
Definition: rs.cpp:2264
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
rs2_processing_block * rs2_create_sync_processing_block(rs2_error **error)
Definition: rs.cpp:2062
GLfloat value
video_frame colorize(frame depth) const
stream_profile get_profile() const
Definition: rs_frame.hpp:557
void enqueue(frame f) const
void register_simple_option(rs2_option option_id, option_range range)
static float max_dist
Definition: rs-kinfu.cpp:16
void operator()(frame f) const
std::shared_ptr< rs2_processing_block > init()
frame wait_for_frame(unsigned int timeout_ms=5000) const
std::function< void(frame_interface *)> on_frame
Definition: streaming.h:164
pointcloud(rs2_stream stream, int index=0)
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
Definition: rs.cpp:2023
units_transform(std::shared_ptr< rs2_processing_block > block)
GLint GLint GLsizei GLsizei GLsizei depth
void rs2_delete_frame_queue(rs2_frame_queue *queue)
Definition: rs.cpp:1036
bool supports(rs2_camera_info info) const
void map_to(frame mapped)
Definition: cah-model.h:10
frame allocate_points(const stream_profile &profile, const frame &original) const
rs2_frame_queue * rs2_create_frame_queue(int capacity, rs2_error **error)
Definition: rs.cpp:1030
rs2_frame * rs2_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_error **error)
Definition: rs.cpp:1043
void rs2_process_frame(rs2_processing_block *block, rs2_frame *frame, rs2_error **error)
Definition: rs.cpp:2097
GLuint GLuint stream
Definition: glext.h:1790
GLenum src
Definition: glext.h:1751
unsigned char uint8_t
Definition: stdint.h:78
frame_queue _queue
e
Definition: rmse.py:177
colorizer(float color_scheme)
rs2_processing_block * rs2_create_huffman_depth_decompress_block(rs2_error **error)
Definition: rs.cpp:2288
std::shared_ptr< rs2_processing_block > init()
int rs2_processing_block_register_simple_option(rs2_processing_block *block, rs2_option option_id, float min, float max, float step, float def, rs2_error **error)
Definition: rs.cpp:2046
void frame_ready(frame result) const
processing_block(std::shared_ptr< rs2_processing_block > block)
threshold_filter(float min_dist=0.15f, float max_dist=4.f)
rs2_frame * frame_ref
Definition: rs_frame.hpp:628
bool keep_frames() const
frameset wait_for_frames(unsigned int timeout_ms=5000) const
GLuint index
std::shared_ptr< rs2_processing_block > init()
rs2_processing_block * rs2_create_rates_printer_block(rs2_error **error)
Definition: rs.cpp:2272
frame allocate_video_frame(const stream_profile &profile, const frame &original, int new_bpp=0, int new_width=0, int new_height=0, int new_stride=0, rs2_extension frame_type=RS2_EXTENSION_VIDEO_FRAME) const
def info(name, value, persistent=False)
Definition: test.py:301
align(rs2_stream align_to)
rs2_frame * rs2_allocate_synthetic_video_frame(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, int new_bpp, int new_width, int new_height, int new_stride, rs2_extension frame_type, rs2_error **error)
Definition: rs.cpp:1704
GLdouble f
rs2_processing_block * rs2_create_align(rs2_stream align_to, rs2_error **error)
Definition: rs.cpp:2211
rs2::frame process(rs2::frame frame) const override
GLenum mode
std::shared_ptr< rs2_processing_block > init()
static float min_dist
Definition: rs-kinfu.cpp:17
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
Definition: rs.cpp:2187
temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control)
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
Definition: rs.cpp:1092
frameset process(frameset frames)
std::shared_ptr< rs2_processing_block > init()
frame_queue get_queue()
processing_block(S processing_function)
int rs2_supports_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
Definition: rs.cpp:2807
decimation_filter(float magnitude)
points calculate(frame depth) const
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
Definition: rs.cpp:1745
frame allocate_composite_frame(std::vector< frame > frames) const
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type try_wait_for_frame(T *output, unsigned int timeout_ms=5000) const
S & operator>>(S &on_frame)
frame_source(rs2_source *source)
void init(void)
Definition: boing.c:180
GLuint start
BOOST_DEDUCED_TYPENAME optional< T >::reference_const_type get(optional< T > const &opt)
void rs2_delete_processing_block(rs2_processing_block *block)
Definition: rs.cpp:2106
filter(S processing_function, int queue_size=1)
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
Definition: rs.cpp:2240
std::shared_ptr< rs2_processing_block > init()
void keep()
Definition: rs_frame.hpp:437
void start(S on_frame)
int stream_index() const
Definition: rs_frame.hpp:34
void operator()(frame f) const
syncer(int queue_size=1)
bool supports(rs2_option option) const
Definition: rs_options.hpp:19
void swap(nlohmann::json &j1, nlohmann::json &j2) noexcept(is_nothrow_move_constructible< nlohmann::json >::value andis_nothrow_move_assignable< nlohmann::json >::value)
exchanges the values of two JSON objects
Definition: json.hpp:12141
static void handle(rs2_error *e)
Definition: rs_types.hpp:144
rs2_processing_block * rs2_create_disparity_transform_block(unsigned char transform_to_disparity, rs2_error **error)
Definition: rs.cpp:2256
rs2_processing_block * rs2_create_colorizer(rs2_error **error)
Definition: rs.cpp:2221
frame_queue _results
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
bool poll_for_frames(frameset *fs) const
std::shared_ptr< rs2_processing_block > init()
std::shared_ptr< rs2_processing_block > init(rs2_stream align_to)
std::shared_ptr< rs2_processing_block > init()
rs2_processing_block * rs2_create_sequence_id_filter(rs2_error **error)
Definition: rs.cpp:2304
T as() const
std::shared_ptr< rs2_processing_block > init()
rs2_format format() const
Definition: rs_frame.hpp:44
yuy_decoder(std::shared_ptr< rs2_processing_block > block)
filter(std::shared_ptr< rs2_processing_block > block, int queue_size=1)
rs2_frame * rs2_allocate_synthetic_motion_frame(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, rs2_extension frame_type, rs2_error **error)
Definition: rs.cpp:1718
std::shared_ptr< rs2_processing_block > init()
rs2_processing_block * rs2_create_yuy_decoder(rs2_error **error)
Definition: rs.cpp:2193
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:166
const char * get_info(rs2_camera_info info) const
GLenum type
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
sequence_id_filter(float sequence_id)
void invoke(frame f) const
std::shared_ptr< rs2_processing_block > init()
spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill)
rs2_processing_block * rs2_create_spatial_filter_block(rs2_error **error)
Definition: rs.cpp:2248
rs2_source * _source
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
options & operator=(const options &other)
Definition: rs_options.hpp:134
GLsizei GLsizei GLchar * source
rs2_processing_block * get() const
frame_queue(unsigned int capacity, bool keep_frames=false)
GLsizei range
bool is() const
int i
GLuint res
Definition: glext.h:8856
int rs2_try_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_frame **output_frame, rs2_error **error)
Definition: rs.cpp:1075
int rs2_is_processing_block_extendable_to(const rs2_processing_block *block, rs2_extension extension_type, rs2_error **error)
Definition: rs.cpp:1481
const char * rs2_get_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
Definition: rs.cpp:2795
rs2_stream stream_type() const
Definition: rs_frame.hpp:39
std::shared_ptr< rs2_processing_block > init()
std::shared_ptr< rs2_frame_queue > _queue
GLuint64EXT * result
Definition: glext.h:10921
colorizer(std::shared_ptr< rs2_processing_block > block)
pointcloud(std::shared_ptr< rs2_processing_block > block)
rs2_processing_block * rs2_create_hdr_merge_processing_block(rs2_error **error)
Definition: rs.cpp:2296
struct rs2_frame rs2_frame
Definition: rs_types.h:261
disparity_transform(bool transform_to_disparity=true)


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:40