mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-14 20:10:19 +08:00
update OrbbecSDK version to 2.6.1
This commit is contained in:
@@ -3,9 +3,8 @@
|
||||
|
||||
/**
|
||||
* @file Context.h
|
||||
* @brief Context is a management class that describes the runtime of the SDK and is responsible for
|
||||
* resource allocation and release of the SDK. Context has the ability to manage multiple devices.
|
||||
* It is responsible for enumerating devices, monitoring device callbacks, and enabling multi-device
|
||||
* @brief Context is a management class that describes the runtime of the SDK and is responsible for resource allocation and release of the SDK.
|
||||
* Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi-device
|
||||
* synchronization.
|
||||
*/
|
||||
#pragma once
|
||||
@@ -19,8 +18,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief Create a context object with the default configuration file
|
||||
*
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* context creation
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context creation
|
||||
*
|
||||
* @return Pointer to the created context object
|
||||
*/
|
||||
@@ -29,10 +27,8 @@ OB_EXPORT ob_context *ob_create_context(ob_error **error);
|
||||
/**
|
||||
* @brief Create a context object with a specified configuration file
|
||||
*
|
||||
* @param[in] config_file_path Path to the configuration file. If NULL, the default configuration
|
||||
* file will be used.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* context creation
|
||||
* @param[in] config_file_path Path to the configuration file. If NULL, the default configuration file will be used.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context creation
|
||||
*
|
||||
* @return Pointer to the created context object
|
||||
*/
|
||||
@@ -42,8 +38,7 @@ OB_EXPORT ob_context *ob_create_context_with_config(const char *config_file_path
|
||||
* @brief Delete a context object
|
||||
*
|
||||
* @param[in] context Pointer to the context object to be deleted
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* context deletion
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context deletion
|
||||
*/
|
||||
OB_EXPORT void ob_delete_context(ob_context *context, ob_error **error);
|
||||
|
||||
@@ -51,8 +46,7 @@ OB_EXPORT void ob_delete_context(ob_context *context, ob_error **error);
|
||||
* @brief Get a list of enumerated devices
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* device enumeration
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during device enumeration
|
||||
*
|
||||
* @return Pointer to the device list object
|
||||
*/
|
||||
@@ -60,11 +54,11 @@ OB_EXPORT ob_device_list *ob_query_device_list(ob_context *context, ob_error **e
|
||||
|
||||
/**
|
||||
* @brief Enable or disable network device enumeration
|
||||
* @brief After enabling, the network device will be automatically discovered and can be retrieved
|
||||
* through @ref ob_query_device_list. The default state can be set in the configuration file.
|
||||
* @brief After enabling, the network device will be automatically discovered and can be retrieved through @ref ob_query_device_list. The default state can be
|
||||
* set in the configuration file.
|
||||
*
|
||||
* @attention Network device enumeration is performed through the GVCP protocol. If the device is
|
||||
* not in the same subnet as the host, it will be discovered but cannot be connected.
|
||||
* @attention Network device enumeration is performed through the GVCP protocol. If the device is not in the same subnet as the host, it will be discovered but
|
||||
* cannot be connected.
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] enable true to enable, false to disable
|
||||
@@ -77,8 +71,7 @@ OB_EXPORT void ob_enable_net_device_enumeration(ob_context *context, bool enable
|
||||
*
|
||||
* @param[in] macAddress MAC address of the network device.
|
||||
* You can obtain it from @ref ob_device_info_get_uid, or specify it manually
|
||||
* in the format xx:xx:xx:xx:xx:xx, where each xx is a two-digit hexadecimal
|
||||
* value.
|
||||
* in the format xx:xx:xx:xx:xx:xx, where each xx is a two-digit hexadecimal value.
|
||||
* @param[in] config The new IP configuration.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs.
|
||||
*
|
||||
@@ -86,8 +79,7 @@ OB_EXPORT void ob_enable_net_device_enumeration(ob_context *context, bool enable
|
||||
*
|
||||
* @note This applies to all GigE Vision devices
|
||||
*/
|
||||
OB_EXPORT bool ob_force_ip_config(const char *macAddress, ob_net_ip_config config,
|
||||
ob_error **error);
|
||||
OB_EXPORT bool ob_force_ip_config(const char *macAddress, ob_net_ip_config config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a network device object
|
||||
@@ -95,13 +87,11 @@ OB_EXPORT bool ob_force_ip_config(const char *macAddress, ob_net_ip_config confi
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] address IP address of the device
|
||||
* @param[in] port Port number of the device
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* device creation
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during device creation
|
||||
*
|
||||
* @return Pointer to the created device object
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_create_net_device(ob_context *context, const char *address, uint16_t port,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_create_net_device(ob_context *context, const char *address, uint16_t port, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a network device object
|
||||
@@ -110,84 +100,63 @@ OB_EXPORT ob_device *ob_create_net_device(ob_context *context, const char *addre
|
||||
* @param[in] address IP address of the device
|
||||
* @param[in] port Port number of the device
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default
|
||||
* OB_DEVICE_DEFAULT_ACCESS is used. Applies only on first device creation or after release and
|
||||
* re-creation; subsequent calls ignore it.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* device creation
|
||||
* If the device does not support setting the Access Mode, the default OB_DEVICE_DEFAULT_ACCESS is used.
|
||||
* Applies only on first device creation or after release and re-creation; subsequent calls ignore it.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during device creation
|
||||
*
|
||||
* @return Pointer to the created device object
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_create_net_device_ex(ob_context *context, const char *address,
|
||||
uint16_t port, ob_device_access_mode accessMode,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_create_net_device_ex(ob_context *context, const char *address, uint16_t port, ob_device_access_mode accessMode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a device plug-in callback function
|
||||
*
|
||||
* @attention The added and removed device lists returned through the callback interface need to be
|
||||
* released manually
|
||||
* @attention This function supports multiple callbacks. Each call to this function adds a new
|
||||
* callback to an internal list.
|
||||
* @attention The added and removed device lists returned through the callback interface need to be released manually
|
||||
* @attention This function supports multiple callbacks. Each call to this function adds a new callback to an internal list.
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] callback Pointer to the callback function triggered when a device is plugged or
|
||||
* unplugged
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback
|
||||
* function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* callback function setting
|
||||
* @param[in] callback Pointer to the callback function triggered when a device is plugged or unplugged
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during callback function setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_device_changed_callback(ob_context *context,
|
||||
ob_device_changed_callback callback, void *user_data,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_set_device_changed_callback(ob_context *context, ob_device_changed_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all
|
||||
* created devices (if supported).
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] repeat_interval_msec The interval for auto-repeated synchronization, in milliseconds.
|
||||
* If the value is 0, synchronization is performed only once.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* execution
|
||||
* @param[in] repeat_interval_msec The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during execution
|
||||
*/
|
||||
OB_EXPORT void ob_enable_device_clock_sync(ob_context *context, uint64_t repeat_interval_msec,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_enable_device_clock_sync(ob_context *context, uint64_t repeat_interval_msec, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Free idle memory from the internal frame memory pool
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* memory freeing
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during memory freeing
|
||||
*/
|
||||
OB_EXPORT void ob_free_idle_memory(ob_context *context, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function is
|
||||
* used to set the backend type.
|
||||
* @brief For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function is used to set the backend type.
|
||||
* @brief It is effective when the new device is created.
|
||||
*
|
||||
* @attention This interface is only available for Linux.
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] backend_type The backend type to be used.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* backend type setting
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during backend type setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_uvc_backend_type(ob_context *context, ob_uvc_backend_type backend_type,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_set_uvc_backend_type(ob_context *context, ob_uvc_backend_type backend_type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the global log level
|
||||
*
|
||||
* @attention This interface setting will affect the output level of all logs (terminal, file,
|
||||
* callback)
|
||||
* @attention This interface setting will affect the output level of all logs (terminal, file, callback)
|
||||
*
|
||||
* @param[in] severity Log level to set
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log
|
||||
* level setting
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log level setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_logger_severity(ob_log_severity severity, ob_error **error);
|
||||
|
||||
@@ -199,13 +168,11 @@ OB_EXPORT void ob_set_logger_severity(ob_log_severity severity, ob_error **error
|
||||
* If empty, the existing configuration is used;
|
||||
* if the existing configuration is also empty,
|
||||
* the value from the config file or the default configuration will be used.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log
|
||||
* output setting
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
|
||||
*
|
||||
* @note Other settings, such as log file name, remain unchanged.
|
||||
*/
|
||||
OB_EXPORT void ob_set_logger_to_file(ob_log_severity severity, const char *directory,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_set_logger_to_file(ob_log_severity severity, const char *directory, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the log file name for file output
|
||||
@@ -222,20 +189,16 @@ OB_EXPORT void ob_set_logger_file_name(const char *file_name, ob_error **error);
|
||||
*
|
||||
* @param[in] severity Log level to set for the callback function
|
||||
* @param[in] callback Pointer to the callback function
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback
|
||||
* function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log
|
||||
* callback function setting
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log callback function setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_logger_to_callback(ob_log_severity severity, ob_log_callback callback,
|
||||
void *user_data, ob_error **error);
|
||||
OB_EXPORT void ob_set_logger_to_callback(ob_log_severity severity, ob_log_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the log output to the console
|
||||
*
|
||||
* @param[in] severity Log level to output to the console
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log
|
||||
* output setting
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_logger_to_console(ob_log_severity severity, ob_error **error);
|
||||
|
||||
@@ -248,25 +211,19 @@ OB_EXPORT void ob_set_logger_to_console(ob_log_severity severity, ob_error **err
|
||||
* @param[in] file Source file name, e.g., __FILE__
|
||||
* @param[in] func Function name, e.g., __func__
|
||||
* @param[in] line Line number, e.g., __LINE__
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log
|
||||
* output setting
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
|
||||
*/
|
||||
OB_EXPORT void ob_log_external_message(ob_log_severity severity, const char *module,
|
||||
const char *message, const char *file, const char *func,
|
||||
int line, ob_error **error);
|
||||
OB_EXPORT void ob_log_external_message(ob_log_severity severity, const char *module, const char *message, const char *file, const char *func, int line,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the extensions directory
|
||||
* @brief The extensions directory is used to search for dynamic libraries that provide additional
|
||||
* functionality to the SDK, such as the Frame filters.
|
||||
* @brief The extensions directory is used to search for dynamic libraries that provide additional functionality to the SDK, such as the Frame filters.
|
||||
*
|
||||
* @attention Should be called before creating the context and pipeline, otherwise the default
|
||||
* extensions directory (./extensions) will be used.
|
||||
* @attention Should be called before creating the context and pipeline, otherwise the default extensions directory (./extensions) will be used.
|
||||
*
|
||||
* @param[in] directory Path to the extensions directory. If the path is empty, extensions path will
|
||||
* be set to the current working directory.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during
|
||||
* extensions directory setting
|
||||
* @param[in] directory Path to the extensions directory. If the path is empty, extensions path will be set to the current working directory.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during extensions directory setting
|
||||
*/
|
||||
OB_EXPORT void ob_set_extensions_directory(const char *directory, ob_error **error);
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
|
||||
/**
|
||||
* @file Device.h
|
||||
* @brief Device-related functions, including operations such as obtaining and creating a device,
|
||||
* setting and obtaining device property, and obtaining sensors
|
||||
* @brief Device-related functions, including operations such as obtaining and creating a device, setting and obtaining device property, and obtaining sensors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -54,8 +53,7 @@ OB_EXPORT ob_sensor *ob_device_get_sensor(ob_device *device, ob_sensor_type type
|
||||
* @param[in] value The property value to be set.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_set_int_property(ob_device *device, ob_property_id property_id,
|
||||
int32_t value, ob_error **error);
|
||||
OB_EXPORT void ob_device_set_int_property(ob_device *device, ob_property_id property_id, int32_t value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get an integer type of device property.
|
||||
@@ -66,8 +64,7 @@ OB_EXPORT void ob_device_set_int_property(ob_device *device, ob_property_id prop
|
||||
*
|
||||
* @return int32_t The property value.
|
||||
*/
|
||||
OB_EXPORT int32_t ob_device_get_int_property(ob_device *device, ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT int32_t ob_device_get_int_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the integer type of device property range.
|
||||
@@ -78,9 +75,7 @@ OB_EXPORT int32_t ob_device_get_int_property(ob_device *device, ob_property_id p
|
||||
*
|
||||
* @return The property range.
|
||||
*/
|
||||
OB_EXPORT ob_int_property_range ob_device_get_int_property_range(ob_device *device,
|
||||
ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_int_property_range ob_device_get_int_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a float type of device property.
|
||||
@@ -90,8 +85,7 @@ OB_EXPORT ob_int_property_range ob_device_get_int_property_range(ob_device *devi
|
||||
* @param[in] value The property value to be set.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_set_float_property(ob_device *device, ob_property_id property_id,
|
||||
float value, ob_error **error);
|
||||
OB_EXPORT void ob_device_set_float_property(ob_device *device, ob_property_id property_id, float value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a float type of device property.
|
||||
@@ -102,8 +96,7 @@ OB_EXPORT void ob_device_set_float_property(ob_device *device, ob_property_id pr
|
||||
*
|
||||
* @return float The property value.
|
||||
*/
|
||||
OB_EXPORT float ob_device_get_float_property(ob_device *device, ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT float ob_device_get_float_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the float type of device property range.
|
||||
@@ -114,9 +107,7 @@ OB_EXPORT float ob_device_get_float_property(ob_device *device, ob_property_id p
|
||||
*
|
||||
* @return The property range.
|
||||
*/
|
||||
OB_EXPORT ob_float_property_range ob_device_get_float_property_range(ob_device *device,
|
||||
ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_float_property_range ob_device_get_float_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a boolean type of device property.
|
||||
@@ -126,8 +117,7 @@ OB_EXPORT ob_float_property_range ob_device_get_float_property_range(ob_device *
|
||||
* @param[in] value The property value to be set.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_set_bool_property(ob_device *device, ob_property_id property_id,
|
||||
bool value, ob_error **error);
|
||||
OB_EXPORT void ob_device_set_bool_property(ob_device *device, ob_property_id property_id, bool value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a boolean type of device property.
|
||||
@@ -138,8 +128,7 @@ OB_EXPORT void ob_device_set_bool_property(ob_device *device, ob_property_id pro
|
||||
*
|
||||
* @return bool The property value.
|
||||
*/
|
||||
OB_EXPORT bool ob_device_get_bool_property(ob_device *device, ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT bool ob_device_get_bool_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the boolean type of device property range.
|
||||
@@ -150,9 +139,7 @@ OB_EXPORT bool ob_device_get_bool_property(ob_device *device, ob_property_id pro
|
||||
*
|
||||
* @return The property range.
|
||||
*/
|
||||
OB_EXPORT ob_bool_property_range ob_device_get_bool_property_range(ob_device *device,
|
||||
ob_property_id property_id,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_bool_property_range ob_device_get_bool_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set structured data.
|
||||
@@ -163,9 +150,7 @@ OB_EXPORT ob_bool_property_range ob_device_get_bool_property_range(ob_device *de
|
||||
* @param[in] data_size The size of the property to be set.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_set_structured_data(ob_device *device, ob_property_id property_id,
|
||||
const uint8_t *data, uint32_t data_size,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_device_set_structured_data(ob_device *device, ob_property_id property_id, const uint8_t *data, uint32_t data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get structured data of a device property.
|
||||
@@ -176,8 +161,7 @@ OB_EXPORT void ob_device_set_structured_data(ob_device *device, ob_property_id p
|
||||
* @param[out] data_size The size of the obtained property data.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_get_structured_data(ob_device *device, ob_property_id property_id,
|
||||
uint8_t *data, uint32_t *data_size, ob_error **error);
|
||||
OB_EXPORT void ob_device_get_structured_data(ob_device *device, ob_property_id property_id, uint8_t *data, uint32_t *data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get raw data of a device property.
|
||||
@@ -188,20 +172,17 @@ OB_EXPORT void ob_device_get_structured_data(ob_device *device, ob_property_id p
|
||||
* @param[out] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_get_raw_data(ob_device *device, ob_property_id property_id,
|
||||
ob_get_data_callback cb, void *user_data, ob_error **error);
|
||||
OB_EXPORT void ob_device_get_raw_data(ob_device *device, ob_property_id property_id, ob_get_data_callback cb, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set customer data.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] data The property data to be set.
|
||||
* @param[in] data_size The size of the property to be set,the maximum length cannot exceed 65532
|
||||
* bytes.
|
||||
* @param[in] data_size The size of the property to be set,the maximum length cannot exceed 65532 bytes.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
OB_EXPORT void ob_device_write_customer_data(ob_device *device, const void *data,
|
||||
uint32_t data_size, ob_error **error);
|
||||
OB_EXPORT void ob_device_write_customer_data(ob_device *device, const void *data, uint32_t data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get customer data of a device property.
|
||||
@@ -211,8 +192,7 @@ OB_EXPORT void ob_device_write_customer_data(ob_device *device, const void *data
|
||||
* @param[out] data_size The size of the obtained property data.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
OB_EXPORT void ob_device_read_customer_data(ob_device *device, void *data, uint32_t *data_size,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_device_read_customer_data(ob_device *device, void *data, uint32_t *data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of properties supported by the device.
|
||||
@@ -222,8 +202,7 @@ OB_EXPORT void ob_device_read_customer_data(ob_device *device, void *data, uint3
|
||||
*
|
||||
* @return The number of properties supported by the device.
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_device_get_supported_property_count(const ob_device *device,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_device_get_supported_property_count(const ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the type of property supported by the device.
|
||||
@@ -234,8 +213,7 @@ OB_EXPORT uint32_t ob_device_get_supported_property_count(const ob_device *devic
|
||||
*
|
||||
* @return The type of property supported by the device.
|
||||
*/
|
||||
OB_EXPORT ob_property_item ob_device_get_supported_property_item(const ob_device *device,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT ob_property_item ob_device_get_supported_property_item(const ob_device *device, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if a device property permission is supported.
|
||||
@@ -247,8 +225,7 @@ OB_EXPORT ob_property_item ob_device_get_supported_property_item(const ob_device
|
||||
*
|
||||
* @return Whether the property permission is supported.
|
||||
*/
|
||||
OB_EXPORT bool ob_device_is_property_supported(const ob_device *device, ob_property_id property_id,
|
||||
ob_permission_type permission, ob_error **error);
|
||||
OB_EXPORT bool ob_device_is_property_supported(const ob_device *device, ob_property_id property_id, ob_permission_type permission, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if the device supports global timestamp.
|
||||
@@ -279,9 +256,8 @@ OB_EXPORT void ob_device_enable_global_timestamp(ob_device *device, bool enable,
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_update_firmware(ob_device *device, const char *path,
|
||||
ob_device_fw_update_callback callback, bool async,
|
||||
void *user_data, ob_error **error);
|
||||
OB_EXPORT void ob_device_update_firmware(ob_device *device, const char *path, ob_device_fw_update_callback callback, bool async, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Update the device firmware from data.
|
||||
@@ -294,33 +270,26 @@ OB_EXPORT void ob_device_update_firmware(ob_device *device, const char *path,
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_update_firmware_from_data(ob_device *device, const uint8_t *data,
|
||||
uint32_t data_size,
|
||||
ob_device_fw_update_callback callback,
|
||||
OB_EXPORT void ob_device_update_firmware_from_data(ob_device *device, const uint8_t *data, uint32_t data_size, ob_device_fw_update_callback callback,
|
||||
bool async, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Update the device optional depth presets.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] file_path_list A list(2D array) of preset file paths, each up to OB_PATH_MAX
|
||||
* characters.
|
||||
* @param[in] file_path_list A list(2D array) of preset file paths, each up to OB_PATH_MAX characters.
|
||||
* @param[in] path_count The number of the preset file paths.
|
||||
* @param[in] callback The preset upgrade progress callback.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_update_optional_depth_presets(ob_device *device,
|
||||
const char file_path_list[][OB_PATH_MAX],
|
||||
uint8_t path_count,
|
||||
ob_device_fw_update_callback callback,
|
||||
void *user_data, ob_error **error);
|
||||
OB_EXPORT void ob_device_update_optional_depth_presets(ob_device *device, const char file_path_list[][OB_PATH_MAX], uint8_t path_count,
|
||||
ob_device_fw_update_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Device reboot
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the
|
||||
* interface access to the device handle may be abnormal. Please use the ob_delete_device interface
|
||||
* to delete the handle directly. After the device is reconnected, it can be obtained again.
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the interface access to the device handle may be abnormal.
|
||||
* Please use the ob_delete_device interface to delete the handle directly. After the device is reconnected, it can be obtained again.
|
||||
*
|
||||
* @param[in] device Device object
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
@@ -345,17 +314,13 @@ OB_EXPORT ob_device_state ob_device_get_device_state(const ob_device *device, ob
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_set_state_changed_callback(ob_device *device,
|
||||
ob_device_state_callback callback,
|
||||
void *user_data, ob_error **error);
|
||||
OB_EXPORT void ob_device_set_state_changed_callback(ob_device *device, ob_device_state_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable or disable the device heartbeat.
|
||||
* @brief After enable the device heartbeat, the sdk will start a thread to send heartbeat signal to
|
||||
the device error every 3 seconds.
|
||||
* @brief After enable the device heartbeat, the sdk will start a thread to send heartbeat signal to the device error every 3 seconds.
|
||||
|
||||
* @attention If the device does not receive the heartbeat signal for a long time, it will be
|
||||
disconnected and rebooted.
|
||||
* @attention If the device does not receive the heartbeat signal for a long time, it will be disconnected and rebooted.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] enable Whether to enable the device heartbeat.
|
||||
@@ -365,19 +330,17 @@ OB_EXPORT void ob_device_enable_heartbeat(ob_device *device, bool enable, ob_err
|
||||
|
||||
/**
|
||||
* @brief Send data to the device and receive data from the device.
|
||||
* @brief This is a factory and debug function, which can be used to send and receive data from the
|
||||
* device. The data format is secret and belongs to the device vendor.
|
||||
* @brief This is a factory and debug function, which can be used to send and receive data from the device. The data format is secret and belongs to the device
|
||||
* vendor.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] send_data The data to be sent to the device.
|
||||
* @param[in] send_data_size The size of the data to be sent to the device.
|
||||
* @param[out] receive_data The data received from the device.
|
||||
* @param[in,out] receive_data_size Pass in the expected size of the receive data, and return the
|
||||
* actual size of the received data.
|
||||
* @param[in,out] receive_data_size Pass in the expected size of the receive data, and return the actual size of the received data.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_device_send_and_receive_data(ob_device *device, const uint8_t *send_data,
|
||||
uint32_t send_data_size, uint8_t *receive_data,
|
||||
OB_EXPORT void ob_device_send_and_receive_data(ob_device *device, const uint8_t *send_data, uint32_t send_data_size, uint8_t *receive_data,
|
||||
uint32_t *receive_data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
@@ -443,22 +406,20 @@ OB_EXPORT const char *ob_device_info_get_uid(const ob_device_info *info, ob_erro
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* return device serial number
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_serial_number(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_info_get_serial_number(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the firmware version number
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return int return the firmware version number
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_firmware_version(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_info_get_firmware_version(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device connection type
|
||||
@@ -466,11 +427,9 @@ OB_EXPORT const char *ob_device_info_get_firmware_version(const ob_device_info *
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return const char* The connection type, currently supports: "USB", "USB1.0", "USB1.1", "USB2.0",
|
||||
* "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet", "GMSL2"
|
||||
* @return const char* The connection type, currently supports: "USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet", "GMSL2"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_connection_type(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_info_get_connection_type(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device IP address
|
||||
@@ -479,7 +438,7 @@ OB_EXPORT const char *ob_device_info_get_connection_type(const ob_device_info *i
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The IP address, such as "192.168.1.10"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_ip_address(const ob_device_info *info, ob_error **error);
|
||||
@@ -511,8 +470,7 @@ OB_EXPORT const char *ob_device_info_get_gateway(const ob_device_info *info, ob_
|
||||
*
|
||||
* @return const char* The hardware version number
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_hardware_version(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_info_get_hardware_version(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if the device extension information exists.
|
||||
@@ -523,13 +481,11 @@ OB_EXPORT const char *ob_device_info_get_hardware_version(const ob_device_info *
|
||||
*
|
||||
* @return bool Whether the device extension information exists.
|
||||
*/
|
||||
OB_EXPORT bool ob_device_is_extension_info_exist(const ob_device *device, const char *info_key,
|
||||
ob_error **error);
|
||||
OB_EXPORT bool ob_device_is_extension_info_exist(const ob_device *device, const char *info_key, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device extension information.
|
||||
* @brief Extension information is a set of key-value pair of string, user cat get the information
|
||||
* by the key.
|
||||
* @brief Extension information is a set of key-value pair of string, user cat get the information by the key.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] info_key The key of the device extension information.
|
||||
@@ -537,26 +493,24 @@ OB_EXPORT bool ob_device_is_extension_info_exist(const ob_device *device, const
|
||||
*
|
||||
* @return const char* The device extension information
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_get_extension_info(const ob_device *device, const char *info_key,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_get_extension_info(const ob_device *device, const char *info_key, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the minimum SDK version number supported by the device
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The minimum SDK version number supported by the device
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_supported_min_sdk_version(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_info_get_supported_min_sdk_version(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the chip name
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* The ASIC name
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_info_get_asicName(const ob_device_info *info, ob_error **error);
|
||||
@@ -566,11 +520,10 @@ OB_EXPORT const char *ob_device_info_get_asicName(const ob_device_info *info, ob
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return ob_device_type The device type
|
||||
*/
|
||||
OB_EXPORT ob_device_type ob_device_info_get_device_type(const ob_device_info *info,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device_type ob_device_info_get_device_type(const ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a device list.
|
||||
@@ -585,7 +538,7 @@ OB_EXPORT void ob_delete_device_list(ob_device_list *list, ob_error **error);
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return uint32_t return the number of devices
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_device_list_get_count(const ob_device_list *list, ob_error **error);
|
||||
@@ -596,11 +549,10 @@ OB_EXPORT uint32_t ob_device_list_get_count(const ob_device_list *list, ob_error
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return const char* return device name
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_name(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_name(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the pid of the specified device
|
||||
@@ -608,11 +560,10 @@ OB_EXPORT const char *ob_device_list_get_device_name(const ob_device_list *list,
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
*
|
||||
* @return int return the device pid
|
||||
*/
|
||||
OB_EXPORT int ob_device_list_get_device_pid(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT int ob_device_list_get_device_pid(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the vid of the specified device
|
||||
@@ -623,8 +574,7 @@ OB_EXPORT int ob_device_list_get_device_pid(const ob_device_list *list, uint32_t
|
||||
*
|
||||
* @return int return device vid
|
||||
*/
|
||||
OB_EXPORT int ob_device_list_get_device_vid(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT int ob_device_list_get_device_vid(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the uid of the specified device
|
||||
@@ -635,8 +585,7 @@ OB_EXPORT int ob_device_list_get_device_vid(const ob_device_list *list, uint32_t
|
||||
*
|
||||
* @return const char* return the device uid
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_uid(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_uid(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the serial number of the specified device.
|
||||
@@ -647,8 +596,7 @@ OB_EXPORT const char *ob_device_list_get_device_uid(const ob_device_list *list,
|
||||
*
|
||||
* @return const char* The device UID.
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_serial_number(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_serial_number(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device connection type
|
||||
@@ -657,11 +605,10 @@ OB_EXPORT const char *ob_device_list_get_device_serial_number(const ob_device_li
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return const char* returns the device connection type, currently supports: "USB", "USB1.0",
|
||||
* "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet", "GMSL2"
|
||||
* @return const char* returns the device connection type, currently supports: "USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2",
|
||||
* "Ethernet", "GMSL2"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_connection_type(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_connection_type(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device ip address
|
||||
@@ -674,8 +621,7 @@ OB_EXPORT const char *ob_device_list_get_device_connection_type(const ob_device_
|
||||
*
|
||||
* @return const char* returns the device ip address, such as "192.168.1.10"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_ip_address(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_ip_address(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device subnet mask
|
||||
@@ -688,8 +634,7 @@ OB_EXPORT const char *ob_device_list_get_device_ip_address(const ob_device_list
|
||||
*
|
||||
* @return const char* returns the device subnet mask, such as "255.255.255.0"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_subnet_mask(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_subnet_mask(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device gateway
|
||||
@@ -702,8 +647,7 @@ OB_EXPORT const char *ob_device_list_get_device_subnet_mask(const ob_device_list
|
||||
*
|
||||
* @return const char* returns the device gateway, such as "192.168.1.1"
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_gateway(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_gateway(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the MAC address of the host network interface corresponding to the network device.
|
||||
@@ -716,8 +660,7 @@ OB_EXPORT const char *ob_device_list_get_device_gateway(const ob_device_list *li
|
||||
*
|
||||
* @return const char* The MAC address of the host network interface associated with the device.
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_mac(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_mac(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the IP address of the host network interface corresponding to the network device.
|
||||
@@ -730,8 +673,7 @@ OB_EXPORT const char *ob_device_list_get_device_local_mac(const ob_device_list *
|
||||
*
|
||||
* @return const char* The IP address of the host network interface associated with the device.
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_ip(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_ip(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the subnet length of the host network interface corresponding to the network device.
|
||||
@@ -742,11 +684,9 @@ OB_EXPORT const char *ob_device_list_get_device_local_ip(const ob_device_list *l
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return const uint8_t The subnet length (0~32) of the host network interface associated with the
|
||||
* device.
|
||||
* @return const uint8_t The subnet length (0~32) of the host network interface associated with the device.
|
||||
*/
|
||||
OB_EXPORT uint8_t ob_device_list_get_device_local_subnet_length(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT uint8_t ob_device_list_get_device_local_subnet_length(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the gateway of the host network interface corresponding to the network device.
|
||||
@@ -759,14 +699,12 @@ OB_EXPORT uint8_t ob_device_list_get_device_local_subnet_length(const ob_device_
|
||||
*
|
||||
* @return const char* The gateway of the host network interface associated with the device.
|
||||
*/
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_gateway(const ob_device_list *list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT const char *ob_device_list_get_device_local_gateway(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] index The index of the device to create.
|
||||
@@ -776,34 +714,28 @@ OB_EXPORT const char *ob_device_list_get_device_local_gateway(const ob_device_li
|
||||
*
|
||||
* @note Default access mode is OB_DEVICE_DEFAULT_ACCESS
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device(const ob_device_list *list, uint32_t index,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_device_list_get_device(const ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] index The index of the device to create.
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default
|
||||
* OB_DEVICE_DEFAULT_ACCESS is used. Applies only on first device creation or after release and
|
||||
* re-creation; subsequent calls ignore it.
|
||||
* If the device does not support setting the Access Mode, the default OB_DEVICE_DEFAULT_ACCESS is used.
|
||||
* Applies only on first device creation or after release and re-creation; subsequent calls ignore it.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_device* The created device.
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_ex(const ob_device_list *list, uint32_t index,
|
||||
ob_device_access_mode accessMode,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_ex(const ob_device_list *list, uint32_t index, ob_device_access_mode accessMode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] serial_number The serial number of the device to create.
|
||||
@@ -813,41 +745,33 @@ OB_EXPORT ob_device *ob_device_list_get_device_ex(const ob_device_list *list, ui
|
||||
*
|
||||
* @note Default access mode is OB_DEVICE_DEFAULT_ACCESS
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_serial_number(const ob_device_list *list,
|
||||
const char *serial_number,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_serial_number(const ob_device_list *list, const char *serial_number, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] serial_number The serial number of the device to create.
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default
|
||||
* OB_DEVICE_DEFAULT_ACCESS is used. Applies only on first device creation or after release and
|
||||
* re-creation; subsequent calls ignore it.
|
||||
* If the device does not support setting the Access Mode, the default OB_DEVICE_DEFAULT_ACCESS is used.
|
||||
* Applies only on first device creation or after release and re-creation; subsequent calls ignore it.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_device* The created device.
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_serial_number_ex(const ob_device_list *list,
|
||||
const char *serial_number,
|
||||
ob_device_access_mode accessMode,
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_serial_number_ex(const ob_device_list *list, const char *serial_number, ob_device_access_mode accessMode,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create device by uid
|
||||
* @brief On Linux platform, for usb device, the uid of the device is composed of bus-port-dev, for
|
||||
* example 1-1.2-1. But the SDK will remove the dev number and only keep the bus-port as the uid to
|
||||
* create the device, for example 1-1.2, so that we can create a device connected to the specified
|
||||
* USB port. Similarly, users can also directly pass in bus-port as uid to create device.
|
||||
* @brief On Linux platform, for usb device, the uid of the device is composed of bus-port-dev, for example 1-1.2-1. But the SDK will remove the dev number and
|
||||
* only keep the bus-port as the uid to create the device, for example 1-1.2, so that we can create a device connected to the specified USB port. Similarly,
|
||||
* users can also directly pass in bus-port as uid to create device.
|
||||
* @brief For GMSL device, the uid is GMSL port with "gmsl2-" prefix, for example gmsl2-1.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] uid The UID of the device to create.
|
||||
@@ -857,50 +781,41 @@ OB_EXPORT ob_device *ob_device_list_get_device_by_serial_number_ex(const ob_devi
|
||||
*
|
||||
* @note Default access mode is OB_DEVICE_DEFAULT_ACCESS
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_uid(const ob_device_list *list, const char *uid,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_uid(const ob_device_list *list, const char *uid, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create device by uid
|
||||
* @brief On Linux platform, for usb device, the uid of the device is composed of bus-port-dev, for
|
||||
* example 1-1.2-1. But the SDK will remove the dev number and only keep the bus-port as the uid to
|
||||
* create the device, for example 1-1.2, so that we can create a device connected to the specified
|
||||
* USB port. Similarly, users can also directly pass in bus-port as uid to create device.
|
||||
* @brief On Linux platform, for usb device, the uid of the device is composed of bus-port-dev, for example 1-1.2-1. But the SDK will remove the dev number and
|
||||
* only keep the bus-port as the uid to create the device, for example 1-1.2, so that we can create a device connected to the specified USB port. Similarly,
|
||||
* users can also directly pass in bus-port as uid to create device.
|
||||
* @brief For GMSL device, the uid is GMSL port with "gmsl2-" prefix, for example gmsl2-1.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions
|
||||
* will return an error.
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] uid The UID of the device to create.
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default
|
||||
* OB_DEVICE_DEFAULT_ACCESS is used. Applies only on first device creation or after release and
|
||||
* re-creation; subsequent calls ignore it.
|
||||
* If the device does not support setting the Access Mode, the default OB_DEVICE_DEFAULT_ACCESS is used.
|
||||
* Applies only on first device creation or after release and re-creation; subsequent calls ignore it.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_device* The created device.
|
||||
*/
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_uid_ex(const ob_device_list *list,
|
||||
const char *uid,
|
||||
ob_device_access_mode accessMode,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_device *ob_device_list_get_device_by_uid_ex(const ob_device_list *list, const char *uid, ob_device_access_mode accessMode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the original parameter list of camera calibration saved on the device.
|
||||
*
|
||||
* @attention The parameters in the list do not correspond to the current open-stream
|
||||
* configuration.You need to select the parameters according to the actual situation, and may need
|
||||
* to do scaling, mirroring and other processing. Non-professional users are recommended to use the
|
||||
* ob_pipeline_get_camera_param() interface.
|
||||
* @attention The parameters in the list do not correspond to the current open-stream configuration.You need to select the parameters according to the actual
|
||||
* situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the ob_pipeline_get_camera_param()
|
||||
* interface.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_camera_param_list The camera parameter list.
|
||||
*/
|
||||
OB_EXPORT ob_camera_param_list *ob_device_get_calibration_camera_param_list(ob_device *device,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_camera_param_list *ob_device_get_calibration_camera_param_list(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of camera parameter lists
|
||||
@@ -910,8 +825,7 @@ OB_EXPORT ob_camera_param_list *ob_device_get_calibration_camera_param_list(ob_d
|
||||
*
|
||||
* @return uint32_t The number of lists
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_camera_param_list_get_count(ob_camera_param_list *param_list,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_camera_param_list_get_count(ob_camera_param_list *param_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get camera parameters from the camera parameter list
|
||||
@@ -920,11 +834,9 @@ OB_EXPORT uint32_t ob_camera_param_list_get_count(ob_camera_param_list *param_li
|
||||
* @param[in] index Parameter index
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return ob_camera_param The camera parameters. Since it returns the structure object directly,
|
||||
* there is no need to provide a delete interface.
|
||||
* @return ob_camera_param The camera parameters. Since it returns the structure object directly, there is no need to provide a delete interface.
|
||||
*/
|
||||
OB_EXPORT ob_camera_param ob_camera_param_list_get_param(ob_camera_param_list *param_list,
|
||||
uint32_t index, ob_error **error);
|
||||
OB_EXPORT ob_camera_param ob_camera_param_list_get_param(ob_camera_param_list *param_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the camera parameter list
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,10 +3,9 @@
|
||||
|
||||
/**
|
||||
* @file Pipeline.h
|
||||
* @brief The SDK's advanced API can quickly implement functions such as switching streaming, frame
|
||||
* synchronization, software filtering, etc., suitable for applications, and the algorithm focuses
|
||||
* on rgbd data stream scenarios. If you are on real-time or need to handle synchronization
|
||||
* separately, align the scene. Please use the interface of Device's Lower API.
|
||||
* @brief The SDK's advanced API can quickly implement functions such as switching streaming, frame synchronization, software filtering, etc., suitable for
|
||||
* applications, and the algorithm focuses on rgbd data stream scenarios. If you are on real-time or need to handle synchronization separately, align the scene.
|
||||
* Please use the interface of Device's Lower API.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -58,14 +57,12 @@ OB_EXPORT void ob_pipeline_start(ob_pipeline *pipeline, ob_error **error);
|
||||
* @param[in] config Parameters to be configured
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_pipeline_start_with_config(ob_pipeline *pipeline, const ob_config *config,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_pipeline_start_with_config(ob_pipeline *pipeline, const ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline and set the frame collection data callback
|
||||
*
|
||||
* @attention After start the pipeline with this interface, the frames will be output to the
|
||||
* callback function and cannot be obtained frames by call
|
||||
* @attention After start the pipeline with this interface, the frames will be output to the callback function and cannot be obtained frames by call
|
||||
* @ref ob_pipeline_wait_for_frameset
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
@@ -74,8 +71,7 @@ OB_EXPORT void ob_pipeline_start_with_config(ob_pipeline *pipeline, const ob_con
|
||||
* @param[in] user_data Pass in any user data and get it from the callback
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_pipeline_start_with_callback(ob_pipeline *pipeline, const ob_config *config,
|
||||
ob_frameset_callback callback, void *user_data,
|
||||
OB_EXPORT void ob_pipeline_start_with_callback(ob_pipeline *pipeline, const ob_config *config, ob_frameset_callback callback, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
@@ -104,8 +100,7 @@ OB_EXPORT ob_config *ob_pipeline_get_config(const ob_pipeline *pipeline, ob_erro
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
OB_EXPORT void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *config,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Wait for a set of frames to be returned synchronously
|
||||
@@ -114,11 +109,9 @@ OB_EXPORT void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *confi
|
||||
* @param[in] timeout_ms The timeout for waiting (in milliseconds)
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_frame* The frameset that was waited for. A frameset is a special frame that can be
|
||||
* used to obtain independent frames from the set.
|
||||
* @return ob_frame* The frameset that was waited for. A frameset is a special frame that can be used to obtain independent frames from the set.
|
||||
*/
|
||||
OB_EXPORT ob_frame *ob_pipeline_wait_for_frameset(ob_pipeline *pipeline, uint32_t timeout_ms,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_frame *ob_pipeline_wait_for_frameset(ob_pipeline *pipeline, uint32_t timeout_ms, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device object associated with the pipeline
|
||||
@@ -134,20 +127,16 @@ OB_EXPORT ob_device *ob_pipeline_get_device(const ob_pipeline *pipeline, ob_erro
|
||||
* @brief Get the stream profile list associated with the pipeline
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] sensorType The sensor type. The supported sensor types can be obtained through the
|
||||
* ob_device_get_sensor_list() interface.
|
||||
* @param[in] sensorType The sensor type. The supported sensor types can be obtained through the ob_device_get_sensor_list() interface.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_stream_profile_list* The stream profile list
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile_list *ob_pipeline_get_stream_profile_list(const ob_pipeline *pipeline,
|
||||
ob_sensor_type sensorType,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile_list *ob_pipeline_get_stream_profile_list(const ob_pipeline *pipeline, ob_sensor_type sensorType, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable frame synchronization
|
||||
* @brief Synchronize the frames of different streams by using the timestamp information of the
|
||||
* frames.
|
||||
* @brief Synchronize the frames of different streams by using the timestamp information of the frames.
|
||||
* @brief Dynamically (when pipeline is started) enable/disable frame synchronization is allowed.
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
@@ -164,8 +153,7 @@ OB_EXPORT void ob_pipeline_enable_frame_sync(ob_pipeline *pipeline, ob_error **e
|
||||
OB_EXPORT void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color
|
||||
* sensor resolution
|
||||
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] color_profile The input profile of the color sensor
|
||||
@@ -174,9 +162,8 @@ OB_EXPORT void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **
|
||||
*
|
||||
* @return ob_stream_profile_list* The list of D2C-enabled depth sensor resolutions
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile_list *ob_get_d2c_depth_profile_list(
|
||||
const ob_pipeline *pipeline, const ob_stream_profile *color_profile, ob_align_mode align_mode,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile_list *ob_get_d2c_depth_profile_list(const ob_pipeline *pipeline, const ob_stream_profile *color_profile, ob_align_mode align_mode,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create the pipeline configuration
|
||||
@@ -202,8 +189,7 @@ OB_EXPORT void ob_delete_config(ob_config *config, ob_error **error);
|
||||
* @param[in] stream_type The type of the stream to be enabled
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_stream(ob_config *config, ob_stream_type stream_type,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_stream(ob_config *config, ob_stream_type stream_type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable all streams in the pipeline configuration
|
||||
@@ -220,15 +206,12 @@ OB_EXPORT void ob_config_enable_all_stream(ob_config *config, ob_error **error);
|
||||
* @param[in] profile The stream profile to be enabled
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_stream_with_stream_profile(ob_config *config,
|
||||
const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_stream_with_stream_profile(ob_config *config, const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable video stream with specified parameters
|
||||
*
|
||||
* @attention The stream_type should be a video stream type, such as OB_STREAM_IR, OB_STREAM_COLOR,
|
||||
* OB_STREAM_DEPTH, etc.
|
||||
* @attention The stream_type should be a video stream type, such as OB_STREAM_IR, OB_STREAM_COLOR, OB_STREAM_DEPTH, etc.
|
||||
*
|
||||
* @param[in] config The pipeline configuration object
|
||||
* @param[in] stream_type The type of the stream to be enabled
|
||||
@@ -238,9 +221,8 @@ OB_EXPORT void ob_config_enable_stream_with_stream_profile(ob_config *config,
|
||||
* @param[in] format The format of the video stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_video_stream(ob_config *config, ob_stream_type stream_type,
|
||||
uint32_t width, uint32_t height, uint32_t fps,
|
||||
ob_format format, ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_video_stream(ob_config *config, ob_stream_type stream_type, uint32_t width, uint32_t height, uint32_t fps, ob_format format,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable accelerometer stream with specified parameters
|
||||
@@ -250,9 +232,7 @@ OB_EXPORT void ob_config_enable_video_stream(ob_config *config, ob_stream_type s
|
||||
* @param[in] sample_rate The sample rate of the accelerometer
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_accel_stream(ob_config *config,
|
||||
ob_accel_full_scale_range full_scale_range,
|
||||
ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_accel_stream(ob_config *config, ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable gyroscope stream with specified parameters
|
||||
@@ -262,9 +242,7 @@ OB_EXPORT void ob_config_enable_accel_stream(ob_config *config,
|
||||
* @param[in] sample_rate The sample rate of the gyroscope
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_gyro_stream(ob_config *config,
|
||||
ob_gyro_full_scale_range full_scale_range,
|
||||
ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_gyro_stream(ob_config *config, ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable LiDAR stream with specified parameters
|
||||
@@ -274,8 +252,7 @@ OB_EXPORT void ob_config_enable_gyro_stream(ob_config *config,
|
||||
* @param[in] format The format of the LiDAR stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_enable_lidar_stream(ob_config *config, ob_lidar_scan_rate scan_rate,
|
||||
ob_format format, ob_error **error);
|
||||
OB_EXPORT void ob_config_enable_lidar_stream(ob_config *config, ob_lidar_scan_rate scan_rate, ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the enabled stream profile list in the pipeline configuration
|
||||
@@ -283,11 +260,9 @@ OB_EXPORT void ob_config_enable_lidar_stream(ob_config *config, ob_lidar_scan_ra
|
||||
* @param[in] config The pipeline configuration object
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_stream_profile_list* The enabled stream profile list, should be released by @ref
|
||||
* ob_delete_stream_profile_list after use
|
||||
* @return ob_stream_profile_list* The enabled stream profile list, should be released by @ref ob_delete_stream_profile_list after use
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile_list *ob_config_get_enabled_stream_profile_list(const ob_config *config,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile_list *ob_config_get_enabled_stream_profile_list(const ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Disable a specific stream in the pipeline configuration
|
||||
@@ -317,35 +292,28 @@ OB_EXPORT void ob_config_set_align_mode(ob_config *config, ob_align_mode mode, o
|
||||
|
||||
/**
|
||||
* @brief Set whether depth scaling is required after enable depth to color alignment
|
||||
* @brief After enabling depth to color alignment, the depth image may need to be scaled to match
|
||||
* the color image size.
|
||||
* @brief After enabling depth to color alignment, the depth image may need to be scaled to match the color image size.
|
||||
*
|
||||
* @param[in] config The pipeline configuration object
|
||||
* @param[in] enable Whether scaling is required
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_set_depth_scale_after_align_require(ob_config *config, bool enable,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_config_set_depth_scale_after_align_require(ob_config *config, bool enable, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the frame aggregation output mode for the pipeline configuration
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function does
|
||||
* not contain the frames of all opened streams (which can be caused by different frame rates of
|
||||
* each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function does not contain the frames of all opened streams (which
|
||||
* can be caused by different frame rates of each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
*
|
||||
* @param[in] config The pipeline configuration object
|
||||
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref
|
||||
* OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION)
|
||||
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION)
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_config_set_frame_aggregate_output_mode(ob_config *config,
|
||||
ob_frame_aggregate_output_mode mode,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_config_set_frame_aggregate_output_mode(ob_config *config, ob_frame_aggregate_output_mode mode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get current camera parameters
|
||||
* @attention If D2C is enabled, it will return the camera parameters after D2C, if not, it will
|
||||
* return to the default parameters
|
||||
* @attention If D2C is enabled, it will return the camera parameters after D2C, if not, it will return to the default parameters
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[out] error Log error messages
|
||||
@@ -366,9 +334,8 @@ OB_EXPORT ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, ob
|
||||
*
|
||||
* @return ob_camera_param returns camera internal parameters
|
||||
*/
|
||||
OB_EXPORT ob_camera_param ob_pipeline_get_camera_param_with_profile(
|
||||
ob_pipeline *pipeline, uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth,
|
||||
uint32_t depthHeight, ob_error **error);
|
||||
OB_EXPORT ob_camera_param ob_pipeline_get_camera_param_with_profile(ob_pipeline *pipeline, uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth,
|
||||
uint32_t depthHeight, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device calibration parameters with the specified configuration
|
||||
@@ -379,9 +346,7 @@ OB_EXPORT ob_camera_param ob_pipeline_get_camera_param_with_profile(
|
||||
*
|
||||
* @return ob_calibration_param The calibration parameters
|
||||
*/
|
||||
OB_EXPORT ob_calibration_param ob_pipeline_get_calibration_param(ob_pipeline *pipeline,
|
||||
ob_config *config,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_calibration_param ob_pipeline_get_calibration_param(ob_pipeline *pipeline, ob_config *config, ob_error **error);
|
||||
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
#define ob_config_set_depth_scale_require ob_config_set_depth_scale_after_align_require
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,7 @@
|
||||
|
||||
/**
|
||||
* @file StreamProfile.h
|
||||
* @brief The stream profile related type is used to get information such as the width, height,
|
||||
* frame rate, and format of the stream.
|
||||
* @brief The stream profile related type is used to get information such as the width, height, frame rate, and format of the stream.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -24,8 +23,7 @@ extern "C" {
|
||||
*
|
||||
* @return ob_stream_profile* return the stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile(ob_stream_type type, ob_format format,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile(ob_stream_type type, ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a video stream profile object
|
||||
@@ -39,9 +37,8 @@ OB_EXPORT ob_stream_profile *ob_create_stream_profile(ob_stream_type type, ob_fo
|
||||
*
|
||||
* @return ob_stream_profile* return the video stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_video_stream_profile(ob_stream_type type, ob_format format,
|
||||
uint32_t width, uint32_t height,
|
||||
uint32_t fps, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_video_stream_profile(ob_stream_type type, ob_format format, uint32_t width, uint32_t height, uint32_t fps,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a accel stream profile object
|
||||
@@ -52,8 +49,7 @@ OB_EXPORT ob_stream_profile *ob_create_video_stream_profile(ob_stream_type type,
|
||||
*
|
||||
* @return ob_stream_profile* return the accel stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_accel_stream_profile(
|
||||
ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_accel_stream_profile(ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a gyro stream profile object
|
||||
@@ -64,8 +60,7 @@ OB_EXPORT ob_stream_profile *ob_create_accel_stream_profile(
|
||||
*
|
||||
* @return ob_stream_profile* return the gyro stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_gyro_stream_profile(
|
||||
ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_gyro_stream_profile(ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a LiDAR stream profile object
|
||||
@@ -75,8 +70,7 @@ OB_EXPORT ob_stream_profile *ob_create_gyro_stream_profile(
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
* @return ob_stream_profile* return the LiDAR stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_lidar_stream_profile(ob_lidar_scan_rate scan_rate,
|
||||
ob_format format, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_lidar_stream_profile(ob_lidar_scan_rate scan_rate, ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Copy the stream profile object from an other stream profile object
|
||||
@@ -86,8 +80,7 @@ OB_EXPORT ob_stream_profile *ob_create_lidar_stream_profile(ob_lidar_scan_rate s
|
||||
*
|
||||
* @return ob_stream_profile* return the new stream profile object
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile_from_other_stream_profile(
|
||||
const ob_stream_profile *srcProfile, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile_from_other_stream_profile(const ob_stream_profile *srcProfile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Copy the stream profile object with a new format object
|
||||
@@ -98,8 +91,7 @@ OB_EXPORT ob_stream_profile *ob_create_stream_profile_from_other_stream_profile(
|
||||
*
|
||||
* @return ob_stream_profile* return the new stream profile object with the new format
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile_with_new_format(
|
||||
const ob_stream_profile *profile, ob_format new_format, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_create_stream_profile_with_new_format(const ob_stream_profile *profile, ob_format new_format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the stream configuration.
|
||||
@@ -117,8 +109,7 @@ OB_EXPORT void ob_delete_stream_profile(const ob_stream_profile *profile, ob_err
|
||||
*
|
||||
* @return ob_format return the format of the stream
|
||||
*/
|
||||
OB_EXPORT ob_format ob_stream_profile_get_format(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_format ob_stream_profile_get_format(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set stream profile format
|
||||
@@ -127,8 +118,7 @@ OB_EXPORT ob_format ob_stream_profile_get_format(const ob_stream_profile *profil
|
||||
* @param[in] format The format of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_stream_profile_set_format(ob_stream_profile *profile, ob_format format,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_stream_profile_set_format(ob_stream_profile *profile, ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get stream profile type
|
||||
@@ -138,8 +128,7 @@ OB_EXPORT void ob_stream_profile_set_format(ob_stream_profile *profile, ob_forma
|
||||
*
|
||||
* @return ob_stream_type stream type
|
||||
*/
|
||||
OB_EXPORT ob_stream_type ob_stream_profile_get_type(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_type ob_stream_profile_get_type(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set stream profile type
|
||||
@@ -148,8 +137,7 @@ OB_EXPORT ob_stream_type ob_stream_profile_get_type(const ob_stream_profile *pro
|
||||
* @param[in] type The type of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_stream_profile_set_type(const ob_stream_profile *profile, ob_stream_type type,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_stream_profile_set_type(const ob_stream_profile *profile, ob_stream_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the extrinsic for source stream to target stream
|
||||
@@ -160,9 +148,7 @@ OB_EXPORT void ob_stream_profile_set_type(const ob_stream_profile *profile, ob_s
|
||||
*
|
||||
* @return ob_extrinsic The extrinsic
|
||||
*/
|
||||
OB_EXPORT ob_extrinsic ob_stream_profile_get_extrinsic_to(const ob_stream_profile *source,
|
||||
ob_stream_profile *target,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_extrinsic ob_stream_profile_get_extrinsic_to(const ob_stream_profile *source, ob_stream_profile *target, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the extrinsic for source stream to target stream
|
||||
@@ -172,9 +158,7 @@ OB_EXPORT ob_extrinsic ob_stream_profile_get_extrinsic_to(const ob_stream_profil
|
||||
* @param[in] extrinsic The extrinsic
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_stream_profile_set_extrinsic_to(ob_stream_profile *source,
|
||||
const ob_stream_profile *target,
|
||||
ob_extrinsic extrinsic, ob_error **error);
|
||||
OB_EXPORT void ob_stream_profile_set_extrinsic_to(ob_stream_profile *source, const ob_stream_profile *target, ob_extrinsic extrinsic, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the extrinsic for source stream to target stream type
|
||||
@@ -184,9 +168,7 @@ OB_EXPORT void ob_stream_profile_set_extrinsic_to(ob_stream_profile *source,
|
||||
* @param[in] extrinsic The extrinsic
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_stream_profile_set_extrinsic_to_type(ob_stream_profile *source,
|
||||
const ob_stream_type type,
|
||||
ob_extrinsic extrinsic, ob_error **error);
|
||||
OB_EXPORT void ob_stream_profile_set_extrinsic_to_type(ob_stream_profile *source, const ob_stream_type type, ob_extrinsic extrinsic, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the frame rate of the video stream
|
||||
@@ -196,54 +178,45 @@ OB_EXPORT void ob_stream_profile_set_extrinsic_to_type(ob_stream_profile *source
|
||||
*
|
||||
* @return uint32_t return the frame rate of the stream
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_fps(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_fps(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the width of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an
|
||||
* error will be returned
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return uint32_t return the width of the stream
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_width(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_width(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the width of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an
|
||||
* error will be returned
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[in] width The width of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_video_stream_profile_set_width(ob_stream_profile *profile, uint32_t width,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_video_stream_profile_set_width(ob_stream_profile *profile, uint32_t width, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the height of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an
|
||||
* error will be returned
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return uint32_t return the height of the stream
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_height(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_video_stream_profile_get_height(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the height of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an
|
||||
* error will be returned
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[in] height The height of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_video_stream_profile_set_height(ob_stream_profile *profile, uint32_t height,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_video_stream_profile_set_height(ob_stream_profile *profile, uint32_t height, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the video stream profile
|
||||
@@ -253,8 +226,7 @@ OB_EXPORT void ob_video_stream_profile_set_height(ob_stream_profile *profile, ui
|
||||
*
|
||||
* @return ob_camera_intrinsic Return the intrinsic of the stream
|
||||
*/
|
||||
OB_EXPORT ob_camera_intrinsic
|
||||
ob_video_stream_profile_get_intrinsic(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_camera_intrinsic ob_video_stream_profile_get_intrinsic(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the intrinsic of the video stream profile
|
||||
@@ -263,9 +235,7 @@ ob_video_stream_profile_get_intrinsic(const ob_stream_profile *profile, ob_error
|
||||
* @param[in] intrinsic The intrinsic of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_video_stream_profile_set_intrinsic(ob_stream_profile *profile,
|
||||
ob_camera_intrinsic intrinsic,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_video_stream_profile_set_intrinsic(ob_stream_profile *profile, ob_camera_intrinsic intrinsic, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the distortion of the video stream profile
|
||||
@@ -275,8 +245,7 @@ OB_EXPORT void ob_video_stream_profile_set_intrinsic(ob_stream_profile *profile,
|
||||
*
|
||||
* @return ob_camera_distortion Return the distortion of the stream
|
||||
*/
|
||||
OB_EXPORT ob_camera_distortion
|
||||
ob_video_stream_profile_get_distortion(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_camera_distortion ob_video_stream_profile_get_distortion(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the distortion of the video stream profile
|
||||
@@ -285,9 +254,7 @@ ob_video_stream_profile_get_distortion(const ob_stream_profile *profile, ob_erro
|
||||
* @param[in] distortion The distortion of the stream
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_video_stream_profile_set_distortion(ob_stream_profile *profile,
|
||||
ob_camera_distortion distortion,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_video_stream_profile_set_distortion(ob_stream_profile *profile, ob_camera_distortion distortion, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the process param of the disparity stream
|
||||
@@ -297,126 +264,103 @@ OB_EXPORT void ob_video_stream_profile_set_distortion(ob_stream_profile *profile
|
||||
*
|
||||
* @return ob_disparity_param Return the disparity process param of the stream
|
||||
*/
|
||||
OB_EXPORT ob_disparity_param ob_disparity_based_stream_profile_get_disparity_param(
|
||||
const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_disparity_param ob_disparity_based_stream_profile_get_disparity_param(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the disparity process param of the disparity stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the disparity stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the disparity stream, an error will be returned.
|
||||
* @param[in] param The disparity process param of the disparity stream.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_disparity_based_stream_profile_set_disparity_param(ob_stream_profile *profile,
|
||||
ob_disparity_param param,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_disparity_based_stream_profile_set_disparity_param(ob_stream_profile *profile, ob_disparity_param param, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the full-scale range of the accelerometer stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The full-scale range of the accelerometer stream.
|
||||
*/
|
||||
OB_EXPORT ob_accel_full_scale_range
|
||||
ob_accel_stream_profile_get_full_scale_range(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_accel_full_scale_range ob_accel_stream_profile_get_full_scale_range(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sampling frequency of the accelerometer frame.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The sampling frequency of the accelerometer frame.
|
||||
*/
|
||||
OB_EXPORT ob_accel_sample_rate
|
||||
ob_accel_stream_profile_get_sample_rate(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_accel_sample_rate ob_accel_stream_profile_get_sample_rate(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the accelerometer stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_accel_intrinsic Return the intrinsic of the accelerometer stream.
|
||||
*/
|
||||
OB_EXPORT ob_accel_intrinsic ob_accel_stream_profile_get_intrinsic(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_accel_intrinsic ob_accel_stream_profile_get_intrinsic(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the intrinsic of the accelerometer stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[in] intrinsic The intrinsic of the accelerometer stream.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_accel_stream_profile_set_intrinsic(ob_stream_profile *profile,
|
||||
ob_accel_intrinsic intrinsic,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_accel_stream_profile_set_intrinsic(ob_stream_profile *profile, ob_accel_intrinsic intrinsic, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the full-scale range of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The full-scale range of the gyroscope stream.
|
||||
*/
|
||||
OB_EXPORT ob_gyro_full_scale_range
|
||||
ob_gyro_stream_profile_get_full_scale_range(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_gyro_full_scale_range ob_gyro_stream_profile_get_full_scale_range(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sampling frequency of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The sampling frequency of the gyroscope stream.
|
||||
*/
|
||||
OB_EXPORT ob_gyro_sample_rate
|
||||
ob_gyro_stream_profile_get_sample_rate(const ob_stream_profile *profile, ob_error **error);
|
||||
OB_EXPORT ob_gyro_sample_rate ob_gyro_stream_profile_get_sample_rate(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return ob_gyro_intrinsic Return the intrinsic of the gyroscope stream.
|
||||
*/
|
||||
OB_EXPORT ob_gyro_intrinsic ob_gyro_stream_get_intrinsic(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_gyro_intrinsic ob_gyro_stream_get_intrinsic(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the intrinsic of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an
|
||||
* error will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[in] intrinsic The intrinsic of the gyroscope stream.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_gyro_stream_set_intrinsic(ob_stream_profile *profile, ob_gyro_intrinsic intrinsic,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_gyro_stream_set_intrinsic(ob_stream_profile *profile, ob_gyro_intrinsic intrinsic, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the scan rate of the LiDAR stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the LiDAR stream, an error
|
||||
* will be returned.
|
||||
* @param[in] profile Stream profile object. If the profile is not for the LiDAR stream, an error will be returned.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
* @return The scan rate of the LiDAR stream.
|
||||
*/
|
||||
OB_EXPORT ob_lidar_scan_rate ob_lidar_stream_profile_get_scan_rate(const ob_stream_profile *profile,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_lidar_scan_rate ob_lidar_stream_profile_get_scan_rate(const ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of StreamProfile lists.
|
||||
@@ -426,14 +370,12 @@ OB_EXPORT ob_lidar_scan_rate ob_lidar_stream_profile_get_scan_rate(const ob_stre
|
||||
*
|
||||
* @return The number of StreamProfile lists.
|
||||
*/
|
||||
OB_EXPORT uint32_t ob_stream_profile_list_get_count(const ob_stream_profile_list *profile_list,
|
||||
ob_error **error);
|
||||
OB_EXPORT uint32_t ob_stream_profile_list_get_count(const ob_stream_profile_list *profile_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the corresponding StreamProfile by subscripting.
|
||||
*
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref
|
||||
* ob_delete_stream_profile() when it is no longer needed.
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
|
||||
*
|
||||
* @param[in] profile_list StreamProfile lists.
|
||||
* @param[in] index Index.
|
||||
@@ -441,91 +383,74 @@ OB_EXPORT uint32_t ob_stream_profile_list_get_count(const ob_stream_profile_list
|
||||
*
|
||||
* @return The matching profile.
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_profile(
|
||||
const ob_stream_profile_list *profile_list, int index, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_profile(const ob_stream_profile_list *profile_list, int index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are
|
||||
* multiple matches, the first one in the list will be returned by default. If no matched profile is
|
||||
* found, an error will be returned.
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref
|
||||
* ob_delete_stream_profile() when it is no longer needed.
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] width Width. If you don't need to add matching conditions, you can pass OB_WIDTH_ANY.
|
||||
* @param[in] height Height. If you don't need to add matching conditions, you can pass
|
||||
* OB_HEIGHT_ANY.
|
||||
* @param[in] format Format. If you don't need to add matching conditions, you can pass
|
||||
* OB_FORMAT_ANY.
|
||||
* @param[in] height Height. If you don't need to add matching conditions, you can pass OB_HEIGHT_ANY.
|
||||
* @param[in] format Format. If you don't need to add matching conditions, you can pass OB_FORMAT_ANY.
|
||||
* @param[in] fps Frame rate. If you don't need to add matching conditions, you can pass OB_FPS_ANY.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The matching profile.
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_video_stream_profile(
|
||||
const ob_stream_profile_list *profile_list, int width, int height, ob_format format, int fps,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_video_stream_profile(const ob_stream_profile_list *profile_list, int width, int height,
|
||||
ob_format format, int fps, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are
|
||||
* multiple matches, the first one in the list will be returned by default. If no matched profile is
|
||||
* found, an error will be returned.
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref
|
||||
* ob_delete_stream_profile() when it is no longer needed.
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] full_scale_range Full-scale range. If you don't need to add matching conditions, you
|
||||
* can pass 0.
|
||||
* @param[in] full_scale_range Full-scale range. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[in] sample_rate Sample rate. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The matching profile.
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_accel_stream_profile(
|
||||
const ob_stream_profile_list *profile_list, ob_accel_full_scale_range full_scale_range,
|
||||
ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_accel_stream_profile(const ob_stream_profile_list *profile_list,
|
||||
ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are
|
||||
* multiple matches, the first one in the list will be returned by default. If no matched profile is
|
||||
* found, an error will be returned.
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref
|
||||
* ob_delete_stream_profile() when it is no longer needed.
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] full_scale_range Full-scale range. If you don't need to add matching conditions, you
|
||||
* can pass 0.
|
||||
* @param[in] full_scale_range Full-scale range. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[in] sample_rate Sample rate. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*
|
||||
* @return The matching profile.
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_gyro_stream_profile(
|
||||
const ob_stream_profile_list *profile_list, ob_gyro_full_scale_range full_scale_range,
|
||||
ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_gyro_stream_profile(const ob_stream_profile_list *profile_list,
|
||||
ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are
|
||||
* multiple matches, the first one in the list will be returned by default. If no matched profile is
|
||||
* found, an error will be returned.
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref
|
||||
* ob_delete_stream_profile() when it is no longer needed.
|
||||
* @attention The stream profile returned by this function should be deleted by calling @ref ob_delete_stream_profile() when it is no longer needed.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] scan_rate The scan rate of LiDAR. If you don't need to add matching conditions, you
|
||||
* can pass OB_LIDAR_SCAN_ANY.
|
||||
* @param[in] format The format of the LiDAR stream. If you don't need to add matching conditions,
|
||||
* you can pass OB_FORMAT_ANY.
|
||||
* @param[in] scan_rate The scan rate of LiDAR. If you don't need to add matching conditions, you can pass OB_LIDAR_SCAN_ANY.
|
||||
* @param[in] format The format of the LiDAR stream. If you don't need to add matching conditions, you can pass OB_FORMAT_ANY.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
* @return The matching profile.
|
||||
*/
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_lidar_stream_profile(
|
||||
const ob_stream_profile_list *profile_list, ob_lidar_scan_rate scan_rate, ob_format format,
|
||||
ob_error **error);
|
||||
OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_lidar_stream_profile(const ob_stream_profile_list *profile_list, ob_lidar_scan_rate scan_rate,
|
||||
ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the stream profile list.
|
||||
@@ -533,8 +458,7 @@ OB_EXPORT ob_stream_profile *ob_stream_profile_list_get_lidar_stream_profile(
|
||||
* @param[in] profile_list Stream configuration list.
|
||||
* @param[out] error Pointer to an error object that will be set if an error occurs.
|
||||
*/
|
||||
OB_EXPORT void ob_delete_stream_profile_list(const ob_stream_profile_list *profile_list,
|
||||
ob_error **error);
|
||||
OB_EXPORT void ob_delete_stream_profile_list(const ob_stream_profile_list *profile_list, ob_error **error);
|
||||
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
#define ob_stream_profile_format ob_stream_profile_get_format
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
/**
|
||||
* @file Context.hpp
|
||||
* @brief The SDK context class, which serves as the entry point to the underlying SDK. It is used
|
||||
* to query device lists, handle device callbacks, and set the log level.
|
||||
* @brief The SDK context class, which serves as the entry point to the underlying SDK. It is used to query device lists, handle device callbacks, and set the
|
||||
* log level.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
@@ -25,298 +25,278 @@ class DeviceInfo;
|
||||
class DeviceList;
|
||||
|
||||
class Context {
|
||||
public:
|
||||
/**
|
||||
* @brief Type definition for the device changed callback function.
|
||||
*
|
||||
* @param[in] removedList The list of removed devices.
|
||||
* @param[in] addedList The list of added devices.
|
||||
*/
|
||||
typedef std::function<void(std::shared_ptr<DeviceList> removedList,
|
||||
std::shared_ptr<DeviceList> addedList)>
|
||||
DeviceChangedCallback;
|
||||
public:
|
||||
/**
|
||||
* @brief Type definition for the device changed callback function.
|
||||
*
|
||||
* @param[in] removedList The list of removed devices.
|
||||
* @param[in] addedList The list of added devices.
|
||||
*/
|
||||
typedef std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)> DeviceChangedCallback;
|
||||
|
||||
/**
|
||||
* @brief Type definition for the log output callback function.
|
||||
*
|
||||
* @param[in] severity The current callback log level.
|
||||
* @param[in] logMsg The log message.
|
||||
*/
|
||||
typedef std::function<void(OBLogSeverity severity, const char *logMsg)> LogCallback;
|
||||
/**
|
||||
* @brief Type definition for the log output callback function.
|
||||
*
|
||||
* @param[in] severity The current callback log level.
|
||||
* @param[in] logMsg The log message.
|
||||
*/
|
||||
typedef std::function<void(OBLogSeverity severity, const char *logMsg)> LogCallback;
|
||||
|
||||
private:
|
||||
ob_context *impl_ = nullptr;
|
||||
DeviceChangedCallback deviceChangedCallback_;
|
||||
// static LogCallback logCallback_;
|
||||
private:
|
||||
ob_context *impl_ = nullptr;
|
||||
DeviceChangedCallback deviceChangedCallback_;
|
||||
// static LogCallback logCallback_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Context constructor.
|
||||
* @brief The Context class is a management class that describes the runtime of the SDK. It is
|
||||
* responsible for applying and releasing resources for the SDK. The context has the ability to
|
||||
* manage multiple devices, enumerate devices, monitor device callbacks, and enable functions such
|
||||
* as multi-device synchronization.
|
||||
*
|
||||
* @param[in] configPath The path to the configuration file. If the path is empty, the default
|
||||
* configuration will be used.
|
||||
*/
|
||||
explicit Context(const char *configPath = "") {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_context_with_config(configPath, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Context destructor.
|
||||
*/
|
||||
~Context() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_context(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Queries the enumerated device list.
|
||||
*
|
||||
* @return std::shared_ptr<DeviceList> A pointer to the device list class.
|
||||
*/
|
||||
std::shared_ptr<DeviceList> queryDeviceList() const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_query_device_list(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<DeviceList>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief enable or disable net device enumeration.
|
||||
* @brief after enable, the net device will be discovered automatically and can be retrieved by
|
||||
* @ref queryDeviceList. The default state can be set in the configuration file.
|
||||
*
|
||||
* @attention Net device enumeration by gvcp protocol, if the device is not in the same subnet as
|
||||
* the host, it will be discovered but cannot be connected.
|
||||
*
|
||||
* @param[in] enable true to enable, false to disable
|
||||
*/
|
||||
void enableNetDeviceEnumeration(bool enable) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_enable_net_device_enumeration(impl_, enable, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief "Force" a static IP address configuration in a device identified by its MAC Address.
|
||||
*
|
||||
* @param[in] macAddress MAC address of the network device.
|
||||
* You can obtain it from @ref ob_device_info_get_uid, or specify it
|
||||
* manually in the format xx:xx:xx:xx:xx:xx, where each xx is a two-digit hexadecimal value.
|
||||
* @param[in] config The new IP configuration.
|
||||
* @return bool true if the configuration command was processed successfully, false otherwise.
|
||||
*
|
||||
* @note This applies to all GigE Vision devices
|
||||
*/
|
||||
bool forceIp(const char *macAddress, const OBNetIpConfig &config) {
|
||||
ob_error *error = nullptr;
|
||||
auto res = ob_force_ip_config(macAddress, config, &error);
|
||||
Error::handle(&error);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a network device with the specified IP address and port.
|
||||
*
|
||||
* @param[in] address The IP address, ipv4 only. such as "192.168.1.10"
|
||||
* @param[in] port The port number, currently only support 8090
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default
|
||||
* OB_DEVICE_DEFAULT_ACCESS is used. Applies only on first device creation or after release and
|
||||
* re-creation; subsequent calls ignore it.
|
||||
*
|
||||
* @return std::shared_ptr<Device> The created device object.
|
||||
*/
|
||||
std::shared_ptr<Device> createNetDevice(
|
||||
const char *address, uint16_t port,
|
||||
OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
|
||||
ob_error *error = nullptr;
|
||||
auto device = ob_create_net_device_ex(impl_, address, port, accessMode, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Device>(device);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the device plug-in callback function.
|
||||
* @attention This function supports multiple callbacks. Each call to this function adds a new
|
||||
* callback to an internal list.
|
||||
*
|
||||
* @param[in] callback The function triggered when the device is plugged and unplugged.
|
||||
*/
|
||||
void setDeviceChangedCallback(DeviceChangedCallback callback) {
|
||||
deviceChangedCallback_ = callback;
|
||||
ob_error *error = nullptr;
|
||||
ob_set_device_changed_callback(impl_, &Context::deviceChangedCallback, this, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all
|
||||
* created devices (if supported).
|
||||
*
|
||||
* @param[in] repeatIntervalMsec The interval for auto-repeated synchronization, in milliseconds.
|
||||
* If the value is 0, synchronization is performed only once.
|
||||
*/
|
||||
void enableDeviceClockSync(uint64_t repeatIntervalMsec) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_enable_device_clock_sync(impl_, repeatIntervalMsec, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Frees idle memory from the internal frame memory pool.
|
||||
* @brief The SDK includes an internal frame memory pool that caches memory allocated for frames
|
||||
* received from devices.
|
||||
*/
|
||||
void freeIdleMemory() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_free_idle_memory(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function
|
||||
* is used to set the backend type.
|
||||
* @brief It is effective when the new device is created.
|
||||
*
|
||||
* @attention This interface is only available for Linux.
|
||||
*
|
||||
* @param[in] type The backend type to be used.
|
||||
*/
|
||||
void setUvcBackendType(OBUvcBackendType type) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_uvc_backend_type(impl_, type, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the level of the global log, which affects both the log level output to the console,
|
||||
* output to the file and output the user defined callback.
|
||||
*
|
||||
* @param[in] severity The log output level.
|
||||
*/
|
||||
static void setLoggerSeverity(OBLogSeverity severity) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_severity(severity, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set log output to a file.
|
||||
*
|
||||
* @param[in] severity The log level output to the file.
|
||||
* @param[in] directory The log file output path. If the path is empty, the existing settings will
|
||||
* continue to be used (if the existing configuration is also empty, the log will not be output to
|
||||
* the file).
|
||||
*/
|
||||
static void setLoggerToFile(OBLogSeverity severity, const char *directory) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_to_file(severity, directory, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the log file name for file output
|
||||
*
|
||||
* @param[in] fileName Log file name. Must not be empty.
|
||||
*
|
||||
* @note Other settings, such as log level and output directory, remain unchanged.
|
||||
*/
|
||||
static void setLoggerFileName(const std::string &fileName) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_file_name(fileName.c_str(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set log output to the console.
|
||||
*
|
||||
* @param[in] severity The log level output to the console.
|
||||
*/
|
||||
static void setLoggerToConsole(OBLogSeverity severity) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_to_console(severity, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the logger to callback.
|
||||
*
|
||||
* @param[in] severity The callback log level.
|
||||
* @param[in] callback The callback function.
|
||||
*/
|
||||
static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback) {
|
||||
ob_error *error = nullptr;
|
||||
Context::getLogCallback() = callback;
|
||||
ob_set_logger_to_callback(severity, &Context::logCallback, &Context::getLogCallback(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Logs a message with severity, file, function, and line info.
|
||||
*
|
||||
* @param severity Log level, see @ref OBLogSeverity for details
|
||||
* @param module The module or component the log belongs to
|
||||
* @param message Message string to log
|
||||
* @param file Source file name, e.g., __FILE__
|
||||
* @param func Function name, e.g., __func__
|
||||
* @param line Line number, e.g., __LINE__
|
||||
*/
|
||||
static void logExternalMessage(OBLogSeverity severity, const std::string &module,
|
||||
const std::string &message, const std::string &file,
|
||||
const std::string &func, int line) {
|
||||
ob_error *error = nullptr;
|
||||
ob_log_external_message(severity, module.c_str(), message.c_str(), file.c_str(), func.c_str(),
|
||||
line, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the extensions directory
|
||||
* @brief The extensions directory is used to search for dynamic libraries that provide additional
|
||||
* functionality to the SDK, such as the Frame filters.
|
||||
*
|
||||
* @attention Should be called before creating the context and pipeline, otherwise the default
|
||||
* extensions directory (./extensions) will be used.
|
||||
*
|
||||
* @param[in] directory Path to the extensions directory. If the path is empty, the existing
|
||||
* settings will continue to be used (if the existing
|
||||
*/
|
||||
static void setExtensionsDirectory(const char *directory) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_extensions_directory(directory, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
private:
|
||||
static void deviceChangedCallback(ob_device_list *removedList, ob_device_list *addedList,
|
||||
void *userData) {
|
||||
auto ctx = static_cast<Context *>(userData);
|
||||
if (ctx && ctx->deviceChangedCallback_) {
|
||||
auto removed = std::make_shared<DeviceList>(removedList);
|
||||
auto added = std::make_shared<DeviceList>(addedList);
|
||||
ctx->deviceChangedCallback_(removed, added);
|
||||
public:
|
||||
/**
|
||||
* @brief Context constructor.
|
||||
* @brief The Context class is a management class that describes the runtime of the SDK. It is responsible for applying and releasing resources for the SDK.
|
||||
* The context has the ability to manage multiple devices, enumerate devices, monitor device callbacks, and enable functions such as multi-device
|
||||
* synchronization.
|
||||
*
|
||||
* @param[in] configPath The path to the configuration file. If the path is empty, the default configuration will be used.
|
||||
*/
|
||||
explicit Context(const char *configPath = "") {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_context_with_config(configPath, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
}
|
||||
|
||||
static void logCallback(OBLogSeverity severity, const char *logMsg, void *userData) {
|
||||
auto cb = static_cast<LogCallback *>(userData);
|
||||
if (cb) {
|
||||
(*cb)(severity, logMsg);
|
||||
/**
|
||||
* @brief Context destructor.
|
||||
*/
|
||||
~Context() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_context(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Lazy initialization of the logcallback_. The purpose is to initialize logcallback_ in .hpp
|
||||
static LogCallback &getLogCallback() {
|
||||
static LogCallback logCallback_ = nullptr;
|
||||
return logCallback_;
|
||||
}
|
||||
/**
|
||||
* @brief Queries the enumerated device list.
|
||||
*
|
||||
* @return std::shared_ptr<DeviceList> A pointer to the device list class.
|
||||
*/
|
||||
std::shared_ptr<DeviceList> queryDeviceList() const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_query_device_list(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<DeviceList>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief enable or disable net device enumeration.
|
||||
* @brief after enable, the net device will be discovered automatically and can be retrieved by @ref queryDeviceList. The default state can be set in the
|
||||
* configuration file.
|
||||
*
|
||||
* @attention Net device enumeration by gvcp protocol, if the device is not in the same subnet as the host, it will be discovered but cannot be connected.
|
||||
*
|
||||
* @param[in] enable true to enable, false to disable
|
||||
*/
|
||||
void enableNetDeviceEnumeration(bool enable) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_enable_net_device_enumeration(impl_, enable, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief "Force" a static IP address configuration in a device identified by its MAC Address.
|
||||
*
|
||||
* @param[in] macAddress MAC address of the network device.
|
||||
* You can obtain it from @ref ob_device_info_get_uid, or specify it manually
|
||||
* in the format xx:xx:xx:xx:xx:xx, where each xx is a two-digit hexadecimal value.
|
||||
* @param[in] config The new IP configuration.
|
||||
* @return bool true if the configuration command was processed successfully, false otherwise.
|
||||
*
|
||||
* @note This applies to all GigE Vision devices
|
||||
*/
|
||||
bool forceIp(const char *macAddress, const OBNetIpConfig &config) {
|
||||
ob_error *error = nullptr;
|
||||
auto res = ob_force_ip_config(macAddress, config, &error);
|
||||
Error::handle(&error);
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Creates a network device with the specified IP address and port.
|
||||
*
|
||||
* @param[in] address The IP address, ipv4 only. such as "192.168.1.10"
|
||||
* @param[in] port The port number, currently only support 8090
|
||||
* @param[in] accessMode Device access mode. @ref ob_device_access_mode.
|
||||
* If the device does not support setting the Access Mode, the default OB_DEVICE_DEFAULT_ACCESS is used.
|
||||
* Applies only on first device creation or after release and re-creation; subsequent calls ignore it.
|
||||
*
|
||||
* @return std::shared_ptr<Device> The created device object.
|
||||
*/
|
||||
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port, OBDeviceAccessMode accessMode = OB_DEVICE_DEFAULT_ACCESS) const {
|
||||
ob_error *error = nullptr;
|
||||
auto device = ob_create_net_device_ex(impl_, address, port, accessMode, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Device>(device);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the device plug-in callback function.
|
||||
* @attention This function supports multiple callbacks. Each call to this function adds a new callback to an internal list.
|
||||
*
|
||||
* @param[in] callback The function triggered when the device is plugged and unplugged.
|
||||
*/
|
||||
void setDeviceChangedCallback(DeviceChangedCallback callback) {
|
||||
deviceChangedCallback_ = callback;
|
||||
ob_error *error = nullptr;
|
||||
ob_set_device_changed_callback(impl_, &Context::deviceChangedCallback, this, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
|
||||
*
|
||||
* @param[in] repeatIntervalMsec The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once.
|
||||
*/
|
||||
void enableDeviceClockSync(uint64_t repeatIntervalMsec) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_enable_device_clock_sync(impl_, repeatIntervalMsec, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Frees idle memory from the internal frame memory pool.
|
||||
* @brief The SDK includes an internal frame memory pool that caches memory allocated for frames received from devices.
|
||||
*/
|
||||
void freeIdleMemory() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_free_idle_memory(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For linux, there are two ways to enable the UVC backend: libuvc and v4l2. This function is used to set the backend type.
|
||||
* @brief It is effective when the new device is created.
|
||||
*
|
||||
* @attention This interface is only available for Linux.
|
||||
*
|
||||
* @param[in] type The backend type to be used.
|
||||
*/
|
||||
void setUvcBackendType(OBUvcBackendType type) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_uvc_backend_type(impl_, type, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the level of the global log, which affects both the log level output to the console, output to the file and output the user defined
|
||||
* callback.
|
||||
*
|
||||
* @param[in] severity The log output level.
|
||||
*/
|
||||
static void setLoggerSeverity(OBLogSeverity severity) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_severity(severity, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set log output to a file.
|
||||
*
|
||||
* @param[in] severity The log level output to the file.
|
||||
* @param[in] directory The log file output path. If the path is empty, the existing settings will continue to be used (if the existing configuration is
|
||||
* also empty, the log will not be output to the file).
|
||||
*/
|
||||
static void setLoggerToFile(OBLogSeverity severity, const char *directory) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_to_file(severity, directory, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the log file name for file output
|
||||
*
|
||||
* @param[in] fileName Log file name. Must not be empty.
|
||||
*
|
||||
* @note Other settings, such as log level and output directory, remain unchanged.
|
||||
*/
|
||||
static void setLoggerFileName(const std::string &fileName) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_file_name(fileName.c_str(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set log output to the console.
|
||||
*
|
||||
* @param[in] severity The log level output to the console.
|
||||
*/
|
||||
static void setLoggerToConsole(OBLogSeverity severity) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_logger_to_console(severity, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the logger to callback.
|
||||
*
|
||||
* @param[in] severity The callback log level.
|
||||
* @param[in] callback The callback function.
|
||||
*/
|
||||
static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback) {
|
||||
ob_error *error = nullptr;
|
||||
Context::getLogCallback() = callback;
|
||||
ob_set_logger_to_callback(severity, &Context::logCallback, &Context::getLogCallback(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Logs a message with severity, file, function, and line info.
|
||||
*
|
||||
* @param severity Log level, see @ref OBLogSeverity for details
|
||||
* @param module The module or component the log belongs to
|
||||
* @param message Message string to log
|
||||
* @param file Source file name, e.g., __FILE__
|
||||
* @param func Function name, e.g., __func__
|
||||
* @param line Line number, e.g., __LINE__
|
||||
*/
|
||||
static void logExternalMessage(OBLogSeverity severity, const std::string &module, const std::string &message, const std::string &file,
|
||||
const std::string &func, int line) {
|
||||
ob_error *error = nullptr;
|
||||
ob_log_external_message(severity, module.c_str(), message.c_str(), file.c_str(), func.c_str(), line, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the extensions directory
|
||||
* @brief The extensions directory is used to search for dynamic libraries that provide additional functionality to the SDK, such as the Frame filters.
|
||||
*
|
||||
* @attention Should be called before creating the context and pipeline, otherwise the default extensions directory (./extensions) will be used.
|
||||
*
|
||||
* @param[in] directory Path to the extensions directory. If the path is empty, the existing settings will continue to be used (if the existing
|
||||
*/
|
||||
static void setExtensionsDirectory(const char *directory) {
|
||||
ob_error *error = nullptr;
|
||||
ob_set_extensions_directory(directory, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
private:
|
||||
static void deviceChangedCallback(ob_device_list *removedList, ob_device_list *addedList, void *userData) {
|
||||
auto ctx = static_cast<Context *>(userData);
|
||||
if(ctx && ctx->deviceChangedCallback_) {
|
||||
auto removed = std::make_shared<DeviceList>(removedList);
|
||||
auto added = std::make_shared<DeviceList>(addedList);
|
||||
ctx->deviceChangedCallback_(removed, added);
|
||||
}
|
||||
}
|
||||
|
||||
static void logCallback(OBLogSeverity severity, const char *logMsg, void *userData) {
|
||||
auto cb = static_cast<LogCallback *>(userData);
|
||||
if(cb) {
|
||||
(*cb)(severity, logMsg);
|
||||
}
|
||||
}
|
||||
|
||||
// Lazy initialization of the logcallback_. The purpose is to initialize logcallback_ in .hpp
|
||||
static LogCallback &getLogCallback() {
|
||||
static LogCallback logCallback_ = nullptr;
|
||||
return logCallback_;
|
||||
}
|
||||
|
||||
// for backward compatibility
|
||||
#define enableMultiDeviceSync enableDeviceClockSync
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,8 @@
|
||||
|
||||
/**
|
||||
* @file Pipeline.hpp
|
||||
* @brief The SDK's advanced API type can quickly implement switching streaming and frame
|
||||
* synchronization operations.
|
||||
* @brief The SDK's advanced API type can quickly implement switching streaming and frame synchronization
|
||||
* operations.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
@@ -26,477 +26,444 @@ namespace ob {
|
||||
* The Config class provides an interface for configuring pipeline parameters.
|
||||
*/
|
||||
class Config {
|
||||
private:
|
||||
ob_config_t *impl_;
|
||||
private:
|
||||
ob_config_t *impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Config object
|
||||
*/
|
||||
Config() {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_config(&error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Config object
|
||||
*/
|
||||
Config() {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_config(&error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
explicit Config(ob_config_t *impl) : impl_(impl) {}
|
||||
explicit Config(ob_config_t *impl) : impl_(impl) {}
|
||||
|
||||
/**
|
||||
* @brief Destroy the Config object
|
||||
*/
|
||||
~Config() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_config(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
/**
|
||||
* @brief Destroy the Config object
|
||||
*/
|
||||
~Config() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_config(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
|
||||
ob_config_t *getImpl() const { return impl_; }
|
||||
ob_config_t *getImpl() const {
|
||||
return impl_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief enable a stream with a specific stream type
|
||||
*
|
||||
* @param[in] streamType The stream type to be enabled
|
||||
*/
|
||||
void enableStream(OBStreamType streamType) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_stream(impl_, streamType, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief enable a stream with a specific stream type
|
||||
*
|
||||
* @param[in] streamType The stream type to be enabled
|
||||
*/
|
||||
void enableStream(OBStreamType streamType) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_stream(impl_, streamType, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a stream with a specific sensor type
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor type to be enabled
|
||||
*/
|
||||
void enableStream(OBSensorType sensorType) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
enableStream(streamType);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a stream with a specific sensor type
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor type to be enabled
|
||||
*/
|
||||
void enableStream(OBSensorType sensorType) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
enableStream(streamType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a stream to be used in the pipeline
|
||||
*
|
||||
* @param[in] streamProfile The stream configuration to be enabled
|
||||
*/
|
||||
void enableStream(std::shared_ptr<const StreamProfile> streamProfile) const {
|
||||
ob_error *error = nullptr;
|
||||
auto c_stream_profile = streamProfile->getImpl();
|
||||
ob_config_enable_stream_with_stream_profile(impl_, c_stream_profile, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a stream to be used in the pipeline
|
||||
*
|
||||
* @param[in] streamProfile The stream configuration to be enabled
|
||||
*/
|
||||
void enableStream(std::shared_ptr<const StreamProfile> streamProfile) const {
|
||||
ob_error *error = nullptr;
|
||||
auto c_stream_profile = streamProfile->getImpl();
|
||||
ob_config_enable_stream_with_stream_profile(impl_, c_stream_profile, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a video stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default resolution settings.
|
||||
* Users who wish to set custom resolutions should refer to the product manual, as available
|
||||
* resolutions vary by camera model.
|
||||
*
|
||||
* @param[in] streamType The video stream type.
|
||||
* @param[in] width The video stream width (default is OB_WIDTH_ANY, which selects the default
|
||||
* resolution).
|
||||
* @param[in] height The video stream height (default is OB_HEIGHT_ANY, which selects the default
|
||||
* resolution).
|
||||
* @param[in] fps The video stream frame rate (default is OB_FPS_ANY, which selects the default
|
||||
* frame rate).
|
||||
* @param[in] format The video stream format (default is OB_FORMAT_ANY, which selects the default
|
||||
* format).
|
||||
*/
|
||||
void enableVideoStream(OBStreamType streamType, uint32_t width = OB_WIDTH_ANY,
|
||||
uint32_t height = OB_HEIGHT_ANY, uint32_t fps = OB_FPS_ANY,
|
||||
OBFormat format = OB_FORMAT_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_video_stream(impl_, streamType, width, height, fps, format, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a video stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default resolution settings.
|
||||
* Users who wish to set custom resolutions should refer to the product manual, as available resolutions vary by camera model.
|
||||
*
|
||||
* @param[in] streamType The video stream type.
|
||||
* @param[in] width The video stream width (default is OB_WIDTH_ANY, which selects the default resolution).
|
||||
* @param[in] height The video stream height (default is OB_HEIGHT_ANY, which selects the default resolution).
|
||||
* @param[in] fps The video stream frame rate (default is OB_FPS_ANY, which selects the default frame rate).
|
||||
* @param[in] format The video stream format (default is OB_FORMAT_ANY, which selects the default format).
|
||||
*/
|
||||
void enableVideoStream(OBStreamType streamType, uint32_t width = OB_WIDTH_ANY, uint32_t height = OB_HEIGHT_ANY, uint32_t fps = OB_FPS_ANY,
|
||||
OBFormat format = OB_FORMAT_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_video_stream(impl_, streamType, width, height, fps, format, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the pipeline.
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor type to be enabled.
|
||||
* @param[in] width The video stream width (default is OB_WIDTH_ANY, which selects the default
|
||||
* resolution).
|
||||
* @param[in] height The video stream height (default is OB_HEIGHT_ANY, which selects the default
|
||||
* resolution).
|
||||
* @param[in] fps The video stream frame rate (default is OB_FPS_ANY, which selects the default
|
||||
* frame rate).
|
||||
* @param[in] format The video stream format (default is OB_FORMAT_ANY, which selects the default
|
||||
* format).
|
||||
*/
|
||||
void enableVideoStream(OBSensorType sensorType, uint32_t width = OB_WIDTH_ANY,
|
||||
uint32_t height = OB_HEIGHT_ANY, uint32_t fps = OB_FPS_ANY,
|
||||
OBFormat format = OB_FORMAT_ANY) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
enableVideoStream(streamType, width, height, fps, format);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the pipeline.
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor type to be enabled.
|
||||
* @param[in] width The video stream width (default is OB_WIDTH_ANY, which selects the default resolution).
|
||||
* @param[in] height The video stream height (default is OB_HEIGHT_ANY, which selects the default resolution).
|
||||
* @param[in] fps The video stream frame rate (default is OB_FPS_ANY, which selects the default frame rate).
|
||||
* @param[in] format The video stream format (default is OB_FORMAT_ANY, which selects the default format).
|
||||
*/
|
||||
void enableVideoStream(OBSensorType sensorType, uint32_t width = OB_WIDTH_ANY, uint32_t height = OB_HEIGHT_ANY, uint32_t fps = OB_FPS_ANY,
|
||||
OBFormat format = OB_FORMAT_ANY) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
enableVideoStream(streamType, width, height, fps, format);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable an accelerometer stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable an accelerometer stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product
|
||||
* manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] fullScaleRange The full-scale range of the accelerometer (default is
|
||||
* OB_ACCEL_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param[in] sampleRate The sample rate of the accelerometer (default is
|
||||
* OB_ACCEL_SAMPLE_RATE_ANY, which selects the default rate).
|
||||
*/
|
||||
void enableAccelStream(OBAccelFullScaleRange fullScaleRange = OB_ACCEL_FULL_SCALE_RANGE_ANY,
|
||||
OBAccelSampleRate sampleRate = OB_ACCEL_SAMPLE_RATE_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_accel_stream(impl_, fullScaleRange, sampleRate, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Enable an accelerometer stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable an accelerometer stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] fullScaleRange The full-scale range of the accelerometer (default is OB_ACCEL_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param[in] sampleRate The sample rate of the accelerometer (default is OB_ACCEL_SAMPLE_RATE_ANY, which selects the default rate).
|
||||
*/
|
||||
void enableAccelStream(OBAccelFullScaleRange fullScaleRange = OB_ACCEL_FULL_SCALE_RANGE_ANY,
|
||||
OBAccelSampleRate sampleRate = OB_ACCEL_SAMPLE_RATE_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_accel_stream(impl_, fullScaleRange, sampleRate, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a gyroscope stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a gyroscope stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product
|
||||
* manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] fullScaleRange The full-scale range of the gyroscope (default is
|
||||
* OB_GYRO_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param[in] sampleRate The sample rate of the gyroscope (default is OB_GYRO_SAMPLE_RATE_ANY,
|
||||
* which selects the default rate).
|
||||
*/
|
||||
void enableGyroStream(OBGyroFullScaleRange fullScaleRange = OB_GYRO_FULL_SCALE_RANGE_ANY,
|
||||
OBGyroSampleRate sampleRate = OB_GYRO_SAMPLE_RATE_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_gyro_stream(impl_, fullScaleRange, sampleRate, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a gyroscope stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a gyroscope stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] fullScaleRange The full-scale range of the gyroscope (default is OB_GYRO_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param[in] sampleRate The sample rate of the gyroscope (default is OB_GYRO_SAMPLE_RATE_ANY, which selects the default rate).
|
||||
*/
|
||||
void enableGyroStream(OBGyroFullScaleRange fullScaleRange = OB_GYRO_FULL_SCALE_RANGE_ANY, OBGyroSampleRate sampleRate = OB_GYRO_SAMPLE_RATE_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_gyro_stream(impl_, fullScaleRange, sampleRate, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable a LiDAR stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a LiDAR stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product
|
||||
* manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] scanRate The scan rate of the LiDAR (default is OB_LIDAR_SCAN_ANY, which selects the
|
||||
* default scan rate).
|
||||
* @param[in] format The stream format (default is OB_FORMAT_ANY, which selects the default
|
||||
* format).
|
||||
*/
|
||||
void enableLiDARStream(OBLiDARScanRate scanRate = OB_LIDAR_SCAN_ANY,
|
||||
OBFormat format = OB_FORMAT_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_lidar_stream(impl_, scanRate, format, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Enable a LiDAR stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a LiDAR stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product manual, as available settings vary by device model.
|
||||
*
|
||||
* @param[in] scanRate The scan rate of the LiDAR (default is OB_LIDAR_SCAN_ANY, which selects the default scan rate).
|
||||
* @param[in] format The stream format (default is OB_FORMAT_ANY, which selects the default format).
|
||||
*/
|
||||
void enableLiDARStream(OBLiDARScanRate scanRate = OB_LIDAR_SCAN_ANY, OBFormat format = OB_FORMAT_ANY) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_lidar_stream(impl_, scanRate, format, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use enableStream(std::shared_ptr<StreamProfile> streamProfile) instead
|
||||
* @brief Enable all streams to be used in the pipeline
|
||||
*/
|
||||
void enableAllStream() {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_all_stream(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @deprecated Use enableStream(std::shared_ptr<StreamProfile> streamProfile) instead
|
||||
* @brief Enable all streams to be used in the pipeline
|
||||
*/
|
||||
void enableAllStream() {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_enable_all_stream(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable a stream to be used in the pipeline
|
||||
*
|
||||
* @param[in] streamType The stream configuration to be disabled
|
||||
*/
|
||||
void disableStream(OBStreamType streamType) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_disable_stream(impl_, streamType, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Disable a stream to be used in the pipeline
|
||||
*
|
||||
* @param[in] streamType The stream configuration to be disabled
|
||||
*/
|
||||
void disableStream(OBStreamType streamType) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_disable_stream(impl_, streamType, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable a sensor stream to be used in the pipeline.
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor configuration to be disabled
|
||||
*/
|
||||
void disableStream(OBSensorType sensorType) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
disableStream(streamType);
|
||||
}
|
||||
/**
|
||||
* @brief Disable a sensor stream to be used in the pipeline.
|
||||
* @brief Will convert sensor type to stream type automatically.
|
||||
*
|
||||
* @param[in] sensorType The sensor configuration to be disabled
|
||||
*/
|
||||
void disableStream(OBSensorType sensorType) const {
|
||||
auto streamType = ob::TypeHelper::convertSensorTypeToStreamType(sensorType);
|
||||
disableStream(streamType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable all streams to be used in the pipeline
|
||||
*/
|
||||
void disableAllStream() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_disable_all_stream(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Disable all streams to be used in the pipeline
|
||||
*/
|
||||
void disableAllStream() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_disable_all_stream(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the Enabled Stream Profile List
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList>
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getEnabledStreamProfileList() const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_config_get_enabled_stream_profile_list(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
/**
|
||||
* @brief Get the Enabled Stream Profile List
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList>
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getEnabledStreamProfileList() const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_config_get_enabled_stream_profile_list(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the alignment mode
|
||||
*
|
||||
* @param[in] mode The alignment mode
|
||||
*/
|
||||
void setAlignMode(OBAlignMode mode) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_align_mode(impl_, mode, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Set the alignment mode
|
||||
*
|
||||
* @param[in] mode The alignment mode
|
||||
*/
|
||||
void setAlignMode(OBAlignMode mode) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_align_mode(impl_, mode, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set whether the depth needs to be scaled after setting D2C
|
||||
*
|
||||
* @param[in] enable Whether scaling is required
|
||||
*/
|
||||
void setDepthScaleRequire(bool enable) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_depth_scale_after_align_require(impl_, enable, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Set whether the depth needs to be scaled after setting D2C
|
||||
*
|
||||
* @param[in] enable Whether scaling is required
|
||||
*/
|
||||
void setDepthScaleRequire(bool enable) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_depth_scale_after_align_require(impl_, enable, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the frame aggregation output mode for the pipeline configuration
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function
|
||||
* does not contain the frames of all opened streams (which can be caused by different frame rates
|
||||
* of each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
*
|
||||
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref
|
||||
* OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION)
|
||||
*/
|
||||
void setFrameAggregateOutputMode(OBFrameAggregateOutputMode mode) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_frame_aggregate_output_mode(impl_, mode, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Set the frame aggregation output mode for the pipeline configuration
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function does not contain the frames of all opened streams (which
|
||||
* can be caused by different frame rates of each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
*
|
||||
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION)
|
||||
*/
|
||||
void setFrameAggregateOutputMode(OBFrameAggregateOutputMode mode) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_set_frame_aggregate_output_mode(impl_, mode, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
};
|
||||
|
||||
class Pipeline {
|
||||
public:
|
||||
/**
|
||||
* @brief FrameSetCallback is a callback function type for frameset data arrival.
|
||||
*
|
||||
* @param[in] frame The returned frameset data
|
||||
*/
|
||||
typedef std::function<void(std::shared_ptr<FrameSet> frame)> FrameSetCallback;
|
||||
public:
|
||||
/**
|
||||
* @brief FrameSetCallback is a callback function type for frameset data arrival.
|
||||
*
|
||||
* @param[in] frame The returned frameset data
|
||||
*/
|
||||
typedef std::function<void(std::shared_ptr<FrameSet> frame)> FrameSetCallback;
|
||||
|
||||
private:
|
||||
ob_pipeline_t *impl_;
|
||||
FrameSetCallback callback_;
|
||||
private:
|
||||
ob_pipeline_t *impl_;
|
||||
FrameSetCallback callback_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Pipeline is a high-level interface for applications, algorithms related RGBD data
|
||||
* streams. Pipeline can provide alignment inside and synchronized FrameSet. Pipeline() no
|
||||
* parameter version, which opens the first device in the list of devices connected to the OS by
|
||||
* default. If the application has obtained the device through the DeviceList, opening the
|
||||
* Pipeline() at this time will throw an exception that the device has been created.
|
||||
*/
|
||||
Pipeline() {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_pipeline(&error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple
|
||||
* devices need to be obtained through DeviceList, and the device and pipeline are bound through
|
||||
* this interface.
|
||||
*/
|
||||
explicit Pipeline(std::shared_ptr<Device> device) {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_pipeline_with_device(device->getImpl(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Destroy the pipeline object
|
||||
*/
|
||||
~Pipeline() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_pipeline(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline with configuration parameters
|
||||
*
|
||||
* @param[in] config The parameter configuration of the pipeline
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config = nullptr) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_t *config_impl = config == nullptr ? nullptr : config->getImpl();
|
||||
ob_pipeline_start_with_config(impl_, config_impl, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline and set the frameset data callback
|
||||
*
|
||||
* @param[in] config The configuration of the pipeline
|
||||
* @param[in] callback The callback to be triggered when all frame data in the frameset arrives
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config, FrameSetCallback callback) {
|
||||
callback_ = callback;
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_start_with_callback(impl_, config ? config->getImpl() : nullptr,
|
||||
&Pipeline::frameSetCallback, this, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
static void frameSetCallback(ob_frame_t *frameSet, void *userData) {
|
||||
auto pipeline = static_cast<Pipeline *>(userData);
|
||||
pipeline->callback_(std::make_shared<FrameSet>(frameSet));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Stop the pipeline
|
||||
*/
|
||||
void stop() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_stop(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the pipeline configuration parameters
|
||||
* @brief Returns the default configuration if the user has not configured it
|
||||
*
|
||||
* @return std::shared_ptr<Config> The configured parameters
|
||||
*/
|
||||
std::shared_ptr<Config> getConfig() const {
|
||||
ob_error *error = nullptr;
|
||||
auto config = ob_pipeline_get_config(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Config>(config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wait for frameset
|
||||
*
|
||||
* @param[in] timeoutMs The waiting timeout in milliseconds
|
||||
*
|
||||
* @return std::shared_ptr<FrameSet> The waiting frameset data
|
||||
*/
|
||||
std::shared_ptr<FrameSet> waitForFrameset(uint32_t timeoutMs = 1000) const {
|
||||
ob_error *error = nullptr;
|
||||
auto frameSet = ob_pipeline_wait_for_frameset(impl_, timeoutMs, &error);
|
||||
if (frameSet == nullptr) {
|
||||
return nullptr;
|
||||
public:
|
||||
/**
|
||||
* @brief Pipeline is a high-level interface for applications, algorithms related RGBD data streams. Pipeline can provide alignment inside and synchronized
|
||||
* FrameSet. Pipeline() no parameter version, which opens the first device in the list of devices connected to the OS by default. If the application has
|
||||
* obtained the device through the DeviceList, opening the Pipeline() at this time will throw an exception that the device has been created.
|
||||
*/
|
||||
Pipeline() {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_pipeline(&error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
Error::handle(&error);
|
||||
return std::make_shared<FrameSet>(frameSet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the device object
|
||||
*
|
||||
* @return std::shared_ptr<Device> The device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDevice() const {
|
||||
ob_error *error = nullptr;
|
||||
auto device = ob_pipeline_get_device(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Device>(device);
|
||||
}
|
||||
/**
|
||||
* @brief
|
||||
* Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices need to be obtained through DeviceList, and the device
|
||||
* and pipeline are bound through this interface.
|
||||
*/
|
||||
explicit Pipeline(std::shared_ptr<Device> device) {
|
||||
ob_error *error = nullptr;
|
||||
impl_ = ob_create_pipeline_with_device(device->getImpl(), &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile of the specified sensor
|
||||
*
|
||||
* @param[in] sensorType The type of sensor
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getStreamProfileList(OBSensorType sensorType) const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_pipeline_get_stream_profile_list(impl_, sensorType, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
/**
|
||||
* @brief Destroy the pipeline object
|
||||
*/
|
||||
~Pipeline() noexcept {
|
||||
ob_error *error = nullptr;
|
||||
ob_delete_pipeline(impl_, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile list of supported depth-to-color alignments
|
||||
*
|
||||
* @param[in] colorProfile The color stream profile, which is the target stream profile for the
|
||||
* depth-to-color alignment.
|
||||
* @param[in] alignMode The alignment mode.
|
||||
*
|
||||
* @attention Currently, only ALIGN_D2C_HW_MODE supported. For other align modes, please using the
|
||||
* AlignFilter interface.
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list of supported depth-to-color
|
||||
* alignments.
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getD2CDepthProfileList(
|
||||
std::shared_ptr<StreamProfile> colorProfile, OBAlignMode alignMode) {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_get_d2c_depth_profile_list(impl_, colorProfile->getImpl(), alignMode, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
/**
|
||||
* @brief Start the pipeline with configuration parameters
|
||||
*
|
||||
* @param[in] config The parameter configuration of the pipeline
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config = nullptr) const {
|
||||
ob_error *error = nullptr;
|
||||
ob_config_t *config_impl = config == nullptr ? nullptr : config->getImpl();
|
||||
ob_pipeline_start_with_config(impl_, config_impl, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turn on frame synchronization
|
||||
*/
|
||||
void enableFrameSync() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_enable_frame_sync(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
/**
|
||||
* @brief Start the pipeline and set the frameset data callback
|
||||
*
|
||||
* @param[in] config The configuration of the pipeline
|
||||
* @param[in] callback The callback to be triggered when all frame data in the frameset arrives
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config, FrameSetCallback callback) {
|
||||
callback_ = callback;
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_start_with_callback(impl_, config ? config->getImpl() : nullptr, &Pipeline::frameSetCallback, this, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turn off frame synchronization
|
||||
*/
|
||||
void disableFrameSync() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_disable_frame_sync(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
static void frameSetCallback(ob_frame_t *frameSet, void *userData) {
|
||||
auto pipeline = static_cast<Pipeline *>(userData);
|
||||
pipeline->callback_(std::make_shared<FrameSet>(frameSet));
|
||||
}
|
||||
|
||||
public:
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
/**
|
||||
* @brief Stop the pipeline
|
||||
*/
|
||||
void stop() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_stop(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
OBCameraParam getCameraParam() {
|
||||
ob_error *error = nullptr;
|
||||
OBCameraParam cameraParam = ob_pipeline_get_camera_param(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return cameraParam;
|
||||
}
|
||||
/**
|
||||
* @brief Get the pipeline configuration parameters
|
||||
* @brief Returns the default configuration if the user has not configured it
|
||||
*
|
||||
* @return std::shared_ptr<Config> The configured parameters
|
||||
*/
|
||||
std::shared_ptr<Config> getConfig() const {
|
||||
ob_error *error = nullptr;
|
||||
auto config = ob_pipeline_get_config(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Config>(config);
|
||||
}
|
||||
|
||||
OBCameraParam getCameraParamWithProfile(uint32_t colorWidth, uint32_t colorHeight,
|
||||
uint32_t depthWidth, uint32_t depthHeight) {
|
||||
ob_error *error = nullptr;
|
||||
OBCameraParam cameraParam = ob_pipeline_get_camera_param_with_profile(
|
||||
impl_, colorWidth, colorHeight, depthWidth, depthHeight, &error);
|
||||
Error::handle(&error);
|
||||
return cameraParam;
|
||||
}
|
||||
/**
|
||||
* @brief Wait for frameset
|
||||
*
|
||||
* @param[in] timeoutMs The waiting timeout in milliseconds
|
||||
*
|
||||
* @return std::shared_ptr<FrameSet> The waiting frameset data
|
||||
*/
|
||||
std::shared_ptr<FrameSet> waitForFrameset(uint32_t timeoutMs = 1000) const {
|
||||
ob_error *error = nullptr;
|
||||
auto frameSet = ob_pipeline_wait_for_frameset(impl_, timeoutMs, &error);
|
||||
if(frameSet == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
Error::handle(&error);
|
||||
return std::make_shared<FrameSet>(frameSet);
|
||||
}
|
||||
|
||||
OBCalibrationParam getCalibrationParam(std::shared_ptr<Config> config) {
|
||||
ob_error *error = nullptr;
|
||||
OBCalibrationParam calibrationParam =
|
||||
ob_pipeline_get_calibration_param(impl_, config->getImpl(), &error);
|
||||
Error::handle(&error);
|
||||
return calibrationParam;
|
||||
}
|
||||
/**
|
||||
* @brief Get the device object
|
||||
*
|
||||
* @return std::shared_ptr<Device> The device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDevice() const {
|
||||
ob_error *error = nullptr;
|
||||
auto device = ob_pipeline_get_device(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<Device>(device);
|
||||
}
|
||||
|
||||
std::shared_ptr<FrameSet> waitForFrames(uint32_t timeoutMs = 1000) const {
|
||||
return waitForFrameset(timeoutMs);
|
||||
}
|
||||
/**
|
||||
* @brief Get the stream profile of the specified sensor
|
||||
*
|
||||
* @param[in] sensorType The type of sensor
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getStreamProfileList(OBSensorType sensorType) const {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_pipeline_get_stream_profile_list(impl_, sensorType, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile list of supported depth-to-color alignments
|
||||
*
|
||||
* @param[in] colorProfile The color stream profile, which is the target stream profile for the depth-to-color alignment.
|
||||
* @param[in] alignMode The alignment mode.
|
||||
*
|
||||
* @attention Currently, only ALIGN_D2C_HW_MODE supported. For other align modes, please using the AlignFilter interface.
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list of supported depth-to-color alignments.
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getD2CDepthProfileList(std::shared_ptr<StreamProfile> colorProfile, OBAlignMode alignMode) {
|
||||
ob_error *error = nullptr;
|
||||
auto list = ob_get_d2c_depth_profile_list(impl_, colorProfile->getImpl(), alignMode, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<StreamProfileList>(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turn on frame synchronization
|
||||
*/
|
||||
void enableFrameSync() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_enable_frame_sync(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Turn off frame synchronization
|
||||
*/
|
||||
void disableFrameSync() const {
|
||||
ob_error *error = nullptr;
|
||||
ob_pipeline_disable_frame_sync(impl_, &error);
|
||||
Error::handle(&error);
|
||||
}
|
||||
|
||||
public:
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
|
||||
OBCameraParam getCameraParam() {
|
||||
ob_error *error = nullptr;
|
||||
OBCameraParam cameraParam = ob_pipeline_get_camera_param(impl_, &error);
|
||||
Error::handle(&error);
|
||||
return cameraParam;
|
||||
}
|
||||
|
||||
OBCameraParam getCameraParamWithProfile(uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth, uint32_t depthHeight) {
|
||||
ob_error *error = nullptr;
|
||||
OBCameraParam cameraParam = ob_pipeline_get_camera_param_with_profile(impl_, colorWidth, colorHeight, depthWidth, depthHeight, &error);
|
||||
Error::handle(&error);
|
||||
return cameraParam;
|
||||
}
|
||||
|
||||
OBCalibrationParam getCalibrationParam(std::shared_ptr<Config> config) {
|
||||
ob_error *error = nullptr;
|
||||
OBCalibrationParam calibrationParam = ob_pipeline_get_calibration_param(impl_, config->getImpl(), &error);
|
||||
Error::handle(&error);
|
||||
return calibrationParam;
|
||||
}
|
||||
|
||||
std::shared_ptr<FrameSet> waitForFrames(uint32_t timeoutMs = 1000) const {
|
||||
return waitForFrameset(timeoutMs);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,227 +18,189 @@ namespace ob {
|
||||
class Device;
|
||||
|
||||
class CoordinateTransformHelper {
|
||||
public:
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 3d point of the target
|
||||
* coordinate system.
|
||||
*
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation3dto3d(const OBPoint3f source_point3f, OBExtrinsic extrinsic,
|
||||
OBPoint3f *target_point3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_3d_to_3d(source_point3f, extrinsic, target_point3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
public:
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation3dto3d(const OBPoint3f source_point3f, OBExtrinsic extrinsic, OBPoint3f *target_point3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_3d_to_3d(source_point3f, extrinsic, target_point3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into
|
||||
* a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] source_intrinsic Source intrinsic parameters
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation2dto3d(const OBPoint2f source_point2f,
|
||||
const float source_depth_pixel_value,
|
||||
const OBCameraIntrinsic source_intrinsic, OBExtrinsic extrinsic,
|
||||
OBPoint3f *target_point3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_2d_to_3d(source_point2f, source_depth_pixel_value,
|
||||
source_intrinsic, extrinsic, target_point3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] source_intrinsic Source intrinsic parameters
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation2dto3d(const OBPoint2f source_point2f, const float source_depth_pixel_value, const OBCameraIntrinsic source_intrinsic,
|
||||
OBExtrinsic extrinsic, OBPoint3f *target_point3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_2d_to_3d(source_point2f, source_depth_pixel_value, source_intrinsic, extrinsic, target_point3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 2d pixel coordinate of the
|
||||
* target camera.
|
||||
*
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] target_intrinsic Target intrinsic parameters
|
||||
* @param[in] target_distortion Target distortion parameters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation3dto2d(const OBPoint3f source_point3f,
|
||||
const OBCameraIntrinsic target_intrinsic,
|
||||
const OBCameraDistortion target_distortion,
|
||||
OBExtrinsic extrinsic, OBPoint2f *target_point2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_3d_to_2d(source_point3f, target_intrinsic, target_distortion,
|
||||
extrinsic, target_point2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 2d pixel coordinate of the target camera.
|
||||
*
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] target_intrinsic Target intrinsic parameters
|
||||
* @param[in] target_distortion Target distortion parameters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation3dto2d(const OBPoint3f source_point3f, const OBCameraIntrinsic target_intrinsic, const OBCameraDistortion target_distortion,
|
||||
OBExtrinsic extrinsic, OBPoint2f *target_point2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_3d_to_2d(source_point3f, target_intrinsic, target_distortion, extrinsic, target_point2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into
|
||||
* a 2d pixel coordinate of the target camera
|
||||
*
|
||||
* @param[in] source_intrinsic Source intrinsic parameters
|
||||
* @param[in] source_distortion Source distortion parameters
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] target_intrinsic Target intrinsic parameters
|
||||
* @param[in] target_distortion Target distortion parameters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation2dto2d(const OBPoint2f source_point2f,
|
||||
const float source_depth_pixel_value,
|
||||
const OBCameraIntrinsic source_intrinsic,
|
||||
const OBCameraDistortion source_distortion,
|
||||
const OBCameraIntrinsic target_intrinsic,
|
||||
const OBCameraDistortion target_distortion,
|
||||
OBExtrinsic extrinsic, OBPoint2f *target_point2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_2d_to_2d(source_point2f, source_depth_pixel_value,
|
||||
source_intrinsic, source_distortion, target_intrinsic,
|
||||
target_distortion, extrinsic, target_point2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 2d pixel coordinate of the target camera
|
||||
*
|
||||
* @param[in] source_intrinsic Source intrinsic parameters
|
||||
* @param[in] source_distortion Source distortion parameters
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] target_intrinsic Target intrinsic parameters
|
||||
* @param[in] target_distortion Target distortion parameters
|
||||
* @param[in] extrinsic Transformation matrix from source to target
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformation2dto2d(const OBPoint2f source_point2f, const float source_depth_pixel_value, const OBCameraIntrinsic source_intrinsic,
|
||||
const OBCameraDistortion source_distortion, const OBCameraIntrinsic target_intrinsic,
|
||||
const OBCameraDistortion target_distortion, OBExtrinsic extrinsic, OBPoint2f *target_point2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_transformation_2d_to_2d(source_point2f, source_depth_pixel_value, source_intrinsic, source_distortion, target_intrinsic,
|
||||
target_distortion, extrinsic, target_point2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
public:
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
static bool calibration3dTo3d(const OBCalibrationParam calibrationParam,
|
||||
const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint3f *targetPoint3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_calibration_3d_to_3d(calibrationParam, sourcePoint3f, sourceSensorType,
|
||||
targetSensorType, targetPoint3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
public:
|
||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||
static bool calibration3dTo3d(const OBCalibrationParam calibrationParam, const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint3f *targetPoint3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_calibration_3d_to_3d(calibrationParam, sourcePoint3f, sourceSensorType, targetSensorType, targetPoint3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool calibration2dTo3d(const OBCalibrationParam calibrationParam,
|
||||
const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint3f *targetPoint3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result =
|
||||
ob_calibration_2d_to_3d(calibrationParam, sourcePoint2f, sourceDepthPixelValue,
|
||||
sourceSensorType, targetSensorType, targetPoint3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
static bool calibration2dTo3d(const OBCalibrationParam calibrationParam, const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType, const OBSensorType targetSensorType, OBPoint3f *targetPoint3f) {
|
||||
ob_error *error = NULL;
|
||||
bool result =
|
||||
ob_calibration_2d_to_3d(calibrationParam, sourcePoint2f, sourceDepthPixelValue, sourceSensorType, targetSensorType, targetPoint3f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool calibration3dTo2d(const OBCalibrationParam calibrationParam,
|
||||
const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint2f *targetPoint2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_calibration_3d_to_2d(calibrationParam, sourcePoint3f, sourceSensorType,
|
||||
targetSensorType, targetPoint2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
static bool calibration3dTo2d(const OBCalibrationParam calibrationParam, const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint2f *targetPoint2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result = ob_calibration_3d_to_2d(calibrationParam, sourcePoint3f, sourceSensorType, targetSensorType, targetPoint2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static bool calibration2dTo2d(const OBCalibrationParam calibrationParam,
|
||||
const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint2f *targetPoint2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result =
|
||||
ob_calibration_2d_to_2d(calibrationParam, sourcePoint2f, sourceDepthPixelValue,
|
||||
sourceSensorType, targetSensorType, targetPoint2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
static bool calibration2dTo2d(const OBCalibrationParam calibrationParam, const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType, const OBSensorType targetSensorType, OBPoint2f *targetPoint2f) {
|
||||
ob_error *error = NULL;
|
||||
bool result =
|
||||
ob_calibration_2d_to_2d(calibrationParam, sourcePoint2f, sourceDepthPixelValue, sourceSensorType, targetSensorType, targetPoint2f, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static std::shared_ptr<ob::Frame> transformationDepthFrameToColorCamera(
|
||||
std::shared_ptr<ob::Device> device, std::shared_ptr<ob::Frame> depthFrame,
|
||||
uint32_t targetColorCameraWidth, uint32_t targetColorCameraHeight) {
|
||||
ob_error *error = NULL;
|
||||
static std::shared_ptr<ob::Frame> transformationDepthFrameToColorCamera(std::shared_ptr<ob::Device> device, std::shared_ptr<ob::Frame> depthFrame,
|
||||
uint32_t targetColorCameraWidth, uint32_t targetColorCameraHeight) {
|
||||
ob_error *error = NULL;
|
||||
|
||||
// unsafe operation, need to cast const to non-const
|
||||
auto unConstImpl = const_cast<ob_frame *>(depthFrame->getImpl());
|
||||
// unsafe operation, need to cast const to non-const
|
||||
auto unConstImpl = const_cast<ob_frame *>(depthFrame->getImpl());
|
||||
|
||||
auto result = transformation_depth_frame_to_color_camera(
|
||||
device->getImpl(), unConstImpl, targetColorCameraWidth, targetColorCameraHeight, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<ob::Frame>(result);
|
||||
}
|
||||
auto result = transformation_depth_frame_to_color_camera(device->getImpl(), unConstImpl, targetColorCameraWidth, targetColorCameraHeight, &error);
|
||||
Error::handle(&error);
|
||||
return std::make_shared<ob::Frame>(result);
|
||||
}
|
||||
|
||||
static bool transformationInitXYTables(const OBCalibrationParam calibrationParam,
|
||||
const OBSensorType sensorType, float *data,
|
||||
uint32_t *dataSize, OBXYTables *xyTables) {
|
||||
ob_error *error = NULL;
|
||||
bool result = transformation_init_xy_tables(calibrationParam, sensorType, data, dataSize,
|
||||
xyTables, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
static bool transformationInitXYTables(const OBCalibrationParam calibrationParam, const OBSensorType sensorType, float *data, uint32_t *dataSize,
|
||||
OBXYTables *xyTables) {
|
||||
ob_error *error = NULL;
|
||||
bool result = transformation_init_xy_tables(calibrationParam, sensorType, data, dataSize, xyTables, &error);
|
||||
Error::handle(&error);
|
||||
return result;
|
||||
}
|
||||
|
||||
static void transformationDepthToPointCloud(OBXYTables *xyTables, const void *depthImageData,
|
||||
void *pointCloudData) {
|
||||
ob_error *error = NULL;
|
||||
transformation_depth_to_pointcloud(xyTables, depthImageData, pointCloudData, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
static void transformationDepthToPointCloud(OBXYTables *xyTables, const void *depthImageData, void *pointCloudData) {
|
||||
ob_error *error = NULL;
|
||||
transformation_depth_to_pointcloud(xyTables, depthImageData, pointCloudData, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
|
||||
static void transformationDepthToRGBDPointCloud(OBXYTables *xyTables, const void *depthImageData,
|
||||
const void *colorImageData,
|
||||
void *pointCloudData) {
|
||||
ob_error *error = NULL;
|
||||
transformation_depth_to_rgbd_pointcloud(xyTables, depthImageData, colorImageData,
|
||||
pointCloudData, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
static void transformationDepthToRGBDPointCloud(OBXYTables *xyTables, const void *depthImageData, const void *colorImageData, void *pointCloudData) {
|
||||
ob_error *error = NULL;
|
||||
transformation_depth_to_rgbd_pointcloud(xyTables, depthImageData, colorImageData, pointCloudData, &error);
|
||||
Error::handle(&error, false);
|
||||
}
|
||||
};
|
||||
|
||||
class PointCloudHelper {
|
||||
public:
|
||||
/**
|
||||
* @brief save point cloud to ply file.
|
||||
*
|
||||
* @param[in] fileName Point cloud save path
|
||||
* @param[in] frame Point cloud frame
|
||||
* @param[in] saveBinary Binary or textual,true: binary, false: textual
|
||||
* @param[in] useMesh Save mesh or not, true: save as mesh, false: not save as mesh
|
||||
* @param[in] meshThreshold Distance threshold for creating faces in point cloud,default value :50
|
||||
*
|
||||
* @return bool save point cloud result
|
||||
*/
|
||||
static bool savePointcloudToPly(const char *fileName, std::shared_ptr<ob::Frame> frame,
|
||||
bool saveBinary, bool useMesh, float meshThreshold) {
|
||||
ob_error *error = NULL;
|
||||
auto unConstImpl = const_cast<ob_frame *>(frame->getImpl());
|
||||
bool result = ob_save_pointcloud_to_ply(fileName, unConstImpl, saveBinary, useMesh,
|
||||
meshThreshold, &error);
|
||||
Error::handle(&error, false);
|
||||
return result;
|
||||
}
|
||||
public:
|
||||
/**
|
||||
* @brief save point cloud to ply file.
|
||||
*
|
||||
* @param[in] fileName Point cloud save path
|
||||
* @param[in] frame Point cloud frame
|
||||
* @param[in] saveBinary Binary or textual,true: binary, false: textual
|
||||
* @param[in] useMesh Save mesh or not, true: save as mesh, false: not save as mesh
|
||||
* @param[in] meshThreshold Distance threshold for creating faces in point cloud,default value :50
|
||||
*
|
||||
* @return bool save point cloud result
|
||||
*/
|
||||
static bool savePointcloudToPly(const char *fileName, std::shared_ptr<ob::Frame> frame, bool saveBinary, bool useMesh, float meshThreshold) {
|
||||
ob_error *error = NULL;
|
||||
auto unConstImpl = const_cast<ob_frame *>(frame->getImpl());
|
||||
bool result = ob_save_pointcloud_to_ply(fileName, unConstImpl, saveBinary, useMesh, meshThreshold, &error);
|
||||
Error::handle(&error, false);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Save LiDAR point cloud to PLY file.
|
||||
*
|
||||
* @param[in] fileName Point cloud save path
|
||||
* @param[in] frame LiDAR point cloud frame
|
||||
* @param[in] saveBinary Binary or textual,true: binary, false: textual
|
||||
* @return bool save LiDAR point cloud result
|
||||
*/
|
||||
static bool saveLiDARPointcloudToPly(const char *fileName,
|
||||
std::shared_ptr<ob::LiDARPointsFrame> frame,
|
||||
bool saveBinary) {
|
||||
ob_error *error = NULL;
|
||||
auto unConstImpl = const_cast<ob_frame *>(frame->getImpl());
|
||||
bool result = ob_save_lidar_pointcloud_to_ply(fileName, unConstImpl, saveBinary, &error);
|
||||
Error::handle(&error, false);
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* @brief Save LiDAR point cloud to PLY file.
|
||||
*
|
||||
* @param[in] fileName Point cloud save path
|
||||
* @param[in] frame LiDAR point cloud frame
|
||||
* @param[in] saveBinary Binary or textual,true: binary, false: textual
|
||||
* @return bool save LiDAR point cloud result
|
||||
*/
|
||||
static bool saveLiDARPointcloudToPly(const char *fileName, std::shared_ptr<ob::LiDARPointsFrame> frame, bool saveBinary) {
|
||||
ob_error *error = NULL;
|
||||
auto unConstImpl = const_cast<ob_frame *>(frame->getImpl());
|
||||
bool result = ob_save_lidar_pointcloud_to_ply(fileName, unConstImpl, saveBinary, &error);
|
||||
Error::handle(&error, false);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
} // namespace ob
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user