OrbbecSDK 2.10.6
OrbbecSDK: Software-Development-Kit for Orbbec 3D Cameras
Loading...
Searching...
No Matches
ApplicationConfig.h File Reference
#include "ObTypes.h"

Go to the source code of this file.

Macros

#define OB_APP_CONFIG_INDEX_NONE   (0u)
#define OB_APP_CONFIG_ITEM(key)
#define OB_APP_CONFIG_ARRAY_ITEM(key, index)
#define OB_APP_CONFIG_ITEM_KEY(item)
#define OB_APP_CONFIG_ITEM_INDEX(item)

Typedefs

typedef enum OBAppConfigKey ob_app_config_key
typedef uint64_t OBAppConfigItem
 Application configuration item. An item combines a configuration key and an optional array index. Non-array keys use OB_APP_CONFIG_ITEM. Array keys use OB_APP_CONFIG_ARRAY_ITEM. The key is stored in bits 0-31 and the index is stored in bits 32-63.
typedef uint64_t ob_app_config_item
typedef enum OBAppConfigValueType ob_app_config_value_type

Enumerations

enum  OBAppConfigKey {
  OB_APP_CONFIG_SENSORS = 0 , OB_APP_CONFIG_SENSOR_TYPE = 1 , OB_APP_CONFIG_STREAM_ENABLED = 2 , OB_APP_CONFIG_STREAM_PROFILE = 3 ,
  OB_APP_CONFIG_UNDISTORTION_ENABLED = 4 , OB_APP_CONFIG_DEVICE_DECIMATION_ENABLED = 5 , OB_APP_CONFIG_DEVICE_DECIMATION = 6 , OB_APP_CONFIG_POINTCLOUD_ENABLED = 100 ,
  OB_APP_CONFIG_POINTCLOUD_FORMAT = 101 , OB_APP_CONFIG_POINTCLOUD_DECIMATION_FACTOR = 102 , OB_APP_CONFIG_POINTCLOUD_ALIGN_MODE = 103 , OB_APP_CONFIG_POINTCLOUD_FRAME_SYNC = 104 ,
  OB_APP_CONFIG_POINTCLOUD_ALL_FRAME_TYPE_REQUIRED = 105 , OB_APP_CONFIG_POINTCLOUD_MATCH_TARGET_RESOLUTION = 106 , OB_APP_CONFIG_HDR_MERGE_ENABLED = 200 , OB_APP_CONFIG_HDR_MERGE_IR_ENABLED = 201
}
 Application configuration key. Each key has a fixed value type and item usage. Keys must stay within the low 32 bits because OBAppConfigItem stores the key in bits 0-31. More...
enum  OBAppConfigValueType {
  OB_APP_CONFIG_VALUE_BOOL , OB_APP_CONFIG_VALUE_INT , OB_APP_CONFIG_VALUE_FLOAT , OB_APP_CONFIG_VALUE_STRING ,
  OB_APP_CONFIG_VALUE_STRUCT
}
 Application configuration value type. More...

Functions

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 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_delete_application_config (ob_application_config *config, ob_error **error)
 Delete an application configuration object.
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_reset (ob_application_config *config, ob_error **error)
 Reset an application configuration object to default values.
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.
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 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_application_config_set_float (ob_application_config *config, OBAppConfigItem item, float value, ob_error **error)
 Set a float value.
OB_EXPORT float ob_application_config_get_float (const ob_application_config *config, OBAppConfigItem item, ob_error **error)
 Get a float value.
OB_EXPORT void ob_application_config_set_string (ob_application_config *config, OBAppConfigItem item, const char *value, ob_error **error)
 Set a string value.
OB_EXPORT const char * ob_application_config_get_string (const ob_application_config *config, OBAppConfigItem item, ob_error **error)
 Get a string value.
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_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 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 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 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.

Macro Definition Documentation

◆ OB_APP_CONFIG_INDEX_NONE

#define OB_APP_CONFIG_INDEX_NONE   (0u)

