1 #ifndef _CHRONOPTICS_TOF_CSF_WRITER_HPP_
2 #define _CHRONOPTICS_TOF_CSF_WRITER_HPP_
4 #include <chronoptics/tof/csf_writer.h>
6 #include <chronoptics/tof/camera_config.hpp>
7 #include <chronoptics/tof/calibration.hpp>
8 #include <chronoptics/tof/data.hpp>
9 #include <chronoptics/tof/csf_reader.hpp>
10 #include <chronoptics/tof/camera.hpp>
11 #include <chronoptics/tof/gige_interface.hpp>
12 #include <chronoptics/tof/usb_interface.hpp>
14 namespace chronoptics {
24 class CsfWriter :
public detail::Base<tof_csf_writer, tof_csf_writer_delete> {
38 this->ptr_ = tof_csf_writer_new(file_location, *
reinterpret_cast<const tof_camera_config_t*
>(&camera_config), *
reinterpret_cast<const tof_calibration_t*
>(&calibration), serial, TOF_ERROR_HANDLER{});
45 return tof_csf_writer_write_frame(this->ptr_, *
reinterpret_cast<const tof_data_t*
>(&frame), TOF_ERROR_HANDLER{});
55 inline CsfWriter create_csf_writer_reader(StringView file_location,
const CsfReader &reader) {
56 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
57 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
58 *ptr = tof_create_csf_writer_reader(file_location, *
reinterpret_cast<const tof_csf_reader_t*
>(&reader), TOF_ERROR_HANDLER{});
59 return new_csf_writer;
67 inline CsfWriter create_csf_writer_camera(StringView file_location,
const Camera &camera) {
68 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
69 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
70 *ptr = tof_create_csf_writer_camera(file_location, *
reinterpret_cast<const tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
71 return new_csf_writer;
79 inline CsfWriter create_csf_writer_gige_interface(StringView file_location,
const GigeInterface &gige_interface) {
80 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
81 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
82 *ptr = tof_create_csf_writer_gige_interface(file_location, *
reinterpret_cast<const tof_gige_interface_t*
>(&gige_interface), TOF_ERROR_HANDLER{});
83 return new_csf_writer;
91 inline CsfWriter create_csf_writer_usb_interface(StringView file_location,
const UsbInterface &usb_interface) {
92 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
93 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
94 *ptr = tof_create_csf_writer_usb_interface(file_location, *
reinterpret_cast<const tof_usb_interface_t*
>(&usb_interface), TOF_ERROR_HANDLER{});
95 return new_csf_writer;
This class contains all the calibration information.
This class allows you to view/edit the camera settings.
The csf writer class takes care of writing depth frames to disk.
CsfWriter(tof_csf_writer_t ptr=nullptr)
Construct from pointer.
void write_frame(const Data &frame)
Write frame to csf file.
CsfWriter(StringView file_location, const CameraConfig &camera_config, const Calibration &calibration, StringView serial)
Construct csf writer from calibration and configuration.
This is the class that contains depth or image data.