Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
Loading...
Searching...
No Matches
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
11namespace rs2
12{
18 class frame_source
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,
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);
45 return result;
46 }
47
57 const frame& original,
59 {
60 rs2_error* e = nullptr;
61 auto result = rs2_allocate_synthetic_motion_frame(_source, profile.get(),
62 original.get(), frame_type, &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);
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);
92 return result;
93 }
94
99 void frame_ready(frame result) const
100 {
101 rs2_error* e = nullptr;
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 {
120 T on_frame_function;
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>(
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>
183 typename std::enable_if<std::is_base_of<rs2::frame, T>::value, bool>::type poll_for_frame(T* output) const
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 }
205
208 void operator()(frame f) const
209 {
210 enqueue(std::move(f));
211 }
212
217 size_t size() const
218 {
219 rs2_error* e = nullptr;
220 auto res = rs2_frame_queue_size(_queue.get(), &e);
221 error::handle(e);
222 return static_cast<size_t>(res);
223 }
224
229 size_t capacity() const { return _capacity; }
234 bool keep_frames() const { return _keep; }
235
240 std::shared_ptr<rs2_frame_queue> get() { return _queue; }
241
242 private:
243 std::shared_ptr<rs2_frame_queue> _queue;
244 size_t _capacity;
245 bool _keep;
246 };
247
252 {
253 public:
254 using options::supports;
255
261 template<class S>
262 void start(S on_frame)
263 {
264 rs2_error* e = nullptr;
265 rs2_start_processing(get(), new frame_callback<S>(on_frame), &e);
266 error::handle(e);
267 }
268
274 template<class S>
275 S& operator>>(S& on_frame)
276 {
277 start(on_frame);
278 return on_frame;
279 }
280
285 void invoke(frame f) const
286 {
287 rs2_frame* ptr = nullptr;
288 std::swap(f.frame_ref, ptr);
289
290 rs2_error* e = nullptr;
291 rs2_process_frame(get(), ptr, &e);
292 error::handle(e);
293 }
294
299 processing_block(std::shared_ptr<rs2_processing_block> block)
300 : options((rs2_options*)block.get()), _block(block)
301 {
302 }
303
309 template<class S>
310 processing_block(S processing_function)
311 {
312 rs2_error* e = nullptr;
313 _block = std::shared_ptr<rs2_processing_block>(
314 rs2_create_processing_block(new frame_processor_callback<S>(processing_function), &e),
317 error::handle(e);
318 }
319
320 operator rs2_options*() const { return (rs2_options*)get(); }
321 rs2_processing_block* get() const { return _block.get(); }
322
328 bool supports(rs2_camera_info info) const
329 {
330 rs2_error* e = nullptr;
331 auto is_supported = rs2_supports_processing_block_info(_block.get(), info, &e);
332 error::handle(e);
333 return is_supported > 0;
334 }
335
341 const char* get_info(rs2_camera_info info) const
342 {
343 rs2_error* e = nullptr;
344 auto result = rs2_get_processing_block_info(_block.get(), info, &e);
345 error::handle(e);
346 return result;
347 }
348 protected:
350 rs2_error * e = nullptr;
352 range.min, range.max, range.step, range.def, &e);
353 error::handle(e);
354 }
355 std::shared_ptr<rs2_processing_block> _block;
356 };
357
362 {
363 public:
371 {
372 invoke(frame);
373 rs2::frame f;
374 if (!_queue.poll_for_frame(&f))
375 throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
376 return f;
377 }
378
384 filter(std::shared_ptr<rs2_processing_block> block, int queue_size = 1)
385 : processing_block(block),
386 _queue(queue_size)
387 {
388 start(_queue);
389 }
390
396 template<class S>
397 filter(S processing_function, int queue_size = 1) :
398 processing_block(processing_function),
399 _queue(queue_size)
400 {
401 start(_queue);
402 }
403
404
406 rs2_processing_block* get() const { return _block.get(); }
407
408 template<class T>
409 bool is() const
410 {
411 T extension(*this);
412 return extension;
413 }
414
415 template<class T>
416 T as() const
417 {
418 T extension(*this);
419 return extension;
420 }
421
422 operator bool() const { return _block.get() != nullptr; }
423 protected:
425 };
426
430 class pointcloud : public filter
431 {
432 public:
436 pointcloud() : filter(init(), 1) {}
437
438 pointcloud(rs2_stream stream, int index = 0) : filter(init(), 1)
439 {
440 set_option(RS2_OPTION_STREAM_FILTER, float(stream));
442 }
443
449 points calculate(frame depth) const
450 {
451 auto res = process(depth);
452 if (res.as<points>())
453 return res;
454
455 if (auto set = res.as <frameset>())
456 {
457 for (auto f : set)
458 {
459 if(f.as<points>())
460 return f;
461 }
462 }
463 throw std::runtime_error("Error occured during execution of the processing block! See the log for more info");
464 }
465
477
478 protected:
479 pointcloud(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
480
481 private:
482 friend class context;
483
484 std::shared_ptr<rs2_processing_block> init()
485 {
486 rs2_error* e = nullptr;
487
488 auto block = std::shared_ptr<rs2_processing_block>(
491
492 error::handle(e);
493
494 // Redirect options API to the processing block
495 //options::operator=(pb);
496 return block;
497 }
498 };
499
500 class yuy_decoder : public filter
501 {
502 public:
511 yuy_decoder() : filter(init(), 1) { }
512
513 protected:
514 yuy_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
515
516 private:
517 std::shared_ptr<rs2_processing_block> init()
518 {
519 rs2_error* e = nullptr;
520 auto block = std::shared_ptr<rs2_processing_block>(
523 error::handle(e);
524
525 return block;
526 }
527 };
528
529 class y411_decoder : public filter
530 {
531 public:
538 y411_decoder() : filter(init()) { }
539
540 protected:
541 y411_decoder(std::shared_ptr<rs2_processing_block> block) : filter(block) {}
542
543 private:
544 static std::shared_ptr<rs2_processing_block> init()
545 {
546 rs2_error* e = nullptr;
547 auto block = std::shared_ptr<rs2_processing_block>(
550 error::handle(e);
551
552 return block;
553 }
554 };
556 {
557 public:
563 threshold_filter(float min_dist = 0.15f, float max_dist = 4.f)
564 : filter(init(), 1)
565 {
568 }
569
571 {
572 rs2_error* e = nullptr;
574 {
575 _block.reset();
576 }
577 error::handle(e);
578 }
579
580 protected:
581 threshold_filter(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
582
583 private:
584 std::shared_ptr<rs2_processing_block> init()
585 {
586 rs2_error* e = nullptr;
587 auto block = std::shared_ptr<rs2_processing_block>(
590 error::handle(e);
591
592 return block;
593 }
594 };
595
596 class units_transform : public filter
597 {
598 public:
602 units_transform() : filter(init(), 1) {}
603
604 protected:
605 units_transform(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
606
607 private:
608 std::shared_ptr<rs2_processing_block> init()
609 {
610 rs2_error* e = nullptr;
611 auto block = std::shared_ptr<rs2_processing_block>(
614 error::handle(e);
615
616 return block;
617 }
618 };
619
621 {
622 public:
627
628 private:
629 std::shared_ptr<rs2_processing_block> init()
630 {
631 rs2_error* e = nullptr;
632 auto block = std::shared_ptr<rs2_processing_block>(
635
636 error::handle(e);
637 return block;
638 }
639 };
640
641 class syncer
642 {
643 public:
647 syncer(int queue_size = 1)
648 :_results(queue_size)
649 {
650 _sync.start(_results);
651 }
652
658 frameset wait_for_frames(unsigned int timeout_ms = 5000) const
659 {
660 return frameset(_results.wait_for_frame(timeout_ms));
661 }
662
668 bool poll_for_frames(frameset* fs) const
669 {
670 frame result;
671 if (_results.poll_for_frame(&result))
672 {
673 *fs = frameset(result);
674 return true;
675 }
676 return false;
677 }
678
685 bool try_wait_for_frames(frameset* fs, unsigned int timeout_ms = 5000) const
686 {
687 frame result;
688 if (_results.try_wait_for_frame(&result, timeout_ms))
689 {
690 *fs = frameset(result);
691 return true;
692 }
693 return false;
694 }
695
696 void operator()(frame f) const
697 {
698 _sync.invoke(std::move(f));
699 }
700 private:
702 frame_queue _results;
703 };
704
708 class align : public filter
709 {
710 public:
720 align(rs2_stream align_to) : filter(init(align_to), 1) {}
721
722 using filter::process;
723
731 {
732 return filter::process(frames);
733 }
734
735 protected:
736 align(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
737
738 private:
739 friend class context;
740 std::shared_ptr<rs2_processing_block> init(rs2_stream align_to)
741 {
742 rs2_error* e = nullptr;
743 auto block = std::shared_ptr<rs2_processing_block>(
744 rs2_create_align(align_to, &e),
746 error::handle(e);
747
748 return block;
749 }
750 };
751
752 class colorizer : public filter
753 {
754 public:
759 colorizer() : filter(init(), 1) { }
775 colorizer(float color_scheme) : filter(init(), 1)
776 {
777 set_option(RS2_OPTION_COLOR_SCHEME, float(color_scheme));
778 }
779
785 {
786 return process(depth);
787 }
788
789 protected:
790 colorizer(std::shared_ptr<rs2_processing_block> block) : filter(block, 1) {}
791
792 private:
793 std::shared_ptr<rs2_processing_block> init()
794 {
795 rs2_error* e = nullptr;
796 auto block = std::shared_ptr<rs2_processing_block>(
799 error::handle(e);
800
801 // Redirect options API to the processing block
802 //options::operator=(pb);
803
804 return block;
805 }
806 };
807
809 {
810 public:
815 decimation_filter() : filter(init(), 1) {}
821 decimation_filter(float magnitude) : filter(init(), 1)
822 {
824 }
825
827 {
828 rs2_error* e = nullptr;
830 {
831 _block.reset();
832 }
833 error::handle(e);
834 }
835
836 private:
837 friend class context;
838
839 std::shared_ptr<rs2_processing_block> init()
840 {
841 rs2_error* e = nullptr;
842 auto block = std::shared_ptr<rs2_processing_block>(
845 error::handle(e);
846
847 // Redirect options API to the processing block
848 //options::operator=(this);
849
850 return block;
851 }
852 };
853
854 class rotation_filter : public filter
855 {
856 public:
862 : filter( init(), 1 )
863 {
864 }
865
866 rotation_filter( float value )
867 : filter( init(), 1 )
868 {
870 }
871
873 : filter( f )
874 {
875 rs2_error * e = nullptr;
877 {
878 _block.reset();
879 }
880 error::handle( e );
881 }
882
883 private:
884 friend class context;
885
886 std::shared_ptr< rs2_processing_block > init()
887 {
888 rs2_error * e = nullptr;
889 auto block = std::shared_ptr< rs2_processing_block >( rs2_create_rotation_filter_block( &e ),
891 error::handle( e );
892 return block;
893 }
894 };
895
896 class temporal_filter : public filter
897 {
898 public:
905 temporal_filter() : filter(init(), 1) {}
923 temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control) : filter(init(), 1)
924 {
925 set_option(RS2_OPTION_HOLES_FILL, float(persistence_control));
926 set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
927 set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
928 }
929
931 {
932 rs2_error* e = nullptr;
934 {
935 _block.reset();
936 }
937 error::handle(e);
938 }
939 private:
940 friend class context;
941
942 std::shared_ptr<rs2_processing_block> init()
943 {
944 rs2_error* e = nullptr;
945 auto block = std::shared_ptr<rs2_processing_block>(
948 error::handle(e);
949
950 // Redirect options API to the processing block
951 //options::operator=(pb);
952
953 return block;
954 }
955 };
956
957 class spatial_filter : public filter
958 {
959 public:
967 spatial_filter() : filter(init(), 1) { }
968
978 spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill) : filter(init(), 1)
979 {
980 set_option(RS2_OPTION_FILTER_SMOOTH_ALPHA, float(smooth_alpha));
981 set_option(RS2_OPTION_FILTER_SMOOTH_DELTA, float(smooth_delta));
984 }
985
987 {
988 rs2_error* e = nullptr;
990 {
991 _block.reset();
992 }
993 error::handle(e);
994 }
995 private:
996 friend class context;
997
998 std::shared_ptr<rs2_processing_block> init()
999 {
1000 rs2_error* e = nullptr;
1001 auto block = std::shared_ptr<rs2_processing_block>(
1004 error::handle(e);
1005
1006 // Redirect options API to the processing block
1007 //options::operator=(pb);
1008
1009 return block;
1010 }
1011 };
1012
1014 {
1015 public:
1020 disparity_transform(bool transform_to_disparity = true) : filter(init(transform_to_disparity), 1) { }
1021
1023 {
1024 rs2_error* e = nullptr;
1026 {
1027 _block.reset();
1028 }
1029 error::handle(e);
1030 }
1031 private:
1032 friend class context;
1033 std::shared_ptr<rs2_processing_block> init(bool transform_to_disparity)
1034 {
1035 rs2_error* e = nullptr;
1036 auto block = std::shared_ptr<rs2_processing_block>(
1037 rs2_create_disparity_transform_block(uint8_t(transform_to_disparity), &e),
1039 error::handle(e);
1040
1041 // Redirect options API to the processing block
1042 //options::operator=(pb);
1043
1044 return block;
1045 }
1046 };
1047
1049 {
1050 public:
1055 {}
1056
1058 {
1059 rs2_error* e = nullptr;
1061 {
1062 _block.reset();
1063 }
1064 error::handle(e);
1065 }
1066
1067 private:
1068 friend class context;
1069
1070 std::shared_ptr<rs2_processing_block> init()
1071 {
1072 rs2_error* e = nullptr;
1073 auto block = std::shared_ptr<rs2_processing_block>(
1076 error::handle(e);
1077
1078 return block;
1079 }
1080 };
1081
1083 {
1084 public:
1089 hole_filling_filter() : filter(init(), 1) {}
1090
1099 hole_filling_filter(int mode) : filter(init(), 1)
1100 {
1101 set_option(RS2_OPTION_HOLES_FILL, float(mode));
1102 }
1103
1105 {
1106 rs2_error* e = nullptr;
1108 {
1109 _block.reset();
1110 }
1111 error::handle(e);
1112 }
1113 private:
1114 friend class context;
1115
1116 std::shared_ptr<rs2_processing_block> init()
1117 {
1118 rs2_error* e = nullptr;
1119 auto block = std::shared_ptr<rs2_processing_block>(
1122 error::handle(e);
1123
1124 // Redirect options API to the processing block
1125 //options::operator=(_block);
1126
1127 return block;
1128 }
1129 };
1130
1131 class rates_printer : public filter
1132 {
1133 public:
1138 rates_printer() : filter(init(), 1) {}
1139
1140 private:
1141 friend class context;
1142
1143 std::shared_ptr<rs2_processing_block> init()
1144 {
1145 rs2_error* e = nullptr;
1146 auto block = std::shared_ptr<rs2_processing_block>(
1149 error::handle(e);
1150
1151 return block;
1152 }
1153 };
1154
1155 class hdr_merge : public filter
1156 {
1157 public:
1163 hdr_merge() : filter(init()) {}
1164
1166 {
1167 rs2_error* e = nullptr;
1169 {
1170 _block.reset();
1171 }
1172 error::handle(e);
1173 }
1174
1175 private:
1176 friend class context;
1177
1178 std::shared_ptr<rs2_processing_block> init()
1179 {
1180 rs2_error* e = nullptr;
1181 auto block = std::shared_ptr<rs2_processing_block>(
1184 error::handle(e);
1185
1186 return block;
1187 }
1188 };
1189
1191 {
1192 public:
1198
1204 sequence_id_filter(float sequence_id) : filter(init(), 1)
1205 {
1206 set_option(RS2_OPTION_SEQUENCE_ID, sequence_id);
1207 }
1208
1210 {
1211 rs2_error* e = nullptr;
1213 {
1214 _block.reset();
1215 }
1216 error::handle(e);
1217 }
1218
1219 private:
1220 friend class context;
1221
1222 std::shared_ptr<rs2_processing_block> init()
1223 {
1224 rs2_error* e = nullptr;
1225 auto block = std::shared_ptr<rs2_processing_block>(
1228 error::handle(e);
1229
1230 return block;
1231 }
1232 };
1233}
1234#endif // LIBREALSENSE_RS2_PROCESSING_HPP
align(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:736
frameset process(frameset frames)
Definition rs_processing.hpp:730
friend class context
Definition rs_processing.hpp:739
align(rs2_stream align_to)
Definition rs_processing.hpp:720
Definition rs_processing.hpp:621
asynchronous_syncer()
Definition rs_processing.hpp:626
colorizer(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:790
video_frame colorize(frame depth) const
Definition rs_processing.hpp:784
colorizer()
Definition rs_processing.hpp:759
colorizer(float color_scheme)
Definition rs_processing.hpp:775
decimation_filter(float magnitude)
Definition rs_processing.hpp:821
decimation_filter()
Definition rs_processing.hpp:815
friend class context
Definition rs_processing.hpp:837
decimation_filter(filter f)
Definition rs_processing.hpp:826
depth_huffman_decoder(filter f)
Definition rs_processing.hpp:1057
depth_huffman_decoder()
Definition rs_processing.hpp:1054
friend class context
Definition rs_processing.hpp:1068
disparity_transform(filter f)
Definition rs_processing.hpp:1022
disparity_transform(bool transform_to_disparity=true)
Definition rs_processing.hpp:1020
friend class context
Definition rs_processing.hpp:1032
static void handle(rs2_error *e)
Definition rs_types.hpp:162
Definition rs_frame.hpp:339
filter(std::shared_ptr< rs2_processing_block > block, int queue_size=1)
Definition rs_processing.hpp:384
filter(S processing_function, int queue_size=1)
Definition rs_processing.hpp:397
rs2_processing_block * get() const
Definition rs_processing.hpp:406
rs2::frame process(rs2::frame frame) const override
Definition rs_processing.hpp:370
bool is() const
Definition rs_processing.hpp:409
T as() const
Definition rs_processing.hpp:416
frame_queue get_queue()
Definition rs_processing.hpp:405
frame_queue _queue
Definition rs_processing.hpp:424
Definition rs_frame.hpp:1181
Definition rs_processing.hpp:119
void on_frame(rs2_frame *f, rs2_source *source) override
Definition rs_processing.hpp:124
frame_processor_callback(T on_frame)
Definition rs_processing.hpp:122
void release() override
Definition rs_processing.hpp:131
Definition rs_processing.hpp:135
void enqueue(frame f) const
Definition rs_processing.hpp:158
size_t capacity() const
Definition rs_processing.hpp:229
void operator()(frame f) const
Definition rs_processing.hpp:208
frame wait_for_frame(unsigned int timeout_ms=5000) const
Definition rs_processing.hpp:169
size_t size() const
Definition rs_processing.hpp:217
frame_queue()
Definition rs_processing.hpp:152
bool keep_frames() const
Definition rs_processing.hpp:234
std::shared_ptr< rs2_frame_queue > get()
Definition rs_processing.hpp:240
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
Definition rs_processing.hpp:183
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:195
frame_queue(unsigned int capacity, bool keep_frames=false)
Definition rs_processing.hpp:143
Definition rs_processing.hpp:19
frame allocate_composite_frame(std::vector< frame > frames) const
Definition rs_processing.hpp:82
void frame_ready(frame result) const
Definition rs_processing.hpp:99
friend class frame_processor_callback
Definition rs_processing.hpp:110
rs2_source * _source
Definition rs_processing.hpp:107
frame allocate_motion_frame(const stream_profile &profile, const frame &original, rs2_extension frame_type=RS2_EXTENSION_MOTION_FRAME) const
Definition rs_processing.hpp:56
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
frame allocate_points(const stream_profile &profile, const frame &original) const
Definition rs_processing.hpp:67
Definition rs_frame.hpp:346
void keep()
Definition rs_frame.hpp:439
stream_profile get_profile() const
Definition rs_frame.hpp:559
rs2_frame * get() const
Definition rs_frame.hpp:592
Definition rs_frame.hpp:958
friend class context
Definition rs_processing.hpp:1176
hdr_merge(filter f)
Definition rs_processing.hpp:1165
hdr_merge()
Definition rs_processing.hpp:1163
hole_filling_filter(int mode)
Definition rs_processing.hpp:1099
hole_filling_filter(filter f)
Definition rs_processing.hpp:1104
hole_filling_filter()
Definition rs_processing.hpp:1089
friend class context
Definition rs_processing.hpp:1114
options & operator=(const options &other)
Definition rs_options.hpp:323
options(const options &other)
Definition rs_options.hpp:329
void set_option(rs2_option option, float value) const
Definition rs_options.hpp:256
bool supports(rs2_option option) const
Definition rs_options.hpp:163
pointcloud()
Definition rs_processing.hpp:436
pointcloud(rs2_stream stream, int index=0)
Definition rs_processing.hpp:438
pointcloud(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:479
points calculate(frame depth) const
Definition rs_processing.hpp:449
friend class context
Definition rs_processing.hpp:482
void map_to(frame mapped)
Definition rs_processing.hpp:470
Definition rs_frame.hpp:740
const char * get_info(rs2_camera_info info) const
Definition rs_processing.hpp:341
processing_block(S processing_function)
Definition rs_processing.hpp:310
processing_block(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:299
void invoke(frame f) const
Definition rs_processing.hpp:285
bool supports(rs2_camera_info info) const
Definition rs_processing.hpp:328
void register_simple_option(rs2_option option_id, option_range range)
Definition rs_processing.hpp:349
std::shared_ptr< rs2_processing_block > _block
Definition rs_processing.hpp:355
void start(S on_frame)
Definition rs_processing.hpp:262
rs2_processing_block * get() const
Definition rs_processing.hpp:321
S & operator>>(S &on_frame)
Definition rs_processing.hpp:275
rates_printer()
Definition rs_processing.hpp:1138
friend class context
Definition rs_processing.hpp:1141
rotation_filter()
Definition rs_processing.hpp:861
rotation_filter(filter f)
Definition rs_processing.hpp:872
friend class context
Definition rs_processing.hpp:884
rotation_filter(float value)
Definition rs_processing.hpp:866
sequence_id_filter()
Definition rs_processing.hpp:1197
sequence_id_filter(filter f)
Definition rs_processing.hpp:1209
sequence_id_filter(float sequence_id)
Definition rs_processing.hpp:1204
friend class context
Definition rs_processing.hpp:1220
spatial_filter(filter f)
Definition rs_processing.hpp:986
spatial_filter()
Definition rs_processing.hpp:967
friend class context
Definition rs_processing.hpp:996
spatial_filter(float smooth_alpha, float smooth_delta, float magnitude, float hole_fill)
Definition rs_processing.hpp:978
Definition rs_frame.hpp:23
rs2_format format() const
Definition rs_frame.hpp:44
int stream_index() const
Definition rs_frame.hpp:34
rs2_stream stream_type() const
Definition rs_frame.hpp:39
const rs2_stream_profile * get() const
Definition rs_frame.hpp:137
bool try_wait_for_frames(frameset *fs, unsigned int timeout_ms=5000) const
Definition rs_processing.hpp:685
bool poll_for_frames(frameset *fs) const
Definition rs_processing.hpp:668
void operator()(frame f) const
Definition rs_processing.hpp:696
syncer(int queue_size=1)
Definition rs_processing.hpp:647
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition rs_processing.hpp:658
friend class context
Definition rs_processing.hpp:940
temporal_filter(float smooth_alpha, float smooth_delta, int persistence_control)
Definition rs_processing.hpp:923
temporal_filter()
Definition rs_processing.hpp:905
temporal_filter(filter f)
Definition rs_processing.hpp:930
threshold_filter(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:581
threshold_filter(float min_dist=0.15f, float max_dist=4.f)
Definition rs_processing.hpp:563
threshold_filter(filter f)
Definition rs_processing.hpp:570
units_transform()
Definition rs_processing.hpp:602
units_transform(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:605
Definition rs_frame.hpp:639
y411_decoder()
Definition rs_processing.hpp:538
y411_decoder(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:541
yuy_decoder()
Definition rs_processing.hpp:511
yuy_decoder(std::shared_ptr< rs2_processing_block > block)
Definition rs_processing.hpp:514
Definition rs_processing_gl.hpp:13
rs2_frame * rs2_allocate_points(rs2_source *source, const rs2_stream_profile *new_stream, rs2_frame *original, rs2_error **error)
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)
rs2_frame * rs2_allocate_composite_frame(rs2_source *source, rs2_frame **frames, int count, rs2_error **error)
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
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_option
Defines general configuration controls. These can generally be mapped to camera UVC controls,...
Definition rs_option.h:27
@ RS2_OPTION_FILTER_SMOOTH_ALPHA
Definition rs_option.h:65
@ RS2_OPTION_STREAM_FILTER
Definition rs_option.h:71
@ RS2_OPTION_ROTATION
Definition rs_option.h:128
@ RS2_OPTION_HOLES_FILL
Definition rs_option.h:67
@ RS2_OPTION_SEQUENCE_ID
Definition rs_option.h:108
@ RS2_OPTION_MAX_DISTANCE
Definition rs_option.h:62
@ RS2_OPTION_COLOR_SCHEME
Definition rs_option.h:59
@ RS2_OPTION_STREAM_INDEX_FILTER
Definition rs_option.h:73
@ RS2_OPTION_MIN_DISTANCE
Definition rs_option.h:61
@ RS2_OPTION_FILTER_SMOOTH_DELTA
Definition rs_option.h:66
@ RS2_OPTION_FILTER_MAGNITUDE
Definition rs_option.h:64
@ RS2_OPTION_STREAM_FORMAT_FILTER
Definition rs_option.h:72
void rs2_delete_processing_block(rs2_processing_block *block)
rs2_processing_block * rs2_create_decimation_filter_block(rs2_error **error)
void rs2_delete_frame_queue(rs2_frame_queue *queue)
rs2_processing_block * rs2_create_sequence_id_filter(rs2_error **error)
rs2_processing_block * rs2_create_threshold(rs2_error **error)
rs2_processing_block * rs2_create_yuy_decoder(rs2_error **error)
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)
void rs2_process_frame(rs2_processing_block *block, rs2_frame *frame, rs2_error **error)
const char * rs2_get_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
rs2_processing_block * rs2_create_units_transform(rs2_error **error)
int rs2_is_processing_block_extendable_to(const rs2_processing_block *block, rs2_extension extension_type, rs2_error **error)
rs2_frame_queue * rs2_create_frame_queue(int capacity, rs2_error **error)
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
rs2_processing_block * rs2_create_rates_printer_block(rs2_error **error)
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
rs2_processing_block * rs2_create_rotation_filter_block(rs2_error **error)
void rs2_start_processing(rs2_processing_block *block, rs2_frame_callback *on_frame, rs2_error **error)
rs2_frame * rs2_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_error **error)
rs2_processing_block * rs2_create_hdr_merge_processing_block(rs2_error **error)
rs2_processing_block * rs2_create_colorizer(rs2_error **error)
int rs2_try_wait_for_frame(rs2_frame_queue *queue, unsigned int timeout_ms, rs2_frame **output_frame, rs2_error **error)
rs2_processing_block * rs2_create_align(rs2_stream align_to, rs2_error **error)
rs2_processing_block * rs2_create_y411_decoder(rs2_error **error)
int rs2_supports_processing_block_info(const rs2_processing_block *block, rs2_camera_info info, rs2_error **error)
rs2_processing_block * rs2_create_hole_filling_filter_block(rs2_error **error)
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
int rs2_frame_queue_size(rs2_frame_queue *queue, rs2_error **error)
rs2_processing_block * rs2_create_spatial_filter_block(rs2_error **error)
rs2_processing_block * rs2_create_sync_processing_block(rs2_error **error)
rs2_processing_block * rs2_create_disparity_transform_block(unsigned char transform_to_disparity, rs2_error **error)
rs2_processing_block * rs2_create_huffman_depth_decompress_block(rs2_error **error)
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition rs_sensor.h:44
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
struct rs2_source rs2_source
Definition rs_types.h:246
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition rs_types.h:137
@ RS2_EXTENSION_MOTION_FRAME
Definition rs_types.h:147
@ RS2_EXTENSION_HDR_MERGE
Definition rs_types.h:190
@ RS2_EXTENSION_HOLE_FILLING_FILTER
Definition rs_types.h:169
@ RS2_EXTENSION_DISPARITY_FILTER
Definition rs_types.h:166
@ RS2_EXTENSION_TEMPORAL_FILTER
Definition rs_types.h:168
@ RS2_EXTENSION_ROTATION_FILTER
Definition rs_types.h:164
@ RS2_EXTENSION_DEPTH_HUFFMAN_DECODER
Definition rs_types.h:184
@ RS2_EXTENSION_VIDEO_FRAME
Definition rs_types.h:146
@ RS2_EXTENSION_SPATIAL_FILTER
Definition rs_types.h:167
@ RS2_EXTENSION_DECIMATION_FILTER
Definition rs_types.h:163
@ RS2_EXTENSION_SEQUENCE_ID_FILTER
Definition rs_types.h:191
@ RS2_EXTENSION_THRESHOLD_FILTER
Definition rs_types.h:165
struct rs2_error rs2_error
Definition rs_types.h:230
struct rs2_options rs2_options
Definition rs_types.h:255
struct rs2_frame rs2_frame
Definition rs_types.h:233
struct rs2_processing_block rs2_processing_block
Definition rs_types.h:247
Definition rs_types.hpp:195
float def
Definition rs_types.hpp:198
float step
Definition rs_types.hpp:199
float max
Definition rs_types.hpp:197
float min
Definition rs_types.hpp:196
Definition rs_types.hpp:35