CamControlMessage.hh
Go to the documentation of this file.
1 
40 #ifndef LibMultiSense_CamControlMessage
41 #define LibMultiSense_CamControlMessage
42 
46 
47 namespace crl {
48 namespace multisense {
49 namespace details {
50 namespace wire {
51 
52 class CamControl {
53 public:
56 
57  //
58  // Parameters representing the current camera configuration
59 
61  float gain;
62 
63  uint32_t exposure;
64  uint8_t autoExposure;
65  uint32_t autoExposureMax;
68 
74 
75  //
76  // Additions in version 2
77 
78  float stereoPostFilterStrength; // [0.0, 1.0]
79 
80  //
81  // Additions in version 3
82 
83  bool hdrEnabled;
84 
85  //
86  // Additions in version 4
87 
88  bool storeSettingsInFlash; // boolean
89 
90  //
91  // Additions in version 5
92 
93  uint16_t autoExposureRoiX;
94  uint16_t autoExposureRoiY;
97 
98  //
99  // Additions in version 6
100 
101  uint32_t cameraProfile;
102 
103  //
104  // Additions in version 7
105 
106  SourceType exposureSource; // Deprecated
107  std::vector<ExposureConfig> secondaryExposureConfigs; // Deprecated
108 
109  //
110  // Additions in version 8
111 
113  float gamma;
114 
115  //
116  // Additions in version 9
117 
118  bool sharpeningEnable; // Deprecated
119  float sharpeningPercentage; // Deprecated
120  uint8_t sharpeningLimit; // Deprecated
121 
122 
123  //
124  // Constructors
125 
128 
129  //
130  // Serialization routine
131 
132  template<class Archive>
133  void serialize(Archive& message,
134  const VersionType version)
135  {
136  message & framesPerSecond;
137  message & gain;
138 
139  message & exposure;
140  message & autoExposure;
141  message & autoExposureMax;
142  message & autoExposureDecay;
143  message & autoExposureThresh;
144 
145  message & whiteBalanceRed;
146  message & whiteBalanceBlue;
147  message & autoWhiteBalance;
148  message & autoWhiteBalanceDecay;
149  message & autoWhiteBalanceThresh;
150 
151  if (version >= 2)
152  message & stereoPostFilterStrength;
153  else
154  stereoPostFilterStrength = 0.5f;
155 
156  if (version >= 3)
157  message & hdrEnabled;
158  else
159  hdrEnabled = false;
160 
161  if (version >= 4)
162  message & storeSettingsInFlash;
163  else
164  storeSettingsInFlash = false;
165 
166  if (version >= 5)
167  {
168  message & autoExposureRoiX;
169  message & autoExposureRoiY;
170  message & autoExposureRoiWidth;
171  message & autoExposureRoiHeight;
172  }
173  else
174  {
175  autoExposureRoiX = 0;
176  autoExposureRoiY = 0;
177  autoExposureRoiWidth = crl::multisense::Roi_Full_Image;
178  autoExposureRoiHeight = crl::multisense::Roi_Full_Image;
179  }
180 
181  if (version >= 6)
182  {
183  message & cameraProfile;
184  }
185  else
186  {
187  cameraProfile = 0;
188  }
189 
190  if (version >= 7)
191  {
192  message & exposureSource;
193  message & secondaryExposureConfigs;
194  }
195  else
196  {
197  exposureSource = Default_Exposure_Source;
198  secondaryExposureConfigs = std::vector<ExposureConfig>();
199  }
200 
201  if (version >= 8)
202  {
203  message & autoExposureTargetIntensity;
204  message & gamma;
205  }
206  else
207  {
208  autoExposureTargetIntensity = Default_Target_Intensity;
209  gamma = Default_Gamma;
210  }
211 
212  if (version >= 9)
213  {
214  message & sharpeningEnable;
215  message & sharpeningPercentage;
216  message & sharpeningLimit;
217  }
218  else
219  {
220  sharpeningEnable = false;
221  sharpeningPercentage = 0.0f;
222  sharpeningLimit = 0;
223  }
224 
225  }
226 };
227 
228 }}}} // namespaces
229 
230 #endif
static CRL_CONSTEXPR IdType ID_CMD_CAM_CONTROL
Definition: Protocol.hh:159
static CRL_CONSTEXPR SourceType Default_Exposure_Source
Definition: Protocol.hh:304
std::vector< ExposureConfig > secondaryExposureConfigs
CamControl(utility::BufferStreamReader &r, VersionType v)
Definition: channel.cc:58
void serialize(Archive &message, const VersionType version)
static CRL_CONSTEXPR float Default_Target_Intensity
Definition: Protocol.hh:305
static CRL_CONSTEXPR float Default_Gamma
Definition: Protocol.hh:306
static CRL_CONSTEXPR VersionType VERSION
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