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
13struct PipelineImpl;
14struct ConfigImpl;
15
16namespace ob {
17class FrameSet;
18class Frame;
19class Device;
20class Playback;
21class DeviceInfo;
22class Config;
23class StreamProfile;
24class StreamProfileList;
25
26typedef std::function<void(std::shared_ptr<FrameSet> frame)> FrameSetCallback;
27
29private:
30 std::unique_ptr<PipelineImpl> impl_;
31
32public:
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
211private:
212 std::unique_ptr<ConfigImpl> impl_;
213
214public:
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,
265
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
#define OB_ACCEL_FULL_SCALE_RANGE_ANY
Definition ObTypes.h:80
OBSensorType
Enumeration value describing the sensor type.
Definition ObTypes.h:162
#define OB_ACCEL_SAMPLE_RATE_ANY
Definition ObTypes.h:81
enum OBGyroSampleRate ob_gyro_sample_rate
OBFormat
Enumeration value describing the pixel format.
Definition ObTypes.h:216
enum OBGyroFullScaleRange ob_gyro_full_scale_range
#define OB_GYRO_FULL_SCALE_RANGE_ANY
Definition ObTypes.h:82
OBStreamType
Enumeration value describing the type of data stream.
Definition ObTypes.h:179
#define OB_GYRO_SAMPLE_RATE_ANY
Definition ObTypes.h:83
enum OBStreamType ob_stream_type
enum OBGyroSampleRate ob_accel_sample_rate
#define OB_WIDTH_ANY
Definition ObTypes.h:74
enum OB_FRAME_AGGREGATE_OUTPUT_MODE OBFrameAggregateOutputMode
#define OB_EXTENSION_API
Definition ObTypes.h:28
#define OB_FPS_ANY
Definition ObTypes.h:76
#define OB_HEIGHT_ANY
Definition ObTypes.h:75
#define OB_FORMAT_ANY
Definition ObTypes.h:77
enum OBAccelFullScaleRange ob_accel_full_scale_range
OBAlignMode
Alignment mode.
Definition ObTypes.h:524
Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes....
Config class for configuring pipeline parameters.
Definition Pipeline.hpp:210
~Config() noexcept
Destroy the Config object.
Config()
Construct a new Config object.
Define the FrameSet class, which inherits from the Frame class.
Definition Frame.hpp:305
~Pipeline() noexcept
Destroy the pipeline object.
Pipeline()
Pipeline is a high-level interface for applications, algorithms related RGBD data streams....
Pipeline(const char *filename)
Construct a pipeline for playback of recorded stream files.
Pipeline(std::shared_ptr< Device > device)
Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices ne...
Definition Context.hpp:16
std::function< void(std::shared_ptr< FrameSet > frame)> FrameSetCallback
Definition Pipeline.hpp:26
calibration parameters
Definition ObTypes.h:486
Structure for camera parameters.
Definition ObTypes.h:462
Rectangle.
Definition ObTypes.h:534