Time-of-Flight Library(ToF) 3.13.5
 
stream.h
1#ifndef _CHRONOPTICS_TOF_STREAM_H_
2#define _CHRONOPTICS_TOF_STREAM_H_
3
4#include <chronoptics/tof/error.h>
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10/** The different frame types that are supported
11 */
12enum tof_frame_type {
13 TOF_FRAME_TYPE_RAW_COMMON = 0, /** The 16bits coming off the OPT8241 image sensor */
14 TOF_FRAME_TYPE_COMMON = 1, /** Common (A + B) image, 4 or 12 bits depending on the sensor */
15 TOF_FRAME_TYPE_RAW = 2, /** Raw (A - B) image 12 bits signed data */
16 TOF_FRAME_TYPE_REAL = 3, /** The real image */
17 TOF_FRAME_TYPE_IMAGINARY = 4, /** The imaginary image */
18 TOF_FRAME_TYPE_PHASE = 5, /** The phase image */
19 TOF_FRAME_TYPE_AMPLITUDE = 6, /** The amplitude image */
20 TOF_FRAME_TYPE_RADIAL = 7, /** The radial distance image */
21 TOF_FRAME_TYPE_INTENSITY = 8, /** The intensity image */
22 TOF_FRAME_TYPE_X = 9, /** The x image of the point cloud */
23 TOF_FRAME_TYPE_Y = 10, /** The y image of the point cloud */
24 TOF_FRAME_TYPE_Z = 11, /** The z image of the point cloud */
25 TOF_FRAME_TYPE_XYZ = 12, /** A complete pointcloud image: float x, float y, float z, float padding */
26 TOF_FRAME_TYPE_XYZ_AMP = 13, /** A complete pointcloud image with amplitude: float x, float y, float z, float amplitude */
27 TOF_FRAME_TYPE_XYZ_BGR = 14, /** A complete pointcloud image with bgr: float x, float y, float z, uint8 b, uint8 g, uint8 r, uint8 padding */
28 TOF_FRAME_TYPE_XYZ_BGR_I = 15, /** A complete pointcloud image with bgr and intensity: float x, float y, float z, uint8 b, uint8 g, uint8 r, uint8 intensity */
29 TOF_FRAME_TYPE_BGR = 18, /** A color image, encode bgr */
30 TOF_FRAME_TYPE_YUV = 19, /** A color image encoded in YUV422 */
31 TOF_FRAME_TYPE_RAW_AB = 20, /** A raw image containing both the A and B tap */
32 TOF_FRAME_TYPE_MJPEG = 21, /** a color image encoded in mjpeg */
33 TOF_FRAME_TYPE_BGR_PROJECTED = 22, /** A color image projected to the XYZ locations of the depth sensor */
34 TOF_FRAME_TYPE_COMPRESSED_DOT = 23, /** The averaged value for each dot. In the XYZAmp format. */
35};
36
37/** This class describes the different data streams coming from the camera
38 */
39typedef struct tof_stream* tof_stream_t;
40
41/** Destruct tof_stream */
42TOF_EXPORT void tof_stream_delete(tof_stream_t ptr);
43
44/** Get the frame type
45 * @param ptr Pointer to class
46 * @param error Pointer to error
47 * @return The frame type
48 */
49TOF_EXPORT enum tof_frame_type tof_stream_frame_type(const tof_stream_t ptr, tof_error_t *error);
50
51/** Get the frame id
52 * @param ptr Pointer to class
53 * @param error Pointer to error
54 * @return The frame id
55 */
56TOF_EXPORT uint32_t tof_stream_frame_id(const tof_stream_t ptr, tof_error_t *error);
57
58/** Get the modulation frequency of the frame
59 * @param ptr Pointer to class
60 * @param error Pointer to error
61 * @return The modulation frequency
62 */
63TOF_EXPORT float tof_stream_modulation_frequency(const tof_stream_t ptr, tof_error_t *error);
64
65/** Get the integration time of the frame
66 * @param ptr Pointer to class
67 * @param error Pointer to error
68 * @return The integration time
69 */
70TOF_EXPORT uint32_t tof_stream_integration_time(const tof_stream_t ptr, tof_error_t *error);
71
72/** Get a bit array of the processing performed on the frame
73 * @param ptr Pointer to class
74 * @param error Pointer to error
75 * @return A bit array
76 */
77TOF_EXPORT uint32_t tof_stream_process(const tof_stream_t ptr, tof_error_t *error);
78
79/** Get the string representation of the frame type
80 * @param frame_type Frame type
81 * @param error Pointer to error
82 * @return String representation of frame type
83 */
84TOF_EXPORT const char* tof_frame_type_to_string(enum tof_frame_type frame_type, tof_error_t *error);
85
86#ifdef __cplusplus
87}
88#endif
89
90#endif