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 {
18  {
19  public:
33  const frame& original,
34  int new_bpp = 0,
35  int new_width = 0,
36  int new_height = 0,
37  int new_stride = 0,
38  rs2_extension frame_type = RS2_EXTENSION_VIDEO_FRAME) const
39  {
40  rs2_error* e = nullptr;
41  auto result = rs2_allocate_synthetic_video_frame(_source, profile.get(),
42  original.get(), new_bpp, new_width, new_height, new_stride, frame_type, &e);
43  error::handle(e);
44  return result;
45  }
46 
48  const frame& original) const
49  {
50  rs2_error* e = nullptr;
51  auto result = rs2_allocate_points(_source, profile.get(), original.get(), &e);
52  error::handle(e);
53  return result;
54  }
55 
62  frame allocate_composite_frame(std::vector<frame> frames) const
63  {
64  rs2_error* e = nullptr;
65 
66  std::vector<rs2_frame*> refs(frames.size(), (rs2_frame*)nullptr);
67  for (size_t i = 0; i < frames.size(); i++)
68  std::swap(refs[i], frames[i].frame_ref);
69 
70  auto result = rs2_allocate_composite_frame(_source, refs.data(), (int)refs.size(), &e);
71  error::handle(e);
72  return result;
73  }
79  void frame_ready(frame result) const
80  {
81  rs2_error* e = nullptr;
82  rs2_synthetic_frame_ready(_source, result.get(), &e);
83  error::handle(e);
84  result.frame_ref = nullptr;
85  }
86 
88  private:
89  template<class T>
91 
92  frame_source(rs2_source* source) : _source(source) {}
93  frame_source(const frame_source&) = delete;
94 
95  };
96 
97  template<class T>
99  {
100  T on_frame_function;
101  public:
102  explicit frame_processor_callback(T on_frame) : on_frame_function(on_frame) {}
103 
104  void on_frame(rs2_frame* f, rs2_source * source) override
105  {
106  frame_source src(source);
107  frame frm(f);
108  on_frame_function(std::move(frm), src);
109  }
110 
111  void release() override { delete this; }
112  };
113 
115  {
116  public:
122  explicit frame_queue(unsigned int capacity) : _capacity(capacity)
123  {
124  rs2_error* e = nullptr;
125  _queue = std::shared_ptr<rs2_frame_queue>(
128  error::handle(e);
129  }
130 
132 
137  void enqueue(frame f) const
138  {
139  rs2_enqueue_frame(f.frame_ref, _queue.get()); // noexcept
140  f.frame_ref = nullptr; // frame has been essentially moved from
141  }
142 
147  frame wait_for_frame(unsigned int timeout_ms = 5000) const
148  {
149  rs2_error* e = nullptr;
150  auto frame_ref = rs2_wait_for_frame(_queue.get(), timeout_ms, &e);
151  error::handle(e);
152  return{ frame_ref };
153  }
154 
160  template<typename T>
161  typename std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type poll_for_frame(T* output) const
162  {
163  rs2_error* e = nullptr;
164  rs2_frame* frame_ref = nullptr;
165  auto res = rs2_poll_for_frame(_queue.get(), &frame_ref, &e);
166  error::handle(e);
167  frame f{ frame_ref };
168  if (res) *output = f;
169  return res > 0;
170  }
171 
172  template<typename T>
173  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
174  {
175  rs2_error* e = nullptr;
176  rs2_frame* frame_ref = nullptr;
177  auto res = rs2_try_wait_for_frame(_queue.get(), timeout_ms, &frame_ref, &e);
178  error::handle(e);
179  frame f{ frame_ref };
180  if (res) *output = f;
181  return res > 0;
182  }
186  void operator()(frame f) const
187  {
188  enqueue(std::move(f));
189  }
194  size_t capacity() const { return _capacity; }
195 
196  private:
197  std::shared_ptr<rs2_frame_queue> _queue;
198  size_t _capacity;
199  };
200 
204  class processing_block : public options
205  {
206  public:
207  using options::supports;
208 
214  template<class S>
215  void start(S on_frame)
216  {
217  rs2_error* e = nullptr;
218  rs2_start_processing(get(), new frame_callback<S>(on_frame), &e);
219  error::handle(e);
220  }
227  template<class S>
228  S& operator>>(S& on_frame)
229  {
230  start(on_frame);
231  return on_frame;
232  }
238  void invoke(frame f) const
239  {
240  rs2_frame* ptr = nullptr;
241  std::swap(f.frame_ref, ptr);
242 
243  rs2_error* e = nullptr;
244  rs2_process_frame(get(), ptr, &e);
245  error::handle(e);
246  }
252  processing_block(std::shared_ptr<rs2_processing_block> block)
253  : _block(block), options((rs2_options*)block.get())
254  {
255  }
256 
262  template<class S>
263  processing_block(S processing_function)
264  {
265  rs2_error* e = nullptr;
266  _block = std::shared_ptr<rs2_processing_block>(
267  rs2_create_processing_block(new frame_processor_callback<S>(processing_function), &e),
270  error::handle(e);
271  }
272 
273  operator rs2_options*() const { return (rs2_options*)get(); }
274  rs2_processing_block* get() const { return _block.get(); }
275 
281  bool supports(rs2_camera_info info) const
282  {
283  rs2_error* e = nullptr;
284  auto is_supported = rs2_supports_processing_block_info(_block.get(), info, &e);
285  error::handle(e);
286  return is_supported > 0;
287  }
288 
294  const char* get_info(rs2_camera_info info) const
295  {
296  rs2_error* e = nullptr;
297  auto result = rs2_get_processing_block_info(_block.get(), info, &e);
298  error::handle(e);
299  return result;
300  }
301  protected:
303  rs2_error * e = nullptr;
305  range.min, range.max, range.step, range.def, &e);
306  error::handle(e);
307  }
308  std::shared_ptr<rs2_processing_block> _block;
309  };
310 
314  class filter : public processing_block, public filter_interface
315  {
316  public:
324  {
325  invoke(frame);
326  rs2::frame f;
327  if (!_queue.poll_for_frame(&f))
328  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
329  return f;
330  }
331 
337  filter(std::shared_ptr<rs2_processing_block> block, int queue_size = 1)
338  : processing_block(block),
339  _queue(queue_size)
340  {
341  start(_queue);
342  }
343 
349  template<class S>
350  filter(S processing_function, int queue_size = 1) :
351  processing_block(processing_function),
352  _queue(queue_size)
353  {
354  start(_queue);
355  }
356 
357 
359  rs2_processing_block* get() const { return _block.get(); }
360 
361  template<class T>
362  bool is() const
363  {
364  T extension(*this);
365  return extension;
366  }
367 
368  template<class T>
369  T as() const
370  {
371  T extension(*this);
372  return extension;
373  }
374 
375  operator bool() const { return _block.get() != nullptr; }
376  protected:
378  };
379 
383  class pointcloud : public filter
384  {
385  public:
389  pointcloud() : filter(init(), 1) {}
390 
391  pointcloud(rs2_stream stream, int index = 0) : filter(init(), 1)
392  {
393  set_option(RS2_OPTION_STREAM_FILTER, float(stream));
395  }
403  {
404  auto res = process(depth);
405  if (res.as<points>())
406  return res;
407 
408  if (auto set = res.as <frameset>())
409  {
410  for (auto f : set)
411  {
412  if(f.as<points>())
413  return f;
414  }
415  }
416  throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
417  }
423  void map_to(frame mapped)
424  {
428  process(mapped);
429  }
430 
431  protected:
432  pointcloud(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
433 
434  private:
435  friend class context;
436 
437  std::shared_ptr<rs2_processing_block> init()
438  {
439  rs2_error* e = nullptr;
440 
441  auto block = std::shared_ptr<rs2_processing_block>(
444 
445  error::handle(e);
446 
447  // Redirect options API to the processing block
448  //options::operator=(pb);
449  return block;
450  }
451  };
452 
453  class yuy_decoder : public filter
454  {
455  public:
464  yuy_decoder() : filter(init(), 1) { }
465 
466  protected:
467  yuy_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
468 
469  private:
470  std::shared_ptr<rs2_processing_block> init()
471  {
472  rs2_error* e = nullptr;
473  auto block = std::shared_ptr<rs2_processing_block>(
476  error::handle(e);
477 
478  return block;
479  }
480  };
481 
482  class threshold_filter : public filter
483  {
484  public:
490  threshold_filter(float min_dist = 0.15f, float max_dist = 4.f)
491  : filter(init(), 1)
492  {
495  }
496 
498  {
499  rs2_error* e = nullptr;
501  {
502  _block.reset();
503  }
504  error::handle(e);
505  }
506 
507  protected:
508  threshold_filter(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
509 
510  private:
511  std::shared_ptr<rs2_processing_block> init()
512  {
513  rs2_error* e = nullptr;
514  auto block = std::shared_ptr<rs2_processing_block>(
517  error::handle(e);
518 
519  return block;
520  }
521  };
522 
523 
525  {
526  public:
531 
532  private:
533  std::shared_ptr<rs2_processing_block> init()
534  {
535  rs2_error* e = nullptr;
536  auto block = std::shared_ptr<rs2_processing_block>(
539 
540  error::handle(e);
541  return block;
542  }
543  };
544 
545  class syncer
546  {
547  public:
551  syncer(int queue_size = 1)
552  :_results(queue_size)
553  {
554  _sync.start(_results);
555  }
556 
562  frameset wait_for_frames(unsigned int timeout_ms = 5000) const
563  {
564  return frameset(_results.wait_for_frame(timeout_ms));
565  }
566 
572  bool poll_for_frames(frameset* fs) const
573  {
574  frame result;
575  if (_results.poll_for_frame(&result))
576  {
577  *fs = frameset(result);
578  return true;
579  }
580  return false;
581  }
582 
589  bool try_wait_for_frames(frameset* fs, unsigned int timeout_ms = 5000) const
590  {
591  frame result;
592  if (_results.try_wait_for_frame(&result, timeout_ms))
593  {
594  *fs = frameset(result);
595  return true;
596  }
597  return false;
598  }
599 
600  void operator()(frame f) const
601  {
602  _sync.invoke(std::move(f));
603  }
604  private:
605  asynchronous_syncer _sync;
606  frame_queue _results;
607  };
608 
612  class align : public filter
613  {
614  public:
624  align(rs2_stream align_to) : filter(init(align_to), 1) {}
625 
633  {
634  return filter::process(frames);
635  }
636 
637  private:
638  friend class context;
639  std::shared_ptr<rs2_processing_block> init(rs2_stream align_to)
640  {
641  rs2_error* e = nullptr;
642  auto block = std::shared_ptr<rs2_processing_block>(
643  rs2_create_align(align_to, &e),
645  error::handle(e);
646 
647  return block;
648  }
649  };
650 
651  class colorizer : public filter
652  {
653  public:
658  colorizer() : filter(init(), 1) { }
673  colorizer(float color_scheme) : filter(init(), 1)
674  {
675  set_option(RS2_OPTION_COLOR_SCHEME, float(color_scheme));
676  }
683  {
684  return process(depth);
685  }
686 
687  protected:
688  colorizer(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
689 
690  private:
691  std::shared_ptr<rs2_processing_block> init()
692  {
693  rs2_error* e = nullptr;
694  auto block = std::shared_ptr<rs2_processing_block>(
697  error::handle(e);
698 
699  // Redirect options API to the processing block
700  //options::operator=(pb);
701 
702  return block;
703  }
704  };
705 
706  class decimation_filter : public filter
707  {
708  public:
713  decimation_filter() : filter(init(), 1) {}
719  decimation_filter(float magnitude) : filter(init(), 1)
720  {
722  }
723 
725  {
726  rs2_error* e = nullptr;
728  {
729  _block.reset();
730  }
731  error::handle(e);
732  }
733 
734  private:
735  friend class context;
736 
737  std::shared_ptr<rs2_processing_block> init()
738  {
739  rs2_error* e = nullptr;
740  auto block = std::shared_ptr<rs2_processing_block>(
743  error::handle(e);
744 
745  // Redirect options API to the processing block
746  //options::operator=(this);
747 
748  return block;
749  }
750  };
751 
752  class temporal_filter : public filter
753  {
754  public:
761  temporal_filter() : filter(init(), 1) {}
779  temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control) : filter(init(), 1)
780  {
781  set_option(RS2_OPTION_HOLES_FILL, float(persistence_control));
782  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
783  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
784  }
785 
787  {
788  rs2_error* e = nullptr;
790  {
791  _block.reset();
792  }
793  error::handle(e);
794  }
795  private:
796  friend class context;
797 
798  std::shared_ptr<rs2_processing_block> init()
799  {
800  rs2_error* e = nullptr;
801  auto block = std::shared_ptr<rs2_processing_block>(
804  error::handle(e);
805 
806  // Redirect options API to the processing block
807  //options::operator=(pb);
808 
809  return block;
810  }
811  };
812 
813  class spatial_filter : public filter
814  {
815  public:
823  spatial_filter() : filter(init(), 1) { }
824 
834  spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill) : filter(init(), 1)
835  {
836  set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
837  set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
839  set_option(RS2_OPTION_HOLES_FILL, hole_fill);
840  }
841 
843  {
844  rs2_error* e = nullptr;
846  {
847  _block.reset();
848  }
849  error::handle(e);
850  }
851  private:
852  friend class context;
853 
854  std::shared_ptr<rs2_processing_block> init()
855  {
856  rs2_error* e = nullptr;
857  auto block = std::shared_ptr<rs2_processing_block>(
860  error::handle(e);
861 
862  // Redirect options API to the processing block
863  //options::operator=(pb);
864 
865  return block;
866  }
867  };
868 
870  {
871  public:
876  disparity_transform(bool transform_to_disparity = true) : filter(init(transform_to_disparity), 1) { }
877 
879  {
880  rs2_error* e = nullptr;
882  {
883  _block.reset();
884  }
885  error::handle(e);
886  }
887  private:
888  friend class context;
889  std::shared_ptr<rs2_processing_block> init(bool transform_to_disparity)
890  {
891  rs2_error* e = nullptr;
892  auto block = std::shared_ptr<rs2_processing_block>(
893  rs2_create_disparity_transform_block(uint8_t(transform_to_disparity), &e),
895  error::handle(e);
896 
897  // Redirect options API to the processing block
898  //options::operator=(pb);
899 
900  return block;
901  }
902  };
903 
905  {
906  public:
912  {}
913 
915  {
916  rs2_error* e = nullptr;
918  {
919  _block.reset();
920  }
921  error::handle(e);
922  }
923 
924  private:
925  friend class context;
926 
927  std::shared_ptr<rs2_processing_block> init()
928  {
929  rs2_error* e = nullptr;
930  auto block = std::shared_ptr<rs2_processing_block>(
933  error::handle(e);
934 
935  return block;
936  }
937  };
938 
940  {
941  public:
946  hole_filling_filter() : filter(init(), 1) {}
947 
956  hole_filling_filter(int mode) : filter(init(), 1)
957  {
958  set_option(RS2_OPTION_HOLES_FILL, float(mode));
959  }
960 
962  {
963  rs2_error* e = nullptr;
965  {
966  _block.reset();
967  }
968  error::handle(e);
969  }
970  private:
971  friend class context;
972 
973  std::shared_ptr<rs2_processing_block> init()
974  {
975  rs2_error* e = nullptr;
976  auto block = std::shared_ptr<rs2_processing_block>(
979  error::handle(e);
980 
981  // Redirect options API to the processing block
982  //options::operator=(_block);
983 
984  return block;
985  }
986  };
987 
988  class rates_printer : public filter
989  {
990  public:
995  rates_printer() : filter(init(), 1) {}
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  return block;
1009  }
1010  };
1011 }
1012 #endif // LIBREALSENSE_RS2_PROCESSING_HPP
decimation_filter()
Definition: rs_processing.hpp:713
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:551
Definition: rs_frame.hpp:295
threshold_filter(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:508
rs2_processing_block * rs2_create_threshold(rs2_error **error)
bool supports(rs2_option option) const
Definition: rs_options.hpp:19
Definition: rs_processing.hpp:524
std::shared_ptr< rs2_processing_block > _block
Definition: rs_processing.hpp:308
frame_queue(unsigned int capacity)
Definition: rs_processing.hpp:122
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:961
bool supports(rs2_camera_info info) const
Definition: rs_processing.hpp:281
Definition: rs_types.h:162
points calculate(frame depth)
Definition: rs_processing.hpp:402
Definition: rs_processing.hpp:813
Definition: rs_processing.hpp:939
Definition: rs_option.h:57
threshold_filter(filter f)
Definition: rs_processing.hpp:497
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls,...
Definition: rs_option.h:22
Definition: rs_types.h:160
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
Definition: rs_processing.hpp:161
rs2_processing_block * rs2_create_zero_order_invalidation_block(rs2_error **error)
Definition: rs_types.h:161
rs2_frame * rs2_allocate_points(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, 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:163
Definition: rs_option.h:55
Definition: rs_processing.hpp:453
Definition: rs_frame.hpp:634
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
size_t capacity() const
Definition: rs_processing.hpp:194
void on_frame(rs2_frame *f, rs2_source *source) override
Definition: rs_processing.hpp:104
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:600
void register_simple_option(rs2_option option_id, option_range range)
Definition: rs_processing.hpp:302
pointcloud(rs2_stream stream, int index=0)
Definition: rs_processing.hpp:391
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
float min
Definition: rs_types.hpp:155
bool poll_for_frames(frameset *fs) const
Definition: rs_processing.hpp:572
Definition: rs_frame.hpp:830
T as() const
Definition: rs_processing.hpp:369
void rs2_delete_frame_queue(rs2_frame_queue *queue)
void map_to(frame mapped)
Definition: rs_processing.hpp:423
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:204
frame_queue _queue
Definition: rs_processing.hpp:377
colorizer(float color_scheme)
Definition: rs_processing.hpp:673
Definition: rs_context.hpp:96
void frame_ready(frame result) const
Definition: rs_processing.hpp:79
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:252
threshold_filter(float min_dist=0.15f, float max_dist=4.f)
Definition: rs_processing.hpp:490
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:32
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:238
align(rs2_stream align_to)
Definition: rs_processing.hpp:624
Definition: rs_frame.hpp:1045
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:323
Definition: rs_option.h:60
frame_queue()
Definition: rs_processing.hpp:131
yuy_decoder()
Definition: rs_processing.hpp:464
Definition: rs_processing.hpp:17
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
bool is() const
Definition: rs_processing.hpp:362
hole_filling_filter()
Definition: rs_processing.hpp:946
temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control)
Definition: rs_processing.hpp:779
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
frameset process(frameset frames)
Definition: rs_processing.hpp:632
frame_queue get_queue()
Definition: rs_processing.hpp:358
Definition: rs_types.hpp:32
zero_order_invalidation(filter f)
Definition: rs_processing.hpp:914
processing_block(S processing_function)
Definition: rs_processing.hpp:263
Definition: rs_processing.hpp:752
Definition: rs_types.hpp:153
video_frame colorize(frame depth) const
Definition: rs_processing.hpp:682
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:719
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
rs2_processing_block * get() const
Definition: rs_processing.hpp:274
spatial_filter()
Definition: rs_processing.hpp:823
decimation_filter(filter f)
Definition: rs_processing.hpp:724
S & operator>>(S &on_frame)
Definition: rs_processing.hpp:228
pointcloud()
Definition: rs_processing.hpp:389
Definition: rs_options.hpp:11
spatial_filter(filter f)
Definition: rs_processing.hpp:842
void rs2_delete_processing_block(rs2_processing_block *block)
filter(S processing_function, int queue_size=1)
Definition: rs_processing.hpp:350
Definition: rs_processing.hpp:383
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
void enqueue(frame f) const
Definition: rs_processing.hpp:137
Definition: rs_processing.hpp:482
Definition: rs_option.h:62
void start(S on_frame)
Definition: rs_processing.hpp:215
struct rs2_options rs2_options
Definition: rs_types.h:220
Definition: rs_processing.hpp:904
void operator()(frame f) const
Definition: rs_processing.hpp:186
Definition: rs_option.h:63
int stream_index() const
Definition: rs_frame.hpp:33
syncer(int queue_size=1)
Definition: rs_processing.hpp:551
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
struct rs2_source rs2_source
Definition: rs_types.h:212
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:314
Definition: rs_types.h:158
bool try_wait_for_frames(frameset *fs, unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:589
Definition: rs_option.h:69
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:136
Definition: rs_processing.hpp:651
frame wait_for_frame(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:147
Definition: rs_types.h:141
zero_order_invalidation()
Definition: rs_processing.hpp:911
void release() override
Definition: rs_processing.hpp:111
yuy_decoder(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:467
filter(std::shared_ptr< rs2_processing_block > block, int queue_size=1)
Definition: rs_processing.hpp:337
frame allocate_points(const stream_profile &profile, const frame &original) const
Definition: rs_processing.hpp:47
Definition: rs_option.h:58
Definition: rs_processing.hpp:612
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:213
rs2_processing_block * rs2_create_yuy_decoder(rs2_error **error)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:131
asynchronous_syncer()
Definition: rs_processing.hpp:530
Definition: rs_frame.hpp:288
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:294
float def
Definition: rs_types.hpp:157
spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill)
Definition: rs_processing.hpp:834
rs2_processing_block * rs2_create_spatial_filter_block(rs2_error **error)
frame_processor_callback(T on_frame)
Definition: rs_processing.hpp:102
rs2_source * _source
Definition: rs_processing.hpp:87
options & operator=(const options &other)
Definition: rs_options.hpp:135
Definition: rs_processing.hpp:545
rs2_processing_block * get() const
Definition: rs_processing.hpp:359
Definition: rs_processing.hpp:114
Definition: rs_processing.hpp:98
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:562
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:159
Definition: rs_processing.hpp:706
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:956
temporal_filter()
Definition: rs_processing.hpp:761
struct rs2_error rs2_error
Definition: rs_types.h:197
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:505
rates_printer()
Definition: rs_processing.hpp:995
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:173
colorizer(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:688
colorizer()
Definition: rs_processing.hpp:658
pointcloud(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:432
struct rs2_frame rs2_frame
Definition: rs_types.h:199
Definition: rs_processing.hpp:869
disparity_transform(filter f)
Definition: rs_processing.hpp:878
Definition: rs_option.h:67
Definition: rs_processing.hpp:988
stream_profile get_profile() const
Definition: rs_frame.hpp:472
frame allocate_composite_frame(std::vector< frame > frames) const
Definition: rs_processing.hpp:62
disparity_transform(bool transform_to_disparity=true)
Definition: rs_processing.hpp:876
temporal_filter(filter f)
Definition: rs_processing.hpp:786
Definition: rs_types.h:164