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 {
18 KeaCamera(tof_kea_camera_t ptr =
nullptr) :
Camera(reinterpret_cast<tof_camera_t>(ptr)) {}
32 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, TOF_ERROR_HANDLER{}));
47 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new_simple(serial, TOF_ERROR_HANDLER{}));
63 this->ptr_ =
reinterpret_cast<tof_camera_t
>(tof_kea_camera_new_both_configs(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), TOF_ERROR_HANDLER{}));
70 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
71 return tof_kea_camera_on_camera_processing_capable(this_class, TOF_ERROR_HANDLER{});
78 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
79 return tof_kea_camera_get_on_camera_processing(this_class, TOF_ERROR_HANDLER{});
87 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
88 return tof_kea_camera_set_on_camera_processing(this_class, on_camera_processing, TOF_ERROR_HANDLER{});
96 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
97 return tof_kea_camera_get_delay(this_class, TOF_ERROR_HANDLER{});
105 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
106 return tof_kea_camera_set_delay(this_class, delay, TOF_ERROR_HANDLER{});
113 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
114 return tof_kea_camera_get_packet_size(this_class, TOF_ERROR_HANDLER{});
121 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
122 return tof_kea_camera_set_packet_size(this_class, size, TOF_ERROR_HANDLER{});
129 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
130 return tof_kea_camera_set_camera_config(this_class, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), TOF_ERROR_HANDLER{});
138 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
139 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{});
146 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
147 return tof_kea_camera_version(this_class, TOF_ERROR_HANDLER{});
154 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
155 return tof_kea_camera_software_trigger_capable(this_class, TOF_ERROR_HANDLER{});
161 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
162 return tof_kea_camera_software_trigger(this_class, TOF_ERROR_HANDLER{});
169 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
170 return tof_kea_camera_remote_update_capable(this_class, TOF_ERROR_HANDLER{});
181 auto this_class =
reinterpret_cast<tof_kea_camera_t
>(this->ptr_);
182 return tof_kea_camera_remote_update(this_class, file_location, TOF_ERROR_HANDLER{});
189class DiscoveredKea :
public detail::Base<tof_discovered_kea, tof_discovered_kea_delete> {
200 return tof_discovered_kea_serial(this->ptr_, TOF_ERROR_HANDLER{});
207 return tof_discovered_kea_info(this->ptr_, TOF_ERROR_HANDLER{});
215inline std::vector<DiscoveredKea> discover_kea_cameras() {
216 size_t size = tof_discover_kea_cameras(
nullptr, 0, TOF_ERROR_HANDLER{});
217 std::vector<DiscoveredKea> vec;
219 for (
size_t i = 0; i < size; i++)
220 vec.emplace_back(
static_cast<tof_discovered_kea_t
>(
nullptr));
221 auto data =
reinterpret_cast<tof_discovered_kea_t*
>(vec.data());
222 size = tof_discover_kea_cameras(data, vec.size(), TOF_ERROR_HANDLER{});
241inline KeaCamera create_kea_camera_gige(
const ProcessingConfig &processing_config, StringView serial, uint16_t packet_size = 1472) {
242 KeaCamera new_kea_camera(
static_cast<tof_kea_camera_t
>(
nullptr));
243 auto ptr =
reinterpret_cast<tof_kea_camera_t*
>(&new_kea_camera);
244 *ptr = tof_create_kea_camera_gige(*
reinterpret_cast<const tof_processing_config_t*
>(&processing_config), serial, packet_size, TOF_ERROR_HANDLER{});
245 return new_kea_camera;
This class allows you to view/edit the camera settings.
The main interface to the depth cameras.
Simple class containing information about found kea cameras.
const char * info() const
Additional information about the discovered camera.
const char * serial() const
The serial.
DiscoveredKea(tof_discovered_kea_t ptr=nullptr)
Construct from pointer.
The main interface to the kea camera.
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.
bool remote_update_capable()
Check whether the camera is capable of updating remotely.
void software_trigger()
Software trigger the camera.
void set_on_camera_processing(bool on_camera_processing)
Set on camera processing.
bool software_trigger_capable()
Check whether the camera is capable of software trigger.
void set_packet_size(uint16_t size)
Set maximum size of each network packet transmitted.
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.
uint32_t get_delay() const
Get delay between network packets.
uint16_t get_packet_size() const
Get maximum size of each network packet transmitted.
KeaCamera(const ProcessingConfig &processing_config, StringView serial, const CameraConfig &camera_config)
Construct the kea camera with the given processing and camera config.
const char * version()
Get the tof library version running on the camera.
void remote_update(StringView file_location)
Update the camera remotely.
void set_camera_config(const CameraConfig &camera_config)
Set the camera config.
void set_delay(uint32_t delay)
Set delay between network packets.
KeaCamera(StringView serial)
Construct the kea camera with a processing config generated by default_processing from the camera con...
KeaCamera(const ProcessingConfig &processing_config, StringView serial)
Construct the kea camera.
Processing that can be done.