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 = 1;
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 
74  :
75 #ifdef SENSORPOD_FIRMWARE
76  id(ID),
77  version(VERSION),
78 #endif // SENSORPOD_FIRMWARE
79  frameId(0),
80  framesPerSecond(0),
81  gain(0.0),
82  exposureTime(0),
83  timeSeconds(0),
84  timeMicroSeconds(0),
85  angle(0) {};
86 };
87 
88 #ifndef SENSORPOD_FIRMWARE
89 
90 class ImageMeta : public ImageMetaHeader {
91 public:
92 
93  uint32_t histogramP[HISTOGRAM_BINS * HISTOGRAM_CHANNELS];
94 
95  //
96  // Constructors
97 
99  ImageMeta() {};
100 
101  //
102  // Serialization routine
103 
104  template<class Archive>
105  void serialize(Archive& message,
106  const VersionType version)
107  {
108  message & frameId;
109  message & framesPerSecond;
110  message & gain;
111  message & exposureTime;
112  message & timeSeconds;
113  message & timeMicroSeconds;
114  message & angle;
115 
116  if (typeid(Archive) == typeid(utility::BufferStreamWriter))
117  message.write(histogramP, HISTOGRAM_LENGTH);
118  else
119  message.read(histogramP, HISTOGRAM_LENGTH);
120  }
121 };
122 
123 #endif // !SENSORPOD_FIRMWARE
124 
125 }}}}; // namespaces
126 
127 #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:193
#define WIRE_HEADER_ATTRIBS_
Definition: Protocol.h:55
#define CRL_CONSTEXPR
Definition: Portability.hh:38


multisense_lib
Author(s):
autogenerated on Sat Apr 6 2019 02:16:46