CamConfigMessage.hh
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_CamConfigMessage
41 #define LibMultiSense_CamConfigMessage
42 
46 
47 namespace crl {
48 namespace multisense {
49 namespace details {
50 namespace wire {
51 
52 class CamConfig {
53 public:
56 
57  //
58  // Parameters representing the current camera configuration
59 
60  uint16_t width;
61  uint16_t height;
63  float gain;
64 
65  uint32_t exposure;
66  uint8_t autoExposure;
67  uint32_t autoExposureMax;
70 
76 
77  float fx, fy;
78  float cx, cy;
79  float tx, ty, tz;
80  float roll, pitch, yaw;
81 
82  //
83  // Version 2 additions
84 
85  int32_t disparities;
86 
87  //
88  // Version 3 additions
89 
91 
92  //
93  // Version 4 additions
94 
95  bool hdrEnabled;
96 
97  //
98  // Version 5 additions
99 
104 
105  //
106  // Version 6 additions
107 
108  uint32_t cameraProfile;
109 
110  //
111  // Version 7 additions
112 
114  std::vector<ExposureConfig> secondaryExposureConfigs;
115 
116  //
117  // Version 8 additions
118 
120  float gamma;
121 
122  //
123  // Version 9 additions
124 
128 
129  //
130  // Constructors
131 
134  width(0),
135  height(0),
136  framesPerSecond(0.0),
137  gain(0.0),
138  exposure(0),
139  autoExposure(0),
140  autoExposureMax(0),
141  autoExposureDecay(0),
142  autoExposureThresh(0.0),
143  whiteBalanceRed(0.0),
144  whiteBalanceBlue(0.0),
145  autoWhiteBalance(0),
146  autoWhiteBalanceDecay(0),
147  autoWhiteBalanceThresh(0.0),
148  fx(0.0),
149  fy(0.0),
150  cx(0.0),
151  cy(0.0),
152  tx(0.0),
153  ty(0.0),
154  tz(0.0),
155  roll(0.0),
156  pitch(0.0),
157  yaw(0.0),
158  disparities(0),
159  stereoPostFilterStrength(0.0),
160  hdrEnabled(false),
161  autoExposureRoiX(0),
162  autoExposureRoiY(0),
163  autoExposureRoiWidth(crl::multisense::Roi_Full_Image),
164  autoExposureRoiHeight(crl::multisense::Roi_Full_Image),
165  cameraProfile(0),
166  exposureSource(Default_Exposure_Source),
167  secondaryExposureConfigs(),
168  autoExposureTargetIntensity(Default_Target_Intensity),
169  gamma(Default_Gamma),
170  sharpeningEnable(false),
171  sharpeningPercentage(0.0f),
172  sharpeningLimit(0)
173  {};
174 
175  //
176  // Serialization routine
177 
178  template<class Archive>
179  void serialize(Archive& message,
180  const VersionType version)
181  {
182  message & width;
183  message & height;
184 
185  message & framesPerSecond;
186  message & gain;
187 
188  message & exposure;
189  message & autoExposure;
190  message & autoExposureMax;
191  message & autoExposureDecay;
192  message & autoExposureThresh;
193 
194  message & whiteBalanceRed;
195  message & whiteBalanceBlue;
196  message & autoWhiteBalance;
197  message & autoWhiteBalanceDecay;
198  message & autoWhiteBalanceThresh;
199 
200  message & fx;
201  message & fy;
202  message & cx;
203  message & cy;
204 
205  message & tx;
206  message & ty;
207  message & tz;
208 
209  message & roll;
210  message & pitch;
211  message & yaw;
212 
213  if (version >= 2)
214  message & disparities;
215  else
216  disparities = -1;
217 
218  if (version >= 3)
219  message & stereoPostFilterStrength;
220  else
221  stereoPostFilterStrength = 0.5f;
222 
223  if (version >= 4)
224  message & hdrEnabled;
225  else
226  hdrEnabled = false;
227 
228  if (version >= 5)
229  {
230  message & autoExposureRoiX;
231  message & autoExposureRoiY;
232  message & autoExposureRoiWidth;
233  message & autoExposureRoiHeight;
234  }
235  else
236  {
237  autoExposureRoiX = 0;
238  autoExposureRoiY = 0;
239  autoExposureRoiWidth = crl::multisense::Roi_Full_Image;
240  autoExposureRoiHeight = crl::multisense::Roi_Full_Image;
241  }
242 
243  if (version >= 6)
244  {
245  message & cameraProfile;
246  }
247  else
248  {
249  cameraProfile = 0;
250  }
251 
252  if (version >= 7)
253  {
254  message & exposureSource;
255  message & secondaryExposureConfigs;
256  }
257  else
258  {
259  exposureSource = Default_Exposure_Source;
260  secondaryExposureConfigs = std::vector<ExposureConfig>();
261  }
262 
263  if (version >= 8)
264  {
265  message & autoExposureTargetIntensity;
266  message & gamma;
267  }
268  else
269  {
270  autoExposureTargetIntensity = Default_Target_Intensity;
271  gamma = Default_Gamma;
272  }
273 
274  if (version >= 9)
275  {
276  message & sharpeningEnable;
277  message & sharpeningPercentage;
278  message & sharpeningLimit;
279  }
280  else
281  {
282  sharpeningEnable = false;
283  sharpeningPercentage = 0.0f;
284  sharpeningLimit = 0;
285  }
286 
287  }
288 };
289 
290 }}}} // namespaces
291 
292 #endif
f
static CRL_CONSTEXPR SourceType Default_Exposure_Source
Definition: Protocol.hh:304
CamConfig(utility::BufferStreamReader &r, VersionType v)
static CRL_CONSTEXPR VersionType VERSION
static CRL_CONSTEXPR IdType ID_DATA_CAM_CONFIG
Definition: Protocol.hh:199
Definition: channel.cc:58
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR float Default_Target_Intensity
Definition: Protocol.hh:305
std::vector< ExposureConfig > secondaryExposureConfigs
static CRL_CONSTEXPR float Default_Gamma
Definition: Protocol.hh:306
static CRL_CONSTEXPR int Roi_Full_Image
#define CRL_CONSTEXPR
Definition: Portability.hh:49


multisense_lib
Author(s):
autogenerated on Sat Jun 24 2023 03:01:21