LibMultiSense
LibMultiSense Documentation
Loading...
Searching...
No Matches
ImageMetaMessage.hh
Go to the documentation of this file.
1
37#ifndef LibMultiSense_ImageMetaMessage
38#define LibMultiSense_ImageMetaMessage
39
40#include <typeinfo>
41
43
44namespace crl {
45namespace multisense {
46namespace details {
47namespace wire {
48
50public:
51
52 static CRL_CONSTEXPR IdType ID = ID_DATA_IMAGE_META;
53 static CRL_CONSTEXPR VersionType VERSION = 2;
54
55 static CRL_CONSTEXPR uint32_t HISTOGRAM_CHANNELS = 4; // g0, r, b, g1
56 static CRL_CONSTEXPR uint32_t HISTOGRAM_BINS = 256;
57 static CRL_CONSTEXPR uint32_t HISTOGRAM_LENGTH = (HISTOGRAM_CHANNELS * HISTOGRAM_BINS *
58 sizeof(uint32_t));
59
60#ifdef SENSORPOD_FIRMWARE
61 IdType id;
62 VersionType version;
63#endif // SENSORPOD_FIRMWARE
64
65 int64_t frameId;
67 float gain;
68 uint32_t exposureTime;
69 uint32_t timeSeconds;
71 int32_t angle; // microradians
73
75 :
76#ifdef SENSORPOD_FIRMWARE
77 id(ID),
78 version(VERSION),
79#endif // SENSORPOD_FIRMWARE
80 frameId(0),
81 framesPerSecond(0),
82 gain(0.0),
83 exposureTime(0),
84 timeSeconds(0),
85 timeMicroSeconds(0),
86 angle(0),
87 ptpNanoSeconds(0) {};
88};
89
90#ifndef SENSORPOD_FIRMWARE
91
92class ImageMeta : public ImageMetaHeader {
93public:
94
96
97 //
98 // Constructors
99
102
103 //
104 // Serialization routine
105
106 template<class Archive>
107 void serialize(Archive& message,
108 const VersionType version)
109 {
110 (void) version;
111 message & frameId;
112 message & framesPerSecond;
113 message & gain;
114 message & exposureTime;
115 message & timeSeconds;
116 message & timeMicroSeconds;
117 message & angle;
118
119 if (typeid(Archive) == typeid(utility::BufferStreamWriter))
120 message.write(histogramP, HISTOGRAM_LENGTH);
121 else
122 message.read(histogramP, HISTOGRAM_LENGTH);
123
124 if (version >= 2)
125 {
126 message &ptpNanoSeconds;
127 }
128 }
129};
130
131#endif // !SENSORPOD_FIRMWARE
132
133}}}} // namespaces
134
135#endif
Macros and symbols to help portability between different compiler versions.
#define CRL_CONSTEXPR
#define WIRE_HEADER_ATTRIBS_
Definition Protocol.hh:65
ImageMeta(utility::BufferStreamReader &r, VersionType v)
uint32_t histogramP[HISTOGRAM_BINS *HISTOGRAM_CHANNELS]
void serialize(Archive &message, const VersionType version)