LibMultiSense
LibMultiSense Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CompressedImageMessage.hh
Go to the documentation of this file.
1 
37 #ifndef LibMultiSense_CompressedImageMessage
38 #define LibMultiSense_CompressedImageMessage
39 
40 #include <typeinfo>
41 #include <cmath>
42 
43 #include "utility/Portability.hh"
44 
45 namespace crl {
46 namespace multisense {
47 namespace details {
48 namespace wire {
49 
51 public:
52 
54 static CRL_CONSTEXPR VersionType VERSION = 1;
55 
56 #ifdef SENSORPOD_FIRMWARE
57  IdType id;
58  VersionType version;
59 #endif // SENSORPOD_FIRMWARE
60 
61  uint32_t source;
62  uint32_t bitsPerPixel;
63  uint32_t codec;
64  int64_t frameId;
65  uint16_t width;
66  uint16_t height;
67  uint32_t exposure;
68  float gain;
70  uint32_t sourceExtended;
71 
73  :
74 #ifdef SENSORDPOD_FIRMWARE
75  id(ID),
76  version(VERSION),
77 #endif // SENSORPOD_FIRMWARE
78  source(0),
79  bitsPerPixel(0),
80  codec(0),
81  frameId(0),
82  width(0),
83  height(0),
84  exposure(0),
85  gain(0.0),
86  compressedDataBufferSize(0),
87  sourceExtended(0)
88  {};
89 };
90 
91 #ifndef SENSORPOD_FIRMWARE
92 
94 public:
95 
96  void *dataP;
97 
98  //
99  // Constructors
100 
102  CompressedImage() : dataP(NULL) {};
103 
104  //
105  // Serialization routine
106 
107  template<class Archive>
108  void serialize(Archive& message,
109  const VersionType version)
110  {
111  message & source;
112  message & bitsPerPixel;
113  message & codec;
114  message & frameId;
115  message & width;
116  message & height;
117  message & exposure;
118  message & gain;
119  message & compressedDataBufferSize;
120 
121  if (typeid(Archive) == typeid(utility::BufferStreamWriter)) {
122 
123  message.write(dataP, compressedDataBufferSize);
124 
125  } else {
126 
127  dataP = message.peek();
128  message.seek(message.tell() + compressedDataBufferSize);
129  }
130 
131  if (version >= 1)
132  {
133  message & sourceExtended;
134  }
135  else
136  {
137  sourceExtended = 0;
138  }
139 
140  }
141 };
142 
143 #endif // !SENSORPOD_FIRMWARE
144 
145 }}}} // namespaces
146 
147 #endif
crl::multisense::details::wire::CompressedImageHeader::exposure
uint32_t exposure
Definition: CompressedImageMessage.hh:67
crl::multisense::details::wire::CompressedImage::CompressedImage
CompressedImage()
Definition: CompressedImageMessage.hh:102
crl::multisense::details::wire::CompressedImage::CompressedImage
CompressedImage(utility::BufferStreamReader &r, VersionType v)
Definition: CompressedImageMessage.hh:101
crl::multisense::details::wire::CompressedImage::serialize
void serialize(Archive &message, const VersionType version)
Definition: CompressedImageMessage.hh:108
crl::multisense::details::wire::CompressedImage::dataP
void * dataP
Definition: CompressedImageMessage.hh:96
crl::multisense::details::wire::CompressedImage
Definition: CompressedImageMessage.hh:93
Portability.hh
WIRE_HEADER_ATTRIBS_
#define WIRE_HEADER_ATTRIBS_
Definition: Protocol.hh:65
crl::multisense::details::wire::CompressedImageHeader
Definition: CompressedImageMessage.hh:50
CRL_CONSTEXPR
#define CRL_CONSTEXPR
Definition: Portability.hh:49
crl::multisense::details::wire::CompressedImageHeader::sourceExtended
uint32_t sourceExtended
Definition: CompressedImageMessage.hh:70
crl::multisense::details::wire::CompressedImageHeader::width
uint16_t width
Definition: CompressedImageMessage.hh:65
crl::multisense::details::wire::CompressedImageHeader::source
uint32_t source
Definition: CompressedImageMessage.hh:61
crl
Definition: BufferStream.hh:51
crl::multisense::details::wire::CompressedImageHeader::codec
uint32_t codec
Definition: CompressedImageMessage.hh:63
crl::multisense::details::wire::VersionType
uint16_t VersionType
Definition: Protocol.hh:137
crl::multisense::details::utility::BufferStreamWriter
Definition: BufferStream.hh:259
crl::multisense::details::wire::CompressedImageHeader::compressedDataBufferSize
uint32_t compressedDataBufferSize
Definition: CompressedImageMessage.hh:69
crl::multisense::details::wire::CompressedImageHeader::gain
float gain
Definition: CompressedImageMessage.hh:68
crl::multisense::details::wire::CompressedImageHeader::height
uint16_t height
Definition: CompressedImageMessage.hh:66
crl::multisense::details::utility::BufferStreamReader
Definition: BufferStream.hh:192
multisense
Definition: MultiSenseChannel.hh:44
crl::multisense::details::wire::CompressedImageHeader::frameId
int64_t frameId
Definition: CompressedImageMessage.hh:64
crl::multisense::details::wire::ID_DATA_COMPRESSED_IMAGE
static CRL_CONSTEXPR IdType ID_DATA_COMPRESSED_IMAGE
Definition: Protocol.hh:233
crl::multisense::details::wire::CompressedImageHeader::CompressedImageHeader
CompressedImageHeader()
Definition: CompressedImageMessage.hh:72
crl::multisense::details::wire::IdType
uint16_t IdType
Definition: Protocol.hh:136
crl::multisense::details::wire::CompressedImageHeader::bitsPerPixel
uint32_t bitsPerPixel
Definition: CompressedImageMessage.hh:62