Time-of-Flight Library(ToF) 4.0.1
 
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
41typedef struct tof_stream const* tof_stream_ct;
42
43/** Destruct tof_stream */
44TOF_EXPORT void tof_stream_delete(tof_stream_t ptr);
45
46/** Get the frame type
47 * @param ptr Pointer to class
48 * @param error Pointer to error
49 * @return The frame type
50 */
51TOF_EXPORT enum tof_frame_type tof_stream_frame_type(tof_stream_ct ptr, tof_error_t *error);
52
53/** Get the frame id
54 * @param ptr Pointer to class
55 * @param error Pointer to error
56 * @return The frame id
57 */
58TOF_EXPORT uint32_t tof_stream_frame_id(tof_stream_ct ptr, tof_error_t *error);
59
60/** Get the modulation frequency of the frame
61 * @param ptr Pointer to class
62 * @param error Pointer to error
63 * @return The modulation frequency
64 */
65TOF_EXPORT float tof_stream_modulation_frequency(tof_stream_ct ptr, tof_error_t *error);
66
67/** Get the integration time of the frame
68 * @param ptr Pointer to class
69 * @param error Pointer to error
70 * @return The integration time
71 */
72TOF_EXPORT uint32_t tof_stream_integration_time(tof_stream_ct ptr, tof_error_t *error);
73
74/** Get a bit array of the processing performed on the frame
75 * @param ptr Pointer to class
76 * @param error Pointer to error
77 * @return A bit array
78 */
79TOF_EXPORT uint32_t tof_stream_process(tof_stream_ct ptr, tof_error_t *error);
80
81/** Get the string representation of the frame type
82 * @param frame_type Frame type
83 * @param error Pointer to error
84 * @return String representation of frame type
85 */
86TOF_EXPORT const char* tof_frame_type_to_string(enum tof_frame_type frame_type, tof_error_t *error);
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif