| OrbbecSDK 1.10.18 OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras

Loading...
Searching...
No Matches
Pipeline.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include "Types.hpp"
9
10#include <functional>
11#include <memory>
12
13 struct PipelineImpl;
14 struct ConfigImpl;
15
16 namespace ob {
17 class FrameSet;
18 class Frame;
19 class Device;
20 class Playback;
21 class DeviceInfo;
22 class Config;
23 class StreamProfile;
24 class StreamProfileList;
25
26 typedef std::function<void(std::shared_ptr<FrameSet> frame)> FrameSetCallback;
27
28 class OB_EXTENSION_API Pipeline {
29 private:
30 std::unique_ptr<PipelineImpl> impl_;
31
32 public:
38 Pipeline();
39
45 Pipeline(std::shared_ptr<Device> device);
46
52 Pipeline(const char *filename);
53
57 ~Pipeline() noexcept;
58
64 void start(std::shared_ptr<Config> config);
65
69 void start();
70
77 void start(std::shared_ptr<Config> config, FrameSetCallback callback);
78
82 void stop();
83
87 std::shared_ptr<StreamProfileList> getEnabledStreamProfileList();
94 std::shared_ptr<Config> getConfig();
95
102 std::shared_ptr<FrameSet> waitForFrames(uint32_t timeout_ms = 1000);
103
109 std::shared_ptr<Device> getDevice();
110
116 std::shared_ptr<Playback> getPlayback();
117
124 std::shared_ptr<StreamProfileList> getStreamProfileList(OBSensorType sensorType);
125
129 void enableFrameSync();
130
134 void disableFrameSync();
135
143 OBCameraParam getCameraParam();
144
156 OBCameraParam getCameraParamWithProfile(uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth, uint32_t depthHeight);
157
165 OBCalibrationParam getCalibrationParam(std::shared_ptr<Config> config);
166
174 std::shared_ptr<StreamProfileList> getD2CDepthProfileList(std::shared_ptr<StreamProfile> colorProfile, OBAlignMode alignMode);
175
183 OBRect getD2CValidArea(uint32_t minimumDistance, uint32_t maximumDistance = 0);
184
190 void switchConfig(std::shared_ptr<Config> config);
191
197 void startRecord(const char *filename);
198
202 void stopRecord();
203};
204
210class OB_EXTENSION_API Config {
211 private:
212 std::unique_ptr<ConfigImpl> impl_;
213
214 public:
218 Config();
219
223 ~Config() noexcept;
224
230 void enableStream(std::shared_ptr<StreamProfile> streamProfile);
231
236 void enableAllStream();
237
251 void enableVideoStream(ob_stream_type type, int width = OB_WIDTH_ANY, int height = OB_HEIGHT_ANY, int fps = OB_FPS_ANY, OBFormat format = OB_FORMAT_ANY);
252
263 void enableAccelStream(ob_accel_full_scale_range fullScaleRange = OB_ACCEL_FULL_SCALE_RANGE_ANY,
264 ob_accel_sample_rate sampleRate = OB_ACCEL_SAMPLE_RATE_ANY);
265
276 void enableGyroStream(ob_gyro_full_scale_range fullScaleRange = OB_GYRO_FULL_SCALE_RANGE_ANY, ob_gyro_sample_rate sampleRate = OB_GYRO_SAMPLE_RATE_ANY);
277
283 void disableStream(OBStreamType streamType);
284
288 void disableAllStream();
289
295 std::shared_ptr<StreamProfileList> getEnabledStreamProfileList() const;
296
302 void setAlignMode(OBAlignMode mode);
303
309 void setDepthScaleRequire(bool enable);
310
321 void setD2CTargetResolution(uint32_t d2cTargetWidth, uint32_t d2cTargetHeight);
322
330 void setFrameAggregateOutputMode(OBFrameAggregateOutputMode mode);
331
332 friend class Pipeline;
333};
334
335} // namespace ob
OB_ACCEL_FULL_SCALE_RANGE_ANY
#define OB_ACCEL_FULL_SCALE_RANGE_ANY
Definition ObTypes.h:80
OBSensorType
OBSensorType
Enumeration value describing the sensor type.
Definition ObTypes.h:162
OB_ACCEL_SAMPLE_RATE_ANY
#define OB_ACCEL_SAMPLE_RATE_ANY
Definition ObTypes.h:81
ob_gyro_sample_rate
enum OBGyroSampleRate ob_gyro_sample_rate
OBFormat
OBFormat
Enumeration value describing the pixel format.
Definition ObTypes.h:216
ob_gyro_full_scale_range
enum OBGyroFullScaleRange ob_gyro_full_scale_range
OB_GYRO_FULL_SCALE_RANGE_ANY
#define OB_GYRO_FULL_SCALE_RANGE_ANY
Definition ObTypes.h:82
OBStreamType
OBStreamType
Enumeration value describing the type of data stream.
Definition ObTypes.h:179
OB_GYRO_SAMPLE_RATE_ANY
#define OB_GYRO_SAMPLE_RATE_ANY
Definition ObTypes.h:83
ob_stream_type
enum OBStreamType ob_stream_type
ob_accel_sample_rate
enum OBGyroSampleRate ob_accel_sample_rate
OB_WIDTH_ANY
#define OB_WIDTH_ANY
Definition ObTypes.h:74
OBFrameAggregateOutputMode
enum OB_FRAME_AGGREGATE_OUTPUT_MODE OBFrameAggregateOutputMode
OB_EXTENSION_API
#define OB_EXTENSION_API
Definition ObTypes.h:28
OB_FPS_ANY
#define OB_FPS_ANY
Definition ObTypes.h:76
OB_HEIGHT_ANY
#define OB_HEIGHT_ANY
Definition ObTypes.h:75
OB_FORMAT_ANY
#define OB_FORMAT_ANY
Definition ObTypes.h:77
ob_accel_full_scale_range
enum OBAccelFullScaleRange ob_accel_full_scale_range
OBAlignMode
OBAlignMode
Alignment mode.
Definition ObTypes.h:524
Types.hpp
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
ob::Config
Config class for configuring pipeline parameters.
Definition Pipeline.hpp:210
ob::Config::~Config
~Config() noexcept
Destroy the Config object.
ob::Config::Config
Config()
Construct a new Config object.
ob::Device
Definition Device.hpp:29
ob::FrameSet
Define the FrameSet class, which inherits from the Frame class.
Definition Frame.hpp:305
ob::Pipeline
Definition Pipeline.hpp:28
ob::Pipeline::~Pipeline
~Pipeline() noexcept
Destroy the pipeline object.
ob::Pipeline::Pipeline
Pipeline()
Pipeline is a high-level interface for applications, algorithms related RGBD data streams....
ob::Pipeline::Pipeline
Pipeline(const char *filename)
Construct a pipeline for playback of recorded stream files.
ob::Pipeline::Pipeline
Pipeline(std::shared_ptr< Device > device)
Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices ne...
ob::Playback
Definition RecordPlayback.hpp:63
ob::StreamProfileList
Definition StreamProfile.hpp:212
ob::StreamProfile
Definition StreamProfile.hpp:22
ob
Definition Context.hpp:16
ob::FrameSetCallback
std::function< void(std::shared_ptr< FrameSet > frame)> FrameSetCallback
Definition Pipeline.hpp:26
OBCalibrationParam
calibration parameters
Definition ObTypes.h:486
OBCameraParam
Structure for camera parameters.
Definition ObTypes.h:462
OBRect
Rectangle.
Definition ObTypes.h:534