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>
14enum class IntegrationTime {
22enum class ImagingEnvironment {
37class UserConfig :
public detail::Base<tof_user_config, tof_user_config_delete> {
47 this->ptr_ = tof_user_config_new_default(TOF_ERROR_HANDLER{});
55 CameraConfig new_camera_config(
static_cast<tof_camera_config_t
>(
nullptr));
56 auto ptr =
reinterpret_cast<tof_camera_config_t*
>(&new_camera_config);
57 *ptr = tof_user_config_to_camera_config(this->ptr_, *
reinterpret_cast<tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
58 return new_camera_config;
65 return static_cast<ImagingEnvironment
>(tof_user_config_get_environment(this->ptr_, TOF_ERROR_HANDLER{}));
72 return tof_user_config_set_environment(this->ptr_,
static_cast<tof_imaging_environment
>(imaging_environment), TOF_ERROR_HANDLER{});
79 return tof_user_config_get_max_distance(this->ptr_, TOF_ERROR_HANDLER{});
86 return tof_user_config_set_max_distance(this->ptr_, max_distance, TOF_ERROR_HANDLER{});
93 return tof_user_config_get_fps(this->ptr_, TOF_ERROR_HANDLER{});
100 return tof_user_config_set_fps(this->ptr_, fps, TOF_ERROR_HANDLER{});
107 return tof_user_config_get_lens_flare(this->ptr_, TOF_ERROR_HANDLER{});
114 return tof_user_config_set_lens_flare(this->ptr_, lens_flare, TOF_ERROR_HANDLER{});
121 return tof_user_config_get_translucent(this->ptr_, TOF_ERROR_HANDLER{});
128 return tof_user_config_set_translucent(this->ptr_, translucent, TOF_ERROR_HANDLER{});
137 return tof_user_config_get_hdr(this->ptr_, TOF_ERROR_HANDLER{});
146 return tof_user_config_set_hdr(this->ptr_, hdr, TOF_ERROR_HANDLER{});
153 return static_cast<IntegrationTime
>(tof_user_config_get_integration_time(this->ptr_, TOF_ERROR_HANDLER{}));
160 return tof_user_config_set_integration_time(this->ptr_,
static_cast<tof_integration_time
>(int_time), TOF_ERROR_HANDLER{});
167 return static_cast<Strategy
>(tof_user_config_get_strategy(this->ptr_, TOF_ERROR_HANDLER{}));
174 return tof_user_config_set_strategy(this->ptr_,
static_cast<tof_strategy
>(strategy), TOF_ERROR_HANDLER{});
182 return tof_user_config_get_channel(this->ptr_, TOF_ERROR_HANDLER{});
190 return tof_user_config_set_channel(this->ptr_, channel, TOF_ERROR_HANDLER{});
199inline bool hdr_possible(CameraConfig &config) {
200 return tof_hdr_possible(*
reinterpret_cast<tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
207inline bool phase_unwrap_possible(CameraConfig &config) {
208 return tof_phase_unwrap_possible(*
reinterpret_cast<tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
214inline void apply_default_processing_config(Camera &camera) {
215 return tof_apply_default_processing_config(*
reinterpret_cast<tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
This class allows you to view/edit the camera settings.
The main interface to the depth cameras.
Simple interface for camera configuration generation.
bool get_translucent() const
Get if there are translucent objects in the scene.
UserConfig(tof_user_config_t ptr)
Construct from pointer.
float get_max_distance() const
Get the maximum distance photons reflect from.
void set_translucent(bool translucent)
Set if there are translucent objects in the scene.
CameraConfig to_camera_config(Camera &camera) const
Convert to a camera configuration.
bool get_lens_flare() const
Get if lens flare is expected in the scene.
UserConfig()
Create default user config.
void set_integration_time(IntegrationTime int_time)
Set the integration time.
void set_fps(float fps)
Set the depth frame rate.
void set_lens_flare(bool lens_flare)
Set if lens flare is expected in the scene.
Strategy get_strategy() const
Get what the configuration is being optimized for.
void set_max_distance(float max_distance)
Set the maximum distance photons reflect from.
void set_hdr(bool hdr)
Set high dynamic range enabled.
bool get_hdr() const
Get high dynamic range enabled.
void set_environment(ImagingEnvironment imaging_environment)
Set the camera operating environment.
void set_channel(int32_t channel)
Set The camera channel, increment to support multi-camera usage.
ImagingEnvironment get_environment() const
Get the camera operating environment.
void set_strategy(Strategy strategy)
Set what the configuration is being optimized for.
float get_fps() const
Get the depth frame rate.
IntegrationTime get_integration_time() const
Get the integration time.
int32_t get_channel() const
Get The camera channel, increment to support multi-camera usage.