Time-of-Flight Library(ToF) 4.1.5
 
stream.hpp
1#ifndef _CHRONOPTICS_TOF_STREAM_HPP_
2#define _CHRONOPTICS_TOF_STREAM_HPP_
3
4#include <chronoptics/tof/stream.h>
5
6#include <chronoptics/tof/base.hpp>
7
8namespace chronoptics {
9namespace tof {
10
11/** The different frame types that are supported
12 */
13enum class FrameType {
14 RAW_COMMON = 0, /** The 16bits coming off the OPT8241 image sensor */
15 COMMON = 1, /** Common (A + B) image, 4 or 12 bits depending on the sensor */
16 RAW = 2, /** Raw (A - B) image 12 bits signed data */
17 REAL = 3, /** The real image */
18 IMAGINARY = 4, /** The imaginary image */
19 PHASE = 5, /** The phase image */
20 AMPLITUDE = 6, /** The amplitude image */
21 RADIAL = 7, /** The radial distance image */
22 INTENSITY = 8, /** The intensity image */
23 X = 9, /** The x image of the point cloud */
24 Y = 10, /** The y image of the point cloud */
25 Z = 11, /** The z image of the point cloud */
26 XYZ = 12, /** A complete pointcloud image: float x, float y, float z, float padding */
27 XYZ_AMP = 13, /** A complete pointcloud image with amplitude: float x, float y, float z, float amplitude */
28 XYZ_BGR = 14, /** A complete pointcloud image with bgr: float x, float y, float z, uint8 b, uint8 g, uint8 r, uint8 padding */
29 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 */
30 BGR = 18, /** A color image, encode bgr */
31 YUV = 19, /** A color image encoded in YUV422 */
32 RAW_AB = 20, /** A raw image containing both the A and B tap */
33 MJPEG = 21, /** a color image encoded in mjpeg */
34 BGR_PROJECTED = 22, /** A color image projected to the XYZ locations of the depth sensor */
35 COMPRESSED_DOT = 23, /** The averaged value for each dot. In the XYZAmp format. */
36 RAW_AB_SUPER = 24, /** The raw information coming out of the vd55h1 sensor. This is not very useful by itself, but when stored in a CSF file, it reproduces the actual pipeline correctly. This also allows to retrieve data from camera without any processing. */
37 REFLECTIVITY = 25, /** The reflectivity of an object in the IR domain. This is comparable to a black and white image. Do note that due to the angle of incidence and multi path the reflectivity can still change over distance When selecting both intensity and reflectivity as outputs, radial and intensity are streamed from the camera and the reflectivity will be slightly quantized. */
38};
39
40/** This class describes the different data streams coming from the camera
41*/
42class Stream : public detail::Base<tof_stream, tof_stream_delete> {
43 public:
44 /** Construct from pointer */
45 Stream(tof_stream_t ptr = nullptr) {
46 this->ptr_ = ptr;
47 }
48
49 /** Get the frame type
50 * @return The frame type
51 */
52 FrameType frame_type() const {
53 return static_cast<FrameType>(tof_stream_frame_type(this->ptr_, TOF_ERROR_HANDLER{}));
54 }
55
56 /** Get the frame id
57 * @return The frame id
58 */
59 uint32_t frame_id() const {
60 return tof_stream_frame_id(this->ptr_, TOF_ERROR_HANDLER{});
61 }
62
63 /** Get the modulation frequency of the frame
64 * @return The modulation frequency
65 */
66 float modulation_frequency() const {
67 return tof_stream_modulation_frequency(this->ptr_, TOF_ERROR_HANDLER{});
68 }
69
70 /** Get the integration time of the frame
71 * @return The integration time
72 */
73 uint32_t integration_time() const {
74 return tof_stream_integration_time(this->ptr_, TOF_ERROR_HANDLER{});
75 }
76
77 /** Get a bit array of the processing performed on the frame
78 * @return A bit array
79 */
80 uint32_t process() const {
81 return tof_stream_process(this->ptr_, TOF_ERROR_HANDLER{});
82 }
83
84};
85
86/** Get the string representation of the frame type
87 * @param frame_type Frame type
88 * @return String representation of frame type
89 */
90inline const char* frame_type_to_string(FrameType frame_type) {
91 return tof_frame_type_to_string(static_cast<tof_frame_type>(frame_type), TOF_ERROR_HANDLER{});
92}
93
94} // tof
95} // chronoptics
96
97#endif
This class describes the different data streams coming from the camera.
Definition: stream.hpp:42
float modulation_frequency() const
Get the modulation frequency of the frame.
Definition: stream.hpp:66
uint32_t integration_time() const
Get the integration time of the frame.
Definition: stream.hpp:73
uint32_t frame_id() const
Get the frame id.
Definition: stream.hpp:59
uint32_t process() const
Get a bit array of the processing performed on the frame.
Definition: stream.hpp:80
Stream(tof_stream_t ptr=nullptr)
Construct from pointer.
Definition: stream.hpp:45
FrameType frame_type() const
Get the frame type.
Definition: stream.hpp:52