sse-align.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory. */
2 /* Copyright(c) 2019 Intel Corporation. All Rights Reserved. */
3 #pragma once
4 #ifdef __SSSE3__
5 
6 #include "proc/align.h"
7 
8 namespace librealsense
9 {
10  class image_transform
11  {
12  public:
13 
14  image_transform(const rs2_intrinsics& from,
15  float depth_scale);
16 
17  inline void align_depth_to_other(const uint16_t* z_pixels,
18  uint16_t* dest, int bpp,
19  const rs2_intrinsics& depth,
20  const rs2_intrinsics& to,
21  const rs2_extrinsics& from_to_other);
22 
23  inline void align_other_to_depth(const uint16_t* z_pixels,
24  const byte* source,
25  byte* dest, int bpp, const rs2_intrinsics& to,
26  const rs2_extrinsics& from_to_other);
27 
28  void pre_compute_x_y_map_corners();
29 
30  private:
31 
32  const rs2_intrinsics _depth;
33  float _depth_scale;
34 
35  std::vector<float> _pre_compute_map_x_top_left;
36  std::vector<float> _pre_compute_map_y_top_left;
37  std::vector<float> _pre_compute_map_x_bottom_right;
38  std::vector<float> _pre_compute_map_y_bottom_right;
39 
40  std::vector<int2> _pixel_top_left_int;
41  std::vector<int2> _pixel_bottom_right_int;
42 
43  void pre_compute_x_y_map(std::vector<float>& pre_compute_map_x,
44  std::vector<float>& pre_compute_map_y,
45  float offset = 0);
46 
47  template<rs2_distortion dist = RS2_DISTORTION_NONE>
48  inline void align_depth_to_other_sse(const uint16_t* z_pixels,
50  const rs2_intrinsics& to,
51  const rs2_extrinsics& from_to_other);
52 
53  template<rs2_distortion dist = RS2_DISTORTION_NONE>
54  inline void align_other_to_depth_sse(const uint16_t* z_pixels,
55  const byte* source,
56  byte* dest, int bpp, const rs2_intrinsics& to,
57  const rs2_extrinsics& from_to_other);
58 
59  inline void move_depth_to_other(const uint16_t* z_pixels,
60  uint16_t* dest, const rs2_intrinsics& to,
61  const std::vector<int2>& pixel_top_left_int,
62  const std::vector<int2>& pixel_bottom_right_int);
63 
64  template<class T >
65  inline void move_other_to_depth(const uint16_t* z_pixels,
66  const T* source,
67  T* dest, const rs2_intrinsics& to,
68  const std::vector<int2>& pixel_top_left_int,
69  const std::vector<int2>& pixel_bottom_right_int);
70 
71  };
72 
73  class align_sse : public align
74  {
75  public:
76  align_sse(rs2_stream to_stream) : align(to_stream, "Align (SSE3)") {}
77 
78  protected:
79  void reset_cache(rs2_stream from, rs2_stream to) override;
80 
81  void align_z_to_other(rs2::video_frame& aligned, const rs2::video_frame& depth, const rs2::video_stream_profile& other_profile, float z_scale) override;
82 
83  void align_other_to_z(rs2::video_frame& aligned, const rs2::video_frame& depth, const rs2::video_frame& other, float z_scale) override;
84 
85  private:
86  std::shared_ptr<image_transform> _stream_transform;
87  };
88 }
89 #endif // __SSSE3__
GLint GLint GLsizei GLsizei GLsizei depth
unsigned short uint16_t
Definition: stdint.h:79
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:96
unsigned char byte
Definition: src/types.h:52
Video stream intrinsics.
Definition: rs_types.h:58
GLsizei GLsizei GLchar * source
LZ4LIB_API char * dest
Definition: lz4.h:438
void align_other_to_depth(byte *other_aligned_to_depth, GET_DEPTH get_depth, const rs2_intrinsics &depth_intrin, const rs2_extrinsics &depth_to_other, const rs2_intrinsics &other_intrin, const byte *other_pixels, rs2_format other_format)
Definition: align.cpp:103
GLintptr offset


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:10