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 IntegrationTime {
23enum class ImagingEnvironment {
38enum class ConfigMode {
39 LONG_RANGE_DYNAMIC_SCENE = 1,
40 MEDIUM_RANGE_DYNAMIC_SCENE = 2,
41 MEDIUM_RANGE_BALANCED = 3,
42 SHORT_RANGE_HIGH_SPEED = 4,
43 LONG_RANGE_HIGH_RESOLUTION = 5,
44 MEDIUM_RANGE_STATIC_SCENE = 6,
45 FAR_OUT_STATIC_SCENE = 7,
51class UserConfig :
public detail::Base<tof_user_config, tof_user_config_delete> {
61 this->ptr_ = tof_user_config_new_default(TOF_ERROR_HANDLER{});
69 CameraConfig new_camera_config(
static_cast<tof_camera_config_t
>(
nullptr));
70 auto ptr =
reinterpret_cast<tof_camera_config_t*
>(&new_camera_config);
71 *ptr = tof_user_config_to_camera_config(this->ptr_, *
reinterpret_cast<tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
72 return new_camera_config;
79 return static_cast<ImagingEnvironment
>(tof_user_config_get_environment(this->ptr_, TOF_ERROR_HANDLER{}));
86 return tof_user_config_set_environment(this->ptr_,
static_cast<tof_imaging_environment
>(imaging_environment), TOF_ERROR_HANDLER{});
93 return tof_user_config_get_max_distance(this->ptr_, TOF_ERROR_HANDLER{});
100 return tof_user_config_set_max_distance(this->ptr_, max_distance, TOF_ERROR_HANDLER{});
107 return tof_user_config_get_fps(this->ptr_, TOF_ERROR_HANDLER{});
114 return tof_user_config_set_fps(this->ptr_, fps, TOF_ERROR_HANDLER{});
121 return tof_user_config_get_lens_flare(this->ptr_, TOF_ERROR_HANDLER{});
128 return tof_user_config_set_lens_flare(this->ptr_, lens_flare, TOF_ERROR_HANDLER{});
135 return tof_user_config_get_translucent(this->ptr_, TOF_ERROR_HANDLER{});
142 return tof_user_config_set_translucent(this->ptr_, translucent, TOF_ERROR_HANDLER{});
151 return tof_user_config_get_hdr(this->ptr_, TOF_ERROR_HANDLER{});
160 return tof_user_config_set_hdr(this->ptr_, hdr, TOF_ERROR_HANDLER{});
167 return static_cast<IntegrationTime
>(tof_user_config_get_integration_time(this->ptr_, TOF_ERROR_HANDLER{}));
174 return tof_user_config_set_integration_time(this->ptr_,
static_cast<tof_integration_time
>(int_time), TOF_ERROR_HANDLER{});
181 return static_cast<Strategy
>(tof_user_config_get_strategy(this->ptr_, TOF_ERROR_HANDLER{}));
188 return tof_user_config_set_strategy(this->ptr_,
static_cast<tof_strategy
>(strategy), TOF_ERROR_HANDLER{});
196 return tof_user_config_get_channel(this->ptr_, TOF_ERROR_HANDLER{});
204 return tof_user_config_set_channel(this->ptr_, channel, TOF_ERROR_HANDLER{});
214inline CameraConfig config_mode_camera_config(Camera &camera, ConfigMode config_mode) {
215 CameraConfig new_camera_config(
static_cast<tof_camera_config_t
>(
nullptr));
216 auto ptr =
reinterpret_cast<tof_camera_config_t*
>(&new_camera_config);
217 *ptr = tof_config_mode_camera_config(*
reinterpret_cast<tof_camera_t*
>(&camera),
static_cast<tof_config_mode
>(config_mode), TOF_ERROR_HANDLER{});
218 return new_camera_config;
226inline ProcessingConfig config_mode_processing_config(Camera &camera, ConfigMode config_mode) {
227 ProcessingConfig new_processing_config(
static_cast<tof_processing_config_t
>(
nullptr));
228 auto ptr =
reinterpret_cast<tof_processing_config_t*
>(&new_processing_config);
229 *ptr = tof_config_mode_processing_config(*
reinterpret_cast<tof_camera_t*
>(&camera),
static_cast<tof_config_mode
>(config_mode), TOF_ERROR_HANDLER{});
230 return new_processing_config;
237inline bool hdr_possible(CameraConfig &config) {
238 return tof_hdr_possible(*
reinterpret_cast<tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
245inline bool phase_unwrap_possible(CameraConfig &config) {
246 return tof_phase_unwrap_possible(*
reinterpret_cast<tof_camera_config_t*
>(&config), TOF_ERROR_HANDLER{});
252inline void apply_default_processing_config(Camera &camera) {
253 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.
DEPRECATED, use config_mode.
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.