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:
124  explicit frame_queue(unsigned int capacity, bool keep_frames = false) : _capacity(capacity), _keep(keep_frames)
125  {
126  rs2_error* e = nullptr;
127  _queue = std::shared_ptr<rs2_frame_queue>(
130  error::handle(e);
131  }
132 
134 
139  void enqueue(frame f) const
140  {
141  if (_keep) f.keep();
142  rs2_enqueue_frame(f.frame_ref, _queue.get()); // noexcept
143  f.frame_ref = nullptr; // frame has been essentially moved from
144  }
145 
150  frame wait_for_frame(unsigned int timeout_ms = 5000) const
151  {
152  rs2_error* e = nullptr;
153  auto frame_ref = rs2_wait_for_frame(_queue.get(), timeout_ms, &e);
154  error::handle(e);
155  return{ frame_ref };
156  }
157 
163  template<typename T>
164  typename std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type poll_for_frame(T* output) const
165  {
166  rs2_error* e = nullptr;
167  rs2_frame* frame_ref = nullptr;
168  auto res = rs2_poll_for_frame(_queue.get(), &frame_ref, &e);
169  error::handle(e);
170  frame f{ frame_ref };
171  if (res) *output = f;
172  return res > 0;
173  }
174 
175  template<typename T>
176  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
177  {
178  rs2_error* e = nullptr;
179  rs2_frame* frame_ref = nullptr;
180  auto res = rs2_try_wait_for_frame(_queue.get(), timeout_ms, &frame_ref, &e);
181  error::handle(e);
182  frame f{ frame_ref };
183  if (res) *output = f;
184  return res > 0;
185  }
189  void operator()(frame f) const
190  {
191  enqueue(std::move(f));
192  }
197  size_t capacity() const { return _capacity; }
198 
203  bool keep_frames() const { return _keep; }
204 
205  private:
206  std::shared_ptr<rs2_frame_queue> _queue;
207  size_t _capacity;
208  bool _keep;
209  };
210 
214  class processing_block : public options
215  {
216  public:
217  using options::supports;
218 
224  template<class S>
225  void start(S on_frame)
226  {
227  rs2_error* e = nullptr;
228  rs2_start_processing(get(), new frame_callback<S>(on_frame), &e);
229  error::handle(e);
230  }
237  template<class S>
238  S& operator>>(S& on_frame)
239  {
240  start(on_frame);
241  return on_frame;
242  }
248  void invoke(frame f) const
249  {
250  rs2_frame* ptr = nullptr;
251  std::swap(f.frame_ref, ptr);
252 
253  rs2_error* e = nullptr;
254  rs2_process_frame(get(), ptr, &e);
255  error::handle(e);
256  }
262  processing_block(std::shared_ptr<rs2_processing_block> block)
263  : options((rs2_options*)block.get()), _block(block)
264  {
265  }
266 
272  template<class S>
273  processing_block(S processing_function)
274  {
275  rs2_error* e = nullptr;
276  _block = std::shared_ptr<rs2_processing_block>(
277  rs2_create_processing_block(new frame_processor_callback<S>(processing_function), &e),
280  error::handle(e);
281  }
282 
283  operator rs2_options*() const { return (rs2_options*)get(); }
284  rs2_processing_block* get() const { return _block.get(); }
285 
291  bool supports(rs2_camera_info info) const
292  {
293  rs2_error* e = nullptr;
294  auto is_supported = rs2_supports_processing_block_info(_block.get(), info, &e);
295  error::handle(e);
296  return is_supported > 0;
297  }
298 
304  const char* get_info(rs2_camera_info info) const
305  {
306  rs2_error* e = nullptr;
307  auto result = rs2_get_processing_block_info(_block.get(), info, &e);
308  error::handle(e);
309  return result;
310  }
311  protected:
313  rs2_error * e = nullptr;
315  range.min, range.max, range.step, range.def, &e);
316  error::handle(e);
317  }
318  std::shared_ptr<rs2_processing_block> _block;
319  };
320 
324  class filter : public processing_block, public filter_interface
325  {
326  public:
334  {
335  invoke(frame);
336  rs2::frame f;
337  if (!_queue.poll_for_frame(&f))
338  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
339  return f;
340  }
341 
347  filter(std::shared_ptr<rs2_processing_block> block, int queue_size = 1)
348  : processing_block(block),
349  _queue(queue_size)
350  {
351  start(_queue);
352  }
353 
359  template<class S>
360  filter(S processing_function, int queue_size = 1) :
361  processing_block(processing_function),
362  _queue(queue_size)
363  {
364  start(_queue);
365  }
366 
367 
369  rs2_processing_block* get() const { return _block.get(); }
370 
371  template<class T>
372  bool is() const
373  {
374  T extension(*this);
375  return extension;
376  }
377 
378  template<class T>
379  T as() const
380  {
381  T extension(*this);
382  return extension;
383  }
384 
385  operator bool() const { return _block.get() != nullptr; }
386  protected:
388  };
389 
393  class pointcloud : public filter
394  {
395  public:
399  pointcloud() : filter(init(), 1) {}
400 
401  pointcloud(rs2_stream stream, int index = 0) : filter(init(), 1)
402  {
403  set_option(RS2_OPTION_STREAM_FILTER, float(stream));
405  }
413  {
414  auto res = process(depth);
415  if (res.as<points>())
416  return res;
417 
418  if (auto set = res.as <frameset>())
419  {
420  for (auto f : set)
421  {
422  if(f.as<points>())
423  return f;
424  }
425  }
426  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
427  }
433  void map_to(frame mapped)
434  {
438  process(mapped);
439  }
440 
441  protected:
442  pointcloud(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
443 
444  private:
445  friend class context;
446 
447  std::shared_ptr<rs2_processing_block> init()
448  {
449  rs2_error* e = nullptr;
450 
451  auto block = std::shared_ptr<rs2_processing_block>(
454 
455  error::handle(e);
456 
457  // Redirect options API to the processing block
458  //options::operator=(pb);
459  return block;
460  }
461  };
462 
463  class yuy_decoder : public filter
464  {
465  public:
474  yuy_decoder() : filter(init(), 1) { }
475 
476  protected:
477  yuy_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
478 
479  private:
480  std::shared_ptr<rs2_processing_block> init()
481  {
482  rs2_error* e = nullptr;
483  auto block = std::shared_ptr<rs2_processing_block>(
486  error::handle(e);
487 
488  return block;
489  }
490  };
491 
492  class threshold_filter : public filter
493  {
494  public:
500  threshold_filter(float min_dist = 0.15f, float max_dist = 4.f)
501  : filter(init(), 1)
502  {
505  }
506 
508  {
509  rs2_error* e = nullptr;
511  {
512  _block.reset();
513  }
514  error::handle(e);
515  }
516 
517  protected:
518  threshold_filter(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
519 
520  private:
521  std::shared_ptr<rs2_processing_block> init()
522  {
523  rs2_error* e = nullptr;
524  auto block = std::shared_ptr<rs2_processing_block>(
527  error::handle(e);
528 
529  return block;
530  }
531  };
532 
533  class units_transform : public filter
534  {
535  public:
539  units_transform() : filter(init(), 1) {}
540 
541  protected:
542  units_transform(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
543 
544  private:
545  std::shared_ptr<rs2_processing_block> init()
546  {
547  rs2_error* e = nullptr;
548  auto block = std::shared_ptr<rs2_processing_block>(
551  error::handle(e);
552 
553  return block;
554  }
555  };
556 
558  {
559  public:
564 
565  private:
566  std::shared_ptr<rs2_processing_block> init()
567  {
568  rs2_error* e = nullptr;
569  auto block = std::shared_ptr<rs2_processing_block>(
572 
573  error::handle(e);
574  return block;
575  }
576  };
577 
578  class syncer
579  {
580  public:
584  syncer(int queue_size = 1)
585  :_results(queue_size)
586  {
587  _sync.start(_results);
588  }
589 
595  frameset wait_for_frames(unsigned int timeout_ms = 5000) const
596  {
597  return frameset(_results.wait_for_frame(timeout_ms));
598  }
599 
605  bool poll_for_frames(frameset* fs) const
606  {
607  frame result;
608  if (_results.poll_for_frame(&result))
609  {
610  *fs = frameset(result);
611  return true;
612  }
613  return false;
614  }
615 
622  bool try_wait_for_frames(frameset* fs, unsigned int timeout_ms = 5000) const
623  {
624  frame result;
625  if (_results.try_wait_for_frame(&result, timeout_ms))
626  {
627  *fs = frameset(result);
628  return true;
629  }
630  return false;
631  }
632 
633  void operator()(frame f) const
634  {
635  _sync.invoke(std::move(f));
636  }
637  private:
638  asynchronous_syncer _sync;
639  frame_queue _results;
640  };
641 
645  class align : public filter
646  {
647  public:
657  align(rs2_stream align_to) : filter(init(align_to), 1) {}
658 
666  {
667  return filter::process(frames);
668  }
669 
670  protected:
671  align(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
672 
673  private:
674  friend class context;
675  std::shared_ptr<rs2_processing_block> init(rs2_stream align_to)
676  {
677  rs2_error* e = nullptr;
678  auto block = std::shared_ptr<rs2_processing_block>(
679  rs2_create_align(align_to, &e),
681  error::handle(e);
682 
683  return block;
684  }
685  };
686 
687  class colorizer : public filter
688  {
689  public:
694  colorizer() : filter(init(), 1) { }
710  colorizer(float color_scheme) : filter(init(), 1)
711  {
712  set_option(RS2_OPTION_COLOR_SCHEME, float(color_scheme));
713  }
720  {
721  return process(depth);
722  }
723 
724  protected:
725  colorizer(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
726 
727  private:
728  std::shared_ptr<rs2_processing_block> init()
729  {
730  rs2_error* e = nullptr;
731  auto block = std::shared_ptr<rs2_processing_block>(
734  error::handle(e);
735 
736  // Redirect options API to the processing block
737  //options::operator=(pb);
738 
739  return block;
740  }
741  };
742 
743  class decimation_filter : public filter
744  {
745  public:
750  decimation_filter() : filter(init(), 1) {}
756  decimation_filter(float magnitude) : filter(init(), 1)
757  {
759  }
760 
762  {
763  rs2_error* e = nullptr;
765  {
766  _block.reset();
767  }
768  error::handle(e);
769  }
770 
771  private:
772  friend class context;
773 
774  std::shared_ptr<rs2_processing_block> init()
775  {
776  rs2_error* e = nullptr;
777  auto block = std::shared_ptr<rs2_processing_block>(
780  error::handle(e);
781 
782  // Redirect options API to the processing block
783  //options::operator=(this);
784 
785  return block;
786  }
787  };
788 
789  class temporal_filter : public filter
790  {
791  public:
798  temporal_filter() : filter(init(), 1) {}
816  temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control) : filter(init(), 1)
817  {
818  set_option(RS2_OPTION_HOLES_FILL, float(persistence_control));
819  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
820  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
821  }
822 
824  {
825  rs2_error* e = nullptr;
827  {
828  _block.reset();
829  }
830  error::handle(e);
831  }
832  private:
833  friend class context;
834 
835  std::shared_ptr<rs2_processing_block> init()
836  {
837  rs2_error* e = nullptr;
838  auto block = std::shared_ptr<rs2_processing_block>(
841  error::handle(e);
842 
843  // Redirect options API to the processing block
844  //options::operator=(pb);
845 
846  return block;
847  }
848  };
849 
850  class spatial_filter : public filter
851  {
852  public:
860  spatial_filter() : filter(init(), 1) { }
861 
871  spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill) : filter(init(), 1)
872  {
873  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
874  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
876  set_option(RS2_OPTION_HOLES_FILL, hole_fill);
877  }
878 
880  {
881  rs2_error* e = nullptr;
883  {
884  _block.reset();
885  }
886  error::handle(e);
887  }
888  private:
889  friend class context;
890 
891  std::shared_ptr<rs2_processing_block> init()
892  {
893  rs2_error* e = nullptr;
894  auto block = std::shared_ptr<rs2_processing_block>(
897  error::handle(e);
898 
899  // Redirect options API to the processing block
900  //options::operator=(pb);
901 
902  return block;
903  }
904  };
905 
907  {
908  public:
913  disparity_transform(bool transform_to_disparity = true) : filter(init(transform_to_disparity), 1) { }
914 
916  {
917  rs2_error* e = nullptr;
919  {
920  _block.reset();
921  }
922  error::handle(e);
923  }
924  private:
925  friend class context;
926  std::shared_ptr<rs2_processing_block> init(bool transform_to_disparity)
927  {
928  rs2_error* e = nullptr;
929  auto block = std::shared_ptr<rs2_processing_block>(
930  rs2_create_disparity_transform_block(uint8_t(transform_to_disparity), &e),
932  error::handle(e);
933 
934  // Redirect options API to the processing block
935  //options::operator=(pb);
936 
937  return block;
938  }
939  };
940 
942  {
943  public:
949  {}
950 
952  {
953  rs2_error* e = nullptr;
955  {
956  _block.reset();
957  }
958  error::handle(e);
959  }
960 
961  private:
962  friend class context;
963 
964  std::shared_ptr<rs2_processing_block> init()
965  {
966  rs2_error* e = nullptr;
967  auto block = std::shared_ptr<rs2_processing_block>(
970  error::handle(e);
971 
972  return block;
973  }
974  };
975 
977  {
978  public:
983  hole_filling_filter() : filter(init(), 1) {}
984 
993  hole_filling_filter(int mode) : filter(init(), 1)
994  {
995  set_option(RS2_OPTION_HOLES_FILL, float(mode));
996  }
997 
999  {
1000  rs2_error* e = nullptr;
1002  {
1003  _block.reset();
1004  }
1005  error::handle(e);
1006  }
1007  private:
1008  friend class context;
1009 
1010  std::shared_ptr<rs2_processing_block> init()
1011  {
1012  rs2_error* e = nullptr;
1013  auto block = std::shared_ptr<rs2_processing_block>(
1016  error::handle(e);
1017 
1018  // Redirect options API to the processing block
1019  //options::operator=(_block);
1020 
1021  return block;
1022  }
1023  };
1024 
1025  class rates_printer : public filter
1026  {
1027  public:
1032  rates_printer() : filter(init(), 1) {}
1033 
1034  private:
1035  friend class context;
1036 
1037  std::shared_ptr<rs2_processing_block> init()
1038  {
1039  rs2_error* e = nullptr;
1040  auto block = std::shared_ptr<rs2_processing_block>(
1043  error::handle(e);
1044 
1045  return block;
1046  }
1047  };
1048 }
1049 #endif // LIBREALSENSE_RS2_PROCESSING_HPP
decimation_filter()
Definition: rs_processing.hpp:750
rs2_processing_block * rs2_create_decimation_filter_block(rs2_error **error)
Definition: rs_frame.hpp:22
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:629
Definition: rs_frame.hpp:336
threshold_filter(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:518
rs2_processing_block * rs2_create_threshold(rs2_error **error)
bool supports(rs2_option option) const
Definition: rs_options.hpp:19
Definition: rs_processing.hpp:557
std::shared_ptr< rs2_processing_block > _block
Definition: rs_processing.hpp:318
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:998
bool supports(rs2_camera_info info) const
Definition: rs_processing.hpp:291
Definition: rs_types.h:164
points calculate(frame depth)
Definition: rs_processing.hpp:412
Definition: rs_processing.hpp:850
Definition: rs_processing.hpp:976
Definition: rs_option.h:57
threshold_filter(filter f)
Definition: rs_processing.hpp:507
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls,...
Definition: rs_option.h:22
Definition: rs_types.h:162
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
Definition: rs_processing.hpp:164
rs2_processing_block * rs2_create_zero_order_invalidation_block(rs2_error **error)
Definition: rs_types.h:163
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)
bool keep_frames() const
Definition: rs_processing.hpp:203
void rs2_start_processing(rs2_processing_block *block, rs2_frame_callback *on_frame, rs2_error **error)
rs2_format format() const
Definition: rs_frame.hpp:44
Definition: rs_types.h:165
Definition: rs_option.h:55
Definition: rs_processing.hpp:463
Definition: rs_frame.hpp:712
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
size_t capacity() const
Definition: rs_processing.hpp:197
align(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:671
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:633
void register_simple_option(rs2_option option_id, option_range range)
Definition: rs_processing.hpp:312
pointcloud(rs2_stream stream, int index=0)
Definition: rs_processing.hpp:401
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
float min
Definition: rs_types.hpp:162
units_transform(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:542
bool poll_for_frames(frameset *fs) const
Definition: rs_processing.hpp:605
Definition: rs_frame.hpp:908
T as() const
Definition: rs_processing.hpp:379
void rs2_delete_frame_queue(rs2_frame_queue *queue)
void map_to(frame mapped)
Definition: rs_processing.hpp:433
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:214
frame_queue _queue
Definition: rs_processing.hpp:387
colorizer(float color_scheme)
Definition: rs_processing.hpp:710
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:262
threshold_filter(float min_dist=0.15f, float max_dist=4.f)
Definition: rs_processing.hpp:500
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:163
float step
Definition: rs_types.hpp:165
rs2_processing_block * rs2_create_rates_printer_block(rs2_error **error)
void invoke(frame f) const
Definition: rs_processing.hpp:248
align(rs2_stream align_to)
Definition: rs_processing.hpp:657
Definition: rs_frame.hpp:1123
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:333
Definition: rs_option.h:60
frame_queue()
Definition: rs_processing.hpp:133
yuy_decoder()
Definition: rs_processing.hpp:474
Definition: rs_processing.hpp:18
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
bool is() const
Definition: rs_processing.hpp:372
hole_filling_filter()
Definition: rs_processing.hpp:983
temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control)
Definition: rs_processing.hpp:816
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
frameset process(frameset frames)
Definition: rs_processing.hpp:665
frame_queue get_queue()
Definition: rs_processing.hpp:368
Definition: rs_processing.hpp:533
Definition: rs_types.hpp:32
zero_order_invalidation(filter f)
Definition: rs_processing.hpp:951
processing_block(S processing_function)
Definition: rs_processing.hpp:273
Definition: rs_processing.hpp:789
Definition: rs_types.hpp:160
video_frame colorize(frame depth) const
Definition: rs_processing.hpp:719
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:756
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
rs2_processing_block * get() const
Definition: rs_processing.hpp:284
spatial_filter()
Definition: rs_processing.hpp:860
decimation_filter(filter f)
Definition: rs_processing.hpp:761
S & operator>>(S &on_frame)
Definition: rs_processing.hpp:238
pointcloud()
Definition: rs_processing.hpp:399
Definition: rs_options.hpp:11
spatial_filter(filter f)
Definition: rs_processing.hpp:879
void rs2_delete_processing_block(rs2_processing_block *block)
filter(S processing_function, int queue_size=1)
Definition: rs_processing.hpp:360
Definition: rs_processing.hpp:393
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
void enqueue(frame f) const
Definition: rs_processing.hpp:139
Definition: rs_processing.hpp:492
Definition: rs_option.h:62
void keep()
Definition: rs_frame.hpp:430
void start(S on_frame)
Definition: rs_processing.hpp:225
struct rs2_options rs2_options
Definition: rs_types.h:234
Definition: rs_processing.hpp:941
void operator()(frame f) const
Definition: rs_processing.hpp:189
Definition: rs_option.h:63
int stream_index() const
Definition: rs_frame.hpp:34
syncer(int queue_size=1)
Definition: rs_processing.hpp:584
static void handle(rs2_error *e)
Definition: rs_types.hpp:128
struct rs2_source rs2_source
Definition: rs_types.h:225
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:41
Definition: rs_processing.hpp:324
Definition: rs_types.h:160
bool try_wait_for_frames(frameset *fs, unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:622
Definition: rs_option.h:69
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
Definition: rs_processing.hpp:687
frame wait_for_frame(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:150
Definition: rs_types.h:143
zero_order_invalidation()
Definition: rs_processing.hpp:948
void release() override
Definition: rs_processing.hpp:112
yuy_decoder(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:477
filter(std::shared_ptr< rs2_processing_block > block, int queue_size=1)
Definition: rs_processing.hpp:347
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:645
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:226
rs2_processing_block * rs2_create_yuy_decoder(rs2_error **error)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:133
asynchronous_syncer()
Definition: rs_processing.hpp:563
Definition: rs_frame.hpp:329
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:304
float def
Definition: rs_types.hpp:164
spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill)
Definition: rs_processing.hpp:871
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:578
frame_queue(unsigned int capacity, bool keep_frames=false)
Definition: rs_processing.hpp:124
rs2_processing_block * get() const
Definition: rs_processing.hpp:369
Definition: rs_processing.hpp:115
Definition: rs_processing.hpp:99
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:595
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:161
Definition: rs_processing.hpp:743
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:993
temporal_filter()
Definition: rs_processing.hpp:798
struct rs2_error rs2_error
Definition: rs_types.h:210
rs2_stream stream_type() const
Definition: rs_frame.hpp:39
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:583
rates_printer()
Definition: rs_processing.hpp:1032
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:176
colorizer(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:725
colorizer()
Definition: rs_processing.hpp:694
pointcloud(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:442
struct rs2_frame rs2_frame
Definition: rs_types.h:212
Definition: rs_processing.hpp:906
disparity_transform(filter f)
Definition: rs_processing.hpp:915
Definition: rs_option.h:67
Definition: rs_processing.hpp:1025
stream_profile get_profile() const
Definition: rs_frame.hpp:550
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:913
temporal_filter(filter f)
Definition: rs_processing.hpp:823
Definition: rs_types.h:166
units_transform()
Definition: rs_processing.hpp:539