Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
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;
42  auto result = rs2_allocate_synthetic_video_frame(_source, profile.get(),
43  original.get(), new_bpp, new_width, new_height, new_stride, frame_type, &e);
44  error::handle(e);
45  return result;
46  }
47 
49  const frame& original) const
50  {
51  rs2_error* e = nullptr;
52  auto result = rs2_allocate_points(_source, profile.get(), original.get(), &e);
53  error::handle(e);
54  return result;
55  }
56 
63  frame allocate_composite_frame(std::vector<frame> frames) const
64  {
65  rs2_error* e = nullptr;
66 
67  std::vector<rs2_frame*> refs(frames.size(), (rs2_frame*)nullptr);
68  for (size_t i = 0; i < frames.size(); i++)
69  std::swap(refs[i], frames[i].frame_ref);
70 
71  auto result = rs2_allocate_composite_frame(_source, refs.data(), (int)refs.size(), &e);
72  error::handle(e);
73  return result;
74  }
80  void frame_ready(frame result) const
81  {
82  rs2_error* e = nullptr;
83  rs2_synthetic_frame_ready(_source, result.get(), &e);
84  error::handle(e);
85  result.frame_ref = nullptr;
86  }
87 
89  private:
90  template<class T>
92 
93  frame_source(rs2_source* source) : _source(source) {}
94  frame_source(const frame_source&) = delete;
95 
96  };
97 
98  template<class T>
100  {
101  T on_frame_function;
102  public:
103  explicit frame_processor_callback(T on_frame) : on_frame_function(on_frame) {}
104 
105  void on_frame(rs2_frame* f, rs2_source * source) override
106  {
107  frame_source src(source);
108  frame frm(f);
109  on_frame_function(std::move(frm), src);
110  }
111 
112  void release() override { delete this; }
113  };
114 
116  {
117  public:
123  explicit frame_queue(unsigned int capacity) : _capacity(capacity)
124  {
125  rs2_error* e = nullptr;
126  _queue = std::shared_ptr<rs2_frame_queue>(
129  error::handle(e);
130  }
131 
133 
138  void enqueue(frame f) const
139  {
140  rs2_enqueue_frame(f.frame_ref, _queue.get()); // noexcept
141  f.frame_ref = nullptr; // frame has been essentially moved from
142  }
143 
148  frame wait_for_frame(unsigned int timeout_ms = 5000) const
149  {
150  rs2_error* e = nullptr;
151  auto frame_ref = rs2_wait_for_frame(_queue.get(), timeout_ms, &e);
152  error::handle(e);
153  return{ frame_ref };
154  }
155 
161  template<typename T>
162  typename std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type poll_for_frame(T* output) const
163  {
164  rs2_error* e = nullptr;
165  rs2_frame* frame_ref = nullptr;
166  auto res = rs2_poll_for_frame(_queue.get(), &frame_ref, &e);
167  error::handle(e);
168  frame f{ frame_ref };
169  if (res) *output = f;
170  return res > 0;
171  }
172 
173  template<typename T>
174  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
175  {
176  rs2_error* e = nullptr;
177  rs2_frame* frame_ref = nullptr;
178  auto res = rs2_try_wait_for_frame(_queue.get(), timeout_ms, &frame_ref, &e);
179  error::handle(e);
180  frame f{ frame_ref };
181  if (res) *output = f;
182  return res > 0;
183  }
187  void operator()(frame f) const
188  {
189  enqueue(std::move(f));
190  }
195  size_t capacity() const { return _capacity; }
196 
197  private:
198  std::shared_ptr<rs2_frame_queue> _queue;
199  size_t _capacity;
200  };
201 
205  class processing_block : public options
206  {
207  public:
208  using options::supports;
209 
215  template<class S>
216  void start(S on_frame)
217  {
218  rs2_error* e = nullptr;
219  rs2_start_processing(get(), new frame_callback<S>(on_frame), &e);
220  error::handle(e);
221  }
228  template<class S>
229  S& operator>>(S& on_frame)
230  {
231  start(on_frame);
232  return on_frame;
233  }
239  void invoke(frame f) const
240  {
241  rs2_frame* ptr = nullptr;
242  std::swap(f.frame_ref, ptr);
243 
244  rs2_error* e = nullptr;
245  rs2_process_frame(get(), ptr, &e);
246  error::handle(e);
247  }
253  processing_block(std::shared_ptr<rs2_processing_block> block)
254  : options((rs2_options*)block.get()), _block(block)
255  {
256  }
257 
263  template<class S>
264  processing_block(S processing_function)
265  {
266  rs2_error* e = nullptr;
267  _block = std::shared_ptr<rs2_processing_block>(
268  rs2_create_processing_block(new frame_processor_callback<S>(processing_function), &e),
271  error::handle(e);
272  }
273 
274  operator rs2_options*() const { return (rs2_options*)get(); }
275  rs2_processing_block* get() const { return _block.get(); }
276 
282  bool supports(rs2_camera_info info) const
283  {
284  rs2_error* e = nullptr;
285  auto is_supported = rs2_supports_processing_block_info(_block.get(), info, &e);
286  error::handle(e);
287  return is_supported > 0;
288  }
289 
295  const char* get_info(rs2_camera_info info) const
296  {
297  rs2_error* e = nullptr;
298  auto result = rs2_get_processing_block_info(_block.get(), info, &e);
299  error::handle(e);
300  return result;
301  }
302  protected:
304  rs2_error * e = nullptr;
306  range.min, range.max, range.step, range.def, &e);
307  error::handle(e);
308  }
309  std::shared_ptr<rs2_processing_block> _block;
310  };
311 
315  class filter : public processing_block, public filter_interface
316  {
317  public:
325  {
326  invoke(frame);
327  rs2::frame f;
328  if (!_queue.poll_for_frame(&f))
329  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
330  return f;
331  }
332 
338  filter(std::shared_ptr<rs2_processing_block> block, int queue_size = 1)
339  : processing_block(block),
340  _queue(queue_size)
341  {
342  start(_queue);
343  }
344 
350  template<class S>
351  filter(S processing_function, int queue_size = 1) :
352  processing_block(processing_function),
353  _queue(queue_size)
354  {
355  start(_queue);
356  }
357 
358 
360  rs2_processing_block* get() const { return _block.get(); }
361 
362  template<class T>
363  bool is() const
364  {
365  T extension(*this);
366  return extension;
367  }
368 
369  template<class T>
370  T as() const
371  {
372  T extension(*this);
373  return extension;
374  }
375 
376  operator bool() const { return _block.get() != nullptr; }
377  protected:
379  };
380 
384  class pointcloud : public filter
385  {
386  public:
390  pointcloud() : filter(init(), 1) {}
391 
392  pointcloud(rs2_stream stream, int index = 0) : filter(init(), 1)
393  {
394  set_option(RS2_OPTION_STREAM_FILTER, float(stream));
396  }
404  {
405  auto res = process(depth);
406  if (res.as<points>())
407  return res;
408 
409  if (auto set = res.as <frameset>())
410  {
411  for (auto f : set)
412  {
413  if(f.as<points>())
414  return f;
415  }
416  }
417  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
418  }
424  void map_to(frame mapped)
425  {
429  process(mapped);
430  }
431 
432  protected:
433  pointcloud(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
434 
435  private:
436  friend class context;
437 
438  std::shared_ptr<rs2_processing_block> init()
439  {
440  rs2_error* e = nullptr;
441 
442  auto block = std::shared_ptr<rs2_processing_block>(
445 
446  error::handle(e);
447 
448  // Redirect options API to the processing block
449  //options::operator=(pb);
450  return block;
451  }
452  };
453 
454  class yuy_decoder : public filter
455  {
456  public:
465  yuy_decoder() : filter(init(), 1) { }
466 
467  protected:
468  yuy_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
469 
470  private:
471  std::shared_ptr<rs2_processing_block> init()
472  {
473  rs2_error* e = nullptr;
474  auto block = std::shared_ptr<rs2_processing_block>(
477  error::handle(e);
478 
479  return block;
480  }
481  };
482 
483  class threshold_filter : public filter
484  {
485  public:
491  threshold_filter(float min_dist = 0.15f, float max_dist = 4.f)
492  : filter(init(), 1)
493  {
496  }
497 
499  {
500  rs2_error* e = nullptr;
502  {
503  _block.reset();
504  }
505  error::handle(e);
506  }
507 
508  protected:
509  threshold_filter(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
510 
511  private:
512  std::shared_ptr<rs2_processing_block> init()
513  {
514  rs2_error* e = nullptr;
515  auto block = std::shared_ptr<rs2_processing_block>(
518  error::handle(e);
519 
520  return block;
521  }
522  };
523 
524  class units_transform : public filter
525  {
526  public:
530  units_transform() : filter(init(), 1) {}
531 
532  protected:
533  units_transform(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
534 
535  private:
536  std::shared_ptr<rs2_processing_block> init()
537  {
538  rs2_error* e = nullptr;
539  auto block = std::shared_ptr<rs2_processing_block>(
542  error::handle(e);
543 
544  return block;
545  }
546  };
547 
549  {
550  public:
555 
556  private:
557  std::shared_ptr<rs2_processing_block> init()
558  {
559  rs2_error* e = nullptr;
560  auto block = std::shared_ptr<rs2_processing_block>(
563 
564  error::handle(e);
565  return block;
566  }
567  };
568 
569  class syncer
570  {
571  public:
575  syncer(int queue_size = 1)
576  :_results(queue_size)
577  {
578  _sync.start(_results);
579  }
580 
586  frameset wait_for_frames(unsigned int timeout_ms = 5000) const
587  {
588  return frameset(_results.wait_for_frame(timeout_ms));
589  }
590 
596  bool poll_for_frames(frameset* fs) const
597  {
598  frame result;
599  if (_results.poll_for_frame(&result))
600  {
601  *fs = frameset(result);
602  return true;
603  }
604  return false;
605  }
606 
613  bool try_wait_for_frames(frameset* fs, unsigned int timeout_ms = 5000) const
614  {
615  frame result;
616  if (_results.try_wait_for_frame(&result, timeout_ms))
617  {
618  *fs = frameset(result);
619  return true;
620  }
621  return false;
622  }
623 
624  void operator()(frame f) const
625  {
626  _sync.invoke(std::move(f));
627  }
628  private:
629  asynchronous_syncer _sync;
630  frame_queue _results;
631  };
632 
636  class align : public filter
637  {
638  public:
648  align(rs2_stream align_to) : filter(init(align_to), 1) {}
649 
657  {
658  return filter::process(frames);
659  }
660 
661  protected:
662  align(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
663 
664  private:
665  friend class context;
666  std::shared_ptr<rs2_processing_block> init(rs2_stream align_to)
667  {
668  rs2_error* e = nullptr;
669  auto block = std::shared_ptr<rs2_processing_block>(
670  rs2_create_align(align_to, &e),
672  error::handle(e);
673 
674  return block;
675  }
676  };
677 
678  class colorizer : public filter
679  {
680  public:
685  colorizer() : filter(init(), 1) { }
700  colorizer(float color_scheme) : filter(init(), 1)
701  {
702  set_option(RS2_OPTION_COLOR_SCHEME, float(color_scheme));
703  }
710  {
711  return process(depth);
712  }
713 
714  protected:
715  colorizer(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
716 
717  private:
718  std::shared_ptr<rs2_processing_block> init()
719  {
720  rs2_error* e = nullptr;
721  auto block = std::shared_ptr<rs2_processing_block>(
724  error::handle(e);
725 
726  // Redirect options API to the processing block
727  //options::operator=(pb);
728 
729  return block;
730  }
731  };
732 
733  class decimation_filter : public filter
734  {
735  public:
740  decimation_filter() : filter(init(), 1) {}
746  decimation_filter(float magnitude) : filter(init(), 1)
747  {
749  }
750 
752  {
753  rs2_error* e = nullptr;
755  {
756  _block.reset();
757  }
758  error::handle(e);
759  }
760 
761  private:
762  friend class context;
763 
764  std::shared_ptr<rs2_processing_block> init()
765  {
766  rs2_error* e = nullptr;
767  auto block = std::shared_ptr<rs2_processing_block>(
770  error::handle(e);
771 
772  // Redirect options API to the processing block
773  //options::operator=(this);
774 
775  return block;
776  }
777  };
778 
779  class temporal_filter : public filter
780  {
781  public:
788  temporal_filter() : filter(init(), 1) {}
806  temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control) : filter(init(), 1)
807  {
808  set_option(RS2_OPTION_HOLES_FILL, float(persistence_control));
809  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
810  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
811  }
812 
814  {
815  rs2_error* e = nullptr;
817  {
818  _block.reset();
819  }
820  error::handle(e);
821  }
822  private:
823  friend class context;
824 
825  std::shared_ptr<rs2_processing_block> init()
826  {
827  rs2_error* e = nullptr;
828  auto block = std::shared_ptr<rs2_processing_block>(
831  error::handle(e);
832 
833  // Redirect options API to the processing block
834  //options::operator=(pb);
835 
836  return block;
837  }
838  };
839 
840  class spatial_filter : public filter
841  {
842  public:
850  spatial_filter() : filter(init(), 1) { }
851 
861  spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill) : filter(init(), 1)
862  {
863  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
864  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
866  set_option(RS2_OPTION_HOLES_FILL, hole_fill);
867  }
868 
870  {
871  rs2_error* e = nullptr;
873  {
874  _block.reset();
875  }
876  error::handle(e);
877  }
878  private:
879  friend class context;
880 
881  std::shared_ptr<rs2_processing_block> init()
882  {
883  rs2_error* e = nullptr;
884  auto block = std::shared_ptr<rs2_processing_block>(
887  error::handle(e);
888 
889  // Redirect options API to the processing block
890  //options::operator=(pb);
891 
892  return block;
893  }
894  };
895 
897  {
898  public:
903  disparity_transform(bool transform_to_disparity = true) : filter(init(transform_to_disparity), 1) { }
904 
906  {
907  rs2_error* e = nullptr;
909  {
910  _block.reset();
911  }
912  error::handle(e);
913  }
914  private:
915  friend class context;
916  std::shared_ptr<rs2_processing_block> init(bool transform_to_disparity)
917  {
918  rs2_error* e = nullptr;
919  auto block = std::shared_ptr<rs2_processing_block>(
920  rs2_create_disparity_transform_block(uint8_t(transform_to_disparity), &e),
922  error::handle(e);
923 
924  // Redirect options API to the processing block
925  //options::operator=(pb);
926 
927  return block;
928  }
929  };
930 
932  {
933  public:
939  {}
940 
942  {
943  rs2_error* e = nullptr;
945  {
946  _block.reset();
947  }
948  error::handle(e);
949  }
950 
951  private:
952  friend class context;
953 
954  std::shared_ptr<rs2_processing_block> init()
955  {
956  rs2_error* e = nullptr;
957  auto block = std::shared_ptr<rs2_processing_block>(
960  error::handle(e);
961 
962  return block;
963  }
964  };
965 
967  {
968  public:
973  hole_filling_filter() : filter(init(), 1) {}
974 
983  hole_filling_filter(int mode) : filter(init(), 1)
984  {
985  set_option(RS2_OPTION_HOLES_FILL, float(mode));
986  }
987 
989  {
990  rs2_error* e = nullptr;
992  {
993  _block.reset();
994  }
995  error::handle(e);
996  }
997  private:
998  friend class context;
999 
1000  std::shared_ptr<rs2_processing_block> init()
1001  {
1002  rs2_error* e = nullptr;
1003  auto block = std::shared_ptr<rs2_processing_block>(
1006  error::handle(e);
1007 
1008  // Redirect options API to the processing block
1009  //options::operator=(_block);
1010 
1011  return block;
1012  }
1013  };
1014 
1015  class rates_printer : public filter
1016  {
1017  public:
1022  rates_printer() : filter(init(), 1) {}
1023 
1024  private:
1025  friend class context;
1026 
1027  std::shared_ptr<rs2_processing_block> init()
1028  {
1029  rs2_error* e = nullptr;
1030  auto block = std::shared_ptr<rs2_processing_block>(
1033  error::handle(e);
1034 
1035  return block;
1036  }
1037  };
1038 }
1039 #endif // LIBREALSENSE_RS2_PROCESSING_HPP
decimation_filter()
Definition: rs_processing.hpp:740
rs2_processing_block * rs2_create_decimation_filter_block(rs2_error **error)
Definition: rs_frame.hpp:21
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
Definition: rs_frame.hpp:578
Definition: rs_frame.hpp:313
threshold_filter(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:509
rs2_processing_block * rs2_create_threshold(rs2_error **error)
bool supports(rs2_option option) const
Definition: rs_options.hpp:19
Definition: rs_processing.hpp:548
std::shared_ptr< rs2_processing_block > _block
Definition: rs_processing.hpp:309
frame_queue(unsigned int capacity)
Definition: rs_processing.hpp:123
rs2_frame * rs2_allocate_composite_frame(rs2_source *source, rs2_frame **frames, int count, rs2_error **error)
hole_filling_filter(filter f)
Definition: rs_processing.hpp:988
bool supports(rs2_camera_info info) const
Definition: rs_processing.hpp:282
Definition: rs_types.h:163
points calculate(frame depth)
Definition: rs_processing.hpp:403
Definition: rs_processing.hpp:840
Definition: rs_processing.hpp:966
Definition: rs_option.h:57
threshold_filter(filter f)
Definition: rs_processing.hpp:498
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls,...
Definition: rs_option.h:22
Definition: rs_types.h:161
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
Definition: rs_processing.hpp:162
rs2_processing_block * rs2_create_zero_order_invalidation_block(rs2_error **error)
Definition: rs_types.h:162
rs2_frame * rs2_allocate_points(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, rs2_error **error)
rs2_processing_block * rs2_create_units_transform(rs2_error **error)
void rs2_start_processing(rs2_processing_block *block, rs2_frame_callback *on_frame, rs2_error **error)
rs2_format format() const
Definition: rs_frame.hpp:43
Definition: rs_types.h:164
Definition: rs_option.h:55
Definition: rs_processing.hpp:454
Definition: rs_frame.hpp:661
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
size_t capacity() const
Definition: rs_processing.hpp:195
align(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:662
void on_frame(rs2_frame *f, rs2_source *source) override
Definition: rs_processing.hpp:105
rs2_processing_block * rs2_create_hole_filling_filter_block(rs2_error **error)
rs2_processing_block * rs2_create_sync_processing_block(rs2_error **error)
void operator()(frame f) const
Definition: rs_processing.hpp:624
void register_simple_option(rs2_option option_id, option_range range)
Definition: rs_processing.hpp:303
pointcloud(rs2_stream stream, int index=0)
Definition: rs_processing.hpp:392
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
float min
Definition: rs_types.hpp:155
units_transform(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:533
bool poll_for_frames(frameset *fs) const
Definition: rs_processing.hpp:596
Definition: rs_frame.hpp:857
T as() const
Definition: rs_processing.hpp:370
void rs2_delete_frame_queue(rs2_frame_queue *queue)
void map_to(frame mapped)
Definition: rs_processing.hpp:424
Definition: rs_context.hpp:11
rs2_frame_queue * rs2_create_frame_queue(int capacity, rs2_error **error)
rs2_frame * rs2_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_error **error)
void rs2_process_frame(rs2_processing_block *block, rs2_frame *frame, rs2_error **error)
Definition: rs_processing.hpp:205
frame_queue _queue
Definition: rs_processing.hpp:378
colorizer(float color_scheme)
Definition: rs_processing.hpp:700
Definition: rs_context.hpp:96
void frame_ready(frame result) const
Definition: rs_processing.hpp:80
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)
processing_block(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:253
threshold_filter(float min_dist=0.15f, float max_dist=4.f)
Definition: rs_processing.hpp:491
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
Definition: rs_processing.hpp:33
float max
Definition: rs_types.hpp:156
float step
Definition: rs_types.hpp:158
rs2_processing_block * rs2_create_rates_printer_block(rs2_error **error)
void invoke(frame f) const
Definition: rs_processing.hpp:239
align(rs2_stream align_to)
Definition: rs_processing.hpp:648
Definition: rs_frame.hpp:1072
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)
rs2_processing_block * rs2_create_align(rs2_stream align_to, rs2_error **error)
rs2::frame process(rs2::frame frame) const override
Definition: rs_processing.hpp:324
Definition: rs_option.h:60
frame_queue()
Definition: rs_processing.hpp:132
yuy_decoder()
Definition: rs_processing.hpp:465
Definition: rs_processing.hpp:18
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
bool is() const
Definition: rs_processing.hpp:363
hole_filling_filter()
Definition: rs_processing.hpp:973
temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control)
Definition: rs_processing.hpp:806
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
frameset process(frameset frames)
Definition: rs_processing.hpp:656
frame_queue get_queue()
Definition: rs_processing.hpp:359
Definition: rs_processing.hpp:524
Definition: rs_types.hpp:32
zero_order_invalidation(filter f)
Definition: rs_processing.hpp:941
processing_block(S processing_function)
Definition: rs_processing.hpp:264
Definition: rs_processing.hpp:779
Definition: rs_types.hpp:153
video_frame colorize(frame depth) const
Definition: rs_processing.hpp:709
int rs2_supports_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
decimation_filter(float magnitude)
Definition: rs_processing.hpp:746
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
rs2_processing_block * get() const
Definition: rs_processing.hpp:275
spatial_filter()
Definition: rs_processing.hpp:850
decimation_filter(filter f)
Definition: rs_processing.hpp:751
S & operator>>(S &on_frame)
Definition: rs_processing.hpp:229
pointcloud()
Definition: rs_processing.hpp:390
Definition: rs_options.hpp:11
spatial_filter(filter f)
Definition: rs_processing.hpp:869
void rs2_delete_processing_block(rs2_processing_block *block)
filter(S processing_function, int queue_size=1)
Definition: rs_processing.hpp:351
Definition: rs_processing.hpp:384
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
void enqueue(frame f) const
Definition: rs_processing.hpp:138
Definition: rs_processing.hpp:483
Definition: rs_option.h:62
void start(S on_frame)
Definition: rs_processing.hpp:216
struct rs2_options rs2_options
Definition: rs_types.h:228
Definition: rs_processing.hpp:931
void operator()(frame f) const
Definition: rs_processing.hpp:187
Definition: rs_option.h:63
int stream_index() const
Definition: rs_frame.hpp:33
syncer(int queue_size=1)
Definition: rs_processing.hpp:575
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
struct rs2_source rs2_source
Definition: rs_types.h:220
rs2_processing_block * rs2_create_disparity_transform_block(unsigned char transform_to_disparity, rs2_error **error)
rs2_processing_block * rs2_create_colorizer(rs2_error **error)
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
Definition: rs_processing.hpp:315
Definition: rs_types.h:159
bool try_wait_for_frames(frameset *fs, unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:613
Definition: rs_option.h:69
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:136
Definition: rs_processing.hpp:678
frame wait_for_frame(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:148
Definition: rs_types.h:142
zero_order_invalidation()
Definition: rs_processing.hpp:938
void release() override
Definition: rs_processing.hpp:112
yuy_decoder(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:468
filter(std::shared_ptr< rs2_processing_block > block, int queue_size=1)
Definition: rs_processing.hpp:338
frame allocate_points(const stream_profile &profile, const frame &original) const
Definition: rs_processing.hpp:48
Definition: rs_option.h:58
Definition: rs_processing.hpp:636
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:221
rs2_processing_block * rs2_create_yuy_decoder(rs2_error **error)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:132
asynchronous_syncer()
Definition: rs_processing.hpp:554
Definition: rs_frame.hpp:306
void set_option(rs2_option option, float value) const
Definition: rs_options.hpp:99
const char * get_info(rs2_camera_info info) const
Definition: rs_processing.hpp:295
float def
Definition: rs_types.hpp:157
spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill)
Definition: rs_processing.hpp:861
rs2_processing_block * rs2_create_spatial_filter_block(rs2_error **error)
frame_processor_callback(T on_frame)
Definition: rs_processing.hpp:103
rs2_source * _source
Definition: rs_processing.hpp:88
options & operator=(const options &other)
Definition: rs_options.hpp:135
Definition: rs_processing.hpp:569
rs2_processing_block * get() const
Definition: rs_processing.hpp:360
Definition: rs_processing.hpp:115
Definition: rs_processing.hpp:99
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:586
Definition: rs_option.h:68
int rs2_try_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_frame **output_frame, rs2_error **error)
Definition: rs_types.h:160
Definition: rs_processing.hpp:733
int rs2_is_processing_block_extendable_to(const rs2_processing_block *block, rs2_extension extension_type, rs2_error **error)
hole_filling_filter(int mode)
Definition: rs_processing.hpp:983
temporal_filter()
Definition: rs_processing.hpp:788
struct rs2_error rs2_error
Definition: rs_types.h:205
rs2_stream stream_type() const
Definition: rs_frame.hpp:38
const char * rs2_get_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
Definition: rs_option.h:61
rs2_frame * get() const
Definition: rs_frame.hpp:532
rates_printer()
Definition: rs_processing.hpp:1022
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
Definition: rs_processing.hpp:174
colorizer(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:715
colorizer()
Definition: rs_processing.hpp:685
pointcloud(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:433
struct rs2_frame rs2_frame
Definition: rs_types.h:207
Definition: rs_processing.hpp:896
disparity_transform(filter f)
Definition: rs_processing.hpp:905
Definition: rs_option.h:67
Definition: rs_processing.hpp:1015
stream_profile get_profile() const
Definition: rs_frame.hpp:499
frame allocate_composite_frame(std::vector< frame > frames) const
Definition: rs_processing.hpp:63
disparity_transform(bool transform_to_disparity=true)
Definition: rs_processing.hpp:903
temporal_filter(filter f)
Definition: rs_processing.hpp:813
Definition: rs_types.h:165
units_transform()
Definition: rs_processing.hpp:530