updata libOrbbecSDK.so , ob_camera_node and CMakeLists.txt

This commit is contained in:
jj
2024-09-04 12:47:36 +08:00
parent 3cd3a7fdd3
commit 9f764c8e57
58 changed files with 6218 additions and 5345 deletions
@@ -0,0 +1,211 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "ObTypes.h"
/**
* @brief Get the current depth work mode.
*
* @param[in] device The device object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_depth_work_mode The current depth work mode.
*/
OB_EXPORT ob_depth_work_mode ob_device_get_current_depth_work_mode(const ob_device *device, ob_error **error);
/**
* @brief Get current depth mode name
* @brief According the current preset name to return current depth mode name
* @return const char* return the current depth mode name.
*/
OB_EXPORT const char * ob_device_get_current_depth_work_mode_name(const ob_device *device, ob_error **error);
/**
* @brief Switch the depth work mode by ob_depth_work_mode.
* Prefer to use ob_device_switch_depth_work_mode_by_name to switch depth mode when the complete name of the depth work mode is known.
*
* @param[in] device The device object.
* @param[in] work_mode The depth work mode from ob_depth_work_mode_list which is returned by ob_device_get_depth_work_mode_list.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_status The switch result. OB_STATUS_OK: success, other failed.
*/
OB_EXPORT ob_status ob_device_switch_depth_work_mode(ob_device *device, const ob_depth_work_mode *work_mode, ob_error **error);
/**
* @brief Switch the depth work mode by work mode name.
*
* @param[in] device The device object.
* @param[in] mode_name The depth work mode name which is equal to ob_depth_work_mode.name.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_status The switch result. OB_STATUS_OK: success, other failed.
*/
OB_EXPORT ob_status ob_device_switch_depth_work_mode_by_name(ob_device *device, const char *mode_name, ob_error **error);
/**
* @brief Request the list of supported depth work modes.
*
* @param[in] device The device object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_depth_work_mode_list The list of ob_depth_work_mode.
*/
OB_EXPORT ob_depth_work_mode_list *ob_device_get_depth_work_mode_list(const ob_device *device, ob_error **error);
/**
* \if English
* @brief Get the depth work mode count that ob_depth_work_mode_list hold
* @param[in] work_mode_list data struct contain list of ob_depth_work_mode
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return The total number contained in ob_depth_work_mode_list
*
*/
OB_EXPORT uint32_t ob_depth_work_mode_list_get_count(const ob_depth_work_mode_list *work_mode_list, ob_error **error);
/**
* @brief Get the index target of ob_depth_work_mode from work_mode_list
*
* @param[in] work_mode_list Data structure containing a list of ob_depth_work_mode
* @param[in] index Index of the target ob_depth_work_mode
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_depth_work_mode
*
*/
OB_EXPORT ob_depth_work_mode ob_depth_work_mode_list_get_item(const ob_depth_work_mode_list *work_mode_list, uint32_t index, ob_error **error);
/**
* @brief Free the resources of ob_depth_work_mode_list
*
* @param[in] work_mode_list Data structure containing a list of ob_depth_work_mode
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
*/
OB_EXPORT void ob_delete_depth_work_mode_list(ob_depth_work_mode_list *work_mode_list, ob_error **error);
/**
* @breif Get the current preset name.
* @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
*
* @param device The device object.
* @param error Pointer to an error object that will be set if an error occurs.
* @return The current preset name, it should be one of the preset names returned by @ref ob_device_get_available_preset_list.
*/
OB_EXPORT const char *ob_device_get_current_preset_name(const ob_device *device, ob_error **error);
/**
* @brief Get the available preset list.
* @attention After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device
* settings to update the user program temporarily.
*
* @param device The device object.
* @param preset_name Pointer to an error object that will be set if an error occurs. The name should be one of the preset names returned by @ref
* ob_device_get_available_preset_list.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_device_load_preset(ob_device *device, const char *preset_name, ob_error **error);
/**
* @brief Load preset from json string.
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.
*
* @param device The device object.
* @param json_file_path The json file path.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_device_load_preset_from_json_file(ob_device *device, const char *json_file_path, ob_error **error);
/**
* @brief Load custom preset from data.
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the @ref presetName.
*
* @attention The user should ensure that the custom preset data is adapted to the device and the settings in the data are valid.
* @attention It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.
*
* @param data The custom preset data.
* @param size The size of the custom preset data.
*/
OB_EXPORT void ob_device_load_preset_from_json_data(ob_device *device, const char *presetName, const uint8_t *data, uint32_t size, ob_error **error);
/**
* @brief Export current settings as a preset json file.
* @brief After exporting the custom preset, the available preset list will be appended with the custom preset and named as the file name.
*
* @param device The device object.
* @param json_file_path The json file path.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_device_export_current_settings_as_preset_json_file(ob_device *device, const char *json_file_path, ob_error **error);
/**
* @brief Export current device settings as a preset json data.
* @brief After exporting the preset, a new preset named as the @ref presetName will be added to the available preset list.
*
* @attention The memory of the data is allocated by the SDK, and will automatically be released by the SDK.
* @attention The memory of the data will be reused by the SDK on the next call, so the user should copy the data to a new buffer if it needs to be
* preserved.
*
* @param[out] data return the preset json data.
* @param[out] dataSize return the size of the preset json data.
*/
OB_EXPORT void ob_device_export_current_settings_as_preset_json_data(ob_device *device, const char *presetName, const uint8_t **data, uint32_t *dataSize, ob_error **error);
/**
* @brief Get the available preset list.
*
* @param device The device object.
* @param error Pointer to an error object that will be set if an error occurs.
* @return The available preset list.
*/
OB_EXPORT ob_device_preset_list *ob_device_get_available_preset_list(const ob_device *device, ob_error **error);
/**
* @brief Delete the available preset list.
*
* @param preset_list The available preset list.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_preset_list(ob_device_preset_list *preset_list, ob_error **error);
/**
* @brief Get the number of preset in the preset list.
*
* @param preset_list The available preset list.
* @param error Pointer to an error object that will be set if an error occurs.
* @return The number of preset in the preset list.
*/
OB_EXPORT uint32_t ob_device_preset_list_get_count(const ob_device_preset_list *preset_list, ob_error **error);
/**
* @brief Get the name of the preset in the preset list.
*
* @param preset_list The available preset list.
* @param index The index of the preset in the preset list.
* @param error Pointer to an error object that will be set if an error occurs.
* @return The name of the preset in the preset list.
*/
OB_EXPORT const char *ob_device_preset_list_get_name(const ob_device_preset_list *preset_list, uint32_t index, ob_error **error);
/**
* @brief Check if the preset list has the preset.
*
* @param preset_list The available preset list.
* @param preset_name The name of the preset.
* @param error Pointer to an error object that will be set if an error occurs.
* @return Whether the preset list has the preset. If true, the preset list has the preset. If false, the preset list does not have the preset.
*/
OB_EXPORT bool ob_device_preset_list_has_preset(const ob_device_preset_list *preset_list, const char *preset_name, ob_error **error);
/**
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
#define ob_depth_work_mode_list_count ob_depth_work_mode_list_get_count
#define ob_device_preset_list_count ob_device_preset_list_get_count
#ifdef __cplusplus
}
#endif
@@ -13,21 +13,21 @@ extern "C" {
#include "ObTypes.h"
/**
* @brief Create a context object
* @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
* @return Pointer to the created context object
*/
ob_context *ob_create_context(ob_error **error);
OB_EXPORT ob_context *ob_create_context(ob_error **error);
/**
* @brief Create a context object with a specified configuration file
*
* @param[in] config_path Path to the configuration file. If NULL, the default configuration file will be used.
* @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
*/
ob_context *ob_create_context_with_config(const char *config_path, ob_error **error);
OB_EXPORT ob_context *ob_create_context_with_config(const char *config_file_path, ob_error **error);
/**
* @brief Delete a context object
@@ -35,7 +35,7 @@ ob_context *ob_create_context_with_config(const char *config_path, ob_error **er
* @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
*/
void ob_delete_context(ob_context *context, ob_error **error);
OB_EXPORT void ob_delete_context(ob_context *context, ob_error **error);
/**
* @brief Get a list of enumerated devices
@@ -44,7 +44,7 @@ void ob_delete_context(ob_context *context, ob_error **error);
* @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
*/
ob_device_list *ob_query_device_list(ob_context *context, ob_error **error);
OB_EXPORT ob_device_list *ob_query_device_list(ob_context *context, ob_error **error);
/**
* @brief Enable or disable network device enumeration
@@ -58,7 +58,7 @@ ob_device_list *ob_query_device_list(ob_context *context, ob_error **error);
* @param[in] enable true to enable, false to disable
* @param[out] error Pointer to an error object that will be populated if an error occurs.
*/
void ob_enable_net_device_enumeration(ob_context *context, bool enable, ob_error **error);
OB_EXPORT void ob_enable_net_device_enumeration(ob_context *context, bool enable, ob_error **error);
/**
* @brief Create a network device object
@@ -69,7 +69,7 @@ void ob_enable_net_device_enumeration(ob_context *context, bool enable, ob_error
* @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_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 Set a device plug-in callback function
@@ -80,7 +80,7 @@ ob_device *ob_create_net_device(ob_context *context, const char *address, uint16
* @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
*/
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).
@@ -89,8 +89,7 @@ void ob_set_device_changed_callback(ob_context *context, ob_device_changed_callb
* @param[in] repeatInterval 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
*/
void ob_enable_device_clock_sync(ob_context *context, uint64_t repeatInterval, ob_error **error);
#define ob_enable_multi_device_sync ob_enable_device_clock_sync
OB_EXPORT void ob_enable_device_clock_sync(ob_context *context, uint64_t repeatInterval, ob_error **error);
/**
* @brief Free idle memory from the internal frame memory pool
@@ -98,7 +97,7 @@ void ob_enable_device_clock_sync(ob_context *context, uint64_t repeatInterval, o
* @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
*/
void ob_free_idle_memory(ob_context *context, ob_error **error);
OB_EXPORT void ob_free_idle_memory(ob_context *context, ob_error **error);
/**
* @brief Set the global log level
@@ -108,7 +107,7 @@ void ob_free_idle_memory(ob_context *context, ob_error **error);
* @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
*/
void ob_set_logger_severity(ob_log_severity severity, ob_error **error);
OB_EXPORT void ob_set_logger_severity(ob_log_severity severity, ob_error **error);
/**
* @brief Set the log output to a file
@@ -118,7 +117,7 @@ void ob_set_logger_severity(ob_log_severity severity, ob_error **error);
* configuration is also empty, the log will not be output to the file)
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
*/
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 callback function
@@ -128,7 +127,7 @@ void ob_set_logger_to_file(ob_log_severity severity, const char *directory, ob_e
* @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
*/
void ob_set_logger_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
@@ -136,26 +135,14 @@ void ob_set_logger_callback(ob_log_severity severity, ob_log_callback callback,
* @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
*/
void ob_set_logger_to_console(ob_log_severity severity, ob_error **error);
OB_EXPORT void ob_set_logger_to_console(ob_log_severity severity, ob_error **error);
/**
* @brief Load a license file
*
* @param[in] filePath Path to the license file
* @param[in] key Decryption key. "OB_DEFAULT_DECRYPT_KEY" can be used to represent the default key.
* @param[out] error Pointer to an error object that will be populated if an error occurs during license loading
*/
void ob_load_license(const char *filePath, const char *key, ob_error **error);
/**
* @brief Load a license from data
*
* @param[in] data Pointer to the license data
* @param[in] dataLen Length of the license data
* @param[in] key Decryption key. "OB_DEFAULT_DECRYPT_KEY" can be used to represent the default key.
* @param[out] error Pointer to an error object that will be populated if an error occurs during license loading
*/
void ob_load_license_from_data(const char *data, uint32_t dataLen, const char *key, ob_error **error);
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
#define ob_enable_multi_device_sync ob_enable_device_clock_sync
#define ob_set_logger_callback ob_set_logger_to_callback
#ifdef __cplusplus
}
File diff suppressed because it is too large Load Diff
@@ -10,13 +10,25 @@ extern "C" {
#include "ObTypes.h"
/**
* @brief Create a new error object.
*
* @param status The error status.
* @param message The error message.
* @param function The name of the API function that caused the error.
* @param args The error parameters.
* @param exception_type The type of exception that caused the error.
* @return ob_error* The new error object.
*/
OB_EXPORT ob_error *ob_create_error(ob_status status, const char *message, const char *function, const char *args, ob_exception_type exception_type);
/**
* @brief Get the error status.
*
* @param[in] error The error object.
* @return The error status.
*/
ob_status ob_error_status(ob_error *error);
OB_EXPORT ob_status ob_error_get_status(const ob_error *error);
/**
* @brief Get the error message.
@@ -24,7 +36,7 @@ ob_status ob_error_status(ob_error *error);
* @param[in] error The error object.
* @return The error message.
*/
const char *ob_error_message(const ob_error *error);
OB_EXPORT const char *ob_error_get_message(const ob_error *error);
/**
* @brief Get the name of the API function that caused the error.
@@ -32,7 +44,7 @@ const char *ob_error_message(const ob_error *error);
* @param[in] error The error object.
* @return The name of the API function.
*/
const char *ob_error_function(ob_error *error);
OB_EXPORT const char *ob_error_get_function(const ob_error *error);
/**
* @brief Get the error parameters.
@@ -40,7 +52,7 @@ const char *ob_error_function(ob_error *error);
* @param[in] error The error object.
* @return The error parameters.
*/
const char *ob_error_args(ob_error *error);
OB_EXPORT const char *ob_error_get_args(const ob_error *error);
/**
* @brief Get the type of exception that caused the error.
@@ -48,14 +60,24 @@ const char *ob_error_args(ob_error *error);
* @param[in] error The error object.
* @return The type of exception.
*/
ob_exception_type ob_error_exception_type(ob_error *error);
OB_EXPORT ob_exception_type ob_error_get_exception_type(const ob_error *error);
/**
* @brief Delete the error object.
*
* @param[in] error The error object to delete.
*/
void ob_delete_error(ob_error *error);
OB_EXPORT void ob_delete_error(ob_error *error);
/**
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
#define ob_error_status ob_error_get_status
#define ob_error_message ob_error_get_message
#define ob_error_function ob_error_get_function
#define ob_error_args ob_error_get_args
#define ob_error_exception_type ob_error_get_exception_type
#ifdef __cplusplus
}
@@ -0,0 +1,43 @@
#ifndef OB_EXPORT_H
#define OB_EXPORT_H
#ifdef OB_STATIC_DEFINE
# define OB_EXPORT
# define OB_NO_EXPORT
#else
# ifndef OB_EXPORT
# ifdef openobsdk_EXPORTS
/* We are building this library */
# define OB_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define OB_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef OB_NO_EXPORT
# define OB_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef OB_DEPRECATED
# define OB_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef OB_DEPRECATED_EXPORT
# define OB_DEPRECATED_EXPORT OB_EXPORT OB_DEPRECATED
#endif
#ifndef OB_DEPRECATED_NO_EXPORT
# define OB_DEPRECATED_NO_EXPORT OB_NO_EXPORT OB_DEPRECATED
#endif
/* NOLINTNEXTLINE(readability-avoid-unconditional-preprocessor-if) */
#if 0 /* DEFINE_NO_DEPRECATED */
# ifndef OB_NO_DEPRECATED
# define OB_NO_DEPRECATED
# endif
#endif
#endif /* OB_EXPORT_H */
+153 -481
View File
@@ -11,533 +11,157 @@ extern "C" {
#include "ObTypes.h"
/**
* @brief Create a PointCloud Filter.
* @brief Create a Filter object.
*
* @param[out] error Log error messages.
* @attention If the filter of the specified name is a private filter, and the creator of the filter have not been activated, the function will return NULL.
*
* @return A pointcloud_filter object.
* @param name The name of the filter.
* @param error Pointer to an error object that will be set if an error occurs.
*/
ob_filter *ob_create_pointcloud_filter(ob_error **error);
OB_EXPORT ob_filter *ob_create_filter(const char *name, ob_error **error);
/**
* @brief Set the camera parameters for the PointCloud Filter.
* @brief Get the name of ob_filter
*
* @param[in] filter A pointcloud_filter object.
* @param[in] param Camera parameters.
* @param[out] error Log error messages.
* @param filter ob_filter object
* @param error Pointer to an error object that will be set if an error occurs.
* @return char The filter of name
*/
void ob_pointcloud_filter_set_camera_param(ob_filter *filter, ob_camera_param param, ob_error **error);
OB_EXPORT const char *ob_filter_get_name(const ob_filter *filter, ob_error **error);
/**
* @brief Set the point cloud type parameters for the PointCloud Filter.
* @brief Get the vendor specific code of a filter by filter name.
* @brief A private filter can define its own vendor specific code for specific purposes.
*
* @param[in] filter A pointcloud_filter object.
* @param[in] type Point cloud type: depth point cloud or RGBD point cloud.
* @param[out] error Log error messages.
* @param name The name of the filter.
* @param error Pointer to an error object that will be set if an error occurs.
* @return const char* Return the vendor specific code of the filter.
*/
void ob_pointcloud_filter_set_point_format(ob_filter *filter, ob_format type, ob_error **error);
OB_EXPORT const char *ob_filter_get_vendor_specific_code(const char *name, ob_error **error);
/**
* @brief Set the alignment state of the frames that will be input to produce the point cloud.
* @brief Create a private Filter object with activation key.
* @brief Some private filters require an activation key to be activated, its depends on the vendor of the filter.
*
* @param[in] filter A pointcloud_filter object.
* @param[in] state Alignment status, True: aligned; False: unaligned.
* @param[out] error Log error messages.
*/
void ob_pointcloud_filter_set_frame_align_state(ob_filter *filter, bool state, ob_error **error);
/**
* @brief Set the point cloud data scaling factor.
* @param name The name of the filter.
* @param activation_key The activation key of the filter.
* @param error Pointer to an error object that will be set if an error occurs.
*
* @attention Calling this function to set the scale will change the point coordinate scaling factor of the output point cloud frame: posScale = posScale /
* scale. The point coordinate scaling factor for the output point cloud frame can be obtained via the @ref ob_points_frame_get_position_value_scale function.
* @return ob_filter* Return the private filter object.
*/
OB_EXPORT ob_filter *ob_create_private_filter(const char *name, const char *activation_key, ob_error **error);
/**
* @brief Delete the filter.
*
* @param[in] filter A pointcloud_filter object.
* @param[in] scale Set the point cloud coordinate data zoom factor.
* @param[out] error Log error messages.
* @param[in] filter The filter object to be deleted.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pointcloud_filter_set_position_data_scale(ob_filter *filter, float scale, ob_error **error);
OB_EXPORT void ob_delete_filter(ob_filter *filter, ob_error **error);
/**
* @brief Set the point cloud color data normalization.
* @brief Get config schema of the filter
* @brief The returned string is a csv format string representing the configuration schema of the filter. The format of the string is:
* <parameter_name>, <parameter_type: "int", "float", "bool">, <minimum_value>, <maximum_value>, <value_step>, <default_value>, <parameter_description>
*
* @param[in] filter A pointcloud_filter object.
* @param[in] state Sets whether the point cloud color data is normalized.
* @param[out] error Log error messages.
*/
void ob_pointcloud_filter_set_color_data_normalization(ob_filter *filter, bool state, ob_error **error);
/**
* @brief Set the point cloud coordinate system.
* @param[in] filter The filter object to get the configuration schema for
* @param[out] error Pointer to an error object that will be set if an error occurs
*
* @param[in] filter A pointcloud_filter object.
* @param[in] type Coordinate system type.
* @param[out] error Log error messages.
* @return A csv format string representing the configuration schema of the filter
*/
void ob_pointcloud_filter_set_coordinate_system(ob_filter *filter, ob_coordinate_system_type type, ob_error **error);
OB_EXPORT const char *ob_filter_get_config_schema(const ob_filter *filter, ob_error **error);
/**
* @brief Create a format convert Filter.
* @brief Get the filter config schema list of the filter
* @brief The returned string is a list of ob_config_schema_item representing the configuration schema of the filter.
*
* @param[out] error Log error messages.
* @param filter The filter object to get the configuration schema for
* @param error Pointer to an error object that will be set if an error occurs
* @return ob_filter_config_schema_list* Return the filter config schema list of the filter
*/
OB_EXPORT ob_filter_config_schema_list *ob_filter_get_config_schema_list(const ob_filter *filter, ob_error **error);
/**
* @brief Update config of the filter
*
* @return A format_convert object.
*/
ob_filter *ob_create_format_convert_filter(ob_error **error);
/**
* @brief Set the type of format conversion for the format convert Filter.
* @attention The passed in argc and argv must match the configuration schema returned by the @ref ob_filter_get_config_schema function.
*
* @param[in] filter A format convert filter object.
* @param[in] type Format conversion type.
* @param[out] error Log error messages.
* @param[in] filter The filter object to update the configuration for
* @param[in] argc The number of arguments in the argv array
* @param[in] argv An array of strings representing the configuration values
* @param[out] error Pointer to an error object that will be set if an error occurs
*/
void ob_format_convert_filter_set_format(ob_filter *filter, ob_convert_format type, ob_error **error);
OB_EXPORT void ob_filter_update_config(ob_filter *filter, uint8_t argc, const char **argv, ob_error **error);
/**
* @brief Create a compression Filter.
* @brief Get the filter config value by name and cast to double.
*
* @param[out] error Log error messages.
* @attention The returned value is cast to double, the actual type of the value depends on the filter config schema returned by @ref
* ob_filter_get_config_schema.
*
* @return A depth_filter object.
* @param[in] filter A filter object.
* @param[in] config_name config name
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return double The value of the config.
*/
ob_filter *ob_create_compression_filter(ob_error **error);
OB_EXPORT double ob_filter_get_config_value(const ob_filter *filter, const char *config_name, ob_error **error);
/**
* @brief Set the compression parameters for the compression Filter.
* @brief Set the filter config value by name.
*
* @param[in] filter A compression_filter object.
* @param[in] mode Compression mode OB_COMPRESSION_LOSSLESS or OB_COMPRESSION_LOSSY.
* @param[in] params Compression params, struct ob_compression_params, when mode is OB_COMPRESSION_LOSSLESS, params is NULL.
* @param[out] error Log error messages.
*/
void ob_compression_filter_set_compression_params(ob_filter *filter, ob_compression_mode mode, void *params, ob_error **error);
/**
* @brief Create a decompression Filter.
* @attention The pass into value type is double, witch will be cast to the actual type inside the filter. The actual type can be queried by the filter config
* schema returned by @ref ob_filter_get_config_schema.
*
* @param[out] error Log error messages.
*
* @return A decompression Filter object.
* @param[in] filter A filter object.
* @param[in] config_name config name
* @param[in] value The value to set.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
ob_filter *ob_create_decompression_filter(ob_error **error);
/**
* @brief Create a HoleFilling Filter.
*
* @param[out] error Log error messages.
*
* @return A depth_filter object.
*/
ob_filter *ob_create_holefilling_filter(ob_error **error);
/**
* @brief Set the HoleFillingFilter mode.
*
* @param[in] filter A holefilling_filter object.
* @param[in] mode holefilling mode OB_HOLE_FILL_TOP,OB_HOLE_FILL_NEAREST or OB_HOLE_FILL_FAREST.
* @param[out] error Log error messages.
*/
void ob_holefilling_filter_set_mode(ob_filter *filter, ob_hole_filling_mode mode, ob_error **error);
/**
* @brief Get the HoleFillingFilter mode.
*
* @param[in] filter A holefilling_filter object.
* @param[out] error Log error messages.
* @return ob_hole_filling_mode
*/
ob_hole_filling_mode ob_holefilling_filter_get_mode(ob_filter *filter, ob_error **error);
/**
* @brief Create a Temporal Filter.
*
* @param[out] error Log error messages.
*
* @return A depth_filter object.
*/
ob_filter *ob_create_temporal_filter(ob_error **error);
/**
* @brief Get the TemporalFilter diffscale range.
*
* @param[in] filter A temporal_filter object.
* @param[out] error Log error messages.
* @return ob_float_property_range the value of property range.
*/
ob_float_property_range ob_temporal_filter_get_diffscale_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the TemporalFilter diffscale value.
*
* @param[in] filter A temporal_filter object.
* @param[in] value diffscale value.
* @param[out] error Log error messages.
*/
void ob_temporal_filter_set_diffscale_value(ob_filter *filter, float value, ob_error **error);
/**
* @brief Get the TemporalFilter weight range.
*
* @param[in] filter A temporal filter object.
* @param[out] error Log error messages.
*/
ob_float_property_range ob_temporal_filter_get_weight_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the TemporalFilter weight range.
*
* @param[in] filter A temporal_filter object.
* @param[in] value weight value.
* @param[out] error Log error messages.
*/
void ob_temporal_filter_set_weight_value(ob_filter *filter, float value, ob_error **error);
/**
* @brief Create a spatial advanced filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_spatial_advanced_filter(ob_error **error);
/**
* @brief Get the spatial advanced filter alpha range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_float_property_range the alpha value of property range.
*/
ob_float_property_range ob_spatial_advanced_filter_get_alpha_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter disp diff range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the dispdiff value of property range.
*/
ob_uint16_property_range ob_spatial_advanced_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter radius range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the radius value of property range.
*/
ob_uint16_property_range ob_spatial_advanced_filter_get_radius_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter magnitude range.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_int_property_range the magnitude value of property range.
*/
ob_int_property_range ob_spatial_advanced_filter_get_magnitude_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the spatial advanced filter params.
*
* @param[in] filter A spatial advanced filter object.
* @param[out] error Log error messages.
* @return ob_spatial_advanced_filter_params.
*/
ob_spatial_advanced_filter_params ob_spatial_advanced_filter_get_filter_params(ob_filter *filter, ob_error **error);
/**
* @brief Set the spatial advanced filter params.
*
* @param[in] filter A temporal_filter object.
* @param[in] params ob_spatial_advanced_filter_params.
* @param[out] error Log error messages.
*/
void ob_spatial_advanced_filter_set_filter_params(ob_filter *filter, ob_spatial_advanced_filter_params params, ob_error **error);
/**
* @brief Create a noise removal filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_noise_removal_filter(ob_error **error);
/**
* @brief Get the noise removal filter disp diff range.
*
* @param[in] filter A noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the disp_diff value of property range.
*/
ob_uint16_property_range ob_noise_removal_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter max size range.
*
* @param[in] filter noise removal filter object.
* @param[out] error Log error messages.
* @return ob_int_property_range the _max_size value of property range.
*/
ob_int_property_range ob_noise_removal_filter_get_max_size_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the noise removal filter params.
*
* @param[in] filter noise removal filter object.
* @param[in] params ob_noise_removal_filter_params.
* @param[out] error Log error messages.
*/
void ob_noise_removal_filter_set_filter_params(ob_filter *filter, ob_noise_removal_filter_params params, ob_error **error);
/**
* @brief Get the noise removal filter params.
*
* @param[in] filter noise removal filter object.
* @param[out] error Log error messages.
* @return ob_noise_removal_filter_params.
*/
ob_noise_removal_filter_params ob_noise_removal_filter_get_filter_params(ob_filter *filter, ob_error **error);
/**
* @brief Create a edge noise removal filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_edge_noise_removal_filter(ob_error **error);
/**
* @brief Set the edge noise removal filter params.
*
* @param[in] filter edge noise removal filter object.
* @param[in] params ob_edge_noise_removal_filter_params.
* @param[out] error Log error messages.
*/
void ob_edge_noise_removal_filter_set_filter_params(ob_filter *filter, ob_edge_noise_removal_filter_params params, ob_error **error);
/**
* @brief Get the edge noise removal filter params.
*
* @param[in] filter edge noise removal filter object.
* @param[out] error Log error messages.
* @return ob_edge_noise_removal_filter_params.
*/
ob_edge_noise_removal_filter_params ob_edge_noise_removal_filter_get_filter_params(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter margin left th range.
*
* @param[in] filter A edge noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the margin_left_th value of property range.
*/
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_left_th_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter margin right th range.
*
* @param[in] filter A edge noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the margin_right_th value of property range.
*/
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_right_th_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter margin top th range.
*
* @param[in] filter A edge noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the margin_top_th value of property range.
*/
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_top_th_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the noise removal filter margin bottom th range.
*
* @param[in] filter A edge noise removal filter object.
* @param[out] error Log error messages.
* @return ob_uint16_property_range the margin_bottom_th value of property range.
*/
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_bottom_th_range(ob_filter *filter, ob_error **error);
/**
* @brief Create a decimation filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_decimation_filter(ob_error **error);
/**
* @brief Get the decimation filter scale range.
*
* @param[in] filter A decimation filter object.
* @param[out] error Log error messages.
*/
ob_uint8_property_range ob_decimation_filter_get_scale_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the decimation filter scale value.
*
* @param[in] filter A decimation object.
* @param[in] value decimation filter scale value.
* @param[out] error Log error messages.
*/
void ob_decimation_filter_set_scale_value(ob_filter *filter, uint8_t value, ob_error **error);
/**
* @brief Get the decimation filter scale value.
*
* @param[in] filter A decimation object.
* @param[out] error Log error messages.
* @return decimation filter scale value.
*/
uint8_t ob_decimation_filter_get_scale_value(ob_filter *filter, ob_error **error);
/**
* @brief Create a threshold filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_threshold_filter(ob_error **error);
/**
* @brief Get the threshold filter min range.
*
* @param[in] filter A threshold filter object.
* @param[out] error Log error messages.
*/
ob_int_property_range ob_threshold_filter_get_min_range(ob_filter *filter, ob_error **error);
/**
* @brief Get the threshold filter max range.
*
* @param[in] filter A threshold filter object.
* @param[out] error Log error messages.
*/
ob_int_property_range ob_threshold_filter_get_max_range(ob_filter *filter, ob_error **error);
/**
* @brief Set the threshold filter scale range.
*
* @param[in] filter A threshold object.
* @param[in] min threshold filter scale min value.
* @param[in] max threshold filter scale max value.
* @param[out] error Log error messages.
*/
bool ob_threshold_filter_set_scale_value(ob_filter *filter, uint16_t min, uint16_t max, ob_error **error);
/**
* @brief Create a SequenceId filter.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_sequenceId_filter(ob_error **error);
/**
* @brief Set the sequence id filter select sequence id.
*
* @param[in] filter A sequence id object.
* @param[in] sequence_id sequence id to pass the filter.
* @param[out] error Log error messages.
*/
void ob_sequence_id_filter_select_sequence_id(ob_filter *filter, int sequence_id, ob_error **error);
/**
* @brief Get the current sequence id.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
* @return sequence id to pass the filter.
*/
int ob_sequence_id_filter_get_sequence_id(ob_filter *filter, ob_error **error);
/**
* @brief Get the current sequence id list.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
*/
ob_sequence_id_item *ob_sequence_id_filter_get_sequence_id_list(ob_filter *filter, ob_error **error);
/**
* @brief Get the current sequence id list size.
*
* @param[in] filter A sequence id object.
* @param[out] error Log error messages.
*/
int ob_sequence_id_filter_get_sequence_id_list_size(ob_filter *filter, ob_error **error);
/**
* @brief Create a hdr merge.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_hdr_merge(ob_error **error);
/**
* @brief Create a align.
* @param[in] align_to_stream ob_stream_type.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_align(ob_error **error, ob_stream_type align_to_stream);
/**
* @brief Get the algin stream type.
*
* @param[in] filter A align object.
* @param[out] error Log error messages.
* @return A ob_stream_type.
*/
ob_stream_type ob_align_get_to_stream_type(ob_filter *filter, ob_error **error);
/**
* @brief Create a disparity transform.
* @param[in] depth_to_disparity disparity to depth, depth to disparity Conversion.
* @param[out] error Log error messages.
* @return A depth_filter object.
*/
ob_filter *ob_create_disparity_transform(ob_error **error, bool depth_to_disparity);
OB_EXPORT void ob_filter_set_config_value(ob_filter *filter, const char *config_name, double value, ob_error **error);
/**
* @brief Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used, the processing thread will also be stopped and the
* pending cache frames will be cleared.
*
* @param[in] filter A filter object.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_filter_reset(ob_filter *filter, ob_error **error);
OB_EXPORT void ob_filter_reset(ob_filter *filter, ob_error **error);
/**
* @brief Enable the frame post processing
* @brief The filter default is enable.
*
* @attention If the filter has been disabled by calling this function, processing will directly output a clone of the input frame.
*
* @param[in] filter A filter object.
* @param[in] enable enable status, true: enable; false: disable.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_filter_enable(ob_filter *filter, bool enable, ob_error **error);
/**
* @brief Get the enable status of the frame post processing
*
* @attention If the filter is disabled, the processing will directly output a clone of the input frame.
*
* @param[in] filter A filter object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return The post processing filter status. True: enable; False: disable.
*/
OB_EXPORT bool ob_filter_is_enabled(const ob_filter *filter, ob_error **error);
/**
* @brief Process the frame (synchronous interface).
*
* @param[in] filter A filter object.
* @param[in] frame Pointer to the frame object to be processed.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return The frame object processed by the filter.
*/
ob_frame *ob_filter_process(ob_filter *filter, ob_frame *frame, ob_error **error);
/**
* @brief Enable the frame post processing
*
* @param[in] filter A filter object.
* @param[in] enable enable status
* @param[out] error Log error messages.
*/
void ob_filter_enable(ob_filter *filter, bool enable, ob_error **error);
/**
* @brief Get the enable status of the frame post processing
*
* @param[in] filter A filter object.
* @param[out] error Log error messages.
*
* @return The post processing filter status.
*/
bool ob_filter_is_enable(ob_filter *filter, ob_error **error);
OB_EXPORT ob_frame *ob_filter_process(ob_filter *filter, const ob_frame *frame, ob_error **error);
/**
* @brief Set the processing result callback function for the filter (asynchronous callback interface).
@@ -545,26 +169,74 @@ bool ob_filter_is_enable(ob_filter *filter, ob_error **error);
* @param[in] filter A filter object.
* @param[in] callback Callback function.
* @param[in] user_data Arbitrary user data pointer can be passed in and returned from the callback.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_filter_set_callback(ob_filter *filter, ob_filter_callback callback, void *user_data, ob_error **error);
OB_EXPORT void ob_filter_set_callback(ob_filter *filter, ob_filter_callback callback, void *user_data, ob_error **error);
/**
* @brief Push the frame into the pending cache for the filter (asynchronous callback interface).
* @brief The frame will be processed by the filter when the processing thread is available and return a new processed frame to the callback function.
*
* @attention The frame object will be add reference count, so the user still need call @ref ob_delete_frame to release the frame after calling this function.
*
* @param[in] filter A filter object.
* @param[in] frame Pointer to the frame object to be processed.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_filter_push_frame(ob_filter *filter, ob_frame *frame, ob_error **error);
OB_EXPORT void ob_filter_push_frame(ob_filter *filter, const ob_frame *frame, ob_error **error);
/**
* @brief Delete the filter.
* @brief Get the number of filter in the list
*
* @param[in] filter A filter object.
* @param[out] error Log error messages.
* @param[in] filter_list filter list
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t The number of list
*/
void ob_delete_filter(ob_filter *filter, ob_error **error);
OB_EXPORT uint32_t ob_filter_list_get_count(const ob_filter_list *filter_list, ob_error **error);
/**
* @brief Get the filter by index
*
* @param[in] filter_list Filter list
* @param[in] index Filter index
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_filter The index of ob_filter
*/
OB_EXPORT ob_filter *ob_filter_list_get_filter(const ob_filter_list *filter_list, uint32_t index, ob_error **error);
/**
* @brief Delete a list of ob_filter objects.
*
* @param[in] filter_list The list of ob_filter objects to delete.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error);
/**
* @brief Get the number of config schema items in the config schema list
*
* @param config_schema_list Filter config schema list
* @param error Pointer to an error object that will be set if an error occurs.
* @return uint32_t The number of config schema items in the filter list
*/
OB_EXPORT uint32_t ob_filter_config_schema_list_get_count(const ob_filter_config_schema_list *config_schema_list, ob_error **error);
/**
* @brief Get the config schema item by index
*
* @param config_schema_list Filter config schema list
* @param index Config schema item index
* @param error Pointer to an error object that will be set if an error occurs.
* @return ob_filter_config_schema_item* The config schema item by index
*/
OB_EXPORT ob_filter_config_schema_item ob_filter_config_schema_list_get_item(const ob_filter_config_schema_list *config_schema_list, uint32_t index,
ob_error **error);
/**
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
#define ob_get_filter ob_filter_list_get_filter
#define ob_get_filter_name ob_filter_get_name
#ifdef __cplusplus
}
+424 -204
View File
@@ -11,6 +11,148 @@ extern "C" {
#include "ObTypes.h"
/**
* @brief Crate a frame object based on the specified parameters.
*
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no longer needed.
*
* @param frame_type The frame object type.
* @param format The frame object format.
* @param data_size The size of the frame object data.
* @param error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frame object.
*/
OB_EXPORT ob_frame *ob_create_frame(ob_frame_type frame_type, ob_format format, uint32_t data_size, ob_error **error);
/**
* @brief Create (clone) a frame object based on the specified other frame object.
* @brief The new frame object will have the same properties as the other frame object, but the data buffer is newly allocated.
*
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no longer needed.
*
* @param[in] other_frame The frame object to create the new frame object according to.
* @param[in] should_copy_data If true, the data of the source frame object will be copied to the new frame object. If false, the new frame object will
* have a data buffer with random data.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the new frame object.
*/
OB_EXPORT ob_frame *ob_create_frame_from_other_frame(const ob_frame *other_frame, bool should_copy_data, ob_error **error);
/**
* @brief Create a frame object according to the specified stream profile.
*
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no logger needed.
*
* @param stream_profile The stream profile to create the new frame object according to.
* @param error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the new frame object.
*/
OB_EXPORT ob_frame *ob_create_frame_from_stream_profile(const ob_stream_profile *stream_profile, ob_error **error);
/**
* @brief Create an video frame object based on the specified parameters.
*
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no longer needed.
*
* @param[in] frame_type Frame object type.
* @param[in] frame_format Frame object format.
* @param[in] width Frame object width.
* @param[in] height Frame object height.
* @param[in] stride_bytes Row span in bytes. If 0, the stride is calculated based on the width and format.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return an empty frame object.
*/
OB_EXPORT ob_frame *ob_create_video_frame(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes, ob_error **error);
/**
* @brief Create a frame object based on an externally created buffer.
*
* @attention The buffer is owned by the user and will not be destroyed by the frame object. The user should ensure that the buffer is valid and not modified.
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no longer needed.
*
* @param[in] frame_type Frame object type.
* @param[in] format Frame object format.
* @param[in] buffer Frame object buffer.
* @param[in] buffer_size Frame object buffer size.
* @param[in] buffer_destroy_cb Destroy callback, will be called when the frame object is destroyed.
* @param[in] buffer_destroy_context Destroy context, user-defined context to be passed to the destroy callback.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frame object.
*/
OB_EXPORT ob_frame *ob_create_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint8_t *buffer, uint32_t buffer_size,
ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error);
/**
* @brief Create a video frame object based on an externally created buffer.
*
* @attention The buffer is owned by the user and will not be destroyed by the frame object. The user should ensure that the buffer is valid and not modified.
* @attention The frame object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it is
* no longer needed.
*
* @param[in] frame_type Frame object type.
* @param[in] format Frame object format.
* @param[in] width Frame object width.
* @param[in] height Frame object height.
* @param[in] stride_bytes Row span in bytes. If 0, the stride is calculated based on the width and format.
* @param[in] buffer Frame object buffer.
* @param[in] buffer_size Frame object buffer size.
* @param[in] buffer_destroy_cb Destroy callback, user-defined function to destroy the buffer.
* @param[in] buffer_destroy_context Destroy context, user-defined context to be passed to the destroy callback.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frame object.
*/
OB_EXPORT ob_frame *ob_create_video_frame_from_buffer(ob_frame_type frame_type, ob_format format, uint32_t width, uint32_t height, uint32_t stride_bytes,
uint8_t *buffer, uint32_t buffer_size, ob_frame_destroy_callback *buffer_destroy_cb,
void *buffer_destroy_context, ob_error **error);
/**
* @brief Create an empty frameset object.
* @brief A frameset object is a special type of frame object that can be used to store multiple frames.
*
* @attention The frameset object is created with a reference count of 1, and the reference count should be decreased by calling @ref ob_delete_frame() when it
* is no longer needed.
*
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frameset object.
*/
OB_EXPORT ob_frame *ob_create_frameset(ob_error **error);
/**
* @brief Increase the reference count of a frame object.
* @brief The reference count is used to manage the lifetime of the frame object.
*
* @attention When calling this function, the reference count of the frame object is
* increased and requires to be decreased by calling @ref ob_delete_frame().
*
* @param[in] frame Frame object to increase the reference count.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_add_ref(const ob_frame *frame, ob_error **error);
/**
* @brief Delete a frame object
* @brief This function will decrease the reference count of the frame object and release the memory if the reference count becomes 0.
*
* @param[in] frame The frame object to delete.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_frame(const ob_frame *frame, ob_error **error);
/**
* @brief Copy the information of the source frame object to the destination frame object.
* @brief Including the index,timestamp,system timestamp,global timestamp and metadata will be copied.
*
* @param[in] src_frame Source frame object to copy the information from.
* @param[in] dst_frame Destination frame object to copy the information to.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_copy_info(const ob_frame *src_frame, ob_frame *dst_frame, ob_error **error);
/**
* @brief Get the frame index
*
@@ -18,138 +160,178 @@ extern "C" {
* @param[out] error Log wrong message
* @return uint64_t return the frame index
*/
uint64_t ob_frame_index(ob_frame *frame, ob_error **error);
OB_EXPORT uint64_t ob_frame_get_index(const ob_frame *frame, ob_error **error);
/**
* @brief Get the frame format
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_format return the frame format
*/
ob_format ob_frame_format(ob_frame *frame, ob_error **error);
OB_EXPORT ob_format ob_frame_get_format(const ob_frame *frame, ob_error **error);
/**
* @brief Get the frame type
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame_type return the frame type
*/
ob_frame_type ob_frame_get_type(ob_frame *frame, ob_error **error);
OB_EXPORT ob_frame_type ob_frame_get_type(const ob_frame *frame, ob_error **error);
/**
* @brief Get the hardware timestamp of the frame in milliseconds.
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
* @brief Get the frame timestamp (also known as device timestamp, hardware timestamp) of the frame in microseconds.
* @brief The hardware timestamp is the time point when the frame was captured by the device (Typically in the mid-exposure, unless otherwise stated), on device
* clock domain.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @return uint64_t return the frame hardware timestamp in milliseconds
*/
uint64_t ob_frame_time_stamp(ob_frame *frame, ob_error **error);
/**
* @brief Get the hardware timestamp of the frame in microseconds.
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint64_t return the frame hardware timestamp in microseconds
*/
uint64_t ob_frame_time_stamp_us(ob_frame *frame, ob_error **error);
OB_EXPORT uint64_t ob_frame_get_timestamp_us(const ob_frame *frame, ob_error **error);
/**
* @brief Get the system timestamp of the frame in milliseconds.
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
* @brief Set the frame timestamp (also known as the device timestamp, hardware timestamp) of a frame object.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @return uint64_t return the frame system timestamp in milliseconds
* @param[in] frame Frame object to set the timestamp.
* @param[in] timestamp_us frame timestamp to set in microseconds.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
uint64_t ob_frame_system_time_stamp(ob_frame *frame, ob_error **error);
OB_EXPORT void ob_frame_set_timestamp_us(ob_frame *frame, uint64_t timestamp_us, ob_error **error);
/**
* @brief Get the system timestamp of the frame in microseconds.
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint64_t return the frame system timestamp in microseconds
*/
uint64_t ob_frame_system_time_stamp_us(ob_frame *frame, ob_error **error);
OB_EXPORT uint64_t ob_frame_get_system_timestamp_us(const ob_frame *frame, ob_error **error);
/**
* @brief Set the system timestamp of the frame in microseconds.
*
* @param frame Frame object
* @param system_timestamp_us frame system timestamp to set in microseconds.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_set_system_timestamp_us(ob_frame *frame, uint64_t system_timestamp_us, ob_error **error);
/**
* @brief Get the global timestamp of the frame in microseconds.
* @brief The global timestamp is the time point when the frame was was captured by the device, and has been converted to the host clock domain. The
* conversion process base on the device timestamp and can eliminate the timer drift of the device
* conversion process base on the frame timestamp and can eliminate the timer drift of the device
*
* @attention Only some devices support getting the global timestamp. If the device does not support it, this function will return 0. Check the device support
* status by @ref ob_device_is_global_timestamp_supported() function.
* @attention The global timestamp is disabled by default. If global timestamp is not enabled, the function will return 0. To enable it, call @ref
* ob_device_enable_global_timestamp() function.
* @attention Only some models of device support getting the global timestamp. Check the device support status by @ref
* ob_device_is_global_timestamp_supported() function.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint64_t The global timestamp of the frame in microseconds.
*/
uint64_t ob_frame_global_time_stamp_us(ob_frame *frame, ob_error **error);
OB_EXPORT uint64_t ob_frame_get_global_timestamp_us(const ob_frame *frame, ob_error **error);
/**
* @brief Get frame data
* @brief Get the data buffer of a frame.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @return void* * return frame data pointer
* @attention The returned data buffer is mutable, but it is not recommended to modify it directly. Modifying the data directly may cause issues if the frame is
* being used in other threads or future use. If you need to modify the data, it is recommended to create a new frame object.
*
* @param[in] frame The frame object from which to retrieve the data.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint8_t* Pointer to the frame data buffer.
*/
void *ob_frame_data(ob_frame *frame, ob_error **error);
OB_EXPORT uint8_t *ob_frame_get_data(const ob_frame *frame, ob_error **error);
/**
* @brief Update the data of a frame.
* @brief The data will be memcpy to the frame data buffer.
* @brief The frame data size will be also updated as the input data size.
*
* @attention It is not recommended to update the frame data if the frame was not created by the user. If you must update it, ensure that the frame is not being
* used in other threads.
* @attention The size of the new data should be equal to or less than the current data size of the frame. Exceeding the original size may cause memory
* exceptions.
*
* @param[in] frame The frame object to update.
* @param[in] data The new data to update the frame with.
* @param[in] data_size The size of the new data.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_update_data(ob_frame *frame, const uint8_t *data, uint32_t data_size, ob_error **error);
/**
* @brief Get the frame data size
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the frame data size
* If it is point cloud data, it return the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide dataSize
* by the structure size of the corresponding point type.
*/
uint32_t ob_frame_data_size(ob_frame *frame, ob_error **error);
OB_EXPORT uint32_t ob_frame_get_data_size(const ob_frame *frame, ob_error **error);
/**
* @brief Get the metadata of the frame
*
* @attention The returned metadata is mutable, but it is not recommended to modify it directly. Modifying the metadata directly may cause issues if the frame
* is being used in other threads or future use. If you need to modify the metadata, it is recommended to create a new frame object.
*
* @param[in] frame frame object
* @param[out] error Log error messages
* @return void* return the metadata pointer of the frame
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return const uint8_t * return the metadata pointer of the frame
*/
void *ob_frame_metadata(ob_frame *frame, ob_error **error);
#define ob_video_frame_metadata ob_frame_metadata // for compatibility
OB_EXPORT uint8_t *ob_frame_get_metadata(const ob_frame *frame, ob_error **error);
#define ob_video_frame_metadata ob_frame_get_metadata // for compatibility
/**
* @brief Get the metadata size of the frame
*
* @param[in] frame frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the metadata size of the frame
*/
uint32_t ob_frame_metadata_size(ob_frame *frame, ob_error **error);
#define ob_video_frame_metadata_size ob_frame_metadata_size // for compatibility
OB_EXPORT uint32_t ob_frame_get_metadata_size(const ob_frame *frame, ob_error **error);
#define ob_video_frame_metadata_size ob_frame_get_metadata_size // for compatibility
/**
* @brief Update the metadata of the frame
* @brief The metadata will be memcpy to the frame metadata buffer.
* @brief The frame metadata size will be also updated as the input metadata size.
*
* @attention It is not recommended to update the frame metadata if the frame was not created by the user. If you must update it, ensure that the frame is not
* being used in other threads or future use.
* @attention The metadata size should be equal to or less than 256 bytes, otherwise it will cause memory exception.
*
* @param[in] frame frame object
* @param[in] metadata The new metadata to update.
* @param[in] metadata_size The size of the new metadata.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_update_metadata(ob_frame *frame, const uint8_t *metadata, uint32_t metadata_size, ob_error **error);
/**
* @brief check if the frame contains the specified metadata
*
* @param[in] frame frame object
* @param[in] type metadata type, refer to @ref ob_frame_metadata_type
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
bool ob_frame_has_metadata(ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
OB_EXPORT bool ob_frame_has_metadata(const ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
/**
* @brief Get the metadata value of the frame
*
* @param[in] frame frame object
* @param[in] type metadata type, refer to @ref ob_frame_metadata_type
* @param[out] error Log error messages
* @param[in] type metadata type, refer to @ref ob_frame_metadata_type
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return int64_t return the metadata value of the frame
*/
int64_t ob_frame_get_metadata_value(ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
OB_EXPORT int64_t ob_frame_get_metadata_value(const ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
/**
* @brief Get the stream profile of the frame
@@ -157,10 +339,19 @@ int64_t ob_frame_get_metadata_value(ob_frame *frame, ob_frame_metadata_type type
* @attention Require @ref ob_delete_stream_profile() to release the return stream profile.
*
* @param frame frame object
* @param error Log error messages
* @param error Pointer to an error object that will be set if an error occurs.
* @return ob_stream_profile* Return the stream profile of the frame, if the frame is not captured by a sensor stream, it will return NULL
*/
ob_stream_profile* ob_frame_get_stream_profile(ob_frame *frame, ob_error **error);
OB_EXPORT ob_stream_profile *ob_frame_get_stream_profile(const ob_frame *frame, ob_error **error);
/**
* @brief Set (override) the stream profile of the frame
*
* @param frame frame object
* @param stream_profile The stream profile to set for the frame.
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_frame_set_stream_profile(ob_frame *frame, const ob_stream_profile *stream_profile, ob_error **error);
/**
* @brief Get the sensor of the frame
@@ -168,10 +359,10 @@ ob_stream_profile* ob_frame_get_stream_profile(ob_frame *frame, ob_error **error
* @attention Require @ref ob_delete_sensor() to release the return sensor.
*
* @param[in] frame frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_sensor* return the sensor of the frame, if the frame is not captured by a sensor or the sensor stream has been destroyed, it will return NULL
*/
ob_sensor* ob_frame_get_sensor(ob_frame *frame, ob_error **error);
OB_EXPORT ob_sensor *ob_frame_get_sensor(const ob_frame *frame, ob_error **error);
/**
* @brief Get the device of the frame
@@ -179,257 +370,286 @@ ob_sensor* ob_frame_get_sensor(ob_frame *frame, ob_error **error);
* @attention Require @ref ob_delete_device() to release the return device.
*
* @param frame frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_device* return the device of the frame, if the frame is not captured by a sensor stream or the device has been destroyed, it will return NULL
*/
ob_device* ob_frame_get_device(ob_frame *frame, ob_error **error);
OB_EXPORT ob_device *ob_frame_get_device(const ob_frame *frame, ob_error **error);
/**
* @brief Get video frame width
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the frame width
*/
uint32_t ob_video_frame_width(ob_frame *frame, ob_error **error);
OB_EXPORT uint32_t ob_video_frame_get_width(const ob_frame *frame, ob_error **error);
/**
* @brief Get video frame height
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[in] frame Frame object
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the frame height
*/
uint32_t ob_video_frame_height(ob_frame *frame, ob_error **error);
OB_EXPORT uint32_t ob_video_frame_get_height(const ob_frame *frame, ob_error **error);
/**
* @brief Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)
* @brief Get video frame pixel format
* @brief Usually used to determine the pixel type of depth frame (depth, disparity, raw phase, etc.)
*
* @attention Always return OB_PIXEL_UNKNOWN for non-depth frame currently if user has not set the pixel type by @ref ob_video_frame_set_pixel_type()
*
* @param frame Frame object
* @param error Pointer to an error object that will be set if an error occurs.
* @return ob_pixel_type return the pixel format of the frame.
*/
OB_EXPORT ob_pixel_type ob_video_frame_get_pixel_type(const ob_frame *frame, ob_error **error);
/**
* @brief Set video frame pixel format
*
* @param frame Frame object
* @param pixel_type the pixel format of the frame
* @param error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_video_frame_set_pixel_type(ob_frame *frame, ob_pixel_type pixel_type, ob_error **error);
/**
* @brief Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)
* @attention Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format
*
* @param[in] frame video frame object
* @param[out] error log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint8_t return the effective number of pixels in the pixel, or 0 if it is an unsupported format
*/
uint8_t ob_video_frame_pixel_available_bit_size(ob_frame *frame, ob_error **error);
OB_EXPORT uint8_t ob_video_frame_get_pixel_available_bit_size(const ob_frame *frame, ob_error **error);
/**
* @brief Set the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)
* @attention Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format
*
* @param[in] frame video frame object
* @param[in] bit_size the effective number of pixels in the pixel, or 0 if it is an unsupported format
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_video_frame_set_pixel_available_bit_size(ob_frame *frame, uint8_t bit_size, ob_error **error);
/**
* @brief Get the source sensor type of the ir frame (left or right for dual camera)
*
* @param frame Frame object
* @param ob_error Log error messages
* @param ob_error Pointer to an error object that will be set if an error occurs.
* @return ob_sensor_type return the source sensor type of the ir frame
*/
ob_sensor_type ob_ir_frame_get_source_sensor_type(ob_frame *frame, ob_error **ob_error);
OB_EXPORT ob_sensor_type ob_ir_frame_get_source_sensor_type(const ob_frame *frame, ob_error **ob_error);
/**
* @brief Get the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale to give a depth value in millimeters.
* For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return float The value scale of the depth frame
*/
float ob_depth_frame_get_value_scale(ob_frame *frame, ob_error **error);
OB_EXPORT float ob_depth_frame_get_value_scale(const ob_frame *frame, ob_error **error);
/**
* @brief Get the point position value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position
* @brief Set the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale to give a depth value in millimeters.
* For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm.
*
* @param[in] frame Frame object
* @param[in] value_scale The value scale of the depth frame
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_depth_frame_set_value_scale(ob_frame *frame, float value_scale, ob_error **error);
/**
* @brief Get the point coordinate value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position
* value in millimeters. For example, if scale=0.1, the x-coordinate value of a point is x = 10000, which means that the actual x-coordinate value = x*scale =
* 10000*0.1 = 1000mm.
*
* @param[in] frame Frame object
* @param[out] error Log error messages
* @return float The position value scale of the points frame
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return float The coordinate value scale of the points frame
*/
float ob_points_frame_get_position_value_scale(ob_frame *frame, ob_error **error);
OB_EXPORT float ob_points_frame_get_coordinate_value_scale(const ob_frame *frame, ob_error **error);
/**
* @brief Delete a frame object
* @brief Get accelerometer frame data.
*
* @param[in] frame The frame object to delete
* @param[out] error Log error messages
* @param[in] frame Accelerometer frame.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_accel_value Return the accelerometer data.
*/
void ob_delete_frame(ob_frame *frame, ob_error **error);
OB_EXPORT ob_accel_value ob_accel_frame_get_value(const ob_frame *frame, ob_error **error);
/**
* @brief Get the temperature when acquiring the accelerometer frame.
*
* @param[in] frame Accelerometer frame.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return float Return the temperature value.
*/
OB_EXPORT float ob_accel_frame_get_temperature(const ob_frame *frame, ob_error **error);
/**
* @brief Get gyroscope frame data.
*
* @param[in] frame Gyroscope frame.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_gyro_value Return the gyroscope data.
*/
OB_EXPORT ob_gyro_value ob_gyro_frame_get_value(const ob_frame *frame, ob_error **error);
/**
* @brief Get the temperature when acquiring the gyroscope frame.
*
* @param[in] frame Gyroscope frame.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return float Return the temperature value.
*/
OB_EXPORT float ob_gyro_frame_get_temperature(const ob_frame *frame, ob_error **error);
/**
* @brief Get the number of frames contained in the frameset
*
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset frameset object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the number of frames
*/
uint32_t ob_frameset_frame_count(ob_frame *frameset, ob_error **error);
OB_EXPORT uint32_t ob_frameset_get_count(const ob_frame *frameset, ob_error **error);
/**
* @brief Get the depth frame from the frameset.
*
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the depth frame.
*/
ob_frame *ob_frameset_depth_frame(ob_frame *frameset, ob_error **error);
OB_EXPORT ob_frame *ob_frameset_get_depth_frame(const ob_frame *frameset, ob_error **error);
/**
* @brief Get the color frame from the frameset.
*
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the color frame.
*/
ob_frame *ob_frameset_color_frame(ob_frame *frameset, ob_error **error);
OB_EXPORT ob_frame *ob_frameset_get_color_frame(const ob_frame *frameset, ob_error **error);
/**
* @brief Get the infrared frame from the frameset.
*
* @param[in] frameset Frameset object.
* @param[out] error Log error messages.
* @return ob_frame* Return the infrared frame.
*/
ob_frame *ob_frameset_ir_frame(ob_frame *frameset, ob_error **error);
/**
* @brief Get point cloud data from the frameset.
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the infrared frame.
*/
OB_EXPORT ob_frame *ob_frameset_get_ir_frame(const ob_frame *frameset, ob_error **error);
/**
* @brief Get point cloud frame from the frameset.
*
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the point cloud frame.
*/
ob_frame *ob_frameset_points_frame(ob_frame *frameset, ob_error **error);
OB_EXPORT ob_frame *ob_frameset_get_points_frame(const ob_frame *frameset, ob_error **error);
/**
* @brief Get a frame of a specific type from the frameset.
*
* @attention The frame returned by this function should call @ref ob_delete_frame() to decrease the reference count when it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[in] frame_type Frame type.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frame of the specified type, or nullptr if it does not exist.
*/
ob_frame *ob_frameset_get_frame(ob_frame *frameset, ob_frame_type frame_type, ob_error **error);
OB_EXPORT ob_frame *ob_frameset_get_frame(const ob_frame *frameset, ob_frame_type frame_type, ob_error **error);
/**
* @brief Get a frame at a specific index from the FrameSet
*
* @param[in] frameset Frameset object.
* @param[in] index The index of the frame.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_frame* Return the frame at the specified index, or nullptr if it does not exist.
*/
ob_frame *ob_frameset_get_frame_by_index(ob_frame *frameset, int index, ob_error **error);
OB_EXPORT ob_frame *ob_frameset_get_frame_by_index(const ob_frame *frameset, uint32_t index, ob_error **error);
/**
* @brief Get accelerometer frame data.
* @brief Push a frame to the frameset
*
* @param[in] frame Accelerometer frame.
* @param[out] error Log error messages.
* @return ob_accel_value Return the accelerometer data.
*/
ob_accel_value ob_accel_frame_value(ob_frame *frame, ob_error **error);
/**
* @brief Get the temperature when acquiring the accelerometer frame.
*
* @param[in] frame Accelerometer frame.
* @param[out] error Log error messages.
* @return float Return the temperature value.
*/
float ob_accel_frame_temperature(ob_frame *frame, ob_error **error);
/**
* @brief Get gyroscope frame data.
*
* @param[in] frame Gyroscope frame.
* @param[out] error Log error messages.
* @return ob_gyro_value Return the gyroscope data.
*/
ob_gyro_value ob_gyro_frame_value(ob_frame *frame, ob_error **error);
/**
* @brief Get the temperature when acquiring the gyroscope frame.
*
* @param[in] frame Gyroscope frame.
* @param[out] error Log error messages.
* @return float Return the temperature value.
*/
float ob_gyro_frame_temperature(ob_frame *frame, ob_error **error);
/**
* @brief Increase the reference count of a frame object.
*
* @param[in] frame Frame object to increase the reference count.
* @param[out] error Log error messages.
*/
void ob_frame_add_ref(ob_frame *frame, ob_error **error);
/**
* @brief Create an empty frame object based on the specified parameters.
*
* @param[in] frame_format Frame object format.
* @param[in] width Frame object width.
* @param[in] height Frame object height.
* @param[in] stride_bytes Buffer row span.
* @param[in] frame_type Frame object type.
* @param[out] error Log error messages.
* @return ob_frame* Return an empty frame object.
*/
ob_frame *ob_create_frame(ob_format frame_format, int width, int height, int stride_bytes, ob_frame_type frame_type, ob_error **error);
/**
* @brief Create a frame object based on an externally created buffer.
*
* @param[in] frame_format Frame object format.
* @param[in] frame_width Frame object width.
* @param[in] frame_height Frame object height.
* @param[in] buffer Frame object buffer.
* @param[in] buffer_size Frame object buffer size.
* @param[in] buffer_destroy_cb Destroy callback.
* @param[in] buffer_destroy_context Destroy context.
* @param[out] error Log error messages.
* @return ob_frame* Return the frame object.
*/
ob_frame *ob_create_frame_from_buffer(ob_format frame_format, uint32_t frame_width, uint32_t frame_height, uint8_t *buffer, uint32_t buffer_size,
ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error);
/**
* @brief Create an empty frameset object.
*
* @param[out] error Log error messages.
* @return ob_frame* Return the frameset object.
*/
ob_frame *ob_create_frameset(ob_error **error);
/**
* @brief Add a frame of the specified type to the frameset.
* @attention If a frame with same type already exists in the frameset, it will be replaced by the new frame.
* @attention The frame push to the frameset will be add reference count, so you still need to call @ref ob_delete_frame() to decrease the reference count when
* it is no longer needed.
*
* @param[in] frameset Frameset object.
* @param[in] type Type of frame to add.
* @param[in] frame Frame object to add.
* @param[out] error Log error messages.
* @param[in] frame Frame object to push.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_frameset_push_frame(ob_frame *frameset, ob_frame_type type, ob_frame *frame, ob_error **error);
OB_EXPORT void ob_frameset_push_frame(ob_frame *frameset, const ob_frame *frame, ob_error **error);
/**
* @brief Set the system timestamp of a frame object.
*
* @param[in] frame Frame object to set the system timestamp for.
* @param[in] system_timestamp System timestamp to set in milliseconds.
* @param[out] error Log error messages.
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
void ob_frame_set_system_time_stamp(ob_frame *frame, uint64_t system_timestamp, ob_error **error);
#define ob_frame_index ob_frame_get_index
#define ob_frame_format ob_frame_get_format
#define ob_frame_time_stamp_us ob_frame_get_timestamp_us
#define ob_frame_set_device_time_stamp_us ob_frame_set_timestamp_us
#define ob_frame_system_time_stamp_us ob_frame_get_system_timestamp_us
#define ob_frame_global_time_stamp_us ob_frame_get_global_timestamp_us
#define ob_frame_data ob_frame_get_data
#define ob_frame_data_size ob_frame_get_data_size
#define ob_frame_metadata ob_frame_get_metadata
#define ob_frame_metadata_size ob_frame_get_metadata_size
#define ob_video_frame_width ob_video_frame_get_width
#define ob_video_frame_height ob_video_frame_get_height
#define ob_video_frame_pixel_available_bit_size ob_video_frame_get_pixel_available_bit_size
#define ob_points_frame_get_position_value_scale ob_points_frame_get_coordinate_value_scale
#define ob_frameset_frame_count ob_frameset_get_count
#define ob_frameset_depth_frame ob_frameset_get_depth_frame
#define ob_frameset_color_frame ob_frameset_get_color_frame
#define ob_frameset_ir_frame ob_frameset_get_ir_frame
#define ob_frameset_points_frame ob_frameset_get_points_frame
#define ob_accel_frame_value ob_accel_frame_get_value
#define ob_accel_frame_temperature ob_accel_frame_get_temperature
#define ob_gyro_frame_value ob_gyro_frame_get_value
#define ob_gyro_frame_temperature ob_gyro_frame_get_temperature
#define ob_frameset_get_frame_count ob_frameset_get_count
/**
* @brief Set the device timestamp of a frame object.
*
* @param[in] frame Frame object to set the device timestamp.
* @param[in] device_timestamp Device timestamp to set in milliseconds.
* @param[out] error Log error messages.
*/
void ob_frame_set_device_time_stamp(ob_frame *frame, uint64_t device_timestamp, ob_error **error);
#define ob_frame_time_stamp(frame, err) \
do { \
uint64_t timestamp_us = ob_frame_get_timestamp_us(frame, err); \
return timestamp_us / 1000; \
} while(0);
/**
* @brief Set the device timestamp of a frame object.
*
* @param[in] frame Frame object to set the device timestamp for.
* @param[in] device_timestamp_us Device timestamp to set in microseconds.
* @param[out] error Log error messages.
*/
void ob_frame_set_device_time_stamp_us(ob_frame *frame, uint64_t device_timestamp_us, ob_error **error);
#define ob_frame_system_time_stamp(frame, err) \
do { \
uint64_t system_timestamp_us = ob_frame_get_system_timestamp_us(frame, err); \
return system_timestamp_us / 1000; \
} while(0);
#define ob_frame_set_system_time_stamp(frame, system_timestamp, err) \
do { \
ob_frame_set_system_timestamp_us(frame, system_timestamp * 1000, err); \
} while(0);
#define ob_frame_set_device_time_stamp(frame, device_timestamp, err) \
do { \
ob_frame_set_timestamp_us(frame, device_timestamp * 1000, err); \
} while(0);
#ifdef __cplusplus
}
@@ -30,32 +30,32 @@ extern "C" {
* // and so on
* ```
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint16_t return the supported multi device sync mode bitmap of the device.
*/
uint16_t ob_device_get_supported_multi_device_sync_mode_bitmap(ob_device *device, ob_error **error);
OB_EXPORT uint16_t ob_device_get_supported_multi_device_sync_mode_bitmap(const ob_device *device, ob_error **error);
/**
* @brief set the multi device sync configuration of the device.
*
* @param[in] device The device handle.
* @param[in] config The multi device sync configuration.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_device_set_multi_device_sync_config(ob_device *device, const ob_multi_device_sync_config *config, ob_error **error);
OB_EXPORT void ob_device_set_multi_device_sync_config(ob_device *device, const ob_multi_device_sync_config *config, ob_error **error);
/**
* @brief get the multi device sync configuration of the device.
* @brief get the current multi device sync configuration of the device.
*
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_multi_device_sync_config return the multi device sync configuration of the device.
*/
ob_multi_device_sync_config ob_device_get_multi_device_sync_config(ob_device *device, ob_error **error);
OB_EXPORT ob_multi_device_sync_config ob_device_get_multi_device_sync_config(const ob_device *device, ob_error **error);
/**
* @brief send the capture command to the device.
* @brief The device will start one time image capture after receiving the capture command when it is in the @ref OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
* @brief send the capture command to the device to trigger the capture.
* @brief The device will start one time capture after receiving the capture command when it is in the @ref OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
*
* @attention The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream. The
* number of frames per trigger can be set by @ref framesPerTrigger.
@@ -64,27 +64,27 @@ ob_multi_device_sync_config ob_device_get_multi_device_sync_config(ob_device *de
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
*
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_device_trigger_capture(ob_device *device, ob_error **error);
OB_EXPORT void ob_device_trigger_capture(ob_device *device, ob_error **error);
/**
* @brief set the timestamp reset configuration of the device.
*
* @param[in] device The device handle.
* @param[in] config The timestamp reset configuration.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_device_set_timestamp_reset_config(ob_device *device, const ob_device_timestamp_reset_config *config, ob_error **error);
OB_EXPORT void ob_device_set_timestamp_reset_config(ob_device *device, const ob_device_timestamp_reset_config *config, ob_error **error);
/**
* @brief get the timestamp reset configuration of the device.
*
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_device_timestamp_reset_config return the timestamp reset configuration of the device.
*/
ob_device_timestamp_reset_config ob_device_get_timestamp_reset_config(ob_device *device, ob_error **error);
OB_EXPORT ob_device_timestamp_reset_config ob_device_get_timestamp_reset_config(ob_device *device, ob_error **error);
/**
* @brief send the timestamp reset command to the device.
@@ -96,9 +96,9 @@ ob_device_timestamp_reset_config ob_device_get_timestamp_reset_config(ob_device
* can call this function periodically to reset the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
*
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_device_timestamp_reset(ob_device *device, ob_error **error);
OB_EXPORT void ob_device_timestamp_reset(ob_device *device, ob_error **error);
/**
* @brief Alias for @ref ob_device_timestamp_reset since it is more accurate.
@@ -115,9 +115,9 @@ void ob_device_timestamp_reset(ob_device *device, ob_error **error);
* can call this function periodically to synchronize the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
*
* @param[in] device The device handle.
* @param[out] error The error information.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_device_timer_sync_with_host(ob_device *device, ob_error **error);
OB_EXPORT void ob_device_timer_sync_with_host(ob_device *device, ob_error **error);
#ifdef __cplusplus
} // extern "C"
+195 -234
View File
@@ -7,40 +7,8 @@
*/
#pragma once
#if(defined(WIN32) || defined(_WIN32) || defined(WINCE))
#ifdef OB_EXPORTS
#define OB_EXTENSION_API __declspec(dllexport)
#define OB_EXTENSION_INTERNAL_API __declspec(dllexport)
#elif defined(OB2_EXPORTS)
#define OB_EXTENSION_API __declspec(dllexport)
#define OB_EXTENSION_INTERNAL_API
#else
#ifndef OB_STATIC
#define OB_EXTENSION_API __declspec(dllimport)
#define OB_EXTENSION_INTERNAL_API __declspec(dllimport)
#else
#define OB_EXTENSION_API
#define OB_EXTENSION_INTERNAL_API
#endif
#endif
#else
#ifndef OB_STATIC
#define OB_EXTENSION_API __attribute__((visibility("default")))
#define OB_EXTENSION_INTERNAL_API __attribute__((visibility("default")))
#else
#define OB_EXTENSION_API
#define OB_EXTENSION_INTERNAL_API
#endif
#endif
#if defined(__GNUC__) || defined(__clang__)
#define DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED __declspec(deprecated)
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define DEPRECATED
#endif
#include "Export.h"
#pragma pack(push, 1) // struct 1-byte align
@@ -51,48 +19,35 @@ extern "C" {
#include <stdbool.h>
#include <stdint.h>
typedef struct ContextImpl ob_context;
typedef struct DeviceImpl ob_device;
typedef struct DeviceInfoImpl ob_device_info;
typedef struct DeviceListImpl ob_device_list;
typedef struct CameraParamListImpl ob_camera_param_list;
typedef struct SensorImpl ob_sensor;
typedef struct SensorListImpl ob_sensor_list;
typedef struct StreamProfileImpl ob_stream_profile;
typedef struct StreamProfileListImpl ob_stream_profile_list;
typedef struct CFrameImpl ob_frame;
typedef struct FilterImpl ob_filter;
typedef struct PipelineImpl ob_pipeline;
typedef struct ConfigImpl ob_config;
typedef struct RecorderImpl ob_recorder;
typedef struct PlaybackImpl ob_playback;
typedef struct OBDepthWorkModeListImpl ob_depth_work_mode_list;
typedef struct FilterListImpl ob_filter_list;
typedef struct OBFilterListImpl ob_filters;
typedef struct DevicePresetListImpl ob_device_preset_list;
typedef struct ob_context_t ob_context;
typedef struct ob_device_t ob_device;
typedef struct ob_device_info_t ob_device_info;
typedef struct ob_device_list_t ob_device_list;
typedef struct ob_camera_param_list_t ob_camera_param_list;
typedef struct ob_sensor_t ob_sensor;
typedef struct ob_sensor_list_t ob_sensor_list;
typedef struct ob_stream_profile_t ob_stream_profile;
typedef struct ob_stream_profile_list_t ob_stream_profile_list;
typedef struct ob_frame_t ob_frame;
typedef struct ob_filter_t ob_filter;
typedef struct ob_filter_list_t ob_filter_list;
typedef struct ob_pipeline_t ob_pipeline;
typedef struct ob_config_t ob_config;
typedef struct ob_depth_work_mode_list_t ob_depth_work_mode_list;
typedef struct ob_device_preset_list_t ob_device_preset_list;
typedef struct ob_filter_config_schema_list_t ob_filter_config_schema_list;
#define OB_WIDTH_ANY 0
#define OB_HEIGHT_ANY 0
#define OB_FPS_ANY 0
#define OB_FORMAT_ANY OB_FORMAT_UNKNOWN
#define OB_PROFILE_DEFAULT 0
#define OB_DEFAULT_STRIDE_BYTES 0
#define OB_ACCEL_FULL_SCALE_RANGE_ANY OB_ACCEL_FS_UNKNOWN
#define OB_ACCEL_SAMPLE_RATE_ANY OB_SAMPLE_RATE_UNKNOWN
#define OB_GYRO_FULL_SCALE_RANGE_ANY OB_GYRO_FS_UNKNOWN
#define OB_GYRO_SAMPLE_RATE_ANY OB_SAMPLE_RATE_UNKNOWN
/**
* @brief send data or receive data return status type
*/
typedef enum {
HP_STATUS_OK = 0, /**< success*/
HP_STATUS_NO_DEVICE_FOUND = 1, /**< No device found*/
HP_STATUS_CONTROL_TRANSFER_FAILED = 2, /**< Transfer failed*/
HP_STATUS_UNKNOWN_ERROR = 0xffff, /**< Unknown error*/
} OBHPStatusCode,
ob_hp_status_code;
/**
* @brief the permission type of api or property
*/
@@ -127,21 +82,23 @@ typedef enum {
} OBLogSeverity,
ob_log_severity, DEVICE_LOG_SEVERITY_LEVEL, OBDeviceLogSeverityLevel, ob_device_log_severity_level;
#define OB_LOG_SEVERITY_NONE OB_LOG_SEVERITY_OFF
/**
* @brief The exception types in the SDK, through the exception type, you can easily determine the specific type of error.
* For detailed error API interface functions and error logs, please refer to the information of ob_error
*/
typedef enum {
OB_EXCEPTION_TYPE_UNKNOWN, /**< Unknown error, an error not clearly defined by the SDK */
OB_EXCEPTION_TYPE_CAMERA_DISCONNECTED, /**< SDK device disconnection exception */
OB_EXCEPTION_TYPE_PLATFORM, /**< An error in the SDK adaptation platform layer means an error in the implementation of a specific system
platform */
OB_EXCEPTION_TYPE_INVALID_VALUE, /**< Invalid parameter type exception, need to check input parameter */
OB_EXCEPTION_TYPE_WRONG_API_CALL_SEQUENCE, /**< Exception caused by API version mismatch */
OB_EXCEPTION_TYPE_NOT_IMPLEMENTED, /**< SDK and firmware have not yet implemented functions */
OB_EXCEPTION_TYPE_UNKNOWN, /**< Unknown error, an error not clearly defined by the SDK */
OB_EXCEPTION_STD_EXCEPTION, /** < Standard exception, an error caused by the standard library */
OB_EXCEPTION_TYPE_CAMERA_DISCONNECTED, /**< Camera/Device has been disconnected, the camera/device is not available */
OB_EXCEPTION_TYPE_PLATFORM, /**< An error in the SDK adaptation platform layer, which means an error in the implementation of a specific system
platform */
OB_EXCEPTION_TYPE_INVALID_VALUE, /**< Invalid parameter type exception, need to check input parameter */
OB_EXCEPTION_TYPE_WRONG_API_CALL_SEQUENCE, /**< Wrong API call sequence, the API is called in the wrong order or the wrong parameter is passed */
OB_EXCEPTION_TYPE_NOT_IMPLEMENTED, /**< SDK and firmware have not yet implemented this function or feature */
OB_EXCEPTION_TYPE_IO, /**< SDK access IO exception error */
OB_EXCEPTION_TYPE_MEMORY, /**< SDK access and use memory errors, which means that the frame fails to allocate memory */
OB_EXCEPTION_TYPE_UNSUPPORTED_OPERATION, /**< Unsupported operation type error by SDK or RGBD device */
OB_EXCEPTION_TYPE_MEMORY, /**< SDK access and use memory errors. For example, the frame fails to allocate memory */
OB_EXCEPTION_TYPE_UNSUPPORTED_OPERATION, /**< Unsupported operation type error by SDK or device */
} OBExceptionType,
ob_exception_type;
@@ -166,10 +123,10 @@ typedef enum {
OB_SENSOR_DEPTH = 3, /**< Depth */
OB_SENSOR_ACCEL = 4, /**< Accel */
OB_SENSOR_GYRO = 5, /**< Gyro */
OB_SENSOR_IR_LEFT = 6, /**< left IR */
OB_SENSOR_IR_RIGHT = 7, /**< Right IR */
OB_SENSOR_IR_LEFT = 6, /**< left IR for stereo camera*/
OB_SENSOR_IR_RIGHT = 7, /**< Right IR for stereo camera*/
OB_SENSOR_RAW_PHASE = 8, /**< Raw Phase */
OB_SENSOR_COUNT,
OB_SENSOR_TYPE_COUNT, /**The total number of sensor types, is not a valid sensor type */
} OBSensorType,
ob_sensor_type;
@@ -184,9 +141,10 @@ typedef enum {
OB_STREAM_DEPTH = 3, /**< depth stream */
OB_STREAM_ACCEL = 4, /**< Accelerometer data stream */
OB_STREAM_GYRO = 5, /**< Gyroscope data stream */
OB_STREAM_IR_LEFT = 6, /**< Left IR stream */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream */
OB_STREAM_IR_LEFT = 6, /**< Left IR stream for stereo camera */
OB_STREAM_IR_RIGHT = 7, /**< Right IR stream for stereo camera */
OB_STREAM_RAW_PHASE = 8, /**< RawPhase Stream */
OB_STREAM_TYPE_COUNT, /**< The total number of stream type,is not a valid stream type */
} OBStreamType,
ob_stream_type;
@@ -203,57 +161,78 @@ typedef enum {
OB_FRAME_SET = 5, /**< Frame collection (internally contains a variety of data frames) */
OB_FRAME_POINTS = 6, /**< Point cloud frame */
OB_FRAME_GYRO = 7, /**< Gyroscope data frame */
OB_FRAME_IR_LEFT = 8, /**< Left IR frame */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame */
OB_FRAME_RAW_PHASE = 10, /**< Rawphase frame*/
OB_FRAME_IR_LEFT = 8, /**< Left IR frame for stereo camera */
OB_FRAME_IR_RIGHT = 9, /**< Right IR frame for stereo camera */
OB_FRAME_RAW_PHASE = 10, /**< Raw Phase frame*/
OB_FRAME_TYPE_COUNT, /**< The total number of frame types, is not a valid frame type */
} OBFrameType,
ob_frame_type;
/**
* @brief Enumeration value describing the pixel type of frame (usually used for depth frame)
*
*/
typedef enum {
OB_PIXEL_UNKNOWN = -1, // Unknown pixel type, or undefined pixel type for current frame
OB_PIXEL_DEPTH = 0, // Depth pixel type, the value of the pixel is the distance from the camera to the object
OB_PIXEL_DISPARITY = 2, // Disparity for structured light camera
OB_PIXEL_RAW_PHASE = 3, // Raw phase for tof camera
} OBPixelType,
ob_pixel_type;
/**
* @brief Enumeration value describing the pixel format
*/
typedef enum {
OB_FORMAT_YUYV = 0, /**< YUYV format */
OB_FORMAT_YUY2 = 1, /**< YUY2 format (the actual format is the same as YUYV) */
OB_FORMAT_UYVY = 2, /**< UYVY format */
OB_FORMAT_NV12 = 3, /**< NV12 format */
OB_FORMAT_NV21 = 4, /**< NV21 format */
OB_FORMAT_MJPG = 5, /**< MJPEG encoding format */
OB_FORMAT_H264 = 6, /**< H.264 encoding format */
OB_FORMAT_H265 = 7, /**< H.265 encoding format */
OB_FORMAT_Y16 = 8, /**< Y16 format, 16-bit per pixel, single-channel*/
OB_FORMAT_Y8 = 9, /**< Y8 format, 8-bit per pixel, single-channel */
OB_FORMAT_Y10 = 10, /**< Y10 format, 10-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_Y11 = 11, /**< Y11 format, 11-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_Y12 = 12, /**< Y12 format, 12-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_GRAY = 13, /**< GRAY (the actual format is the same as YUYV) */
OB_FORMAT_HEVC = 14, /**< HEVC encoding format (the actual format is the same as H265) */
OB_FORMAT_I420 = 15, /**< I420 format */
OB_FORMAT_ACCEL = 16, /**< Acceleration data format */
OB_FORMAT_GYRO = 17, /**< Gyroscope data format */
OB_FORMAT_POINT = 19, /**< XYZ 3D coordinate point format */
OB_FORMAT_RGB_POINT = 20, /**< XYZ 3D coordinate point format with RGB information */
OB_FORMAT_RLE = 21, /**< RLE pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_RGB = 22, /**< RGB format (actual RGB888) */
OB_FORMAT_BGR = 23, /**< BGR format (actual BGR888) */
OB_FORMAT_Y14 = 24, /**< Y14 format, 14-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_BGRA = 25, /**< BGRA format */
OB_FORMAT_COMPRESSED = 26, /**< Compression format */
OB_FORMAT_RVL = 27, /**< RVL pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_Z16 = 28, /**< Is same as Y16*/
OB_FORMAT_YV12 = 29, /**< Is same as Y12, using for right ir stream*/
OB_FORMAT_BA81 = 30, /**< Is same as Y8, using for right ir stream*/
OB_FORMAT_RGBA = 31, /**< RGBA format */
OB_FORMAT_BYR2 = 32, /**< byr2 format */
OB_FORMAT_RW16 = 33, /**< RAW16 format */
OB_FORMAT_DISP16 = 34, /**< Y16 format for disparity map*/
OB_FORMAT_UNKNOWN = 0xff, /**< unknown format */
OB_FORMAT_UNKNOWN = -1, /*< unknown format */
OB_FORMAT_YUYV = 0, /**< YUYV format */
OB_FORMAT_YUY2 = 1, /**< YUY2 format (the actual format is the same as YUYV) */
OB_FORMAT_UYVY = 2, /**< UYVY format */
OB_FORMAT_NV12 = 3, /**< NV12 format */
OB_FORMAT_NV21 = 4, /**< NV21 format */
OB_FORMAT_MJPG = 5, /**< MJPEG encoding format */
OB_FORMAT_H264 = 6, /**< H.264 encoding format */
OB_FORMAT_H265 = 7, /**< H.265 encoding format */
OB_FORMAT_Y16 = 8, /**< Y16 format, 16-bit per pixel, single-channel*/
OB_FORMAT_Y8 = 9, /**< Y8 format, 8-bit per pixel, single-channel */
OB_FORMAT_Y10 = 10, /**< Y10 format, 10-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_Y11 = 11, /**< Y11 format, 11-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_Y12 = 12, /**< Y12 format, 12-bit per pixel, single-channel(SDK will unpack into Y16 by default) */
OB_FORMAT_GRAY = 13, /**< GRAY (the actual format is the same as YUYV) */
OB_FORMAT_HEVC = 14, /**< HEVC encoding format (the actual format is the same as H265) */
OB_FORMAT_I420 = 15, /**< I420 format */
OB_FORMAT_ACCEL = 16, /**< Acceleration data format */
OB_FORMAT_GYRO = 17, /**< Gyroscope data format */
OB_FORMAT_POINT = 19, /**< XYZ 3D coordinate point format, @ref OBPoint */
OB_FORMAT_RGB_POINT = 20, /**< XYZ 3D coordinate point format with RGB information, @ref OBColorPoint */
OB_FORMAT_RLE = 21, /**< RLE pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_RGB = 22, /**< RGB format (actual RGB888) */
OB_FORMAT_BGR = 23, /**< BGR format (actual BGR888) */
OB_FORMAT_Y14 = 24, /**< Y14 format, 14-bit per pixel, single-channel (SDK will unpack into Y16 by default) */
OB_FORMAT_BGRA = 25, /**< BGRA format */
OB_FORMAT_COMPRESSED = 26, /**< Compression format */
OB_FORMAT_RVL = 27, /**< RVL pressure test format (SDK will be unpacked into Y16 by default) */
OB_FORMAT_Z16 = 28, /**< Is same as Y16*/
OB_FORMAT_YV12 = 29, /**< Is same as Y12, using for right ir stream*/
OB_FORMAT_BA81 = 30, /**< Is same as Y8, using for right ir stream*/
OB_FORMAT_RGBA = 31, /**< RGBA format */
OB_FORMAT_BYR2 = 32, /**< byr2 format */
OB_FORMAT_RW16 = 33, /**< RAW16 format */
} OBFormat,
ob_format;
#define OB_FORMAT_RGB888 OB_FORMAT_RGB // Alias of OB_FORMAT_RGB for compatibility
#define OB_FORMAT_MJPEG OB_FORMAT_MJPG // Alias of OB_FORMAT_MJPG for compatibility
// Check if the format is a fixed data size format
#define IS_FIXED_SIZE_FORMAT(format) \
(format != OB_FORMAT_MJPG && format != OB_FORMAT_H264 && format != OB_FORMAT_H265 && format != OB_FORMAT_HEVC && format != OB_FORMAT_RLE \
&& format != OB_FORMAT_RVL)
// Check if the format is a packed format, which means the data of pixels is not continuous or bytes aligned in memory
#define IS_PACKED_FORMAT(format) \
(format == OB_FORMAT_Y10 || format == OB_FORMAT_Y11 || format == OB_FORMAT_Y12 || format == OB_FORMAT_Y14 || format == OB_FORMAT_RLE)
/**
* @brief Enumeration value describing the firmware upgrade status
*/
@@ -273,7 +252,7 @@ typedef enum {
ERR_DDR = -7, /**< DDR access error */
ERR_TIMEOUT = -8 /**< timeout error */
} OBUpgradeState,
ob_upgrade_state;
OBFwUpdateState, ob_upgrade_state, ob_fw_update_state;
/**
* @brief Enumeration value describing the file transfer status
@@ -373,6 +352,18 @@ typedef struct {
bool def; ///< Default value
} OBBoolPropertyRange, ob_bool_property_range;
/** \brief Distortion model: defines how pixel coordinates should be mapped to sensor coordinates. */
typedef enum {
OB_DISTORTION_NONE, /**< Rectilinear images. No distortion compensation required. */
OB_DISTORTION_MODIFIED_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except that tangential distortion is applied to radially distorted points
*/
OB_DISTORTION_INVERSE_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except undistorts image instead of distorting it */
OB_DISTORTION_BROWN_CONRADY, /**< Unmodified Brown-Conrady distortion model */
OB_DISTORTION_BROWN_CONRADY_K6, /**< Unmodified Brown-Conrady distortion model with k6 supported */
OB_DISTORTION_KANNALA_BRANDT4, /**< Kannala-Brandt distortion model */
} OBCameraDistortionModel,
ob_camera_distortion_model;
/**
* @brief Structure for camera intrinsic parameters
*/
@@ -414,39 +405,17 @@ typedef struct {
* @brief Structure for distortion parameters
*/
typedef struct {
float k1; ///< Radial distortion factor 1
float k2; ///< Radial distortion factor 2
float k3; ///< Radial distortion factor 3
float k4; ///< Radial distortion factor 4
float k5; ///< Radial distortion factor 5
float k6; ///< Radial distortion factor 6
float p1; ///< Tangential distortion factor 1
float p2; ///< Tangential distortion factor 2
float k1; ///< Radial distortion factor 1
float k2; ///< Radial distortion factor 2
float k3; ///< Radial distortion factor 3
float k4; ///< Radial distortion factor 4
float k5; ///< Radial distortion factor 5
float k6; ///< Radial distortion factor 6
float p1; ///< Tangential distortion factor 1
float p2; ///< Tangential distortion factor 2
OBCameraDistortionModel model;
} OBCameraDistortion, ob_camera_distortion;
/** \brief Distortion model: defines how pixel coordinates should be mapped to sensor coordinates. */
typedef enum {
OB_DISTORTION_NONE, /**< Rectilinear images. No distortion compensation required. */
OB_DISTORTION_MODIFIED_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except that tangential distortion is applied to radially distorted points
*/
OB_DISTORTION_INVERSE_BROWN_CONRADY, /**< Equivalent to Brown-Conrady distortion, except undistorts image instead of distorting it */
OB_DISTORTION_BROWN_CONRADY, /**< Unmodified Brown-Conrady distortion model */
} OBCameraDistortionModel,
ob_camera_distortion_model;
/** \brief Video stream intrinsics. */
typedef struct {
int width; /**< Width of the image in pixels */
int height; /**< Height of the image in pixels */
float ppx; /**< Horizontal coordinate of the principal point of the image, as a pixel offset from the left edge */
float ppy; /**< Vertical coordinate of the principal point of the image, as a pixel offset from the top edge */
float fx; /**< Focal length of the image plane, as a multiple of pixel width */
float fy; /**< Focal length of the image plane, as a multiple of pixel height */
OBCameraDistortionModel model; /**< Distortion model of the image */
float coeffs[5]; /**< Distortion coefficients. Order for Brown-Conrady: [k1, k2, p1, p2, k3]. Order for F-Theta Fish-eye: [k1, k2, k3, k4, 0]. Other models
are subject to their own interpretations */
} OBCameraAlignIntrinsic, ob_camera_align_intrinsic;
/**
* @brief Structure for rotation/transformation
*/
@@ -463,30 +432,19 @@ typedef struct {
OBCameraIntrinsic rgbIntrinsic; ///< Color camera internal parameters
OBCameraDistortion depthDistortion; ///< Depth camera distortion parameters
OBCameraDistortion rgbDistortion; ///< Color camera distortion parameters
OBD2CTransform transform; ///< Rotation/transformation matrix (from depth to color)
OBD2CTransform transform; ///< Rotation/transformation matrix
bool isMirrored; ///< Whether the image frame corresponding to this group of parameters is mirrored
} OBCameraParam, ob_camera_param;
/**
* @brief Camera parameters
*/
typedef struct {
OBCameraIntrinsic depthIntrinsic; ///< Depth camera internal parameters
OBCameraIntrinsic rgbIntrinsic; ///< Color camera internal parameters
OBCameraDistortion depthDistortion; ///< Depth camera distortion parameters
OBCameraDistortion rgbDistortion; ///< Distortion parameters for color camera
OBD2CTransform transform; ///< Rotation/transformation matrix
} OBCameraParam_V0, ob_camera_param_v0;
/**
* @brief calibration parameters
*/
typedef struct {
OBCameraIntrinsic intrinsics[OB_SENSOR_COUNT]; ///< Sensor internal parameters
OBCameraDistortion distortion[OB_SENSOR_COUNT]; ///< Sensor distortion
OBExtrinsic extrinsics[OB_SENSOR_COUNT][OB_SENSOR_COUNT]; ///< The extrinsic parameters allow 3D coordinate conversions between sensor.To transform from a
///< source to a target 3D coordinate system,under extrinsics[source][target].
OBCameraIntrinsic intrinsics[OB_SENSOR_TYPE_COUNT]; ///< Sensor internal parameters
OBCameraDistortion distortion[OB_SENSOR_TYPE_COUNT]; ///< Sensor distortion
OBExtrinsic extrinsics[OB_SENSOR_TYPE_COUNT]
[OB_SENSOR_TYPE_COUNT]; ///< The extrinsic parameters allow 3D coordinate conversions between sensor.To transform from a
///< source to a target 3D coordinate system,under extrinsics[source][target].
} OBCalibrationParam, ob_calibration_param;
/**
@@ -581,7 +539,7 @@ typedef enum {
* @brief Enumeration of IMU sample rate values (gyroscope or accelerometer)
*/
typedef enum {
OB_SAMPLE_RATE_UNKNOWN = 0, /**< Unknown sample rate */
OB_SAMPLE_RATE_UNKNOWN = 0,
OB_SAMPLE_RATE_1_5625_HZ = 1, /**< 1.5625Hz */
OB_SAMPLE_RATE_3_125_HZ, /**< 3.125Hz */
OB_SAMPLE_RATE_6_25_HZ, /**< 6.25Hz */
@@ -597,14 +555,14 @@ typedef enum {
OB_SAMPLE_RATE_8_KHZ, /**< 8KHz */
OB_SAMPLE_RATE_16_KHZ, /**< 16KHz */
OB_SAMPLE_RATE_32_KHZ, /**< 32Hz */
} OBGyroSampleRate,
ob_gyro_sample_rate, OBAccelSampleRate, ob_accel_sample_rate, OB_SAMPLE_RATE;
} OBIMUSampleRate,
OBGyroSampleRate, ob_gyro_sample_rate, OBAccelSampleRate, ob_accel_sample_rate, OB_SAMPLE_RATE;
/**
* @brief Enumeration of gyroscope ranges
*/
typedef enum {
OB_GYRO_FS_UNKNOWN = 0, /**< Unknown range */
OB_GYRO_FS_UNKNOWN = -1,
OB_GYRO_FS_16dps = 1, /**< 16 degrees per second */
OB_GYRO_FS_31dps, /**< 31 degrees per second */
OB_GYRO_FS_62dps, /**< 62 degrees per second */
@@ -620,7 +578,7 @@ typedef enum {
* @brief Enumeration of accelerometer ranges
*/
typedef enum {
OB_ACCEL_FS_UNKNOWN = 0, /**< Unknown range */
OB_ACCEL_FS_UNKNOWN = -1,
OB_ACCEL_FS_2g = 1, /**< 1x the acceleration of gravity */
OB_ACCEL_FS_4g, /**< 4x the acceleration of gravity */
OB_ACCEL_FS_8g, /**< 8x the acceleration of gravity */
@@ -635,7 +593,7 @@ typedef struct {
float x; ///< X-direction component
float y; ///< Y-direction component
float z; ///< Z-direction component
} OBAccelValue, OBGyroValue, ob_accel_value, ob_gyro_value;
} OBAccelValue, OBGyroValue, OBFloat3D, ob_accel_value, ob_gyro_value, ob_float_3d;
/**
* @brief Device state
@@ -673,9 +631,10 @@ typedef enum {
* @brief Enumeration for device types
*/
typedef enum {
OB_STRUCTURED_LIGHT_MONOCULAR_CAMERA = 0, /**< Monocular structured light camera */
OB_STRUCTURED_LIGHT_BINOCULAR_CAMERA = 1, /**< Binocular structured light camera */
OB_TOF_CAMERA = 2, /**< Time-of-flight camera */
OB_DEVICE_TYPE_UNKNOWN = -1, /**< Unknown device type */
OB_STRUCTURED_LIGHT_MONOCULAR_CAMERA = 0, /**< Monocular structured light camera */
OB_STRUCTURED_LIGHT_BINOCULAR_CAMERA = 1, /**< Binocular structured light camera */
OB_TOF_CAMERA = 2, /**< Time-of-flight camera */
} OBDeviceType,
ob_device_type, OB_DEVICE_TYPE;
@@ -728,6 +687,25 @@ typedef enum {
} OBDepthPrecisionLevel,
ob_depth_precision_level, OB_DEPTH_PRECISION_LEVEL;
/**
* @brief disparity parameters for disparity based camera
*
*/
typedef struct {
double zpd; // the distance to calib plane
double zpps; // zpps=z0/fx
float baseline; // baseline length, for monocular camera,it means the distance of laser to the center of IR-CMOS
double fx; // focus
uint8_t bitSize; // disparity bit size(raw disp bit size,for example: MX6000 is 12, MX6600 is 14)
float unit; // reference units:unit=10 denote 1cm; unit=1 denote 1mm; unit=0.5 denote 0.5mm; and so on
float minDisparity; // dual disparity coefficient
uint8_t packMode; // data pack mode
float dispOffset; // disparity offset,actual disp=chip disp + disp_offset
int32_t invalidDisp; // invalid disparity,usually is 0,dual IR add a auxiliary value.
int32_t dispIntPlace; // disp integer digits,default is 8,Gemini2 XL is 10
uint8_t isDualCamera; // 0 monocular camera,1 dual camera
} OBDisparityParam, ob_disparity_param;
/**
* @brief Enumeration for TOF filter scene ranges
*/
@@ -1038,56 +1016,6 @@ typedef enum {
} OB_CMD_VERSION,
OBCmdVersion, ob_cmd_version;
/**
* @brief Internal API for future publication
*
* @note This data type matches OBCmdVersion of one propertyId. PropertyId has multiple OBCmdVersion, and different OBCmdVersion of this propertyId has
* different data types. PropertyId and OBCmdVersion match only one data type. itemCount is the number of data types contained in data bytes. C language and C++
* have differences.
*
* C language:
* data's type is a uint8_t pointer, and the user parses data to the destination type.
* itemTypeSize == 1, dataSize == itemCount;
*
* C++:
* data's type is the propertyId and OBCmdVersion's data type.
* itemTypeSize = sizeof(T), itemCount = dataSize / itemTypeSize;
*/
typedef struct OBDataBundle {
/**
* @brief OBCmdVersion of propertyId
*/
OBCmdVersion cmdVersion;
/**
* @brief Data containing itemCount of elements
*
* @note void *data = new T[itemCount];
*/
void *data;
/**
* @brief Data size in bytes
*
* @note dataSize == itemTypeSize * itemCount
*/
uint32_t dataSize;
/**
* @brief Size of data item
*
* @note C language: itemTypeSize = 1, C++: itemTypeSize = sizeof(T)
*/
uint32_t itemTypeSize;
/**
* @brief Count of data item
*
* @note itemCount = dataSize / itemTypeSize; 0 == dataSize % itemTypeSize;
*/
uint32_t itemCount;
} OBDataBundle, ob_data_bundle;
/**
* @brief IP address configuration for network devices (IPv4)
*/
@@ -1175,7 +1103,7 @@ typedef enum {
/**
* @brief Only FrameSet that contains all types of data frames will be output
*/
OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE = 0,
OB_FRAME_AGGREGATE_OUTPUT_ALL_TYPE_FRAME_REQUIRE = 0,
/**
* @brief Color Frame Require output mode
@@ -1193,6 +1121,7 @@ typedef enum {
OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION,
} OB_FRAME_AGGREGATE_OUTPUT_MODE,
OBFrameAggregateOutputMode, ob_frame_aggregate_output_mode;
#define OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE OB_FRAME_AGGREGATE_OUTPUT_ALL_TYPE_FRAME_REQUIRE
/**
* @brief Enumeration of point cloud coordinate system types
@@ -1440,13 +1369,25 @@ typedef struct {
int16_t y1_bottom;
} AE_ROI, ob_region_of_interest, OBRegionOfInterest;
typedef struct{
uint8_t enable;
uint8_t offset0;
uint8_t offset1;
uint8_t reserved;
}DISP_OFFSET_CONFIG,ob_disp_offset_config,OBDispOffsetConfig;
typedef enum {
OB_FILTER_CONFIG_VALUE_TYPE_INVALID = -1,
OB_FILTER_CONFIG_VALUE_TYPE_INT = 0,
OB_FILTER_CONFIG_VALUE_TYPE_FLOAT = 1,
OB_FILTER_CONFIG_VALUE_TYPE_BOOLEAN = 2,
} OBFilterConfigValueType,
ob_filter_config_value_type;
/**
* @brief Configuration Item for the filter
*/
typedef struct {
const char *name; ///< Name of the configuration item
OBFilterConfigValueType type; ///< Value type of the configuration item
double min; ///< Minimum value casted to double
double max; ///< Maximum value casted to double
double step; ///< Step value casted to double
double def; ///< Default value casted to double
const char *desc; ///< Description of the configuration item
} OBFilterConfigSchemaItem, ob_filter_config_schema_item;
/**
* @brief Frame metadata types
@@ -1661,7 +1602,7 @@ typedef void (*ob_file_send_callback)(ob_file_tran_state state, const char *mess
* @param percent Upgrade progress percentage
* @param user_data User-defined data
*/
typedef void (*ob_device_upgrade_callback)(ob_upgrade_state state, const char *message, uint8_t percent, void *user_data);
typedef void (*ob_device_fw_update_callback)(ob_fw_update_state state, const char *message, uint8_t percent, void *user_data);
/**
* @brief Callback for device status
@@ -1734,7 +1675,7 @@ typedef void (*ob_frameset_callback)(ob_frame *frameset, void *user_data);
* @param buffer Data that needs to be deleted
* @param user_data User-defined data
*/
typedef void(ob_frame_destroy_callback)(void *buffer, void *user_data);
typedef void(ob_frame_destroy_callback)(uint8_t *buffer, void *user_data);
/**
* @brief Callback for receiving log
@@ -1745,6 +1686,26 @@ typedef void(ob_frame_destroy_callback)(void *buffer, void *user_data);
*/
typedef void(ob_log_callback)(ob_log_severity severity, const char *message, void *user_data);
/**
* @brief Check if the sensor_type is a video sensor
*
* @param sensor_type Sensor type to check
* @return True if sensor_type is a video sensor, false otherwise
*/
#define ob_is_video_sensor_type(sensor_type) \
(sensor_type == OB_SENSOR_COLOR || sensor_type == OB_SENSOR_DEPTH || sensor_type == OB_SENSOR_IR || sensor_type == OB_SENSOR_IR_LEFT \
|| sensor_type == OB_SENSOR_IR_RIGHT)
/**
* @brief check if the stream_type is a video stream
*
* @param stream_type Stream type to check
* @return True if stream_type is a video stream, false otherwise
*/
#define ob_is_video_stream_type(stream_type) \
(stream_type == OB_STREAM_COLOR || stream_type == OB_STREAM_DEPTH || stream_type == OB_STREAM_IR || stream_type == OB_STREAM_IR_LEFT \
|| stream_type == OB_STREAM_IR_RIGHT || stream_type == OB_STREAM_VIDEO)
/**
* @brief Check if sensor_type is an IR sensor
*
+235 -256
View File
@@ -1,8 +1,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
@@ -15,145 +16,319 @@ extern "C" {
/**
* @brief Create a pipeline object
*
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_pipeline* return the pipeline object
*/
ob_pipeline *ob_create_pipeline(ob_error **error);
OB_EXPORT ob_pipeline *ob_create_pipeline(ob_error **error);
/**
* @brief Using device objects to create pipeline objects
*
* @param[in] dev Device object used to create pipeline
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_pipeline* return the pipeline object
*/
ob_pipeline *ob_create_pipeline_with_device(ob_device *dev, ob_error **error);
/**
* @brief Use the playback file to create a pipeline object
*
* @param[in] file_name The playback file path used to create the pipeline
* @param[out] error Log error messages
* @return ob_pipeline* return the pipeline object
*/
ob_pipeline *ob_create_pipeline_with_playback_file(const char *file_name, ob_error **error);
OB_EXPORT ob_pipeline *ob_create_pipeline_with_device(const ob_device *dev, ob_error **error);
/**
* @brief Delete pipeline objects
*
* @param[in] pipeline The pipeline object to be deleted
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_delete_pipeline(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT void ob_delete_pipeline(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Start the pipeline with default parameters
*
* @param[in] pipeline pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_start(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT void ob_pipeline_start(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Start the pipeline with configuration parameters
*
* @param[in] pipeline pipeline object
* @param[in] config Parameters to be configured
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_start_with_config(ob_pipeline *pipeline, 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
* @ob_pipeline_wait_for_frameset
*
* @param[in] pipeline pipeline object
* @param[in] config Parameters to be configured
* @param[in] callback Trigger a callback when all frame data in the frameset arrives
* @param[in] user_data Pass in any user data and get it from the callback
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_start_with_callback(ob_pipeline *pipeline, ob_config *config, ob_frameset_callback callback, void *user_data, ob_error **error);
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);
/**
* @brief Stop pipeline
*
* @param[in] pipeline pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_stop(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT void ob_pipeline_stop(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Get the configuration object associated with the pipeline
* @brief Returns default configuration if the user has not configured
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_config* The configuration object
*/
ob_config *ob_pipeline_get_config(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT ob_config *ob_pipeline_get_config(const ob_pipeline *pipeline, ob_error **error);
/**
* @brief Switch the corresponding configuration
*
* @param[in] pipeline The pipeline object
* @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);
/**
* @brief Wait for a set of frames to be returned synchronously
*
* @param[in] pipeline The pipeline object
* @param[in] timeout_ms The timeout for waiting (in milliseconds)
* @param[out] error Log error messages
* @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.
* @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.
*/
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
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_device* The device object
*/
ob_device *ob_pipeline_get_device(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Get the playback object associated with the pipeline
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
* @return ob_playback* The playback object
*/
ob_playback *ob_pipeline_get_playback(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT ob_device *ob_pipeline_get_device(const ob_pipeline *pipeline, ob_error **error);
/**
* @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[out] error Log error messages
* @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_stream_profile_list *ob_pipeline_get_stream_profile_list(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 Dynamically (when pipeline is started) enable/disable frame synchronization is allowed.
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_enable_frame_sync(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT void ob_pipeline_enable_frame_sync(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Disable frame synchronization
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **error);
OB_EXPORT void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Dynamically switch the corresponding configuration
* @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
* @param[in] align_mode The input align mode
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @brief Create the pipeline configuration
*
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_config* The configuration object
*/
OB_EXPORT ob_config *ob_create_config(ob_error **error);
/**
* @brief Delete the pipeline configuration
*
* @param[in] config The configuration to be deleted
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_config(ob_config *config, ob_error **error);
/**
* @brief Enable a stream with default profile
*
* @param[in] config The pipeline configuration object
* @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);
/**
* @brief Enable all streams in the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[out] error Log error messages
*/
void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *config, ob_error **error);
OB_EXPORT void ob_config_enable_all_stream(ob_config *config, ob_error **error);
/**
* @brief Enable a stream according to the stream profile
*
* @param[in] config The pipeline configuration object
* @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);
/**
* @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.
*
* @param config[in] The pipeline configuration object
* @param stream_type[in] The type of the stream to be enabled
* @param width[in] The width of the video stream
* @param height[in] The height of the video stream
* @param fps[in] The frame rate of the video stream
* @param format[in] The format of the video stream
* @param error[out] 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);
/**
* @brief Enable accelerometer stream with specified parameters
*
* @param config[in] The pipeline configuration object
* @param full_scale_range[in] The full scale range of the accelerometer
* @param sample_rate[in] The sample rate of the accelerometer
* @param error[out] 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);
/**
* @brief Enable gyroscope stream with specified parameters
*
* @param config[in] The pipeline configuration object
* @param full_scale_range[in] The full scale range of the gyroscope
* @param sample_rate[in] The sample rate of the gyroscope
* @param error[out] 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);
/**
* @brief Get the enabled stream profile list in the pipeline configuration
*
* @param config The pipeline configuration object
* @param 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
*/
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
*
* @param[in] config The pipeline configuration object
* @param[in] type The type of stream to be disabled
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_config_disable_stream(ob_config *config, ob_stream_type type, ob_error **error);
/**
* @brief Disable all streams in the pipeline configuration
*
* @param[in] config The pipeline configuration object
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_config_disable_all_stream(ob_config *config, ob_error **error);
/**
* @brief Set the alignment mode for the pipeline configuration
*
* @param[in] config The pipeline configuration object
* @param[in] mode The alignment mode to be set
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_config_set_align_mode(ob_config *config, ob_align_mode mode, ob_error **error);
/**
* @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.
*
* @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);
/**
* @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] 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[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);
/**
* @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
*
* @param[in] pipeline pipeline object
* @param[out] error Log error messages
* @return ob_camera_param The camera internal parameters
*/
OB_EXPORT ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Get the current camera parameters
@@ -166,18 +341,9 @@ void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *config, ob_erro
* @param[out] error Log error messages
* @return ob_camera_param returns camera internal parameters
*/
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 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
*
* @param[in] pipeline pipeline object
* @param[out] error Log error messages
* @return ob_camera_param The camera internal parameters
*/
ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, 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
@@ -187,202 +353,15 @@ ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, ob_error **e
* @param[out] error Log error messages
* @return ob_calibration_param The calibration parameters
*/
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);
/**
* @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
* @param[in] align_mode The input align mode
* @param[out] error Log error messages
* @return ob_stream_profile_list* The list of D2C-enabled depth sensor resolutions
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
ob_stream_profile_list *ob_get_d2c_depth_profile_list(ob_pipeline *pipeline, ob_stream_profile *color_profile, ob_align_mode align_mode, ob_error **error);
/**
* @brief Get the valid area after D2C (DEPRECATED)
*
* @param[in] pipeline The pipeline object
* @param[in] distance The working distance
* @param[out] error Log error messages
* @return ob_rect The area information that is valid after D2C at the working distance
*/
ob_rect ob_get_d2c_valid_area(ob_pipeline *pipeline, uint32_t distance, ob_error **error);
/**
* @brief Get the valid area between the minimum distance and maximum distance after D2C
*
* @param[in] pipeline The pipeline object
* @param[in] minimum_distance The minimum working distance
* @param[in] maximum_distance The maximum working distance
* @param[out] error Log error messages
* @return ob_rect The area information that is valid after D2C at the working distance
*/
ob_rect ob_get_d2c_range_valid_area(ob_pipeline *pipeline, uint32_t minimum_distance, uint32_t maximum_distance, ob_error **error);
/**
* @brief Start recording
*
* @param[in] pipeline The pipeline object
* @param[in] file_name The recorded file path
* @param[out] error Log error messages
*/
void ob_pipeline_start_record(ob_pipeline *pipeline, const char *file_name, ob_error **error);
/**
* @brief Stop recording
*
* @param[in] pipeline The pipeline object
* @param[out] error Log error messages
*/
void ob_pipeline_stop_record(ob_pipeline *pipeline, ob_error **error);
/**
* @brief Create the pipeline configuration
*
* @param[out] error Log error messages
* @return ob_config* The configuration object
*/
ob_config *ob_create_config(ob_error **error);
/**
* @brief Delete the pipeline configuration
*
* @param[in] config The configuration to be deleted
* @param[out] error Log error messages
*/
void ob_delete_config(ob_config *config, ob_error **error);
/**
* @brief Enable the specified stream in the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[in] profile The stream configuration to be enabled
* @param[out] error Log error messages
*/
void ob_config_enable_stream(ob_config *config, ob_stream_profile *profile, ob_error **error);
/**
* @brief Enable a video stream to be used in the configuration.
*
* This function configures and enables a video stream with specific parameters.
* Users must specify all parameters explicitly as C does not support default arguments.
* Refer to the product manual for details on supported resolutions and formats for different camera models.
*
* @param config Pointer to the configuration structure.
* @param type The video stream type.
* @param width The video stream width.
* @param height The video stream height.
* @param fps The video stream frame rate.
* @param format The video stream format.
* @param error Pointer to store the error if operation fails.
*/
void ob_config_enable_video_stream(ob_config *config, ob_stream_type type, int width, int height, int fps, ob_format format, ob_error **error);
/**
* @brief Enable an accelerometer stream to be used in the configuration.
*
* This function configures and enables an accelerometer stream with specific parameters.
* Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates,
* please refer to the product manual.
*
* @param config Pointer to the configuration structure.
* @param fullScaleRange The full-scale range of the accelerometer.
* @param sampleRate The sample rate of the accelerometer.
* @param error Pointer to store the error if operation fails.
*/
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 a gyroscope stream to be used in the configuration.
*
* This function configures and enables a gyroscope stream with specific parameters.
* Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates,
* please refer to the product manual.
*
* @param config Pointer to the configuration structure.
* @param fullScaleRange The full-scale range of the gyroscope.
* @param sampleRate The sample rate of the gyroscope.
* @param error Pointer to store the error if operation fails.
*/
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);
/**
* @deprecated Use @ref ob_config_enable_stream instead
* @brief Enable all streams in the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[out] error Log error messages
*/
void ob_config_enable_all_stream(ob_config *config, ob_error **error);
/**
* @brief Get the enabled stream profile list in the pipeline configuration
*
* @param config The pipeline configuration
* @param error Log error messages
* @return ob_stream_profile_list* The enabled stream profile list, should be released by @ref ob_delete_stream_profile_list after use
*/
ob_stream_profile_list *ob_config_get_enabled_stream_profile_list(ob_config *config, ob_error **error);
/**
* @brief Disable a specific stream in the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[in] type The type of stream to be disabled
* @param[out] error Log error messages
*/
void ob_config_disable_stream(ob_config *config, ob_stream_type type, ob_error **error);
/**
* @brief Disable all streams in the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[out] error Log error messages
*/
void ob_config_disable_all_stream(ob_config *config, ob_error **error);
/**
* @brief Set the alignment mode for the pipeline configuration
*
* @param[in] config The pipeline configuration
* @param[in] mode The alignment mode to be set
* @param[out] error Log error messages
*/
void ob_config_set_align_mode(ob_config *config, ob_align_mode mode, ob_error **error);
/**
* @brief Set whether depth scaling is required after setting D2C
*
* @param[in] config The pipeline configuration
* @param[in] enable Whether scaling is required
* @param[out] error Log error messages
*/
void ob_config_set_depth_scale_require(ob_config *config, bool enable, ob_error **error);
/**
* @brief Set the target resolution for D2C, which is applicable when the color stream is not enabled using the OrbbecSDK and the depth needs to be D2C
* Note: When using the OrbbecSDK to enable the color stream, this interface should also be used to set the D2C target resolution. The configuration of the
* enabled color stream is preferred for D2C.
*
* @param[in] config The pipeline configuration
* @param[in] d2c_target_width The target width for D2C
* @param[in] d2c_target_height The target height for D2C
* @param[out] error Log error messages
*/
void ob_config_set_d2c_target_resolution(ob_config *config, uint32_t d2c_target_width, uint32_t d2c_target_height, 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.
*
* @param[in] config The pipeline configuration
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE)
* @param[out] error Log error messages
*/
void ob_config_set_frame_aggregate_output_mode(ob_config *config, ob_frame_aggregate_output_mode mode, ob_error **error);
#define ob_config_set_depth_scale_require ob_config_set_depth_scale_after_align_require
#ifdef __cplusplus
}
@@ -6,11 +6,7 @@
* @brief Control command property list maintenance
*/
#ifdef OB_SENSOR_SDK_DEVELOPER
#include "libobsensor/internal/InternalProperty.h"
#else // not define OB_SENSOR_SDK_DEVELOPER
#ifndef _OB_PROPERTY_H_
#define _OB_PROPERTY_H_
#pragma once
#include "ObTypes.h"
@@ -52,6 +48,12 @@ typedef enum {
*/
OB_PROP_FLOOD_LEVEL_INT = 7,
/**
* @brief Enable/disable temperature compensation
*
*/
OB_PROP_TEMPERATURE_COMPENSATION_BOOL = 8,
/**
* @brief Depth mirror
*/
@@ -213,6 +215,11 @@ typedef enum {
*/
OB_PROP_D2C_PREPROCESS_BOOL = 91,
/**
* @brief Enable/disable GPM function
*/
OB_PROP_GPM_BOOL = 93,
/**
* @brief Custom RGB cropping switch, 0 is off, 1 is on custom cropping, and the ROI cropping area is issued
*/
@@ -384,10 +391,6 @@ typedef enum {
* @brief Query the status of laser pulse width protection (read-only)
*/
OB_PROP_LASER_PULSE_WIDTH_PROTECTION_STATUS_BOOL = 149,
/**
* @brief depth noise removal filter
*/
OB_PROP_DEPTH_NOISE_REMOVAL_FILTER_BOOL = 165,
/**
* @brief Laser always on, true: always on, false: off, laser will be turned off when out of exposure time
@@ -418,7 +421,7 @@ typedef enum {
OB_PROP_IR_BRIGHTNESS_INT = 184,
/**
* @brief slave device sync status
* @brief Slave/secondary device synchronization status (read-only)
*/
OB_PROP_SLAVE_DEVICE_SYNC_STATUS_BOOL = 188,
@@ -428,20 +431,15 @@ typedef enum {
OB_PROP_COLOR_AE_MAX_EXPOSURE_INT = 189,
/**
* @brief IR AE max exposure
* @brief Max exposure time of IR auto exposure
*/
OB_PROP_IR_AE_MAX_EXPOSURE_INT = 190,
/**
* @brief disparity search range mode
* @brief Disparity search range mode, 1: 128, 2: 256
*/
OB_PROP_DISP_SEARCH_RANGE_MODE_INT = 191,
/**
* @brief cpu temperature correction . true: calibrate temperature
*/
OB_PROP_CPU_TEMPERATURE_CALIBRATION_BOOL = 199,
/**
* @brief Baseline calibration parameters
*/
@@ -721,11 +719,6 @@ typedef enum {
*/
OB_PROP_SDK_IR_RIGHT_FRAME_UNPACK_BOOL = 3012,
/**
* @brief depth Margin Filter
*/
OB_PROP_SDK_DEPTH_RECTIFY_MG_FILTER_BOOL = 3013,
/**
* @brief Calibration JSON file read from device (Femto Mega, read only)
*/
@@ -764,6 +757,3 @@ typedef struct OBPropertyItem {
#ifdef __cplusplus
}
#endif
#endif // _OB_PROPERTY_H_
#endif // OB_SENSOR_SDK_DEVELOPER
@@ -1,132 +0,0 @@
/**
* @file RecordPlayback.h
* @brief Header file for recording and playback functions.
*/
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "ObTypes.h"
/**
* @brief Create a recorder for data recording.
*
* @param[out] error Pointer to log error messages.
* @return Pointer to the recorder object.
*/
ob_recorder *ob_create_recorder(ob_error **error);
/**
* @brief Create a recorder for data recording.
*
* @param dev The device object used to create the recorder.
* @param[out] error Pointer to log error messages.
* @return Pointer to the recorder object.
*/
ob_recorder *ob_create_recorder_with_device(ob_device *dev, ob_error **error);
/**
* @brief Delete the recorder object.
*
* @param recorder Pointer to the recorder object.
* @param[out] error Pointer to log error messages.
*/
void ob_delete_recorder(ob_recorder *recorder, ob_error **error);
/**
* @brief Start recording.
*
* @param[in] recorder Pointer to the recorder object.
* @param[in] filename Recorded file name.
* @param[in] async Whether to record asynchronously.
* @param[out] error Pointer to log error messages.
*/
void ob_recorder_start(ob_recorder *recorder, const char *filename, bool async, ob_error **error);
/**
* @brief Stop recording.
*
* @param[in] recorder Pointer to the recorder object.
* @param[out] error Pointer to log error messages.
*/
void ob_recorder_stop(ob_recorder *recorder, ob_error **error);
/**
* @brief Write frame data to the recorder.
*
* @param[in] recorder Pointer to the recorder object.
* @param[in] frame Pointer to the frame data to write.
* @param[out] error Pointer to log error messages.
*/
void ob_recorder_write_frame(ob_recorder *recorder, ob_frame *frame, ob_error **error);
/**
* @brief Create a playback object.
*
* @param[in] filename Playback filename.
* @param[out] error Pointer to log error messages.
* @return Pointer to the playback object.
*/
ob_playback *ob_create_playback(const char *filename, ob_error **error);
/**
* @brief Delete the playback object.
*
* @param[in] playback Pointer to the playback object.
* @param[out] error Pointer to log error messages.
*/
void ob_delete_playback(ob_playback *playback, ob_error **error);
/**
* @brief Start playback, with data returned from the callback.
*
* @param[in] playback Pointer to the playback object.
* @param[in] callback Callback function for playback data.
* @param[in] user_data User data.
* @param[in] type Type of playback data.
* @param[out] error Pointer to log error messages.
*/
void ob_playback_start(ob_playback *playback, ob_playback_callback callback, void *user_data, ob_media_type type, ob_error **error);
/**
* @brief Stop playback.
*
* @param[in] playback Pointer to the playback object.
* @param[out] error Pointer to log error messages.
*/
void ob_playback_stop(ob_playback *playback, ob_error **error);
/**
* @brief Set the playback state.
*
* @param[in] playback Pointer to the playback object.
* @param[in] callback Playback status callback function.
* @param[in] user_data User data.
* @param[out] error Pointer to log error messages.
*/
void ob_set_playback_state_callback(ob_playback *playback, ob_media_state_callback callback, void *user_data, ob_error **error);
/**
* @brief Get the device information in the recording file.
*
* @param[in] playback Pointer to the playback object.
* @param[out] error Pointer to log error messages.
* @return Pointer to the device information.
*/
ob_device_info *ob_playback_get_device_info(ob_playback *playback, ob_error **error);
/**
* @brief Get the intrinsic and extrinsic parameter information in the recording file.
*
* @param[in] playback Pointer to the playback object.
* @param[out] error Pointer to log error messages.
* @return Camera intrinsic and extrinsic parameter.
*/
ob_camera_param ob_playback_get_camera_param(ob_playback *playback, ob_error **error);
#ifdef __cplusplus
}
#endif
@@ -17,7 +17,7 @@ extern "C" {
* @param[out] error Logs error messages.
* @return The sensor type.
*/
ob_sensor_type ob_sensor_get_type(ob_sensor *sensor, ob_error **error);
OB_EXPORT ob_sensor_type ob_sensor_get_type(const ob_sensor *sensor, ob_error **error);
/**
* @brief Get a list of all supported stream profiles.
@@ -26,53 +26,7 @@ ob_sensor_type ob_sensor_get_type(ob_sensor *sensor, ob_error **error);
* @param[out] error Logs error messages.
* @return A list of stream profiles.
*/
ob_stream_profile_list *ob_sensor_get_stream_profile_list(ob_sensor *sensor, ob_error **error);
/**
* @brief Request the list of recommended filter list
*
* @param[in] sensor The ob_sensor object.
* @param[out] error Log error messages.
*
* @return ob_filter_list
*/
ob_filter_list *ob_sensor_get_recommended_filter_list(ob_sensor *sensor, ob_error **error);
/**
* @brief Get the number of recommended filter list
*
* @param filter_list Recommended filter list
* @param error Log error messages
* @return uint32_t The number of list
*/
uint32_t ob_filter_list_get_count(ob_filter_list *filter_list, ob_error **error);
/**
* @brief Get the number of recommended filter list
*
* @param filter_list Recommended filter list
* @param index Recommended filter index
* @param error Log error messages
* @return ob_filter The index of ob_filter
*/
ob_filter *ob_get_filter(ob_filter_list *filter_list, uint32_t index, ob_error **error);
/**
* @brief Get the name of ob_filter
*
* @param filter ob_filter object
* @param error Log error messages
* @return char The filter of name
*/
const char *ob_get_filter_name(ob_filter *filter, ob_error **error);
/**
* @brief Delete a list of ob_filter objects.
*
* @param[in] filter_list The list of ob_filter objects to delete.
* @param[out] error Logs error messages.
*/
void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error);
OB_EXPORT ob_stream_profile_list *ob_sensor_get_stream_profile_list(const ob_sensor *sensor, ob_error **error);
/**
* @brief Open the current sensor and set the callback data frame.
@@ -83,7 +37,7 @@ void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error);
* @param[in] user_data Any user data to pass in and get from the callback.
* @param[out] error Logs error messages.
*/
void ob_sensor_start(ob_sensor *sensor, ob_stream_profile *profile, ob_frame_callback callback, void *user_data, ob_error **error);
OB_EXPORT void ob_sensor_start(ob_sensor *sensor, const ob_stream_profile *profile, ob_frame_callback callback, void *user_data, ob_error **error);
/**
* @brief Stop the sensor stream.
@@ -91,24 +45,34 @@ void ob_sensor_start(ob_sensor *sensor, ob_stream_profile *profile, ob_frame_cal
* @param[in] sensor The sensor object.
* @param[out] error Logs error messages.
*/
void ob_sensor_stop(ob_sensor *sensor, ob_error **error);
OB_EXPORT void ob_sensor_stop(ob_sensor *sensor, ob_error **error);
/**
* @brief Dynamically switch resolutions.
* @brief Switch resolutions.
*
* @param[in] sensor The sensor object.
* @param[in] profile The stream configuration information.
* @param[out] error Logs error messages.
*/
void ob_sensor_switch_profile(ob_sensor *sensor, ob_stream_profile *profile, ob_error **error);
OB_EXPORT void ob_sensor_switch_profile(ob_sensor *sensor, ob_stream_profile *profile, ob_error **error);
/**
* @brief Delete a list of sensor objects.
* @brief Delete a sensor object.
*
* @param[in] sensor_list The list of sensor objects to delete.
* @param[in] sensor The sensor object to delete.
* @param[out] error Logs error messages.
*/
void ob_delete_sensor_list(ob_sensor_list *sensor_list, ob_error **error);
OB_EXPORT void ob_delete_sensor(ob_sensor *sensor, ob_error **error);
/**
* @brief Request the list of recommended filter list.
*
* @param[in] sensor The ob_sensor object.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return ob_filter_list
*/
OB_EXPORT ob_filter_list *ob_sensor_get_recommended_filter_list(const ob_sensor *sensor, ob_error **error);
/**
* @brief Get the number of sensors in the sensor list.
@@ -117,7 +81,7 @@ void ob_delete_sensor_list(ob_sensor_list *sensor_list, ob_error **error);
* @param[out] error Logs error messages.
* @return The number of sensors in the list.
*/
uint32_t ob_sensor_list_get_sensor_count(ob_sensor_list *sensor_list, ob_error **error);
OB_EXPORT uint32_t ob_sensor_list_get_count(const ob_sensor_list *sensor_list, ob_error **error);
/**
* @brief Get the sensor type.
@@ -127,7 +91,7 @@ uint32_t ob_sensor_list_get_sensor_count(ob_sensor_list *sensor_list, ob_error *
* @param[out] error Logs error messages.
* @return The sensor type.
*/
ob_sensor_type ob_sensor_list_get_sensor_type(ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
OB_EXPORT ob_sensor_type ob_sensor_list_get_sensor_type(const ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
/**
* @brief Get a sensor by sensor type.
@@ -137,7 +101,7 @@ ob_sensor_type ob_sensor_list_get_sensor_type(ob_sensor_list *sensor_list, uint3
* @param[out] error Logs error messages.
* @return The sensor pointer. If the specified type of sensor does not exist, it will return null.
*/
ob_sensor *ob_sensor_list_get_sensor_by_type(ob_sensor_list *sensor_list, ob_sensor_type sensorType, ob_error **error);
OB_EXPORT ob_sensor *ob_sensor_list_get_sensor_by_type(const ob_sensor_list *sensor_list, ob_sensor_type sensorType, ob_error **error);
/**
* @brief Get a sensor by index number.
@@ -147,15 +111,17 @@ ob_sensor *ob_sensor_list_get_sensor_by_type(ob_sensor_list *sensor_list, ob_sen
* @param[out] error Logs error messages.
* @return The sensor object.
*/
ob_sensor *ob_sensor_list_get_sensor(ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
OB_EXPORT ob_sensor *ob_sensor_list_get_sensor(const ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
/**
* @brief Delete a sensor object.
* @brief Delete a list of sensor objects.
*
* @param[in] sensor The sensor object to delete.
* @param[in] sensor_list The list of sensor objects to delete.
* @param[out] error Logs error messages.
*/
void ob_delete_sensor(ob_sensor *sensor, ob_error **error);
OB_EXPORT void ob_delete_sensor_list(ob_sensor_list *sensor_list, ob_error **error);
#define ob_sensor_list_get_sensor_count ob_sensor_list_get_count
#ifdef __cplusplus
}
@@ -11,208 +11,396 @@ extern "C" {
#include "ObTypes.h"
/**
* @brief Create a stream profile object
*
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @brief Create a video stream profile object
*
* @param[in] type Stream type
* @param[in] format Stream format
* @param[in] width Stream width
* @param[in] height Stream height
* @param[in] fps Stream frame rate
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @brief Create a accel stream profile object
*
* @param[in] full_scale_range Accel full scale range
* @param[in] sample_rate Accel sample rate
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @brief Create a gyro stream profile object
*
* @param[in] full_scale_range Gyro full scale range
* @param[in] sample_rate Gyro sample rate
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_stream_profile* return the accel 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);
/**
* @brief Copy the stream profile object from an other stream profile object
*
* @param[in] srcProfile Source stream profile object
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @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);
/**
* @brief Copy the stream profile object with a new format object
*
* @param[in] profile Stream profile object
* @param[in] new_format New format
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @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);
/**
* @brief Delete the stream configuration.
*
* @param[in] profile Stream profile object .
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
OB_EXPORT void ob_delete_stream_profile(const ob_stream_profile *profile, ob_error **error);
/**
* @brief Get stream profile format
*
* @param[in] profile Stream profile object
* @param[out] error Log error messages
* @param[in] profile Stream profile object
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_format return the format of the stream
*/
ob_format ob_stream_profile_format(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
*
* @param[in] profile Stream profile object
* @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);
/**
* @brief Get stream profile type
*
* @param[in] profile Stream profile object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_stream_type stream type
*/
ob_stream_type ob_stream_profile_type(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
*
* @param[in] profile Stream profile object
* @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);
/**
* @brief Get the extrinsic for source stream to target stream
*
* @param source Source stream profile
* @param target Target stream profile
* @param error Log error messages
* @param[in] source Source stream profile
* @param[in] target Target stream profile
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_extrinsic The extrinsic
*/
ob_extrinsic ob_stream_profile_get_extrinsic_to(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
*
* @param[in] profile Stream profile object
* @param[in] target Target stream type
* @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);
/**
* @brief Get the frame rate of the video stream
*
* @param[in] profile Stream profile object
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return uint32_t return the frame rate of the stream
*/
uint32_t ob_video_stream_profile_fps(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[out] error Log error messages
* @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
*/
uint32_t ob_video_stream_profile_width(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] 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);
/**
* @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[out] error Log error messages
* @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
*/
uint32_t ob_video_stream_profile_height(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 Get the intrinsic of the video stream
* @brief Set the height of the video stream
*
* @param profile Stream profile object
* @param error Log error messages
* @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);
/**
* @brief Get the intrinsic of the video stream profile
*
* @param[in] profile Stream profile object
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_camera_intrinsic Return the intrinsic of the stream
*/
ob_camera_intrinsic ob_video_stream_get_intrinsic(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 Get the distortion of the video stream
* @brief Set the intrinsic of the video stream profile
*
* @param profile Stream profile object
* @param error Log error messages
* @param[in] profile Stream profile object
* @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);
/**
* @brief Get the distortion of the video stream profile
*
* @param[in] profile Stream profile object
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return ob_camera_distortion Return the distortion of the stream
*/
ob_camera_distortion ob_video_stream_get_distortion(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
*
* @param[in] profile Stream profile object
* @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);
/**
* @brief Get the process param of the disparity stream
*
* @param[in] profile Stream profile object
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @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] intrinsic 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);
/**
* @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[out] error Log error messages.
* @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_accel_full_scale_range ob_accel_stream_profile_full_scale_range(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[out] error Log error messages.
* @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_accel_sample_rate ob_accel_stream_profile_sample_rate(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 profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
* @param error Log error messages.
* @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_accel_intrinsic ob_accel_stream_profile_get_intrinsic(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] 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);
/**
* @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[out] error Log error messages.
* @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_gyro_full_scale_range ob_gyro_stream_profile_full_scale_range(ob_stream_profile *profile, ob_error **error);
/**
* @brief Get the intrinsic of the gyroscope stream.
*
* @param profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
* @param error Log error messages.
* @return ob_gyro_intrinsic Return the intrinsic of the gyroscope stream.
*/
ob_gyro_intrinsic ob_gyro_stream_get_intrinsic(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[out] error Log error messages.
* @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_gyro_sample_rate ob_gyro_stream_profile_sample_rate(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[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);
/**
* @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] 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);
/**
* @brief Get the number of StreamProfile lists.
*
* @param[in] profile_list StreamProfile list.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @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);
/**
* @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.
*
* @param[in] profile_list StreamProfile lists.
* @param[in] index Index.
* @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_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.
*
* @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] fps Frame rate. If you don't need to add matching conditions, you can pass OB_FPS_ANY.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
* @return The matching profile.
*/
ob_stream_profile *ob_stream_profile_list_get_video_stream_profile(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.
*
* @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] fullScaleRange Full-scale range. If you don't need to add matching conditions, you can pass 0.
* @param[in] sampleRate Sample rate. If you don't need to add matching conditions, you can pass 0.
* @param[out] error Log error messages.
* @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_stream_profile *ob_stream_profile_list_get_accel_stream_profile(ob_stream_profile_list *profile_list, ob_accel_full_scale_range fullScaleRange,
ob_accel_sample_rate sampleRate, 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.
*
* @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] fullScaleRange Full-scale range. If you don't need to add matching conditions, you can pass 0.
* @param[in] sampleRate Sample rate. If you don't need to add matching conditions, you can pass 0.
* @param[out] error Log error messages.
* @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_stream_profile *ob_stream_profile_list_get_gyro_stream_profile(ob_stream_profile_list *profile_list, ob_gyro_full_scale_range fullScaleRange,
ob_gyro_sample_rate sampleRate, ob_error **error);
/**
* @brief Get the corresponding StreamProfile by subscripting.
*
* @param[in] profile_list StreamProfile lists.
* @param[in] index Index.
* @param[out] error Log error messages.
* @return The matching profile.
*/
ob_stream_profile *ob_stream_profile_list_get_profile(ob_stream_profile_list *profile_list, int index, ob_error **error);
/**
* @brief Get the number of StreamProfile lists.
*
* @param[in] profile_list StreamProfile list.
* @param[out] error Log error messages.
* @return The number of StreamProfile lists.
*/
uint32_t ob_stream_profile_list_count(ob_stream_profile_list *profile_list, 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 Delete the stream profile list.
*
* @param[in] profile_list Stream configuration list.
* @param[out] error Log error messages.
* @param[out] error Pointer to an error object that will be set if an error occurs.
*/
void ob_delete_stream_profile_list(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);
/**
* @brief Delete the stream configuration.
*
* @param[in] profile Stream profile object .
* @param[out] error Log error messages.
* In order to be compatible with the closed source version of orbbecsdk's interface.
* We recommend using the latest interface names for a better experience.
*/
void ob_delete_stream_profile(ob_stream_profile *profile, ob_error **error);
#define ob_stream_profile_format ob_stream_profile_get_format
#define ob_stream_profile_type ob_stream_profile_get_type
#define ob_video_stream_profile_fps ob_video_stream_profile_get_fps
#define ob_video_stream_profile_width ob_video_stream_profile_get_width
#define ob_video_stream_profile_height ob_video_stream_profile_get_height
#define ob_accel_stream_profile_full_scale_range ob_accel_stream_profile_get_full_scale_range
#define ob_accel_stream_profile_sample_rate ob_accel_stream_profile_get_sample_rate
#define ob_gyro_stream_profile_full_scale_range ob_gyro_stream_profile_get_full_scale_range
#define ob_gyro_stream_profile_sample_rate ob_gyro_stream_profile_get_sample_rate
#define ob_stream_profile_list_count ob_stream_profile_list_get_count
#ifdef __cplusplus
}
@@ -0,0 +1,90 @@
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "ObTypes.h"
/**
* @brief Convert OBFormat to " char* " type and then return.
*
* @param[in] type OBFormat type.
* @return OBFormat of "char*" type.
*/
OB_EXPORT const char* ob_format_type_to_string(OBFormat type);
/**
* @brief Convert OBFrameType to " char* " type and then return.
*
* @param[in] type OBFrameType type.
* @return OBFrameType of "char*" type.
*/
OB_EXPORT const char* ob_frame_type_to_string(OBFrameType type);
/**
* @brief Convert OBStreamType to " char* " type and then return.
*
* @param[in] type OBStreamType type.
* @return OBStreamType of "char*" type.
*/
OB_EXPORT const char* ob_stream_type_to_string(OBStreamType type);
/**
* @brief Convert OBSensorType to " char* " type and then return.
*
* @param[in] type OBSensorType type.
* @return OBSensorType of "char*" type.
*/
OB_EXPORT const char* ob_sensor_type_to_string(OBSensorType type);
/**
* @brief Convert OBIMUSampleRate to " char* " type and then return.
*
* @param[in] type OBIMUSampleRate type.
* @return OBIMUSampleRate of "char*" type.
*/
OB_EXPORT const char* ob_imu_rate_type_to_string(OBIMUSampleRate type);
/**
* @brief Convert OBGyroFullScaleRange to " char* " type and then return.
*
* @param[in] type OBGyroFullScaleRange type.
* @return OBGyroFullScaleRange of "char*" type.
*/
OB_EXPORT const char* ob_gyro_range_type_to_string(OBGyroFullScaleRange type);
/**
* @brief Convert OBAccelFullScaleRange to " char* " type and then return.
*
* @param[in] type OBAccelFullScaleRange type.
* @return OBAccelFullScaleRange of "char*" type.
*/
OB_EXPORT const char* ob_accel_range_type_to_string(OBAccelFullScaleRange type);
/**
* @brief Convert OBFrameMetadataType to " char* " type and then return.
*
* @param[in] type OBFrameMetadataType type.
* @return OBFrameMetadataType of "char*" type.
*/
OB_EXPORT const char* ob_meta_data_type_to_string(OBFrameMetadataType type);
/**
* @brief Convert OBStreamType to OBSensorType.
*
* @param[in] type The sensor type to convert.
* @return OBStreamType The corresponding stream type.
*/
OB_EXPORT OBStreamType ob_sensor_type_to_stream_type(OBSensorType type);
/**
* @brief Convert OBFormat to " char* " type and then return.
*
* @param format The OBFormat to convert.
* @return The string.
*/
OB_EXPORT const char *ob_format_to_string(OBFormat format);
#ifdef __cplusplus
}
#endif
+51 -82
View File
@@ -9,134 +9,103 @@ extern "C" {
/**
* @brief Transform a 3d point of a source coordinate system into a 3d point of the target coordinate system.
*
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @param[in] source_point3f Source 3d point value
* @param[in] source_sensor_type Source sensor type
* @param[in] target_sensor_type Target sensor type
* @param[in] extrinsic Transformation matrix from source to target
* @param[out] target_point3f Target 3d point value
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Transform result
*/
bool ob_calibration_3d_to_3d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
OB_EXPORT bool ob_transformation_3d_to_3d(const OBPoint3f source_point3f, OBExtrinsic extrinsic, OBPoint3f *target_point3f, ob_error **error) ;
/**
* @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] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @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] source_sensor_type Source sensor type
* @param[in] target_sensor_type Target sensor type
* @param[in] extrinsic Transformation matrix from source to target
* @param[out] target_point3f Target 3d point value
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Transform result
*/
bool ob_calibration_2d_to_3d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
OB_EXPORT bool ob_transformation_2d_to_3d(const OBPoint2f source_point2f, const float source_depth_pixel_value, const OBCameraIntrinsic source_intrinsic,
OBExtrinsic extrinsic, OBPoint3f *target_point3f, ob_error **error);
/**
* @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] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @param[in] source_point2f Source 2d point value
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
* @param[in] source_sensor_type Source sensor type
* @param[in] target_sensor_type Target sensor type
* @param[out] target_point3f Target 3d point value
* @param[out] error Log error messages
*
* @return bool Transform result
*/
bool ob_calibration_2d_to_3d_undistortion(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point3f *target_point3f,
ob_error **error);
/**
* @brief Transform a 3d point of a source coordinate system into a 2d pixel coordinate of the target camera.
*
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @param[in] source_point3f Source 3d point value
* @param[in] source_sensor_type Source sensor type
* @param[in] target_sensor_type Target sensor type
* @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
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Transform result
*/
bool ob_calibration_3d_to_2d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
OB_EXPORT bool ob_transformation_3d_to_2d(const OBPoint3f source_point3f, const OBCameraIntrinsic target_intrinsic, const OBCameraDistortion target_distortion,
OBExtrinsic extrinsic, OBPoint2f *target_point2f, ob_error **error);
/**
* @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] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @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] source_sensor_type Source sensor type
* @param[in] target_sensor_type Target sensor type
* @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
* @param[out] error Log error messages
* @param[out] error Pointer to an error object that will be set if an error occurs.
*
* @return bool Transform result
*/
bool ob_calibration_2d_to_2d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
OB_EXPORT bool ob_transformation_2d_to_2d(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);
/**
* @brief Transforms the depth frame into the geometry of the color camera.
*
* @param[in] device Device handle
* @param[in] depth_frame Input depth frame
* @param[in] target_color_camera_width Target color camera width
* @param[in] target_color_camera_height Target color camera height
* @param[out] error Log error messages
*
* @return ob_frame* Transformed depth frame
*/
ob_frame *transformation_depth_frame_to_color_camera(ob_device *device, ob_frame *depth_frame, uint32_t target_color_camera_width,
// \deprecated This function is deprecated and will be removed in a future version.
OB_EXPORT ob_frame *transformation_depth_frame_to_color_camera(ob_device *device, ob_frame *depth_frame, uint32_t target_color_camera_width,
uint32_t target_color_camera_height, ob_error **error);
/**
* @brief Init transformation tables
*
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
* @param[in] sensor_type sensor type
* @param[in] data input data,needs to be allocated externally.During initialization, the external allocation size is 'data_size', for example, data_size = 1920
* * 1080 * 2*sizeof(float) (1920 * 1080 represents the image resolution, and 2 represents two LUTs, one for x-coordinate and one for y-coordinate).
* @param[in] data_size input data size
* @param[out] xy_tables output xy tables
* @param[out] error Log error messages
*
* @return bool Transform result
*/
// \deprecated This function is deprecated and will be removed in a future version.
bool transformation_init_xy_tables(const ob_calibration_param calibration_param, const ob_sensor_type sensor_type, float *data, uint32_t *data_size,
ob_xy_tables *xy_tables, ob_error **error);
/**
* @brief Transform depth image to point cloud data
*
* @param[in] xy_tables input xy tables,see transformation_init_xy_tables
* @param[in] depth_image_data input depth image data
* @param[out] pointcloud_data output point cloud data
* @param[out] error Log error messages
*/
// \deprecated This function is deprecated and will be removed in a future version.
void transformation_depth_to_pointcloud(ob_xy_tables *xy_tables, const void *depth_image_data, void *pointcloud_data, ob_error **error);
/**
* @brief Transform depth image to point cloud data
*
* @param[in] xy_tables input xy tables,see transformation_init_xy_tables
* @param[in] depth_image_data input depth image data
* @param[in] color_image_data input color image data (only RGB888 support)
* @param[out] pointcloud_data output point cloud data
* @param[out] error Log error messages
*/
// \deprecated This function is deprecated and will be removed in a future version.
void transformation_depth_to_rgbd_pointcloud(ob_xy_tables *xy_tables, const void *depth_image_data, const void *color_image_data, void *pointcloud_data,
ob_error **error);
// \deprecated This function is deprecated and will be removed in a future version.
// Use the ob_transformation_3d_to_3d instead.
OB_EXPORT bool ob_calibration_3d_to_3d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
// \deprecated This function is deprecated and will be removed in a future version.
// Use the ob_transformation_2d_to_3d instead.
OB_EXPORT bool ob_calibration_2d_to_3d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
// \deprecated This function is deprecated and will be removed in a future version.
// Use the ob_transformation_3d_to_2d instead.
OB_EXPORT bool ob_calibration_3d_to_2d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
// \deprecated This function is deprecated and will be removed in a future version.
// Use the ob_transformation_2d_to_2d instead.
OB_EXPORT bool ob_calibration_2d_to_2d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
#ifdef __cplusplus
}
#endif
@@ -5,6 +5,8 @@
*/
#pragma once
#include "Export.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -14,28 +16,28 @@ extern "C" {
*
* @return int The SDK version number.
*/
int ob_get_version();
OB_EXPORT int ob_get_version();
/**
* @brief Get the SDK major version number.
*
* @return int The SDK major version number.
*/
int ob_get_major_version();
OB_EXPORT int ob_get_major_version();
/**
* @brief Get the SDK minor version number.
*
* @return int The SDK minor version number.
*/
int ob_get_minor_version();
OB_EXPORT int ob_get_minor_version();
/**
* @brief Get the SDK patch version number.
*
* @return int The SDK patch version number.
*/
int ob_get_patch_version();
OB_EXPORT int ob_get_patch_version();
/**
* @brief Get the SDK stage version.
@@ -43,7 +45,7 @@ int ob_get_patch_version();
*
* @return const char* The SDK stage version.
*/
const char *ob_get_stage_version();
OB_EXPORT const char *ob_get_stage_version();
#ifdef __cplusplus
}