Definition at line 50 of file ApplicationConfig.h.

◆ OB_APP_CONFIG_ITEM

#define OB_APP_CONFIG_ITEM ( key)
Value:
((OBAppConfigItem)(uint32_t)(key))
uint64_t OBAppConfigItem
Application configuration item. An item combines a configuration key and an optional array index....

Definition at line 51 of file ApplicationConfig.h.

Referenced by ob::ApplicationConfig::deviceDecimation(), ob::ApplicationConfig::hdrMerge(), ob::ApplicationConfig::pointCloud(), ob::ApplicationConfig::setDeviceDecimation(), ob::ApplicationConfig::setHDRMerge(), and ob::ApplicationConfig::setPointCloud().

◆ OB_APP_CONFIG_ARRAY_ITEM

#define OB_APP_CONFIG_ARRAY_ITEM ( key,
index )
Value:
((((OBAppConfigItem)(uint32_t)(index)) << 32) | (OBAppConfigItem)(uint32_t)(key))

Definition at line 52 of file ApplicationConfig.h.

Referenced by ob::ApplicationConfig::sensors(), and ob::ApplicationConfig::setSensor().

◆ OB_APP_CONFIG_ITEM_KEY

#define OB_APP_CONFIG_ITEM_KEY ( item)
Value:
((OBAppConfigKey)((uint32_t)((item) & 0xFFFFFFFFu)))
OBAppConfigKey
Application configuration key. Each key has a fixed value type and item usage. Keys must stay within ...

Definition at line 53 of file ApplicationConfig.h.

◆ OB_APP_CONFIG_ITEM_INDEX

#define OB_APP_CONFIG_ITEM_INDEX ( item)
Value:
((uint32_t)(((item) >> 32) & 0xFFFFFFFFu))

Definition at line 54 of file ApplicationConfig.h.

Typedef Documentation

◆ ob_app_config_key

◆ OBAppConfigItem

typedef uint64_t OBAppConfigItem

Application configuration item. An item combines a configuration key and an optional array index. Non-array keys use OB_APP_CONFIG_ITEM. Array keys use OB_APP_CONFIG_ARRAY_ITEM. The key is stored in bits 0-31 and the index is stored in bits 32-63.

Definition at line 48 of file ApplicationConfig.h.

◆ ob_app_config_item

typedef uint64_t ob_app_config_item

Definition at line 48 of file ApplicationConfig.h.

◆ ob_app_config_value_type

Enumeration Type Documentation

◆ OBAppConfigKey

Application configuration key. Each key has a fixed value type and item usage. Keys must stay within the low 32 bits because OBAppConfigItem stores the key in bits 0-31.

Enumerator
OB_APP_CONFIG_SENSORS 

array, sensor list. Use ob_application_config_get_count to get sensor count.

OB_APP_CONFIG_SENSOR_TYPE 

int32_t, sensor item: OBSensorType.

OB_APP_CONFIG_STREAM_ENABLED 

bool, sensor item: whether the sensor stream should be started.

OB_APP_CONFIG_STREAM_PROFILE 

ob_stream_profile, sensor item: stream profile.

OB_APP_CONFIG_UNDISTORTION_ENABLED 

bool, sensor item: whether undistortion should be enabled.

OB_APP_CONFIG_DEVICE_DECIMATION_ENABLED 

bool, global item: whether device-level decimation should be applied.

OB_APP_CONFIG_DEVICE_DECIMATION 

OBPresetResolutionConfig, global item: device-level decimation configuration. Currently applied only by Gemini 435Le.

OB_APP_CONFIG_POINTCLOUD_ENABLED 

bool, global item: whether point cloud output should be enabled.

OB_APP_CONFIG_POINTCLOUD_FORMAT 

int32_t, global item: OBFormat, point cloud output format.

OB_APP_CONFIG_POINTCLOUD_DECIMATION_FACTOR 

int32_t, global item: point cloud decimation factor.

OB_APP_CONFIG_POINTCLOUD_ALIGN_MODE 

