27 streamEnabled_ = enabled;
31 return streamEnabled_;
35 streamProfile_ = profile;
39 return streamProfile_;
43 undistortionEnabled_ = enabled;
47 return undistortionEnabled_;
52 bool streamEnabled_ = {
false };
53 std::shared_ptr<StreamProfile> streamProfile_;
54 bool undistortionEnabled_ = {
false };
76 decimationFactor_ = factor;
80 return decimationFactor_;
100 allFrameTypeRequired_ = enabled;
104 return allFrameTypeRequired_;
108 matchTargetResolution_ = enabled;
112 return matchTargetResolution_;
116 bool enabled_{
false };
118 int32_t decimationFactor_{ 0 };
120 bool frameSync_{
false };
121 bool allFrameTypeRequired_{
false };
122 bool matchTargetResolution_{
false };
136 enableIRforHDR_ = enabled;
140 return enableIRforHDR_;
144 bool enabled_{
false };
145 bool enableIRforHDR_{
true };
167 bool enabled_{
false };
180 static std::shared_ptr<ApplicationConfig>
get(
const std::shared_ptr<Device> &device) {
184 return std::make_shared<ApplicationConfig>(
handle);
191 static std::shared_ptr<ApplicationConfig>
get(
const std::shared_ptr<Device> &device,
const std::string &presetName) {
198 return std::make_shared<ApplicationConfig>(
handle);
221 std::vector<std::shared_ptr<ApplicationSensorConfig>>
sensors()
const {
222 std::vector<std::shared_ptr<ApplicationSensorConfig>> result;
226 for(uint32_t i = 0; i < count; ++i) {
229 auto sensorConfig = std::make_shared<ApplicationSensorConfig>(sensorType);
233 sensorConfig->enableStream(enable);
238 result.emplace_back(sensorConfig);
242 sensorConfig->enableUndistortion(enable);
248 for(
const auto &sensor:
sensors) {
253 void setSensor(
const std::shared_ptr<ApplicationSensorConfig> &sensor) {
258 auto index = sensorIndex(sensor->sensorType());
263 auto profile = sensor->streamProfile();
265 throw std::runtime_error(
"ApplicationSensorConfig: stream profile must not be null");
275 auto cfg = std::make_shared<ApplicationDevDecimationConfig>();
286 cfg->setPresetResolutionConfig(config);
298 auto presetResConfig = config->presetResolutionConfig();
303 std::shared_ptr<ApplicationPointCloudConfig>
pointCloud()
const {
304 auto cfg = std::make_shared<ApplicationPointCloudConfig>();
313 cfg->setFormat(
static_cast<OBFormat>(value));
317 cfg->setDecimationFactor(value);
321 cfg->setAlignMode(
static_cast<OBAlignMode>(value));
325 cfg->enableFrameSync(enable);
329 cfg->setAllFrameTypeRequired(enable);
333 cfg->enableMatchTargetResolution(enable);
337 void setPointCloud(
const std::shared_ptr<ApplicationPointCloudConfig> &config) {
359 std::shared_ptr<ApplicationHDRMergeConfig>
hdrMerge()
const {
360 auto cfg = std::make_shared<ApplicationHDRMergeConfig>();
369 cfg->enableIR(enable);
373 void setHDRMerge(
const std::shared_ptr<ApplicationHDRMergeConfig> &config) {
389 for(uint32_t i = 0; i < count; ++i) {
392 if(current == sensorType) {
396 throw std::runtime_error(
"Application sensor config not found");
OB_EXPORT uint32_t ob_application_config_get_count(const ob_application_config *config, OBAppConfigKey key, ob_error **error)
Get the number of items in an array key.
OB_EXPORT int32_t ob_application_config_get_int(const ob_application_config *config, OBAppConfigItem item, ob_error **error)
Get an int32_t value.
OB_EXPORT void ob_delete_application_config(ob_application_config *config, ob_error **error)
Delete an application configuration object.
OB_EXPORT ob_application_config * ob_device_get_application_config_by_preset(ob_device *device, const char *preset_name, ob_error **error)
Get the application configuration carried by an externally imported preset, by preset name.
OB_EXPORT void ob_application_config_reset(ob_application_config *config, ob_error **error)
Reset an application configuration object to default values.
OB_EXPORT ob_stream_profile * ob_application_config_get_profile(const ob_application_config *config, OBAppConfigItem item, ob_error **error)
Get the stream profile from a sensor item.
OB_EXPORT void ob_application_config_set_profile(ob_application_config *config, OBAppConfigItem item, const ob_stream_profile *profile, ob_error **error)
Set the stream profile for a sensor item.
OB_EXPORT void ob_application_config_set_int(ob_application_config *config, OBAppConfigItem item, int32_t value, ob_error **error)
Set an int32_t value.
OB_EXPORT void ob_application_config_get_struct(const ob_application_config *config, OBAppConfigItem item, void *value, uint32_t valueSize, ob_error **error)
Get a fixed-size SDK structure value.
OB_EXPORT ob_application_config * ob_device_get_application_config(ob_device *device, ob_error **error)
Get the application runtime configuration cache for the device.
OB_EXPORT bool ob_device_is_application_config_supported(ob_device *device, ob_error **error)
Check whether the current device supports application runtime configuration import/export.
OB_EXPORT void ob_application_config_set_struct(ob_application_config *config, OBAppConfigItem item, const void *value, uint32_t valueSize, ob_error **error)
Set a fixed-size SDK structure value.
@ OB_APP_CONFIG_HDR_MERGE_IR_ENABLED
@ OB_APP_CONFIG_POINTCLOUD_ALIGN_MODE
@ OB_APP_CONFIG_DEVICE_DECIMATION
@ OB_APP_CONFIG_POINTCLOUD_ALL_FRAME_TYPE_REQUIRED
@ OB_APP_CONFIG_POINTCLOUD_MATCH_TARGET_RESOLUTION
@ OB_APP_CONFIG_STREAM_PROFILE
@ OB_APP_CONFIG_UNDISTORTION_ENABLED
@ OB_APP_CONFIG_POINTCLOUD_FRAME_SYNC
@ OB_APP_CONFIG_DEVICE_DECIMATION_ENABLED
@ OB_APP_CONFIG_POINTCLOUD_FORMAT
@ OB_APP_CONFIG_SENSOR_TYPE
@ OB_APP_CONFIG_STREAM_ENABLED
@ OB_APP_CONFIG_POINTCLOUD_ENABLED
@ OB_APP_CONFIG_POINTCLOUD_DECIMATION_FACTOR
@ OB_APP_CONFIG_HDR_MERGE_ENABLED
#define OB_APP_CONFIG_ARRAY_ITEM(key, index)
OB_EXPORT void ob_application_config_set_bool(ob_application_config *config, OBAppConfigItem item, bool value, ob_error **error)
Set a bool value.
OB_EXPORT bool ob_application_config_get_bool(const ob_application_config *config, OBAppConfigItem item, ob_error **error)
Get a bool value.
#define OB_APP_CONFIG_ITEM(key)
Device related types, including operations such as getting and creating a device, setting and obtaini...
This file defines the Error class, which describes abnormal errors within the SDK....
OBSensorType
Enumeration value describing the sensor type.
OBFormat
Enumeration value describing the pixel format.
struct ob_application_config_t ob_application_config
OBAlignMode
Alignment mode.
The stream profile related type is used to get information such as the width, height,...
std::shared_ptr< ApplicationHDRMergeConfig > hdrMerge() const
void setSensors(const std::vector< std::shared_ptr< ApplicationSensorConfig > > &sensors)
void setHDRMerge(const std::shared_ptr< ApplicationHDRMergeConfig > &config)
std::shared_ptr< ApplicationPointCloudConfig > pointCloud() const
void setDeviceDecimation(const std::shared_ptr< ApplicationDevDecimationConfig > &config)
void setPointCloud(const std::shared_ptr< ApplicationPointCloudConfig > &config)
ob_application_config * handle() const
std::vector< std::shared_ptr< ApplicationSensorConfig > > sensors() const
void setSensor(const std::shared_ptr< ApplicationSensorConfig > &sensor)
static bool isSupported(const std::shared_ptr< Device > &device)
std::shared_ptr< ApplicationDevDecimationConfig > deviceDecimation() const
~ApplicationConfig() noexcept
static std::shared_ptr< ApplicationConfig > get(const std::shared_ptr< Device > &device)
ApplicationConfig(ob_application_config *handle)
static std::shared_ptr< ApplicationConfig > get(const std::shared_ptr< Device > &device, const std::string &presetName)
Get the application config carried by an externally imported preset, by preset name.
const OBPresetResolutionConfig & presetResolutionConfig() const
void enable(bool enabled)
void setPresetResolutionConfig(const OBPresetResolutionConfig &config)
void enable(bool enabled)
void enableIR(bool enabled)
void setAlignMode(OBAlignMode mode)
void enableFrameSync(bool enabled)
bool isFrameSyncEnabled() const
void setAllFrameTypeRequired(bool enabled)
bool isAllFrameTypeRequired() const
OBAlignMode alignMode() const
void enable(bool enabled)
void setDecimationFactor(int32_t factor)
void enableMatchTargetResolution(bool enabled)
int32_t decimationFactor() const
void setFormat(OBFormat format)
bool isMatchTargetResolutionEnabled() const
std::shared_ptr< StreamProfile > streamProfile() const
ApplicationSensorConfig(OBSensorType sensorType)
bool isUndistortionEnabled() const
bool isStreamEnabled() const
OBSensorType sensorType() const
void enableStream(bool enabled)
void enableUndistortion(bool enabled)
void setStreamProfile(const std::shared_ptr< StreamProfile > &profile)
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
static std::shared_ptr< StreamProfile > create(const ob_stream_profile_t *impl)
std::shared_ptr< ApplicationConfig > ApplicationConfigPtr
The error class exposed by the SDK, users can get detailed error information according to the error.