4 #ifndef LIBREALSENSE_RS2_PROCESSING_HPP 5 #define LIBREALSENSE_RS2_PROCESSING_HPP 17 const frame& original,
26 original.
get(), new_bpp, new_width, new_height, new_stride, frame_type, &e);
35 std::vector<rs2_frame*> refs(frames.size(),
nullptr);
36 for (
size_t i = 0; i < frames.size(); i++)
37 std::swap(refs[i], frames[i].frame_ref);
49 result.frame_ref =
nullptr;
73 on_frame_function(std::move(frm), src);
100 std::swap(f.frame_ref, ptr);
121 _block = std::shared_ptr<rs2_processing_block>(
131 std::shared_ptr<rs2_processing_block> _block;
146 _queue = std::shared_ptr<rs2_frame_queue>(
161 f.frame_ref =
nullptr;
188 frame f{ frame_ref };
189 if (res) *output = f;
201 std::shared_ptr<rs2_frame_queue> _queue;
212 auto pb = std::shared_ptr<rs2_processing_block>(
215 _block = std::make_shared<processing_block>(pb);
222 _block->start(_queue);
227 _block->invoke(std::move(depth));
234 _block->invoke(std::move(mapped));
239 std::shared_ptr<processing_block> _block;
249 _processing_block = std::make_shared<processing_block>(
250 std::shared_ptr<rs2_processing_block>(
265 _processing_block->operator()(std::move(f));
268 std::shared_ptr<processing_block> _processing_block;
275 :_results(queue_size)
277 _sync.
start(_results);
334 _block = std::make_shared<processing_block>(
335 std::shared_ptr<rs2_processing_block>(
340 _block->start(_queue);
359 (*_block)(std::move(f));
364 std::shared_ptr<processing_block> _block;
374 auto pb = std::shared_ptr<rs2_processing_block>(
377 _block = std::make_shared<processing_block>(pb);
383 _block->start(_queue);
390 _block->invoke(std::move(depth));
399 std::shared_ptr<processing_block> _block;
420 auto pb = std::shared_ptr<rs2_processing_block>(
423 _block = std::make_shared<processing_block>(pb);
429 _block->start(_queue);
442 (*_block)(std::move(f));
447 std::shared_ptr<processing_block> _block;
457 auto pb = std::shared_ptr<rs2_processing_block>(
460 _block = std::make_shared<processing_block>(pb);
466 _block->start(_queue);
479 (*_block)(std::move(f));
484 std::shared_ptr<processing_block> _block;
494 auto pb = std::shared_ptr<rs2_processing_block>(
497 _block = std::make_shared<processing_block>(pb);
503 _block->start(_queue);
516 (*_block)(std::move(f));
521 std::shared_ptr<processing_block> _block;
531 auto pb = std::shared_ptr<rs2_processing_block>(
534 _block = std::make_shared<processing_block>(pb);
540 _block->start(_queue);
553 (*_block)(std::move(f));
558 std::shared_ptr<processing_block> _block;
562 #endif // LIBREALSENSE_RS2_PROCESSING_HPP decimation_filter()
Definition: rs_processing.hpp:417
rs2_processing_block * rs2_create_decimation_filter_block(rs2_error **error)
Definition: rs_frame.hpp:21
Definition: rs_frame.hpp:407
Definition: rs_frame.hpp:202
Definition: rs_processing.hpp:243
frame_queue(unsigned int capacity)
Definition: rs_processing.hpp:143
rs2_frame * rs2_allocate_composite_frame(rs2_source *source, rs2_frame **frames, int count, rs2_error **error)
void operator()(frame f) const
Definition: rs_processing.hpp:357
points calculate(frame depth)
Definition: rs_processing.hpp:225
Definition: rs_processing.hpp:488
std::enable_if< std::is_base_of< rs2::frame, T >::value, bool >::type poll_for_frame(T *output) const
Definition: rs_processing.hpp:182
void rs2_start_processing(rs2_processing_block *block, rs2_frame_callback *on_frame, rs2_error **error)
Definition: rs_frame.hpp:482
int rs2_poll_for_frame(rs2_frame_queue *queue, rs2_frame **output_frame, rs2_error **error)
size_t capacity() const
Definition: rs_processing.hpp:198
void on_frame(rs2_frame *f, rs2_source *source) override
Definition: rs_processing.hpp:69
rs2_processing_block * rs2_create_sync_processing_block(rs2_error **error)
void operator()(frame f) const
Definition: rs_processing.hpp:307
virtual ~process_interface()=default
rs2::frame process(rs2::frame frame) override
Definition: rs_processing.hpp:469
std::function< void(frame_interface *)> on_frame
Definition: streaming.h:103
rs2_processing_block * rs2_create_processing_block(rs2_frame_processor_callback *proc, rs2_error **error)
bool poll_for_frames(frameset *fs) const
Definition: rs_processing.hpp:296
Definition: rs_frame.hpp:630
void rs2_delete_frame_queue(rs2_frame_queue *queue)
void operator()(frame f) const
Definition: rs_processing.hpp:107
void map_to(frame mapped)
Definition: rs_processing.hpp:231
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)
rs2::frame process(rs2::frame frame) override
Definition: rs_processing.hpp:506
Definition: rs_processing.hpp:79
Definition: rs_context.hpp:78
void frame_ready(frame result) const
Definition: rs_processing.hpp:44
processing_block(std::shared_ptr< rs2_processing_block > block)
Definition: rs_processing.hpp:112
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:16
virtual void operator()(frame f) const =0
Definition: rs_processing.hpp:406
void invoke(frame f) const
Definition: rs_processing.hpp:97
align(rs2_stream align_to)
Definition: rs_processing.hpp:331
Definition: rs_sensor.hpp:100
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)
frame_queue()
Definition: rs_processing.hpp:152
Definition: processing.h:12
Definition: rs_processing.hpp:13
rs2_processing_block * rs2_create_pointcloud(rs2_error **error)
void rs2_enqueue_frame(rs2_frame *frame, void *queue)
virtual rs2::frame process(rs2::frame frame)=0
Definition: rs_types.hpp:34
processing_block(S processing_function)
Definition: rs_processing.hpp:118
Definition: rs_processing.hpp:451
video_frame colorize(frame depth) const
Definition: rs_processing.hpp:386
void rs2_synthetic_frame_ready(rs2_source *source, rs2_frame *frame, rs2_error **error)
spatial_filter()
Definition: rs_processing.hpp:491
S & operator>>(S &on_frame)
Definition: rs_processing.hpp:91
pointcloud()
Definition: rs_processing.hpp:208
Definition: rs_sensor.hpp:114
void operator()(frame f) const override
Definition: rs_processing.hpp:477
void rs2_delete_processing_block(rs2_processing_block *block)
Definition: rs_processing.hpp:205
rs2_processing_block * rs2_create_temporal_filter_block(rs2_error **error)
void enqueue(frame f) const
Definition: rs_processing.hpp:158
void start(S on_frame)
Definition: rs_processing.hpp:83
struct rs2_options rs2_options
Definition: rs_types.h:170
void start(S on_frame)
Definition: rs_processing.hpp:258
void operator()(frame f) const
Definition: rs_processing.hpp:263
void operator()(frame f) const
Definition: rs_processing.hpp:193
syncer(int queue_size=1)
Definition: rs_processing.hpp:274
void operator()(frame f) const override
Definition: rs_processing.hpp:440
static void handle(rs2_error *e)
Definition: rs_types.hpp:123
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:36
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:79
Definition: rs_processing.hpp:368
frame wait_for_frame(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:168
Definition: rs_types.h:103
void release() override
Definition: rs_processing.hpp:76
Definition: rs_processing.hpp:319
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:93
asynchronous_syncer()
Definition: rs_processing.hpp:246
rs2_processing_block * rs2_create_spatial_filter_block(rs2_error **error)
frame_processor_callback(T on_frame)
Definition: rs_processing.hpp:67
rs2_source * _source
Definition: rs_processing.hpp:52
options & operator=(const options &other)
Definition: rs_sensor.hpp:209
Definition: rs_processing.hpp:271
video_frame operator()(frame depth) const
Definition: rs_processing.hpp:396
Definition: rs_processing.hpp:135
Definition: rs_processing.hpp:63
frameset wait_for_frames(unsigned int timeout_ms=5000) const
Definition: rs_processing.hpp:286
Definition: rs_processing.hpp:414
temporal_filter()
Definition: rs_processing.hpp:454
Definition: rs_option.h:59
void operator()(frame f) const override
Definition: rs_processing.hpp:514
frameset process(frameset frame)
Definition: rs_processing.hpp:349
rs2_frame * get() const
Definition: rs_frame.hpp:367
colorizer()
Definition: rs_processing.hpp:371
struct rs2_frame rs2_frame
Definition: rs_types.h:150
stream_profile get_profile() const
Definition: rs_frame.hpp:345
frame allocate_composite_frame(std::vector< frame > frames) const
Definition: rs_processing.hpp:31
int unique_id() const
Definition: rs_frame.hpp:32
rs2::frame process(rs2::frame frame) override
Definition: rs_processing.hpp:432