OrbbecSDK  1.5.7
OrbbecSDK: Software-Development-Kit for Orbbec 3D-Sensor devices
Sensor.hpp
浏览该文件的文档.
1 
10 #pragma once
11 
12 #include "Types.hpp"
13 
14 #include <functional>
15 #include <memory>
16 
17 struct SensorImpl;
18 struct SensorListImpl;
19 
20 namespace ob {
21 class StreamProfile;
22 class StreamProfileList;
23 class Device;
24 class Frame;
25 class ImuFrame;
26 
38 using FrameCallback = std::function<void(std::shared_ptr<Frame> frame)>;
39 
41 protected:
42  std::unique_ptr<SensorImpl> impl_;
43 
44 public:
45  Sensor(std::unique_ptr<SensorImpl> impl);
46  virtual ~Sensor() noexcept;
47 
59  OBSensorType type();
60 
72  const std::shared_ptr<StreamProfileList> getStreamProfileList();
73 
87  void start(std::shared_ptr<StreamProfile> streamProfile, FrameCallback callback);
95  void stop();
96 
108  void switchProfile(std::shared_ptr<StreamProfile> streamProfile);
109 };
110 
112 private:
113  std::unique_ptr<SensorListImpl> impl_;
114 
115 public:
116  SensorList(std::unique_ptr<SensorListImpl> impl);
117 
118  virtual ~SensorList() noexcept;
119 
131  uint32_t count();
132 
146  OBSensorType type(uint32_t index);
147 
162  std::shared_ptr<Sensor> getSensor(uint32_t index);
163 
177  std::shared_ptr<Sensor> getSensor(OBSensorType sensorType);
178 };
179 } // namespace ob
Definition: Context.hpp:20
OBSensorType
描述传感器类型的枚举值
Definition: ObTypes.h:159
提供SDK的结构体、枚举常量定义(依赖libobsensor/h/ObTypes.h)
std::unique_ptr< SensorImpl > impl_
Definition: Sensor.hpp:42
std::function< void(std::shared_ptr< Frame > frame)> FrameCallback
帧数据回调
Definition: Sensor.hpp:38
#define OB_EXTENSION_API
Definition: ObTypes.h:25