int32_t, global item: OBAlignMode.

OB_APP_CONFIG_POINTCLOUD_FRAME_SYNC 

bool, global item: whether frame sync should be enabled.

OB_APP_CONFIG_POINTCLOUD_ALL_FRAME_TYPE_REQUIRED 

bool, global item: false: output on any situation, true: require all frame types.

OB_APP_CONFIG_POINTCLOUD_MATCH_TARGET_RESOLUTION 

bool, global item: whether to match target resolution.

OB_APP_CONFIG_HDR_MERGE_ENABLED 

bool, global item: whether HDR merge should be enabled.

OB_APP_CONFIG_HDR_MERGE_IR_ENABLED 

bool, global item: whether IR frame should be enabled for HDR merge.

Definition at line 17 of file ApplicationConfig.h.

◆ OBAppConfigValueType

Application configuration value type.

Enumerator
OB_APP_CONFIG_VALUE_BOOL 

Boolean value.

OB_APP_CONFIG_VALUE_INT 

int32_t value.

OB_APP_CONFIG_VALUE_FLOAT 

float value.

OB_APP_CONFIG_VALUE_STRING 

String value. The returned pointer is owned by the config object.

OB_APP_CONFIG_VALUE_STRUCT 

Fixed-size SDK structure value.

Definition at line 59 of file ApplicationConfig.h.

Function Documentation

◆ ob_device_get_application_config()

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.

Parameters
[in]deviceThe device object.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
ob_application_config* The application configuration object cached by the device.
Attention
If the device has no application configuration cache, the SDK creates one with default values.
Changes made through the returned config update the device cache directly.
The returned config should be released by calling ob_delete_application_config.

Referenced by ob::ApplicationConfig::get(), and ob_device_get_application_config().

◆ ob_device_get_application_config_by_preset()

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.

Parameters
[in]deviceThe device object.
[in]preset_nameThe preset name to query.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
ob_application_config* The application configuration imported with the given preset, or NULL for built-in presets or presets that carry no application configuration.
Attention
The returned config is owned by the device; it should still be released by calling ob_delete_application_config (releasing the handle does not destroy the cached object).

Referenced by ob::ApplicationConfig::get(), and ob_device_get_application_config_by_preset().

◆ ob_delete_application_config()

OB_EXPORT void ob_delete_application_config ( ob_application_config * config,
ob_error ** error )

Delete an application configuration object.

Parameters
[in]configThe application configuration object to be deleted.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_delete_application_config(), and ob::ApplicationConfig::~ApplicationConfig().

◆ ob_device_is_application_config_supported()

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.

Parameters
[in]deviceThe device object.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
bool Return true if application configuration import/export is supported, false otherwise.

Referenced by ob::ApplicationConfig::isSupported(), and ob_device_is_application_config_supported().

◆ ob_application_config_reset()

OB_EXPORT void ob_application_config_reset ( ob_application_config * config,
ob_error ** error )

Reset an application configuration object to default values.

Parameters
[in]configThe application configuration object.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_reset(), and ob::ApplicationConfig::reset().

◆ ob_application_config_set_bool()

OB_EXPORT void ob_application_config_set_bool ( ob_application_config * config,
OBAppConfigItem item,
bool value,
ob_error ** error )

Set a bool value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to update. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[in]valueThe bool value to be set.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_set_bool(), ob::ApplicationConfig::setDeviceDecimation(), ob::ApplicationConfig::setHDRMerge(), ob::ApplicationConfig::setPointCloud(), and ob::ApplicationConfig::setSensor().

◆ ob_application_config_get_bool()

OB_EXPORT bool ob_application_config_get_bool ( const ob_application_config * config,
OBAppConfigItem item,
ob_error ** error )

Get a bool value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to read. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
bool The bool value.

Referenced by ob::ApplicationConfig::deviceDecimation(), ob::ApplicationConfig::hdrMerge(), ob_application_config_get_bool(), ob::ApplicationConfig::pointCloud(), and ob::ApplicationConfig::sensors().

