1#ifndef _CHRONOPTICS_TOF_USER_CONFIG_HPP_
2#define _CHRONOPTICS_TOF_USER_CONFIG_HPP_
4#include <chronoptics/tof/user_config.h>
6#include <chronoptics/tof/camera_config.hpp>
7#include <chronoptics/tof/camera.hpp>
8#include <chronoptics/tof/processing_config.hpp>
10namespace chronoptics {
15enum class ConfigMode {
16 LONG_RANGE_DYNAMIC_SCENE = 1,
17 MEDIUM_RANGE_DYNAMIC_SCENE = 2,
18 MEDIUM_RANGE_BALANCED = 3,
19 SHORT_RANGE_HIGH_SPEED = 4,
20 LONG_RANGE_HIGH_RESOLUTION = 5,
21 MEDIUM_RANGE_STATIC_SCENE = 6,
22 FAR_OUT_STATIC_SCENE = 7,
30inline CameraConfig config_mode_camera_config(Camera &camera, ConfigMode config_mode) {
31 CameraConfig new_camera_config(
static_cast<tof_camera_config_t
>(
nullptr));
32 auto ptr =
reinterpret_cast<tof_camera_config_t*
>(&new_camera_config);
33 *ptr = tof_config_mode_camera_config(*
reinterpret_cast<tof_camera_t*
>(&camera),
static_cast<tof_config_mode
>(config_mode), TOF_ERROR_HANDLER{});
34 return new_camera_config;
42inline ProcessingConfig config_mode_processing_config(Camera &camera, ConfigMode config_mode) {
43 ProcessingConfig new_processing_config(
static_cast<tof_processing_config_t
>(
nullptr));
44 auto ptr =
reinterpret_cast<tof_processing_config_t*
>(&new_processing_config);
45 *ptr = tof_config_mode_processing_config(*
reinterpret_cast<tof_camera_t*
>(&camera),
static_cast<tof_config_mode
>(config_mode), TOF_ERROR_HANDLER{});
46 return new_processing_config;
53inline bool hdr_possible(
const CameraConfig &config) {
54 return tof_hdr_possible(*
reinterpret_cast<const tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
61inline bool phase_unwrap_possible(
const CameraConfig &config) {
62 return tof_phase_unwrap_possible(*
reinterpret_cast<const tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
68inline void apply_default_processing_config(Camera &camera) {
69 return tof_apply_default_processing_config(*
reinterpret_cast<tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});