align.h
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 #pragma once
5 
6 #include <map>
7 #include <utility>
8 #include "../core/processing.h"
9 #include "synthetic-stream.h"
10 #include "../image.h"
11 #include "../source.h"
12 
13 namespace librealsense
14 {
16  {
17  public:
18  align(rs2_stream to_stream);
19 
20  protected:
21  align(rs2_stream to_stream, const char* name)
22  : generic_processing_block(name),
23  _to_stream_type(to_stream), _depth_scale(0)
24  {}
25 
26  bool should_process(const rs2::frame& frame) override;
27  rs2::frame process_frame(const rs2::frame_source& source, const rs2::frame& f) override;
28 
29  virtual void reset_cache(rs2_stream from, rs2_stream to) {}
30 
31  virtual void align_z_to_other(rs2::video_frame& aligned,
32  const rs2::video_frame& depth,
34  float z_scale);
35 
36  virtual void align_other_to_z(rs2::video_frame& aligned,
37  const rs2::video_frame& depth,
38  const rs2::video_frame& other,
39  float z_scale);
40 
41  virtual rs2_extension select_extension(const rs2::frame& input);
42 
43  std::shared_ptr<rs2::video_stream_profile> create_aligned_profile(
44  rs2::video_stream_profile& original_profile,
46 
48  std::map<std::pair<stream_profile_interface*, stream_profile_interface*>, std::shared_ptr<rs2::video_stream_profile>> _align_stream_unique_ids;
50  float _depth_scale;
51 
52  private:
53  rs2::video_frame allocate_aligned_frame(const rs2::frame_source& source, const rs2::video_frame& from, const rs2::video_frame& to);
54  void align_frames(rs2::video_frame& aligned, const rs2::video_frame& from, const rs2::video_frame& to);
55  };
56 }
std::map< std::pair< stream_profile_interface *, stream_profile_interface * >, std::shared_ptr< rs2::video_stream_profile > > _align_stream_unique_ids
Definition: align.h:48
GLsizei GLsizei GLchar * source
GLuint const GLchar * name
float _depth_scale
Definition: align.h:50
GLint GLint GLsizei GLsizei GLsizei depth
align(rs2_stream to_stream, const char *name)
Definition: align.h:21
virtual void reset_cache(rs2_stream from, rs2_stream to)
Definition: align.h:29
#define LRS_EXTENSION_API
Definition: basics.h:15
rs2::stream_profile _source_stream_profile
Definition: align.h:49
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
rs2_stream _to_stream_type
Definition: align.h:47
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:166
stream_profile to_profile(const stream_profile_interface *sp)
Definition: src/stream.h:185
GLdouble f


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:41:41