◆ ob_application_config_set_int()

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.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to update. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[in]valueThe int32_t value to be set.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_set_int(), and ob::ApplicationConfig::setPointCloud().

◆ ob_application_config_get_int()

OB_EXPORT int32_t ob_application_config_get_int ( const ob_application_config * config,
OBAppConfigItem item,
ob_error ** error )

Get an int32_t value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to read. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
int32_t The int32_t value.

Referenced by ob_application_config_get_int(), ob::ApplicationConfig::pointCloud(), and ob::ApplicationConfig::sensors().

◆ ob_application_config_set_float()

OB_EXPORT void ob_application_config_set_float ( ob_application_config * config,
OBAppConfigItem item,
float value,
ob_error ** error )

Set a float value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to update. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[in]valueThe float value to be set.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_set_float().

◆ ob_application_config_get_float()

OB_EXPORT float ob_application_config_get_float ( const ob_application_config * config,
OBAppConfigItem item,
ob_error ** error )

Get a float value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to read. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
float The float value.

Referenced by ob_application_config_get_float().

◆ ob_application_config_set_string()

OB_EXPORT void ob_application_config_set_string ( ob_application_config * config,
OBAppConfigItem item,
const char * value,
ob_error ** error )

Set a string value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to update. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[in]valueThe string value to be set.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_set_string().

◆ ob_application_config_get_string()

OB_EXPORT const char * ob_application_config_get_string ( const ob_application_config * config,
OBAppConfigItem item,
ob_error ** error )

Get a string value.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to read. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
const char* The string value.
Attention
The returned pointer is owned by the config object and becomes invalid after the config is modified or deleted.

Referenced by ob_application_config_get_string().

◆ ob_application_config_set_struct()

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.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to update. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[in]valuePointer to the structure value to be copied.
[in]valueSizeSize of the structure value in bytes.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob_application_config_set_struct(), and ob::ApplicationConfig::setDeviceDecimation().

◆ ob_application_config_get_struct()

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.

Parameters
[in]configThe application configuration object.
[in]itemThe configuration item to read. Use OB_APP_CONFIG_ITEM or OB_APP_CONFIG_ARRAY_ITEM to build it.
[out]valuePointer to the buffer that receives the structure value.
[in]valueSizeSize of the output buffer in bytes.
[out]errorPointer to an error object that will be set if an error occurs.

Referenced by ob::ApplicationConfig::deviceDecimation(), and ob_application_config_get_struct().

◆ ob_application_config_set_profile()

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.

Parameters
[in]configThe application configuration object.
[in]itemThe sensor stream profile item to update. Use OB_APP_CONFIG_ARRAY_ITEM with OB_APP_CONFIG_STREAM_PROFILE.
[in]profileThe stream profile to be copied into the config object.
[out]errorPointer to an error object that will be set if an error occurs.
Attention
The config object clones the profile. The caller still owns and should release the input profile.

Referenced by ob_application_config_set_profile(), and ob::ApplicationConfig::setSensor().

◆ ob_application_config_get_profile()

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.

Parameters
[in]configThe application configuration object.
[in]itemThe sensor stream profile item to read. Use OB_APP_CONFIG_ARRAY_ITEM with OB_APP_CONFIG_STREAM_PROFILE.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
ob_stream_profile* The stream profile stored in the sensor item.
Attention
The returned profile should be released by calling ob_delete_stream_profile.

Referenced by ob_application_config_get_profile(), and ob::ApplicationConfig::sensors().

◆ ob_application_config_get_count()

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.

Currently only OB_APP_CONFIG_SENSORS is supported.

Parameters
[in]configThe application configuration object.
[in]keyThe array key to count. Refer to OBAppConfigKey for available keys.
[out]errorPointer to an error object that will be set if an error occurs.
Returns
uint32_t The number of items in the array key.

Referenced by ob_application_config_get_count(), and ob::ApplicationConfig::sensors().