ImageMetaMessage.h
Go to the documentation of this file.
1 
37 #ifndef LibMultiSense_ImageMetaMessage
38 #define LibMultiSense_ImageMetaMessage
39 
40 #include <typeinfo>
41 
43 
44 namespace crl {
45 namespace multisense {
46 namespace details {
47 namespace wire {
48 
50 public:
51 
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;
70  uint32_t timeMicroSeconds;
71  int32_t angle; // microradians
72  uint64_t ptpNanoSeconds;
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 
92 class ImageMeta : public ImageMetaHeader {
93 public:
94 
95  uint32_t histogramP[HISTOGRAM_BINS * HISTOGRAM_CHANNELS];
96 
97  //
98  // Constructors
99 
101  ImageMeta() {};
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
void serialize(Archive &message, const VersionType version)
std::string * frameId(M &m)
ImageMeta(utility::BufferStreamReader &r, VersionType v)
void serialize(Stream &stream, const T &t)
Definition: channel.cc:56
static CRL_CONSTEXPR IdType ID_DATA_IMAGE_META
Definition: Protocol.h:204
#define WIRE_HEADER_ATTRIBS_
Definition: Protocol.h:64
#define CRL_CONSTEXPR
Definition: Portability.hh:51


multisense_lib
Author(s):
autogenerated on Sun Mar 14 2021 02:34:50