1#ifndef _CHRONOPTICS_TOF_KEA_CAMERA_HPP_
2#define _CHRONOPTICS_TOF_KEA_CAMERA_HPP_
4#include <chronoptics/tof/kea_camera.h>
6#include <chronoptics/tof/camera.hpp>
7#include <chronoptics/tof/processing_config.hpp>
8#include <chronoptics/tof/camera_config.hpp>
10namespace chronoptics {
32 KeaCamera(StringView serial,
const ProcessingConfig &processing_config,
const CameraConfig &camera_config) :
KeaCamera(tof_kea_camera_new_both_configs(serial, *reinterpret_cast<const tof_processing_config_t*>(&processing_config), *reinterpret_cast<const tof_camera_config_t*>(&camera_config), TOF_ERROR_HANDLER{})) {}
45 KeaCamera(StringView serial,
const ProcessingConfig &processing_config) :
KeaCamera(tof_kea_camera_new(serial, *reinterpret_cast<const tof_processing_config_t*>(&processing_config), TOF_ERROR_HANDLER{})) {}
58 KeaCamera(StringView serial) :
KeaCamera(tof_kea_camera_new_simple(serial, TOF_ERROR_HANDLER{})) {}
64 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
65 return tof_kea_camera_on_camera_processing_capable(this_class, TOF_ERROR_HANDLER{});
72 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
73 return tof_kea_camera_get_on_camera_processing(this_class, TOF_ERROR_HANDLER{});
81 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
82 return tof_kea_camera_set_on_camera_processing(this_class, on_camera_processing, TOF_ERROR_HANDLER{});
89 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
90 return tof_kea_camera_set_camera_config(this_class, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), TOF_ERROR_HANDLER{});
98 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
99 return tof_kea_camera_set_configurations(this_class, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), *
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), TOF_ERROR_HANDLER{});
106 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
107 return tof_kea_camera_multiple_configurations_possible(this_class, TOF_ERROR_HANDLER{});
115 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
116 return tof_kea_camera_set_multiple_configurations(this_class,
reinterpret_cast<const tof_camera_config_t*
>(camera_configs.data()), camera_configs.size(),
reinterpret_cast<const tof_processing_config_t*
>(pro_configs.data()), pro_configs.size(), TOF_ERROR_HANDLER{});
123 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
124 return tof_kea_camera_set_process_config(this_class, *
reinterpret_cast<const tof_processing_config_t*
>(&config), TOF_ERROR_HANDLER{});
131class DiscoveredCamera :
public detail::Base<tof_discovered_camera, tof_discovered_camera_delete> {
142 return tof_discovered_camera_serial(this->ptr_, TOF_ERROR_HANDLER{});
149 return tof_discovered_camera_info(this->ptr_, TOF_ERROR_HANDLER{});
156 return tof_discovered_camera_model(this->ptr_, TOF_ERROR_HANDLER{});
163 return tof_discovered_camera_is_tui(this->ptr_, TOF_ERROR_HANDLER{});
171inline std::vector<DiscoveredCamera> discover_cameras() {
172 size_t size = tof_discover_cameras(
nullptr, 0, TOF_ERROR_HANDLER{});
173 std::vector<DiscoveredCamera> vec;
175 for (
size_t i = 0; i < size; i++)
176 vec.emplace_back(
static_cast<tof_discovered_camera_t
>(
nullptr));
177 auto data =
reinterpret_cast<tof_discovered_camera_t*
>(vec.data());
178 size = tof_discover_cameras(data, vec.size(), TOF_ERROR_HANDLER{});
197inline KeaCamera create_kea_camera_gige(
const ProcessingConfig &processing_config, StringView serial, uint16_t packet_size = 1472) {
198 KeaCamera new_kea_camera(
static_cast<tof_kea_camera_t
>(
nullptr));
199 auto ptr =
reinterpret_cast<tof_kea_camera_t*
>(&new_kea_camera);
200 *ptr = tof_create_kea_camera_gige(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, packet_size, TOF_ERROR_HANDLER{});
201 return new_kea_camera;
This class allows you to view/edit the camera settings.
Simple class containing information about found cameras.
bool is_tui() const
Check whether this camera is a TUI camera.
const char * model() const
Get the camera model name.
const char * info() const
Additional information about the discovered camera.
const char * serial() const
The serial.
DiscoveredCamera(tof_discovered_camera_t ptr=nullptr)
Construct from pointer.
The main interface to the kea camera.
bool multiple_configurations_possible() const
Check whether camera supports multiple configurations.
bool on_camera_processing_capable() const
Check whether this kea camera can do on camera processing.
KeaCamera(tof_kea_camera_t ptr=nullptr)
Construct from pointer.
KeaCamera(StringView serial, const ProcessingConfig &processing_config)
Construct the kea camera.
void set_on_camera_processing(bool on_camera_processing)
Set on camera processing.
void set_process_config(const ProcessingConfig &config)
the processing config of the camera
void set_multiple_configurations(const std::vector< CameraConfig > &camera_configs, const std::vector< ProcessingConfig > &pro_configs)
Set multiple configurations.
bool get_on_camera_processing() const
Get on camera processing.
void set_configurations(const CameraConfig &camera_config, const ProcessingConfig &processing_config)
Set both the camera and processing config.
KeaCamera(StringView serial, const ProcessingConfig &processing_config, const CameraConfig &camera_config)
Construct the kea camera with the given processing and camera config.
void set_camera_config(const CameraConfig &camera_config)
Set the camera config.
KeaCamera(StringView serial)
Construct the kea camera with a processing config generated by default_processing from the camera con...
Functions shared across all live cameras.
Processing that can be done.