Rs2Stream.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Rs2Base.h"
4 
5 namespace oni { namespace driver {
6 
8 {
10  int sensorId;
11  int profileId;
12  int streamId;
15  int stride;
16  int width;
17  int height;
18  int framerate;
19 };
20 
21 class Rs2Stream : public StreamBase
22 {
23  friend class Rs2Device;
24 
25 public:
26 
27  Rs2Stream(OniSensorType sensorType);
28  virtual ~Rs2Stream();
29 
30  virtual OniStatus setProperty(int propertyId, const void* data, int dataSize);
31  virtual OniStatus getProperty(int propertyId, void* data, int* dataSize);
32  virtual OniBool isPropertySupported(int propertyId);
33 
34  virtual OniStatus invoke(int commandId, void* data, int dataSize);
35  virtual OniBool isCommandSupported(int commandId);
36 
37  virtual OniStatus start();
38  virtual void stop();
39 
40  virtual OniStatus convertDepthToColorCoordinates(StreamBase* colorStream, int depthX, int depthY, OniDepthPixel depthZ, int* pColorX, int* pColorY);
41 
42  inline class Rs2Device* getDevice() { return m_device; }
43  inline rs2_stream getRsType() const { return m_rsType; }
44  inline OniSensorType getOniType() const { return m_oniType; }
45  inline int getSensorId() const { return m_sensorId; }
46  inline int getStreamId() const { return m_streamId; }
47  inline const OniVideoMode& getVideoMode() const { return m_videoMode; }
48  inline bool isEnabled() const { return m_enabled; }
49 
50 protected:
51 
52  Rs2Stream(const Rs2Stream&);
53  void operator=(const Rs2Stream&);
54 
55  OniStatus initialize(class Rs2Device* device, rs2_sensor* sensor, int sensorId, int streamId, std::vector<Rs2StreamProfileInfo>* profiles);
56  void shutdown();
57 
58  void onStreamStarted();
59  void onPipelineStarted();
60 
61  void updateIntrinsics();
62  Rs2StreamProfileInfo* getCurrentProfile();
63  bool isVideoModeSupported(OniVideoMode* reqMode);
64 
65  bool getTable(void* dst, int* size, const std::vector<uint16_t>& table);
66  bool setTable(const void* src, int size, std::vector<uint16_t>& table);
67 
68 protected:
69 
71  OniSensorType m_oniType;
72 
77  bool m_enabled;
78 
79  std::vector<Rs2StreamProfileInfo> m_profiles;
80  OniVideoMode m_videoMode;
84  float m_depthScale;
85  float m_fovX;
86  float m_fovY;
87 
88  std::vector<uint16_t> m_s2d;
89  std::vector<uint16_t> m_d2s;
90 };
91 
92 class Rs2DepthStream : public Rs2Stream
93 {
94 public:
95  Rs2DepthStream() : Rs2Stream(ONI_SENSOR_DEPTH) {}
96 };
97 
98 class Rs2ColorStream : public Rs2Stream
99 {
100 public:
101  Rs2ColorStream() : Rs2Stream(ONI_SENSOR_COLOR) {}
102 };
103 
105 {
106 public:
107  Rs2InfraredStream() : Rs2Stream(ONI_SENSOR_IR) {}
108 };
109 
110 }} // namespace
std::vector< uint16_t > m_d2s
Definition: Rs2Stream.h:89
GLenum GLsizei dataSize
Definition: glext.h:5691
rs2_sensor * m_sensor
Definition: Rs2Stream.h:74
rs2_extrinsics m_extrinsicsDepthToColor
Definition: Rs2Stream.h:82
GLenum GLenum dst
Definition: glext.h:1751
rs2_stream m_rsType
Definition: Rs2Stream.h:70
GLenum src
Definition: glext.h:1751
int getStreamId() const
Definition: Rs2Stream.h:46
class Rs2Device * getDevice()
Definition: Rs2Stream.h:42
static const textual_icon stop
Definition: model-views.h:225
Definition: Rs2Base.cpp:3
GLsizeiptr size
std::vector< Rs2StreamProfileInfo > m_profiles
Definition: Rs2Stream.h:79
GLuint start
rs2_format
A stream&#39;s format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:59
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:42
bool m_needUpdateExtrinsicsDepthToColor
Definition: Rs2Stream.h:83
GLenum GLenum GLsizei void * table
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:96
class Rs2Device * m_device
Definition: Rs2Stream.h:73
Video stream intrinsics.
Definition: rs_types.h:58
rs2_intrinsics m_intrinsics
Definition: Rs2Stream.h:81
bool isEnabled() const
Definition: Rs2Stream.h:48
OniSensorType getOniType() const
Definition: Rs2Stream.h:44
const rs2_stream_profile * profile
Definition: Rs2Stream.h:9
int getSensorId() const
Definition: Rs2Stream.h:45
std::vector< uint16_t > m_s2d
Definition: Rs2Stream.h:88
auto device
Definition: pyrs_net.cpp:17
OniVideoMode m_videoMode
Definition: Rs2Stream.h:80
Definition: parser.hpp:150
OniSensorType m_oniType
Definition: Rs2Stream.h:71
rs2_stream getRsType() const
Definition: Rs2Stream.h:43
const OniVideoMode & getVideoMode() const
Definition: Rs2Stream.h:47


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