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/camera.hpp>
9#include <chronoptics/tof/data.hpp>
10#include <chronoptics/tof/csf_reader.hpp>
11#include <chronoptics/tof/gige_interface.hpp>
12#include <chronoptics/tof/usb_interface.hpp>
14namespace chronoptics {
24class 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{});
46 this->ptr_ = tof_csf_writer_new_from_camera(file_location, *
reinterpret_cast<tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
53 return tof_csf_writer_write_frame(this->ptr_, *
reinterpret_cast<const tof_data_t*
>(&frame), TOF_ERROR_HANDLER{});
63inline CsfWriter create_csf_writer_reader(StringView file_location,
const CsfReader &reader) {
64 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
65 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
66 *ptr = tof_create_csf_writer_reader(file_location, *
reinterpret_cast<const tof_csf_reader_t*
>(&reader), TOF_ERROR_HANDLER{});
67 return new_csf_writer;
75inline CsfWriter create_csf_writer_camera(StringView file_location,
const Camera &camera) {
76 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
77 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
78 *ptr = tof_create_csf_writer_camera(file_location, *
reinterpret_cast<const tof_camera_t*
>(&camera), TOF_ERROR_HANDLER{});
79 return new_csf_writer;
87inline CsfWriter create_csf_writer_gige_interface(StringView file_location,
const GigeInterface &gige_interface) {
88 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
89 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
90 *ptr = tof_create_csf_writer_gige_interface(file_location, *
reinterpret_cast<const tof_gige_interface_t*
>(&gige_interface), TOF_ERROR_HANDLER{});
91 return new_csf_writer;
99inline CsfWriter create_csf_writer_usb_interface(StringView file_location,
const UsbInterface &usb_interface) {
100 CsfWriter new_csf_writer(
static_cast<tof_csf_writer_t
>(
nullptr));
101 auto ptr =
reinterpret_cast<tof_csf_writer_t*
>(&new_csf_writer);
102 *ptr = tof_create_csf_writer_usb_interface(file_location, *
reinterpret_cast<const tof_usb_interface_t*
>(&usb_interface), TOF_ERROR_HANDLER{});
103 return new_csf_writer;
This class contains all the calibration information.
This class allows you to view/edit the camera settings.
The main interface to the depth cameras.
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, Camera &camera)
Construct the csf writer from a camera.
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.