Time-of-Flight Library(ToF) 3.13.2
 
csf_writer.h
1#ifndef _CHRONOPTICS_TOF_CSF_WRITER_H_
2#define _CHRONOPTICS_TOF_CSF_WRITER_H_
3
4#include <chronoptics/tof/camera_config.h>
5#include <chronoptics/tof/calibration.h>
6#include <chronoptics/tof/camera.h>
7#include <chronoptics/tof/data.h>
8#include <chronoptics/tof/csf_reader.h>
9#include <chronoptics/tof/gige_interface.h>
10#include <chronoptics/tof/usb_interface.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/** The csf writer class takes care of writing depth frames to disk. The class
17 * has to be created from either a Camera or csf reader, because it needs
18 * information about the camera that was used to record the depth frames.
19 * Therefore you should only write depth frames coming from one camera into the
20 * same writer
21
22 */
23typedef struct tof_csf_writer* tof_csf_writer_t;
24
25/** Destruct tof_csf_writer */
26TOF_EXPORT void tof_csf_writer_delete(tof_csf_writer_t ptr);
27
28/** Construct csf writer from calibration and configuration
29 * @param ptr Pointer to class
30 * @param file_location Path to where the csf file should be created
31 * @param camera_config Camera configuration
32 * @param calibration Calibration
33 * @param serial Serial number of camera
34 * @param error Pointer to error
35 * @return New object
36 */
37TOF_EXPORT tof_csf_writer_t tof_csf_writer_new(const char* file_location, const tof_camera_config_t camera_config, const tof_calibration_t calibration, const char* serial, tof_error_t *error);
38
39/** Construct the csf writer from a camera
40 * @param ptr Pointer to class
41 * @param file_location Path to where the csf file should be created
42 * @param camera The camera to get the camera config and calibration file from
43 * @param error Pointer to error
44 * @return New object
45 */
46TOF_EXPORT tof_csf_writer_t tof_csf_writer_new_from_camera(const char* file_location, tof_camera_t camera, tof_error_t *error);
47
48/** Write frame to csf file
49 * @param ptr Pointer to class
50 * @param frame A data frame
51 * @param error Pointer to error
52 */
53TOF_EXPORT void tof_csf_writer_write_frame(tof_csf_writer_t ptr, const tof_data_t frame, tof_error_t *error);
54
55/** Create csf writer from csf reader
56 * @param file_location Path to where the csf file should be created
57 * @param reader A csf reader
58 * @param error Pointer to error
59 * @return csf writer
60 */
61TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_reader(const char* file_location, const tof_csf_reader_t reader, tof_error_t *error);
62
63/** Create csf writer from camera
64 * @param file_location Path to where the csf file should be created
65 * @param camera A camera
66 * @param error Pointer to error
67 * @return csf writer
68 */
69TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_camera(const char* file_location, const tof_camera_t camera, tof_error_t *error);
70
71/** Create csf writer from the GigE interface
72 * @param file_location Path to where the csf file should be created
73 * @param gige_interface A GigE interface
74 * @param error Pointer to error
75 * @return csf writer
76 */
77TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_gige_interface(const char* file_location, const tof_gige_interface_t gige_interface, tof_error_t *error);
78
79/** Create csf writer from the USB interface
80 * @param file_location Path to where the csf file should be created
81 * @param usb_interface A USB interface
82 * @param error Pointer to error
83 * @return csf writer
84 */
85TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_usb_interface(const char* file_location, const tof_usb_interface_t usb_interface, tof_error_t *error);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif