Zivid  1.0.1+3607.8a7510c4
Zivid API
Settings.h
Go to the documentation of this file.
1 /*[
2  * This file is part of the Zivid 3D Camera API
3  *
4  * Copyright 2015-2018 (C) Zivid Labs. All rights reserved.
5  * Contact info@zividlabs.com or see http://www.zividlabs.com
6  *
7  * This code is proprietary and confidential.
8  * Unauthorized copying of this file, via any medium is strictly prohibited.
9 ]*/
10 
11 #pragma once
12 
15 
16 #include <chrono>
17 #include <ctime>
18 #include <iomanip>
19 #include <memory>
20 #include <ostream>
21 #include <sstream>
22 #include <string>
23 #include <utility>
24 #include <vector>
25 
26 #include "APIExport.h"
27 #include "Range.h"
28 
29 #ifdef __has_include
30 #if __has_include("SettingsInternal.h")
31 #include "SettingsInternal.h"
32 #else
33 namespace Zivid {
34 class SettingsInternal;
35 }
36 #endif
37 #else
38 namespace Zivid {
39 class SettingsInternal;
40 }
41 #endif
42 
43 #ifdef _MSC_VER
44 #pragma warning(push)
45 #pragma warning(disable : 4251)
46 #endif
47 
48 namespace Zivid {
50 class ZIVID_COMMON Settings {
51 public:
53  Settings();
55  ~Settings();
57  Settings(const Settings &other);
59  Settings &operator=(const Settings &other);
61  Settings(Settings &&other) noexcept;
63  Settings &operator=(Settings &&other) noexcept;
64 
66  explicit Settings(const std::string &fileName);
67 
69  static constexpr bool isContainer{true};
70 
72  static constexpr const char *path{""};
73 
75  static constexpr const char *name{"Settings"};
76 
78  void set(const std::string &fullPath, const std::string &value);
79 
81  std::string getString(const std::string &fullPath) const;
82 
84  class ZIVID_COMMON BlueBalance {
85  public:
87  using ValueType = double;
88 
90  static constexpr bool isContainer{false};
91 
93  static constexpr const char *path{"BlueBalance"};
94 
96  static constexpr const char *name{"BlueBalance"};
97 
99  BlueBalance() = default;
100 
102  explicit constexpr BlueBalance(ValueType value) noexcept(
103  std::is_nothrow_move_constructible<ValueType>::value)
104  : m_value{value} {}
105 
107  const ValueType &value() const { return m_value; }
108 
111  return {std::numeric_limits<ValueType>::lowest(),
112  std::numeric_limits<ValueType>::max()};
113  }
114 
116  void setFromString(const std::string &value) { m_value = std::stod(value); }
117 
119  std::string toString() const { return std::to_string(m_value); }
120 
122  bool operator==(const BlueBalance &other) const {
123  return m_value == other.m_value;
124  }
125 
127  bool operator!=(const BlueBalance &other) const {
128  return m_value != other.m_value;
129  }
130 
132  bool operator<(const BlueBalance &other) const {
133  return m_value < other.m_value;
134  }
135 
137  bool operator>(const BlueBalance &other) const {
138  return m_value > other.m_value;
139  }
140 
142  friend std::ostream &operator<<(std::ostream &stream,
143  const BlueBalance &value) {
144  return stream << value.toString();
145  }
146 
148  friend std::istream &operator>>(std::istream &stream, BlueBalance &value) {
149  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
150  std::istreambuf_iterator<char>{}});
151  return stream;
152  }
153 
154  private:
155  ValueType m_value{1.081};
156  };
157 
159  class ZIVID_COMMON RedBalance {
160  public:
162  using ValueType = double;
163 
165  static constexpr bool isContainer{false};
166 
168  static constexpr const char *path{"RedBalance"};
169 
171  static constexpr const char *name{"RedBalance"};
172 
174  RedBalance() = default;
175 
177  explicit constexpr RedBalance(ValueType value) noexcept(
178  std::is_nothrow_move_constructible<ValueType>::value)
179  : m_value{value} {}
180 
182  const ValueType &value() const { return m_value; }
183 
186  return {std::numeric_limits<ValueType>::lowest(),
187  std::numeric_limits<ValueType>::max()};
188  }
189 
191  void setFromString(const std::string &value) { m_value = std::stod(value); }
192 
194  std::string toString() const { return std::to_string(m_value); }
195 
197  bool operator==(const RedBalance &other) const {
198  return m_value == other.m_value;
199  }
200 
202  bool operator!=(const RedBalance &other) const {
203  return m_value != other.m_value;
204  }
205 
207  bool operator<(const RedBalance &other) const {
208  return m_value < other.m_value;
209  }
210 
212  bool operator>(const RedBalance &other) const {
213  return m_value > other.m_value;
214  }
215 
217  friend std::ostream &operator<<(std::ostream &stream,
218  const RedBalance &value) {
219  return stream << value.toString();
220  }
221 
223  friend std::istream &operator>>(std::istream &stream, RedBalance &value) {
224  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
225  std::istreambuf_iterator<char>{}});
226  return stream;
227  }
228 
229  private:
230  ValueType m_value{1.709};
231  };
232 
235  class ZIVID_COMMON ExposureTime {
236  public:
238  using ValueType = std::chrono::microseconds;
239 
241  static constexpr bool isContainer{false};
242 
244  static constexpr const char *path{"ExposureTime"};
245 
247  static constexpr const char *name{"ExposureTime"};
248 
250  ExposureTime() = default;
251 
253  explicit constexpr ExposureTime(ValueType value) noexcept(
254  std::is_nothrow_move_constructible<ValueType>::value)
255  : m_value{value} {}
256 
258  const ValueType &value() const { return m_value; }
259 
262  return {ValueType{8333}, ValueType{100000}};
263  }
264 
266  void setFromString(const std::string &value) {
267  m_value = ValueType{std::stoll(value)};
268  }
269 
271  std::string toString() const { return std::to_string(m_value.count()); }
272 
274  bool operator==(const ExposureTime &other) const {
275  return m_value == other.m_value;
276  }
277 
279  bool operator!=(const ExposureTime &other) const {
280  return m_value != other.m_value;
281  }
282 
284  bool operator<(const ExposureTime &other) const {
285  return m_value < other.m_value;
286  }
287 
289  bool operator>(const ExposureTime &other) const {
290  return m_value > other.m_value;
291  }
292 
294  friend std::ostream &operator<<(std::ostream &stream,
295  const ExposureTime &value) {
296  return stream << value.toString();
297  }
298 
300  friend std::istream &operator>>(std::istream &stream, ExposureTime &value) {
301  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
302  std::istreambuf_iterator<char>{}});
303  return stream;
304  }
305 
306  private:
307  ValueType m_value{8333};
308  };
309 
311  class ZIVID_COMMON Iris {
312  public:
314  using ValueType = size_t;
315 
317  static constexpr bool isContainer{false};
318 
320  static constexpr const char *path{"Iris"};
321 
323  static constexpr const char *name{"Iris"};
324 
326  Iris() = default;
327 
329  explicit constexpr Iris(ValueType value) noexcept(
330  std::is_nothrow_move_constructible<ValueType>::value)
331  : m_value{value} {}
332 
334  const ValueType &value() const { return m_value; }
335 
337  Range<ValueType> range() const { return {0, 72}; }
338 
340  void setFromString(const std::string &value) {
341  m_value = std::stoull(value);
342  }
343 
345  std::string toString() const { return std::to_string(m_value); }
346 
348  bool operator==(const Iris &other) const {
349  return m_value == other.m_value;
350  }
351 
353  bool operator!=(const Iris &other) const {
354  return m_value != other.m_value;
355  }
356 
358  bool operator<(const Iris &other) const { return m_value < other.m_value; }
359 
361  bool operator>(const Iris &other) const { return m_value > other.m_value; }
362 
364  friend std::ostream &operator<<(std::ostream &stream, const Iris &value) {
365  return stream << value.toString();
366  }
367 
369  friend std::istream &operator>>(std::istream &stream, Iris &value) {
370  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
371  std::istreambuf_iterator<char>{}});
372  return stream;
373  }
374 
375  private:
376  ValueType m_value{22};
377  };
378 
380  class ZIVID_COMMON Brightness {
381  public:
383  using ValueType = double;
384 
386  static constexpr bool isContainer{false};
387 
389  static constexpr const char *path{"Brightness"};
390 
392  static constexpr const char *name{"Brightness"};
393 
395  Brightness() = default;
396 
398  explicit constexpr Brightness(ValueType value) noexcept(
399  std::is_nothrow_move_constructible<ValueType>::value)
400  : m_value{value} {}
401 
403  const ValueType &value() const { return m_value; }
404 
406  Range<ValueType> range() const { return {0, 1}; }
407 
409  void setFromString(const std::string &value) { m_value = std::stod(value); }
410 
412  std::string toString() const { return std::to_string(m_value); }
413 
415  bool operator==(const Brightness &other) const {
416  return m_value == other.m_value;
417  }
418 
420  bool operator!=(const Brightness &other) const {
421  return m_value != other.m_value;
422  }
423 
425  bool operator<(const Brightness &other) const {
426  return m_value < other.m_value;
427  }
428 
430  bool operator>(const Brightness &other) const {
431  return m_value > other.m_value;
432  }
433 
435  friend std::ostream &operator<<(std::ostream &stream,
436  const Brightness &value) {
437  return stream << value.toString();
438  }
439 
441  friend std::istream &operator>>(std::istream &stream, Brightness &value) {
442  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
443  std::istreambuf_iterator<char>{}});
444  return stream;
445  }
446 
447  private:
448  ValueType m_value{1};
449  };
450 
453  class ZIVID_COMMON Bidirectional {
454  public:
456  using ValueType = bool;
457  static const Bidirectional yes;
458  static const Bidirectional no;
459 
461  static constexpr bool isContainer{false};
462 
464  static constexpr const char *path{"Bidirectional"};
465 
467  static constexpr const char *name{"Bidirectional"};
468 
470  Bidirectional() = default;
471 
473  explicit constexpr Bidirectional(ValueType value) noexcept(
474  std::is_nothrow_move_constructible<ValueType>::value)
475  : m_value{value} {}
476 
478  const ValueType &value() const { return m_value; }
479 
481  void setFromString(const std::string &value) { m_value = (value == "yes"); }
482 
484  std::string toString() const { return m_value ? "yes" : "no"; }
485 
487  explicit operator bool() const { return m_value; }
488 
490  bool operator==(const Bidirectional &other) const {
491  return m_value == other.m_value;
492  }
493 
495  bool operator!=(const Bidirectional &other) const {
496  return m_value != other.m_value;
497  }
498 
500  friend std::ostream &operator<<(std::ostream &stream,
501  const Bidirectional &value) {
502  return stream << value.toString();
503  }
504 
506  friend std::istream &operator>>(std::istream &stream,
507  Bidirectional &value) {
508  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
509  std::istreambuf_iterator<char>{}});
510  return stream;
511  }
512 
513  private:
514  ValueType m_value{false};
515  };
516 
518  class ZIVID_COMMON Filters {
519  public:
520  Filters() = default;
521 
523  explicit Filters(const std::string &fileName);
524 
526  static constexpr bool isContainer{true};
527 
529  static constexpr const char *path{"Filters"};
530 
532  static constexpr const char *name{"Filters"};
533 
535  void set(const std::string &fullPath, const std::string &value);
536 
538  std::string getString(const std::string &fullPath) const;
539 
541  class ZIVID_COMMON Contrast {
542  public:
543  Contrast() = default;
544 
546  explicit Contrast(const std::string &fileName);
547 
549  static constexpr bool isContainer{true};
550 
552  static constexpr const char *path{"Filters/Contrast"};
553 
555  static constexpr const char *name{"Contrast"};
556 
558  void set(const std::string &fullPath, const std::string &value);
559 
561  std::string getString(const std::string &fullPath) const;
562 
565  class ZIVID_COMMON Threshold {
566  public:
568  using ValueType = double;
569 
571  static constexpr bool isContainer{false};
572 
574  static constexpr const char *path{"Filters/Contrast/Threshold"};
575 
577  static constexpr const char *name{"Threshold"};
578 
580  Threshold() = default;
581 
583  explicit constexpr Threshold(ValueType value) noexcept(
584  std::is_nothrow_move_constructible<ValueType>::value)
585  : m_value{value} {}
586 
588  const ValueType &value() const { return m_value; }
589 
592  return {std::numeric_limits<ValueType>::lowest(),
593  std::numeric_limits<ValueType>::max()};
594  }
595 
597  void setFromString(const std::string &value) {
598  m_value = std::stod(value);
599  }
600 
602  std::string toString() const { return std::to_string(m_value); }
603 
605  bool operator==(const Threshold &other) const {
606  return m_value == other.m_value;
607  }
608 
610  bool operator!=(const Threshold &other) const {
611  return m_value != other.m_value;
612  }
613 
615  bool operator<(const Threshold &other) const {
616  return m_value < other.m_value;
617  }
618 
620  bool operator>(const Threshold &other) const {
621  return m_value > other.m_value;
622  }
623 
625  friend std::ostream &operator<<(std::ostream &stream,
626  const Threshold &value) {
627  return stream << value.toString();
628  }
629 
631  friend std::istream &operator>>(std::istream &stream,
632  Threshold &value) {
633  value.setFromString(
634  std::string{std::istreambuf_iterator<char>{stream},
635  std::istreambuf_iterator<char>{}});
636  return stream;
637  }
638 
639  private:
640  ValueType m_value{5};
641  };
642 
643  private:
644  Threshold m_threshold{};
645 
646  public:
648  Contrast &set(const Threshold &value) {
649 
650  if (value.value() < value.range().min() ||
651  value.value() > value.range().max()) {
652  throw std::out_of_range("Contrast: " + std::to_string(value.value()) +
653  ", is out of range: {" +
654  std::to_string(value.range().min()) + ", " +
655  std::to_string(value.range().max()) + "}");
656  }
657 
658  m_threshold = value;
659  return *this;
660  }
662  const Threshold &threshold() const { return m_threshold; }
663 
666  template <typename F> void forEach(const F &f) const { f(m_threshold); }
667 
670  template <typename F> void forEach(const F &f) { f(m_threshold); }
671 
674  template <typename F> void traverseValues(const F &f) const {
675  f(m_threshold);
676  }
677 
680  template <typename F> void traverseValues(const F &f) { f(m_threshold); }
681 
683  std::string toString() const;
684 
686  friend std::ostream &operator<<(std::ostream &stream,
687  const Contrast &value) {
688  return stream << value.toString();
689  }
690 
692  void save(const std::string &fileName) const;
693 
695  void setFromString(const std::string &value);
696 
698  friend std::istream &operator>>(std::istream &stream, Contrast &value) {
699  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
700  std::istreambuf_iterator<char>{}});
701  return stream;
702  }
703 
705  void load(const std::string &fileName);
706 
708  bool operator==(const Contrast &other) const;
709 
711  bool operator!=(const Contrast &other) const;
712  };
713 
715  class ZIVID_COMMON Outlier {
716  public:
717  Outlier() = default;
718 
720  explicit Outlier(const std::string &fileName);
721 
723  static constexpr bool isContainer{true};
724 
726  static constexpr const char *path{"Filters/Outlier"};
727 
729  static constexpr const char *name{"Outlier"};
730 
732  void set(const std::string &fullPath, const std::string &value);
733 
735  std::string getString(const std::string &fullPath) const;
736 
738  class ZIVID_COMMON Enabled {
739  public:
741  using ValueType = bool;
742  static const Enabled yes;
743  static const Enabled no;
744 
746  static constexpr bool isContainer{false};
747 
749  static constexpr const char *path{"Filters/Outlier/Enabled"};
750 
752  static constexpr const char *name{"Enabled"};
753 
755  Enabled() = default;
756 
758  explicit constexpr Enabled(ValueType value) noexcept(
759  std::is_nothrow_move_constructible<ValueType>::value)
760  : m_value{value} {}
761 
763  const ValueType &value() const { return m_value; }
764 
766  void setFromString(const std::string &value) {
767  m_value = (value == "yes");
768  }
769 
771  std::string toString() const { return m_value ? "yes" : "no"; }
772 
774  explicit operator bool() const { return m_value; }
775 
777  bool operator==(const Enabled &other) const {
778  return m_value == other.m_value;
779  }
780 
782  bool operator!=(const Enabled &other) const {
783  return m_value != other.m_value;
784  }
785 
787  friend std::ostream &operator<<(std::ostream &stream,
788  const Enabled &value) {
789  return stream << value.toString();
790  }
791 
793  friend std::istream &operator>>(std::istream &stream, Enabled &value) {
794  value.setFromString(
795  std::string{std::istreambuf_iterator<char>{stream},
796  std::istreambuf_iterator<char>{}});
797  return stream;
798  }
799 
800  private:
801  ValueType m_value{true};
802  };
803 
806  class ZIVID_COMMON Threshold {
807  public:
809  using ValueType = double;
810 
812  static constexpr bool isContainer{false};
813 
815  static constexpr const char *path{"Filters/Outlier/Threshold"};
816 
818  static constexpr const char *name{"Threshold"};
819 
821  Threshold() = default;
822 
824  explicit constexpr Threshold(ValueType value) noexcept(
825  std::is_nothrow_move_constructible<ValueType>::value)
826  : m_value{value} {}
827 
829  const ValueType &value() const { return m_value; }
830 
833  return {std::numeric_limits<ValueType>::lowest(),
834  std::numeric_limits<ValueType>::max()};
835  }
836 
838  void setFromString(const std::string &value) {
839  m_value = std::stod(value);
840  }
841 
843  std::string toString() const { return std::to_string(m_value); }
844 
846  bool operator==(const Threshold &other) const {
847  return m_value == other.m_value;
848  }
849 
851  bool operator!=(const Threshold &other) const {
852  return m_value != other.m_value;
853  }
854 
856  bool operator<(const Threshold &other) const {
857  return m_value < other.m_value;
858  }
859 
861  bool operator>(const Threshold &other) const {
862  return m_value > other.m_value;
863  }
864 
866  friend std::ostream &operator<<(std::ostream &stream,
867  const Threshold &value) {
868  return stream << value.toString();
869  }
870 
872  friend std::istream &operator>>(std::istream &stream,
873  Threshold &value) {
874  value.setFromString(
875  std::string{std::istreambuf_iterator<char>{stream},
876  std::istreambuf_iterator<char>{}});
877  return stream;
878  }
879 
880  private:
881  ValueType m_value{5};
882  };
883 
884  private:
885  Enabled m_enabled{};
886 
887  public:
889  Outlier &set(const Enabled &value) {
890 
891  m_enabled = value;
892  return *this;
893  }
895  const Enabled &isEnabled() const { return m_enabled; }
896 
897  private:
898  Threshold m_threshold{};
899 
900  public:
902  Outlier &set(const Threshold &value) {
903 
904  if (value.value() < value.range().min() ||
905  value.value() > value.range().max()) {
906  throw std::out_of_range("Outlier: " + std::to_string(value.value()) +
907  ", is out of range: {" +
908  std::to_string(value.range().min()) + ", " +
909  std::to_string(value.range().max()) + "}");
910  }
911 
912  m_threshold = value;
913  return *this;
914  }
916  const Threshold &threshold() const { return m_threshold; }
917 
920  template <typename F> void forEach(const F &f) const {
921  f(m_enabled);
922  f(m_threshold);
923  }
924 
927  template <typename F> void forEach(const F &f) {
928  f(m_enabled);
929  f(m_threshold);
930  }
931 
934  template <typename F> void traverseValues(const F &f) const {
935  f(m_enabled);
936  f(m_threshold);
937  }
938 
941  template <typename F> void traverseValues(const F &f) {
942  f(m_enabled);
943  f(m_threshold);
944  }
945 
947  std::string toString() const;
948 
950  friend std::ostream &operator<<(std::ostream &stream,
951  const Outlier &value) {
952  return stream << value.toString();
953  }
954 
956  void save(const std::string &fileName) const;
957 
959  void setFromString(const std::string &value);
960 
962  friend std::istream &operator>>(std::istream &stream, Outlier &value) {
963  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
964  std::istreambuf_iterator<char>{}});
965  return stream;
966  }
967 
969  void load(const std::string &fileName);
970 
972  bool operator==(const Outlier &other) const;
973 
975  bool operator!=(const Outlier &other) const;
976  };
977 
979  class ZIVID_COMMON Saturated {
980  public:
981  Saturated() = default;
982 
984  explicit Saturated(const std::string &fileName);
985 
987  static constexpr bool isContainer{true};
988 
990  static constexpr const char *path{"Filters/Saturated"};
991 
993  static constexpr const char *name{"Saturated"};
994 
996  void set(const std::string &fullPath, const std::string &value);
997 
999  std::string getString(const std::string &fullPath) const;
1000 
1002  class ZIVID_COMMON Enabled {
1003  public:
1005  using ValueType = bool;
1006  static const Enabled yes;
1007  static const Enabled no;
1008 
1010  static constexpr bool isContainer{false};
1011 
1013  static constexpr const char *path{"Filters/Saturated/Enabled"};
1014 
1016  static constexpr const char *name{"Enabled"};
1017 
1019  Enabled() = default;
1020 
1022  explicit constexpr Enabled(ValueType value) noexcept(
1023  std::is_nothrow_move_constructible<ValueType>::value)
1024  : m_value{value} {}
1025 
1027  const ValueType &value() const { return m_value; }
1028 
1030  void setFromString(const std::string &value) {
1031  m_value = (value == "yes");
1032  }
1033 
1035  std::string toString() const { return m_value ? "yes" : "no"; }
1036 
1038  explicit operator bool() const { return m_value; }
1039 
1041  bool operator==(const Enabled &other) const {
1042  return m_value == other.m_value;
1043  }
1044 
1046  bool operator!=(const Enabled &other) const {
1047  return m_value != other.m_value;
1048  }
1049 
1051  friend std::ostream &operator<<(std::ostream &stream,
1052  const Enabled &value) {
1053  return stream << value.toString();
1054  }
1055 
1057  friend std::istream &operator>>(std::istream &stream, Enabled &value) {
1058  value.setFromString(
1059  std::string{std::istreambuf_iterator<char>{stream},
1060  std::istreambuf_iterator<char>{}});
1061  return stream;
1062  }
1063 
1064  private:
1065  ValueType m_value{true};
1066  };
1067 
1068  private:
1069  Enabled m_enabled{};
1070 
1071  public:
1073  Saturated &set(const Enabled &value) {
1074 
1075  m_enabled = value;
1076  return *this;
1077  }
1079  const Enabled &isEnabled() const { return m_enabled; }
1080 
1083  template <typename F> void forEach(const F &f) const { f(m_enabled); }
1084 
1087  template <typename F> void forEach(const F &f) { f(m_enabled); }
1088 
1091  template <typename F> void traverseValues(const F &f) const {
1092  f(m_enabled);
1093  }
1094 
1097  template <typename F> void traverseValues(const F &f) { f(m_enabled); }
1098 
1100  std::string toString() const;
1101 
1103  friend std::ostream &operator<<(std::ostream &stream,
1104  const Saturated &value) {
1105  return stream << value.toString();
1106  }
1107 
1109  void save(const std::string &fileName) const;
1110 
1112  void setFromString(const std::string &value);
1113 
1115  friend std::istream &operator>>(std::istream &stream, Saturated &value) {
1116  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
1117  std::istreambuf_iterator<char>{}});
1118  return stream;
1119  }
1120 
1122  void load(const std::string &fileName);
1123 
1125  bool operator==(const Saturated &other) const;
1126 
1128  bool operator!=(const Saturated &other) const;
1129  };
1130 
1133  class ZIVID_COMMON Reflection {
1134  public:
1135  Reflection() = default;
1136 
1138  explicit Reflection(const std::string &fileName);
1139 
1141  static constexpr bool isContainer{true};
1142 
1144  static constexpr const char *path{"Filters/Reflection"};
1145 
1147  static constexpr const char *name{"Reflection"};
1148 
1150  void set(const std::string &fullPath, const std::string &value);
1151 
1153  std::string getString(const std::string &fullPath) const;
1154 
1158  class ZIVID_COMMON Enabled {
1159  public:
1161  using ValueType = bool;
1162  static const Enabled yes;
1163  static const Enabled no;
1164 
1166  static constexpr bool isContainer{false};
1167 
1169  static constexpr const char *path{"Filters/Reflection/Enabled"};
1170 
1172  static constexpr const char *name{"Enabled"};
1173 
1175  Enabled() = default;
1176 
1178  explicit constexpr Enabled(ValueType value) noexcept(
1179  std::is_nothrow_move_constructible<ValueType>::value)
1180  : m_value{value} {}
1181 
1183  const ValueType &value() const { return m_value; }
1184 
1186  void setFromString(const std::string &value) {
1187  m_value = (value == "yes");
1188  }
1189 
1191  std::string toString() const { return m_value ? "yes" : "no"; }
1192 
1194  explicit operator bool() const { return m_value; }
1195 
1197  bool operator==(const Enabled &other) const {
1198  return m_value == other.m_value;
1199  }
1200 
1202  bool operator!=(const Enabled &other) const {
1203  return m_value != other.m_value;
1204  }
1205 
1207  friend std::ostream &operator<<(std::ostream &stream,
1208  const Enabled &value) {
1209  return stream << value.toString();
1210  }
1211 
1213  friend std::istream &operator>>(std::istream &stream, Enabled &value) {
1214  value.setFromString(
1215  std::string{std::istreambuf_iterator<char>{stream},
1216  std::istreambuf_iterator<char>{}});
1217  return stream;
1218  }
1219 
1220  private:
1221  ValueType m_value{false};
1222  };
1223 
1224  private:
1225  Enabled m_enabled{};
1226 
1227  public:
1229  Reflection &set(const Enabled &value) {
1230 
1231  m_enabled = value;
1232  return *this;
1233  }
1235  const Enabled &isEnabled() const { return m_enabled; }
1236 
1239  template <typename F> void forEach(const F &f) const { f(m_enabled); }
1240 
1243  template <typename F> void forEach(const F &f) { f(m_enabled); }
1244 
1247  template <typename F> void traverseValues(const F &f) const {
1248  f(m_enabled);
1249  }
1250 
1253  template <typename F> void traverseValues(const F &f) { f(m_enabled); }
1254 
1256  std::string toString() const;
1257 
1259  friend std::ostream &operator<<(std::ostream &stream,
1260  const Reflection &value) {
1261  return stream << value.toString();
1262  }
1263 
1265  void save(const std::string &fileName) const;
1266 
1268  void setFromString(const std::string &value);
1269 
1271  friend std::istream &operator>>(std::istream &stream, Reflection &value) {
1272  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
1273  std::istreambuf_iterator<char>{}});
1274  return stream;
1275  }
1276 
1278  void load(const std::string &fileName);
1279 
1281  bool operator==(const Reflection &other) const;
1282 
1284  bool operator!=(const Reflection &other) const;
1285  };
1286 
1287  private:
1288  Contrast m_contrast{};
1289 
1290  public:
1292  Filters &set(const Contrast &value) {
1293 
1294  m_contrast = value;
1295  return *this;
1296  }
1298  const Contrast &contrast() const { return m_contrast; }
1299 
1301  Filters &set(const Contrast::Threshold &value) {
1302 
1303  if (value.value() < value.range().min() ||
1304  value.value() > value.range().max()) {
1305  throw std::out_of_range("Filters: " + std::to_string(value.value()) +
1306  ", is out of range: {" +
1307  std::to_string(value.range().min()) + ", " +
1308  std::to_string(value.range().max()) + "}");
1309  }
1310 
1311  m_contrast.set(value);
1312  return *this;
1313  }
1314 
1315  private:
1316  Outlier m_outlier{};
1317 
1318  public:
1320  Filters &set(const Outlier &value) {
1321 
1322  m_outlier = value;
1323  return *this;
1324  }
1326  const Outlier &outlier() const { return m_outlier; }
1327 
1329  Filters &set(const Outlier::Enabled &value) {
1330 
1331  m_outlier.set(value);
1332  return *this;
1333  }
1334 
1336  Filters &set(const Outlier::Threshold &value) {
1337 
1338  if (value.value() < value.range().min() ||
1339  value.value() > value.range().max()) {
1340  throw std::out_of_range("Filters: " + std::to_string(value.value()) +
1341  ", is out of range: {" +
1342  std::to_string(value.range().min()) + ", " +
1343  std::to_string(value.range().max()) + "}");
1344  }
1345 
1346  m_outlier.set(value);
1347  return *this;
1348  }
1349 
1350  private:
1351  Saturated m_saturated{};
1352 
1353  public:
1355  Filters &set(const Saturated &value) {
1356 
1357  m_saturated = value;
1358  return *this;
1359  }
1361  const Saturated &saturated() const { return m_saturated; }
1362 
1364  Filters &set(const Saturated::Enabled &value) {
1365 
1366  m_saturated.set(value);
1367  return *this;
1368  }
1369 
1370  private:
1371  Reflection m_reflection{};
1372 
1373  public:
1375  Filters &set(const Reflection &value) {
1376 
1377  m_reflection = value;
1378  return *this;
1379  }
1381  const Reflection &reflection() const { return m_reflection; }
1382 
1384  Filters &set(const Reflection::Enabled &value) {
1385 
1386  m_reflection.set(value);
1387  return *this;
1388  }
1389 
1392  template <typename F> void forEach(const F &f) const {
1393  f(m_contrast);
1394  f(m_outlier);
1395  f(m_saturated);
1396  f(m_reflection);
1397  }
1398 
1401  template <typename F> void forEach(const F &f) {
1402  f(m_contrast);
1403  f(m_outlier);
1404  f(m_saturated);
1405  f(m_reflection);
1406  }
1407 
1410  template <typename F> void traverseValues(const F &f) const {
1411  m_contrast.traverseValues(f);
1412  m_outlier.traverseValues(f);
1413  m_saturated.traverseValues(f);
1414  m_reflection.traverseValues(f);
1415  }
1416 
1419  template <typename F> void traverseValues(const F &f) {
1420  m_contrast.traverseValues(f);
1421  m_outlier.traverseValues(f);
1422  m_saturated.traverseValues(f);
1423  m_reflection.traverseValues(f);
1424  }
1425 
1427  std::string toString() const;
1428 
1430  friend std::ostream &operator<<(std::ostream &stream,
1431  const Filters &value) {
1432  return stream << value.toString();
1433  }
1434 
1436  void save(const std::string &fileName) const;
1437 
1439  void setFromString(const std::string &value);
1440 
1442  friend std::istream &operator>>(std::istream &stream, Filters &value) {
1443  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
1444  std::istreambuf_iterator<char>{}});
1445  return stream;
1446  }
1447 
1449  void load(const std::string &fileName);
1450 
1452  bool operator==(const Filters &other) const;
1453 
1455  bool operator!=(const Filters &other) const;
1456  };
1457 
1458 private:
1459  BlueBalance m_blueBalance{};
1460 
1461 public:
1463  Settings &set(const BlueBalance &value) {
1464 
1465  if (value.value() < value.range().min() ||
1466  value.value() > value.range().max()) {
1467  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1468  ", is out of range: {" +
1469  std::to_string(value.range().min()) + ", " +
1470  std::to_string(value.range().max()) + "}");
1471  }
1472 
1473  m_blueBalance = value;
1474  return *this;
1475  }
1477  const BlueBalance &blueBalance() const { return m_blueBalance; }
1478 
1479 private:
1480  RedBalance m_redBalance{};
1481 
1482 public:
1484  Settings &set(const RedBalance &value) {
1485 
1486  if (value.value() < value.range().min() ||
1487  value.value() > value.range().max()) {
1488  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1489  ", is out of range: {" +
1490  std::to_string(value.range().min()) + ", " +
1491  std::to_string(value.range().max()) + "}");
1492  }
1493 
1494  m_redBalance = value;
1495  return *this;
1496  }
1498  const RedBalance &redBalance() const { return m_redBalance; }
1499 
1500 private:
1501  ExposureTime m_exposureTime{};
1502 
1503 public:
1505  Settings &set(const ExposureTime &value) {
1506 
1507  if (value.value().count() < value.range().min().count() ||
1508  value.value().count() > value.range().max().count()) {
1509  throw std::out_of_range(
1510  "Settings: " + std::to_string(value.value().count()) +
1511  ", is out of range: {" + std::to_string(value.range().min().count()) +
1512  ", " + std::to_string(value.range().max().count()) + "}");
1513  }
1514 
1515  m_exposureTime = value;
1516  return *this;
1517  }
1519  const ExposureTime &exposureTime() const { return m_exposureTime; }
1520 
1521 private:
1522  Iris m_iris{};
1523 
1524 public:
1526  Settings &set(const Iris &value) {
1527 
1528  if (value.value() < value.range().min() ||
1529  value.value() > value.range().max()) {
1530  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1531  ", is out of range: {" +
1532  std::to_string(value.range().min()) + ", " +
1533  std::to_string(value.range().max()) + "}");
1534  }
1535 
1536  m_iris = value;
1537  return *this;
1538  }
1540  const Iris &iris() const { return m_iris; }
1541 
1542 private:
1543  Brightness m_brightness{};
1544 
1545 public:
1547  Settings &set(const Brightness &value) {
1548 
1549  if (value.value() < value.range().min() ||
1550  value.value() > value.range().max()) {
1551  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1552  ", is out of range: {" +
1553  std::to_string(value.range().min()) + ", " +
1554  std::to_string(value.range().max()) + "}");
1555  }
1556 
1557  m_brightness = value;
1558  return *this;
1559  }
1561  const Brightness &brightness() const { return m_brightness; }
1562 
1563 private:
1564  Bidirectional m_bidirectional{};
1565 
1566 public:
1568  Settings &set(const Bidirectional &value) {
1569 
1570  m_bidirectional = value;
1571  return *this;
1572  }
1574  const Bidirectional &bidirectional() const { return m_bidirectional; }
1575 
1576 private:
1577  Filters m_filters{};
1578 
1579 public:
1581  Settings &set(const Filters &value) {
1582 
1583  m_filters = value;
1584  return *this;
1585  }
1587  const Filters &filters() const { return m_filters; }
1588 
1590  Settings &set(const Filters::Contrast &value) {
1591 
1592  m_filters.set(value);
1593  return *this;
1594  }
1595 
1598 
1599  if (value.value() < value.range().min() ||
1600  value.value() > value.range().max()) {
1601  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1602  ", is out of range: {" +
1603  std::to_string(value.range().min()) + ", " +
1604  std::to_string(value.range().max()) + "}");
1605  }
1606 
1607  m_filters.set(value);
1608  return *this;
1609  }
1610 
1612  Settings &set(const Filters::Outlier &value) {
1613 
1614  m_filters.set(value);
1615  return *this;
1616  }
1617 
1620 
1621  m_filters.set(value);
1622  return *this;
1623  }
1624 
1627 
1628  if (value.value() < value.range().min() ||
1629  value.value() > value.range().max()) {
1630  throw std::out_of_range("Settings: " + std::to_string(value.value()) +
1631  ", is out of range: {" +
1632  std::to_string(value.range().min()) + ", " +
1633  std::to_string(value.range().max()) + "}");
1634  }
1635 
1636  m_filters.set(value);
1637  return *this;
1638  }
1639 
1641  Settings &set(const Filters::Saturated &value) {
1642 
1643  m_filters.set(value);
1644  return *this;
1645  }
1646 
1649 
1650  m_filters.set(value);
1651  return *this;
1652  }
1653 
1655  Settings &set(const Filters::Reflection &value) {
1656 
1657  m_filters.set(value);
1658  return *this;
1659  }
1660 
1663 
1664  m_filters.set(value);
1665  return *this;
1666  }
1667 
1670  template <typename F> void forEach(const F &f) const {
1671  f(m_blueBalance);
1672  f(m_redBalance);
1673  f(m_exposureTime);
1674  f(m_iris);
1675  f(m_brightness);
1676  f(m_bidirectional);
1677  f(m_filters);
1678  }
1679 
1682  template <typename F> void forEach(const F &f) {
1683  f(m_blueBalance);
1684  f(m_redBalance);
1685  f(m_exposureTime);
1686  f(m_iris);
1687  f(m_brightness);
1688  f(m_bidirectional);
1689  f(m_filters);
1690  }
1691 
1694  template <typename F> void traverseValues(const F &f) const {
1695  f(m_blueBalance);
1696  f(m_redBalance);
1697  f(m_exposureTime);
1698  f(m_iris);
1699  f(m_brightness);
1700  f(m_bidirectional);
1701  m_filters.traverseValues(f);
1702  }
1703 
1706  template <typename F> void traverseValues(const F &f) {
1707  f(m_blueBalance);
1708  f(m_redBalance);
1709  f(m_exposureTime);
1710  f(m_iris);
1711  f(m_brightness);
1712  f(m_bidirectional);
1713  m_filters.traverseValues(f);
1714  }
1715 
1717  std::string toString() const;
1718 
1720  friend std::ostream &operator<<(std::ostream &stream, const Settings &value) {
1721  return stream << value.toString();
1722  }
1723 
1725  void save(const std::string &fileName) const;
1726 
1728  void setFromString(const std::string &value);
1729 
1731  friend std::istream &operator>>(std::istream &stream, Settings &value) {
1732  value.setFromString(std::string{std::istreambuf_iterator<char>{stream},
1733  std::istreambuf_iterator<char>{}});
1734  return stream;
1735  }
1736 
1738  void load(const std::string &fileName);
1739 
1741  bool operator==(const Settings &other) const;
1742 
1744  bool operator!=(const Settings &other) const;
1745 
1746 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1747  SettingsInternal &getSettingsInternal() { return *m_internal; }
1750  const SettingsInternal &getSettingsInternal() const { return *m_internal; }
1751 #endif // DOXYGEN_SHOULD_SKIP_THIS
1752 private:
1753  std::unique_ptr<SettingsInternal> m_internal;
1754 };
1755 } // namespace Zivid
1756 
1757 #ifdef _MSC_VER
1758 #pragma warning(pop)
1759 #endif
friend std::istream & operator>>(std::istream &stream, Bidirectional &value)
Operator to set the value from a stream
Definition: Settings.h:506
bool operator>(const Iris &other) const
Comparison operator
Definition: Settings.h:361
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:409
const Brightness & brightness() const
Get Brightness
Definition: Settings.h:1561
constexpr Enabled(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:1178
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:116
const Saturated & saturated() const
Get Saturated
Definition: Settings.h:1361
friend std::istream & operator>>(std::istream &stream, ExposureTime &value)
Operator to set the value from a stream
Definition: Settings.h:300
constexpr Enabled(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:1022
friend std::istream & operator>>(std::istream &stream, Threshold &value)
Operator to set the value from a stream
Definition: Settings.h:872
friend std::ostream & operator<<(std::ostream &stream, const Outlier &value)
Operator to send the value as string to a stream
Definition: Settings.h:950
bool operator==(const ExposureTime &other) const
Comparison operator
Definition: Settings.h:274
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1392
bool operator!=(const Iris &other) const
Comparison operator
Definition: Settings.h:353
bool operator<(const RedBalance &other) const
Comparison operator
Definition: Settings.h:207
const ValueType & value() const
Get the value
Definition: Settings.h:403
std::string toString() const
Get the value as string
Definition: Settings.h:194
White balance of red channel in the camera
Definition: Settings.h:159
Detect and remove points likely to arise from reflections (useful for shiny materials)
Definition: Settings.h:1133
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:670
friend std::istream & operator>>(std::istream &stream, Filters &value)
Operator to set the value from a stream
Definition: Settings.h:1442
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:1091
friend std::istream & operator>>(std::istream &stream, Enabled &value)
Operator to set the value from a stream
Definition: Settings.h:1057
bool operator<(const Threshold &other) const
Comparison operator
Definition: Settings.h:856
const Threshold & threshold() const
Get Threshold
Definition: Settings.h:662
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:832
const Bidirectional & bidirectional() const
Get Bidirectional
Definition: Settings.h:1574
Toggle on or off various filters
Definition: Settings.h:518
Enable or disable the reflection filter.
Definition: Settings.h:1158
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:1410
friend std::istream & operator>>(std::istream &stream, Contrast &value)
Operator to set the value from a stream
Definition: Settings.h:698
const BlueBalance & blueBalance() const
Get BlueBalance
Definition: Settings.h:1477
double ValueType
The type of the underlying value
Definition: Settings.h:162
Class describing a range of values for a given type T The range boudaries for both minimum and maximu...
Definition: Range.h:24
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1682
const RedBalance & redBalance() const
Get RedBalance
Definition: Settings.h:1498
std::string toString() const
Get the value as string
Definition: Settings.h:843
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream
Definition: Settings.h:787
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:766
Enable or disable the use of bi-directional patterns (requires twice as many patterns as well as incr...
Definition: Settings.h:453
bool operator==(const Bidirectional &other) const
Comparison operator
Definition: Settings.h:490
bool operator>(const Threshold &other) const
Comparison operator
Definition: Settings.h:620
Discard points with low contrast values
Definition: Settings.h:541
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream
Definition: Settings.h:294
const Enabled & isEnabled() const
Get Enabled
Definition: Settings.h:1079
const Filters & filters() const
Get Filters
Definition: Settings.h:1587
bool operator==(const Enabled &other) const
Comparison operator
Definition: Settings.h:777
static const Enabled no
Off/disabled.
Definition: Settings.h:1163
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:1694
bool operator==(const Brightness &other) const
Comparison operator
Definition: Settings.h:415
friend std::ostream & operator<<(std::ostream &stream, const Settings &value)
Operator to send the value as string to a stream
Definition: Settings.h:1720
bool operator>(const ExposureTime &other) const
Comparison operator
Definition: Settings.h:289
friend std::istream & operator>>(std::istream &stream, Threshold &value)
Operator to set the value from a stream
Definition: Settings.h:631
bool operator==(const Enabled &other) const
Comparison operator
Definition: Settings.h:1041
const Iris & iris() const
Get Iris
Definition: Settings.h:1540
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1243
bool operator!=(const ExposureTime &other) const
Comparison operator
Definition: Settings.h:279
constexpr ExposureTime(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:253
double ValueType
The type of the underlying value
Definition: Settings.h:568
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:927
White balance of blue channel in the camera
Definition: Settings.h:84
friend std::istream & operator>>(std::istream &stream, Enabled &value)
Operator to set the value from a stream
Definition: Settings.h:1213
void setFromString(const std::string &value)
Set from the given string
std::string toString() const
Get the value as string
Definition: Settings.h:771
constexpr Threshold(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:583
std::string toString() const
Get the value as string
Definition: Settings.h:412
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:1186
static const Bidirectional yes
On/enabled.
Definition: Settings.h:457
bool operator==(const BlueBalance &other) const
Comparison operator
Definition: Settings.h:122
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream
Definition: Settings.h:1051
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:337
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1401
friend std::ostream & operator<<(std::ostream &stream, const BlueBalance &value)
Operator to serialize the value to a stream
Definition: Settings.h:142
constexpr Brightness(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:398
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1239
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:185
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:941
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:266
const ExposureTime & exposureTime() const
Get ExposureTime
Definition: Settings.h:1519
bool operator!=(const Enabled &other) const
Comparison operator
Definition: Settings.h:1046
void setFromString(const std::string &value)
Set from the given string
bool operator==(const Iris &other) const
Comparison operator
Definition: Settings.h:348
bool operator==(const Threshold &other) const
Comparison operator
Definition: Settings.h:846
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:597
static const Enabled no
Off/disabled.
Definition: Settings.h:743
const Reflection & reflection() const
Get Reflection
Definition: Settings.h:1381
void setFromString(const std::string &value)
Set from the given string
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream
Definition: Settings.h:435
const ValueType & value() const
Get the value
Definition: Settings.h:182
bool operator!=(const Brightness &other) const
Comparison operator
Definition: Settings.h:420
std::string toString() const
Get the value as string
Definition: Settings.h:345
friend std::istream & operator>>(std::istream &stream, Enabled &value)
Operator to set the value from a stream
Definition: Settings.h:793
bool operator!=(const Threshold &other) const
Comparison operator
Definition: Settings.h:610
void setFromString(const std::string &value)
Set from the given string
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:1706
size_t ValueType
The type of the underlying value
Definition: Settings.h:314
static const Enabled yes
On/enabled.
Definition: Settings.h:742
std::string toString() const
Get the value as string
std::string toString() const
Get the value as string
Definition: Settings.h:484
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:340
Enable or disable the saturation filter
Definition: Settings.h:1002
bool ValueType
The type of the underlying value
Definition: Settings.h:456
bool ValueType
The type of the underlying value
Definition: Settings.h:1161
friend std::ostream & operator<<(std::ostream &stream, const Contrast &value)
Operator to send the value as string to a stream
Definition: Settings.h:686
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:920
friend std::istream & operator>>(std::istream &stream, Reflection &value)
Operator to set the value from a stream
Definition: Settings.h:1271
bool operator==(const Threshold &other) const
Comparison operator
Definition: Settings.h:605
Enable or disable the outlier filter
Definition: Settings.h:738
std::chrono::microseconds ValueType
The type of the underlying value
Definition: Settings.h:238
Definition: Application.h:19
bool operator<(const BlueBalance &other) const
Comparison operator
Definition: Settings.h:132
friend std::ostream & operator<<(std::ostream &stream, const Filters &value)
Operator to send the value as string to a stream
Definition: Settings.h:1430
bool operator!=(const Threshold &other) const
Comparison operator
Definition: Settings.h:851
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:110
double ValueType
The type of the underlying value
Definition: Settings.h:383
const ValueType & value() const
Get the value
Definition: Settings.h:258
const Enabled & isEnabled() const
Get Enabled
Definition: Settings.h:1235
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:591
bool operator>(const RedBalance &other) const
Comparison operator
Definition: Settings.h:212
bool ValueType
The type of the underlying value
Definition: Settings.h:741
Disregard points with contrast below the given value
Definition: Settings.h:565
bool ValueType
The type of the underlying value
Definition: Settings.h:1005
bool operator!=(const Bidirectional &other) const
Comparison operator
Definition: Settings.h:495
double ValueType
The type of the underlying value
Definition: Settings.h:87
Definitions for export of DLL interfaces
static const Bidirectional no
Off/disabled.
Definition: Settings.h:458
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1087
friend std::ostream & operator<<(std::ostream &stream, const Saturated &value)
Operator to send the value as string to a stream
Definition: Settings.h:1103
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:1247
friend std::istream & operator>>(std::istream &stream, Settings &value)
Operator to set the value from a stream
Definition: Settings.h:1731
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:1253
Class describing a range of values
const Threshold & threshold() const
Get Threshold
Definition: Settings.h:916
constexpr Enabled(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:758
friend std::istream & operator>>(std::istream &stream, BlueBalance &value)
Operator to set the value from a stream
Definition: Settings.h:148
constexpr Bidirectional(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:473
friend std::ostream & operator<<(std::ostream &stream, const Bidirectional &value)
Operator to serialize the value to a stream
Definition: Settings.h:500
constexpr RedBalance(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:177
double ValueType
The type of the underlying value
Definition: Settings.h:809
constexpr Iris(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:329
Discard pixels that are saturated in the image
Definition: Settings.h:979
friend std::istream & operator>>(std::istream &stream, Outlier &value)
Operator to set the value from a stream
Definition: Settings.h:962
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:261
void setFromString(const std::string &value)
Set from the given string
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:481
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:1097
std::string toString() const
Get the value as string
Mark point as an outlier if neighboring pixel has a 3D distance above given threshold
Definition: Settings.h:806
ZIVID_COMMON std::string toString(const std::exception &exception)
Get string representation of the exception
const ValueType & value() const
Get the value
Definition: Settings.h:763
bool operator==(const RedBalance &other) const
Comparison operator
Definition: Settings.h:197
friend std::ostream & operator<<(std::ostream &stream, const Reflection &value)
Operator to send the value as string to a stream
Definition: Settings.h:1259
const Enabled & isEnabled() const
Get Enabled
Definition: Settings.h:895
Exposure time for each single image in the measurement.
Definition: Settings.h:235
const Contrast & contrast() const
Get Contrast
Definition: Settings.h:1298
std::string toString() const
Get the value as string
Definition: Settings.h:1035
const ValueType & value() const
Get the value
Definition: Settings.h:829
friend std::ostream & operator<<(std::ostream &stream, const Threshold &value)
Operator to serialize the value to a stream
Definition: Settings.h:625
constexpr Threshold(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:824
friend std::ostream & operator<<(std::ostream &stream, const Iris &value)
Operator to serialize the value to a stream
Definition: Settings.h:364
std::string toString() const
Get the value as string
Definition: Settings.h:271
friend std::istream & operator>>(std::istream &stream, Brightness &value)
Operator to set the value from a stream
Definition: Settings.h:441
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream
Definition: Settings.h:1207
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1670
const ValueType & value() const
Get the value
Definition: Settings.h:1183
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:191
bool operator<(const Iris &other) const
Comparison operator
Definition: Settings.h:358
std::string toString() const
Get the value as string
std::string toString() const
Get the value as string
bool operator==(const Enabled &other) const
Comparison operator
Definition: Settings.h:1197
std::string toString() const
Get the value as string
bool operator!=(const Enabled &other) const
Comparison operator
Definition: Settings.h:1202
const ValueType & value() const
Get the value
Definition: Settings.h:1027
const ValueType & value() const
Get the value
Definition: Settings.h:107
friend std::ostream & operator<<(std::ostream &stream, const RedBalance &value)
Operator to serialize the value to a stream
Definition: Settings.h:217
void setFromString(const std::string &value)
Set from the given string
Outlier filter based on connected components
Definition: Settings.h:715
void set(const std::string &fullPath, const std::string &value)
Set a value from string by specifying the path
const Outlier & outlier() const
Get Outlier
Definition: Settings.h:1326
bool operator>(const Brightness &other) const
Comparison operator
Definition: Settings.h:430
bool operator>(const BlueBalance &other) const
Comparison operator
Definition: Settings.h:137
friend std::istream & operator>>(std::istream &stream, Iris &value)
Operator to set the value from a stream
Definition: Settings.h:369
Settings for a Zivid camera
Definition: Settings.h:50
friend std::ostream & operator<<(std::ostream &stream, const Threshold &value)
Operator to serialize the value to a stream
Definition: Settings.h:866
bool operator>(const Threshold &other) const
Comparison operator
Definition: Settings.h:861
const ValueType & value() const
Get the value
Definition: Settings.h:588
Iris (aperture) setting for the camera
Definition: Settings.h:311
static const Enabled yes
On/enabled.
Definition: Settings.h:1162
Brightness in the light output from the projector
Definition: Settings.h:380
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:1419
std::string toString() const
Get the value as string
Definition: Settings.h:602
bool operator<(const ExposureTime &other) const
Comparison operator
Definition: Settings.h:284
std::string toString() const
Get the value as string
Definition: Settings.h:119
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:674
void traverseValues(const F &f) const
Traverse the entire tree using the given function with the value of the member as parameter...
Definition: Settings.h:934
constexpr BlueBalance(ValueType value) noexcept(std::is_nothrow_move_constructible< ValueType >::value)
Constructor
Definition: Settings.h:102
bool operator!=(const BlueBalance &other) const
Comparison operator
Definition: Settings.h:127
void set(const std::string &fullPath, const std::string &value)
Set a value from string by specifying the path
friend std::istream & operator>>(std::istream &stream, Saturated &value)
Operator to set the value from a stream
Definition: Settings.h:1115
bool operator<(const Brightness &other) const
Comparison operator
Definition: Settings.h:425
Range< ValueType > range() const
The range of valid values
Definition: Settings.h:406
std::string toString() const
Get the value as string
Definition: Settings.h:1191
const ValueType & value() const
Get the value
Definition: Settings.h:334
static const Enabled yes
On/enabled.
Definition: Settings.h:1006
static const Enabled no
Off/disabled.
Definition: Settings.h:1007
bool operator!=(const Enabled &other) const
Comparison operator
Definition: Settings.h:782
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:838
const ValueType & value() const
Get the value
Definition: Settings.h:478
void traverseValues(const F &f)
Traverse all members using the given function with the value of the member as parameter
Definition: Settings.h:680
std::string toString() const
Get the value as string
bool operator!=(const RedBalance &other) const
Comparison operator
Definition: Settings.h:202
friend std::istream & operator>>(std::istream &stream, RedBalance &value)
Operator to set the value from a stream
Definition: Settings.h:223
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:666
bool operator<(const Threshold &other) const
Comparison operator
Definition: Settings.h:615
void setFromString(const std::string &value)
Set the value from string
Definition: Settings.h:1030
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings.h:1083