Time-of-Flight Library(ToF)  3.2.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/data.h>
7 #include <chronoptics/tof/csf_reader.h>
8 #include <chronoptics/tof/camera.h>
9 #include <chronoptics/tof/gige_interface.h>
10 #include <chronoptics/tof/usb_interface.h>
11 
12 #ifdef __cplusplus
13 extern "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  */
23 typedef struct tof_csf_writer* tof_csf_writer_t;
24 
25 /** Destruct tof_csf_writer */
26 TOF_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  */
37 TOF_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 /** Write frame to csf file
40  * @param ptr Pointer to class
41  * @param frame A data frame
42  * @param error Pointer to error
43  */
44 TOF_EXPORT void tof_csf_writer_write_frame(tof_csf_writer_t ptr, const tof_data_t frame, tof_error_t *error);
45 
46 /** Create csf writer from csf reader
47  * @param file_location Path to where the csf file should be created
48  * @param reader A csf reader
49  * @param error Pointer to error
50  * @return csf writer
51  */
52 TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_reader(const char* file_location, const tof_csf_reader_t reader, tof_error_t *error);
53 
54 /** Create csf writer from camera
55  * @param file_location Path to where the csf file should be created
56  * @param camera A camera
57  * @param error Pointer to error
58  * @return csf writer
59  */
60 TOF_EXPORT tof_csf_writer_t tof_create_csf_writer_camera(const char* file_location, const tof_camera_t camera, tof_error_t *error);
61 
62 /** Create csf writer from the GigE interface
63  * @param file_location Path to where the csf file should be created
64  * @param gige_interface A GigE interface
65  * @param error Pointer to error
66  * @return csf writer
67  */
68 TOF_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);
69 
70 /** Create csf writer from the USB interface
71  * @param file_location Path to where the csf file should be created
72  * @param usb_interface A USB interface
73  * @param error Pointer to error
74  * @return csf writer
75  */
76 TOF_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);
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif