Zivid C++ API  2.4.2+1a2e8cfb-1
Defining the Future of 3D Machine Vision
Settings2D.h
Go to the documentation of this file.
1 
2 
3 /*******************************************************************************
4 
5  * This file is part of the Zivid 3D Camera API
6 
7  *
8 
9  * Copyright 2015-2021 (C) Zivid AS
10 
11  * All rights reserved.
12 
13  *
14 
15  * Zivid Software License, v1.0
16 
17  *
18 
19  * Redistribution and use in source and binary forms, with or without
20 
21  * modification, are permitted provided that the following conditions are met:
22 
23  *
24 
25  * 1. Redistributions of source code must retain the above copyright notice,
26 
27  * this list of conditions and the following disclaimer.
28 
29  *
30 
31  * 2. Redistributions in binary form must reproduce the above copyright notice,
32 
33  * this list of conditions and the following disclaimer in the documentation
34 
35  * and/or other materials provided with the distribution.
36 
37  *
38 
39  * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40 
41  * to endorse or promote products derived from this software without specific
42 
43  * prior written permission.
44 
45  *
46 
47  * 4. This software, with or without modification, must not be used with any
48 
49  * other 3D camera than from Zivid AS.
50 
51  *
52 
53  * 5. Any software provided in binary form under this license must not be
54 
55  * reverse engineered, decompiled, modified and/or disassembled.
56 
57  *
58 
59  * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60 
61  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62 
63  * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64 
65  * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66 
67  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68 
69  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70 
71  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72 
73  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 
75  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76 
77  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78 
79  *
80 
81  * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82 
83  * Info: http://www.zivid.com
84 
85  ******************************************************************************/
86 
87 
88 
89 #pragma once
90 
91 #include <array>
92 #include <chrono>
93 #include <cmath>
94 #include <ctime>
95 #include <iomanip>
96 #include <memory>
97 #include <set>
98 #include <sstream>
99 #include <string>
100 #include <tuple>
101 #include <utility>
102 #include <vector>
103 
106 #include "Zivid/DataModel/Traits.h"
107 #include "Zivid/Detail/CoreExport.h"
108 #include "Zivid/Detail/TypeTraits.h"
109 #include "Zivid/Range.h"
110 
111 #ifdef _MSC_VER
112 # pragma warning(push)
113 # pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114 #endif
115 
116 namespace Zivid
117 {
120  {
121  public:
123  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
124 
126  static constexpr const char *path{ "" };
127 
129  static constexpr const char *name{ "Settings2D" };
130 
132  static constexpr const char *description{
133  R"description(Settings used when capturing 2D images with a Zivid camera)description"
134  };
135 
136  static constexpr size_t version{ 3 };
137 
138 #ifndef NO_DOC
139  template<size_t>
140  struct Version;
141 
142  using LatestVersion = Zivid::Settings2D;
143 
144  // Short identifier. This value is not guaranteed to be universally unique
145  // Todo(ZIVID-2808): Move this to internal DataModelExt header
146  static constexpr std::array<uint8_t, 3> binaryId{ 's', 't', '2' };
147 
148 #endif
149 
152  {
153  public:
155  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
156 
158  static constexpr const char *path{ "Acquisition" };
159 
161  static constexpr const char *name{ "Acquisition" };
162 
164  static constexpr const char *description{ R"description(Settings for a single acquisition)description" };
165 
170  {
171  public:
174 
176  static constexpr const char *path{ "Acquisition/Aperture" };
177 
179  static constexpr const char *name{ "Aperture" };
180 
182  static constexpr const char *description{
183  R"description(Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to
184 the effective aperture diameter).
185 )description"
186  };
187 
189  using ValueType = double;
190 
192  static constexpr Range<double> validRange()
193  {
194  return { 1.4, 32.0 };
195  }
196 
198  Aperture() = default;
199 
201  explicit constexpr Aperture(double value)
202  : m_opt{ verifyValue(value) }
203  {}
204 
209  double value() const;
210 
212  bool hasValue() const;
213 
215  void reset();
216 
218  std::string toString() const;
219 
221  bool operator==(const Aperture &other) const
222  {
223  return m_opt == other.m_opt;
224  }
225 
227  bool operator!=(const Aperture &other) const
228  {
229  return m_opt != other.m_opt;
230  }
231 
233  bool operator<(const Aperture &other) const
234  {
235  return m_opt < other.m_opt;
236  }
237 
239  bool operator>(const Aperture &other) const
240  {
241  return m_opt > other.m_opt;
242  }
243 
245  friend std::ostream &operator<<(std::ostream &stream, const Aperture &value)
246  {
247  return stream << value.toString();
248  }
249 
250  private:
251  void setFromString(const std::string &value);
252 
253  constexpr ValueType static verifyValue(const ValueType &value)
254  {
255  return validRange().isInRange(value)
256  ? value
257  : throw std::out_of_range{ "Aperture{ " + std::to_string(value) + " } is not in range ["
258  + std::to_string(validRange().min()) + ", "
259  + std::to_string(validRange().max()) + "]" };
260  }
261 
262  Zivid::DataModel::Detail::Optional<double> m_opt;
263 
264  friend struct DataModel::Detail::Befriend<Aperture>;
265  };
266 
281  {
282  public:
285 
287  static constexpr const char *path{ "Acquisition/Brightness" };
288 
290  static constexpr const char *name{ "Brightness" };
291 
293  static constexpr const char *description{
294  R"description(Brightness controls the light output from the projector.
295 
296 Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
297 or in case of high levels of ambient lighting. Brightness above 1.0 is supported on Zivid One
298 Plus and Zivid Two.
299 
300 When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
301 can capture) will be reduced. For Zivid One Plus the duty cycle in boost mode is 50%. For Zivid
302 Two the duty cycle is reduced linearly from 100% at brightness 1.0, to 50% at brightness 1.8.
303 The duty cycle is calculated over a 10 second period. This limitation is enforced automatically
304 by the camera. Calling capture when the duty cycle limit has been reached will cause the camera
305 to first wait (sleep) for a duration of time to cool down, before capture will start.
306 )description"
307  };
308 
310  using ValueType = double;
311 
313  static constexpr Range<double> validRange()
314  {
315  return { 0, 1.8 };
316  }
317 
319  Brightness() = default;
320 
322  explicit constexpr Brightness(double value)
323  : m_opt{ verifyValue(value) }
324  {}
325 
330  double value() const;
331 
333  bool hasValue() const;
334 
336  void reset();
337 
339  std::string toString() const;
340 
342  bool operator==(const Brightness &other) const
343  {
344  return m_opt == other.m_opt;
345  }
346 
348  bool operator!=(const Brightness &other) const
349  {
350  return m_opt != other.m_opt;
351  }
352 
354  bool operator<(const Brightness &other) const
355  {
356  return m_opt < other.m_opt;
357  }
358 
360  bool operator>(const Brightness &other) const
361  {
362  return m_opt > other.m_opt;
363  }
364 
366  friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
367  {
368  return stream << value.toString();
369  }
370 
371  private:
372  void setFromString(const std::string &value);
373 
374  constexpr ValueType static verifyValue(const ValueType &value)
375  {
376  return validRange().isInRange(value)
377  ? value
378  : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
379  + " } is not in range [" + std::to_string(validRange().min())
380  + ", " + std::to_string(validRange().max()) + "]" };
381  }
382 
383  Zivid::DataModel::Detail::Optional<double> m_opt;
384 
385  friend struct DataModel::Detail::Befriend<Brightness>;
386  };
387 
390  {
391  public:
394 
396  static constexpr const char *path{ "Acquisition/ExposureTime" };
397 
399  static constexpr const char *name{ "ExposureTime" };
400 
402  static constexpr const char *description{ R"description(Exposure time for the image)description" };
403 
405  using ValueType = std::chrono::microseconds;
406 
409  {
410  return { std::chrono::microseconds{ 1677 }, std::chrono::microseconds{ 100000 } };
411  }
412 
414  ExposureTime() = default;
415 
417  explicit constexpr ExposureTime(std::chrono::microseconds value)
418  : m_opt{ verifyValue(value) }
419  {}
420 
425  std::chrono::microseconds value() const;
426 
428  bool hasValue() const;
429 
431  void reset();
432 
434  std::string toString() const;
435 
437  bool operator==(const ExposureTime &other) const
438  {
439  return m_opt == other.m_opt;
440  }
441 
443  bool operator!=(const ExposureTime &other) const
444  {
445  return m_opt != other.m_opt;
446  }
447 
449  bool operator<(const ExposureTime &other) const
450  {
451  return m_opt < other.m_opt;
452  }
453 
455  bool operator>(const ExposureTime &other) const
456  {
457  return m_opt > other.m_opt;
458  }
459 
461  friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
462  {
463  return stream << value.toString();
464  }
465 
466  private:
467  void setFromString(const std::string &value);
468 
469  constexpr ValueType static verifyValue(const ValueType &value)
470  {
471  return validRange().isInRange(value)
472  ? value
473  : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
474  + " } is not in range ["
475  + std::to_string(validRange().min().count()) + ", "
476  + std::to_string(validRange().max().count()) + "]" };
477  }
478 
479  Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
480 
481  friend struct DataModel::Detail::Befriend<ExposureTime>;
482  };
483 
486  {
487  public:
490 
492  static constexpr const char *path{ "Acquisition/Gain" };
493 
495  static constexpr const char *name{ "Gain" };
496 
498  static constexpr const char *description{ R"description(Analog gain in the camera)description" };
499 
501  using ValueType = double;
502 
504  static constexpr Range<double> validRange()
505  {
506  return { 1, 16 };
507  }
508 
510  Gain() = default;
511 
513  explicit constexpr Gain(double value)
514  : m_opt{ verifyValue(value) }
515  {}
516 
521  double value() const;
522 
524  bool hasValue() const;
525 
527  void reset();
528 
530  std::string toString() const;
531 
533  bool operator==(const Gain &other) const
534  {
535  return m_opt == other.m_opt;
536  }
537 
539  bool operator!=(const Gain &other) const
540  {
541  return m_opt != other.m_opt;
542  }
543 
545  bool operator<(const Gain &other) const
546  {
547  return m_opt < other.m_opt;
548  }
549 
551  bool operator>(const Gain &other) const
552  {
553  return m_opt > other.m_opt;
554  }
555 
557  friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
558  {
559  return stream << value.toString();
560  }
561 
562  private:
563  void setFromString(const std::string &value);
564 
565  constexpr ValueType static verifyValue(const ValueType &value)
566  {
567  return validRange().isInRange(value)
568  ? value
569  : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
570  + std::to_string(validRange().min()) + ", "
571  + std::to_string(validRange().max()) + "]" };
572  }
573 
574  Zivid::DataModel::Detail::Optional<double> m_opt;
575 
576  friend struct DataModel::Detail::Befriend<Gain>;
577  };
578 
583 
586 
601 #ifndef NO_DOC
602  template<typename... Args,
603  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
604  typename std::enable_if<
605  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
606  typename std::decay<Args>::type...>::value,
607  int>::type = 0>
608 #else
609  template<typename... Args>
610 #endif
611  explicit Acquisition(Args &&...args)
612  {
613  using namespace Zivid::Detail::TypeTraits;
614 
615  static_assert(AllArgsDecayedAreUnique<Args...>::value,
616  "Found duplicate types among the arguments passed to Acquisition(...). "
617  "Types should be listed at most once.");
618 
619  set(std::forward<Args>(args)...);
620  }
621 
635 #ifndef NO_DOC
636  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
637 #else
638  template<typename... Args>
639 #endif
640  void set(Args &&...args)
641  {
642  using namespace Zivid::Detail::TypeTraits;
643 
644  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
645  static_assert(AllArgsAreDescendantNodes::value,
646  "All arguments passed to set(...) must be descendant nodes.");
647 
648  static_assert(AllArgsDecayedAreUnique<Args...>::value,
649  "Found duplicate types among the arguments passed to set(...). "
650  "Types should be listed at most once.");
651 
652  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
653  }
654 
669 #ifndef NO_DOC
670  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
671 #else
672  template<typename... Args>
673 #endif
674  Acquisition copyWith(Args &&...args) const
675  {
676  using namespace Zivid::Detail::TypeTraits;
677 
678  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
679  static_assert(AllArgsAreDescendantNodes::value,
680  "All arguments passed to copyWith(...) must be descendant nodes.");
681 
682  static_assert(AllArgsDecayedAreUnique<Args...>::value,
683  "Found duplicate types among the arguments passed to copyWith(...). "
684  "Types should be listed at most once.");
685 
686  auto copy{ *this };
687  copy.set(std::forward<Args>(args)...);
688  return copy;
689  }
690 
692  const Aperture &aperture() const
693  {
694  return m_aperture;
695  }
696 
699  {
700  return m_aperture;
701  }
702 
704  Acquisition &set(const Aperture &value)
705  {
706  m_aperture = value;
707  return *this;
708  }
709 
711  const Brightness &brightness() const
712  {
713  return m_brightness;
714  }
715 
718  {
719  return m_brightness;
720  }
721 
723  Acquisition &set(const Brightness &value)
724  {
725  m_brightness = value;
726  return *this;
727  }
728 
730  const ExposureTime &exposureTime() const
731  {
732  return m_exposureTime;
733  }
734 
737  {
738  return m_exposureTime;
739  }
740 
742  Acquisition &set(const ExposureTime &value)
743  {
744  m_exposureTime = value;
745  return *this;
746  }
747 
749  const Gain &gain() const
750  {
751  return m_gain;
752  }
753 
756  {
757  return m_gain;
758  }
759 
761  Acquisition &set(const Gain &value)
762  {
763  m_gain = value;
764  return *this;
765  }
766 
767  template<typename T,
768  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
770  {
771  return m_aperture;
772  }
773 
774  template<
775  typename T,
776  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
778  {
779  return m_brightness;
780  }
781 
782  template<
783  typename T,
784  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
786  {
787  return m_exposureTime;
788  }
789 
790  template<typename T,
791  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
793  {
794  return m_gain;
795  }
796 
797  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
799  {
800  return m_aperture;
801  }
802 
803  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
805  {
806  return m_brightness;
807  }
808 
809  template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
811  {
812  return m_exposureTime;
813  }
814 
815  template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
817  {
818  return m_gain;
819  }
820 
822  template<typename F>
823  void forEach(const F &f) const
824  {
825  f(m_aperture);
826  f(m_brightness);
827  f(m_exposureTime);
828  f(m_gain);
829  }
830 
832  template<typename F>
833  void forEach(const F &f)
834  {
835  f(m_aperture);
836  f(m_brightness);
837  f(m_exposureTime);
838  f(m_gain);
839  }
840 
842  bool operator==(const Acquisition &other) const;
843 
845  bool operator!=(const Acquisition &other) const;
846 
848  std::string toString() const;
849 
851  friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
852  {
853  return stream << value.toString();
854  }
855 
856  private:
857  void setFromString(const std::string &value);
858 
859  void setFromString(const std::string &fullPath, const std::string &value);
860 
861  std::string getString(const std::string &fullPath) const;
862 
863  Aperture m_aperture;
864  Brightness m_brightness;
865  ExposureTime m_exposureTime;
866  Gain m_gain;
867 
868  friend struct DataModel::Detail::Befriend<Acquisition>;
869  };
870 
873  {
874  public:
877 
879  static constexpr const char *path{ "Acquisitions" };
880 
882  static constexpr const char *name{ "Acquisitions" };
883 
885  static constexpr const char *description{
886  R"description(List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mode.)description"
887  };
888 
890  using ValueType = std::vector<Settings2D::Acquisition>;
891 
894  {
895  return { 0, std::numeric_limits<ValueType::size_type>::max() };
896  }
897 
899  Acquisitions() = default;
900 
902  explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
903  : m_value{ std::move(value) }
904  {}
905 
907  explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
908  : Acquisitions{ ValueType{ value } }
909  {}
910 
912  const std::vector<Settings2D::Acquisition> &value() const;
913 
915  std::string toString() const;
916 
918  std::size_t size() const noexcept;
919 
921  bool isEmpty() const noexcept;
922 
928  template<typename... Args>
929  void emplaceBack(Args &&...args)
930  {
931  m_value.emplace_back(std::forward<Args>(args)...);
932  }
933 
939  Settings2D::Acquisition &at(std::size_t pos);
940 
946  const Settings2D::Acquisition &at(std::size_t pos) const;
947 
954 
960  const Settings2D::Acquisition &operator[](std::size_t pos) const;
961 
963  template<typename F>
964  void forEach(const F &f)
965  {
966  for(auto &child : m_value)
967  {
968  f(child);
969  }
970  }
971 
973  template<typename F>
974  void forEach(const F &f) const
975  {
976  for(const auto &child : m_value)
977  {
978  f(child);
979  }
980  }
981 
983  bool operator==(const Acquisitions &other) const
984  {
985  return m_value == other.m_value;
986  }
987 
989  bool operator!=(const Acquisitions &other) const
990  {
991  return m_value != other.m_value;
992  }
993 
995  friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
996  {
997  return stream << value.toString();
998  }
999 
1000  private:
1001  void setFromString(const std::string &value);
1002 
1003  std::vector<Settings2D::Acquisition> m_value{};
1004 
1005  friend struct DataModel::Detail::Befriend<Acquisitions>;
1006  };
1007 
1010  {
1011  public:
1014 
1016  static constexpr const char *path{ "Processing" };
1017 
1019  static constexpr const char *name{ "Processing" };
1020 
1022  static constexpr const char *description{ R"description(Processing related settings)description" };
1023 
1026  {
1027  public:
1030 
1032  static constexpr const char *path{ "Processing/Color" };
1033 
1035  static constexpr const char *name{ "Color" };
1036 
1038  static constexpr const char *description{ R"description(Color settings)description" };
1039 
1042  {
1043  public:
1046 
1048  static constexpr const char *path{ "Processing/Color/Balance" };
1049 
1051  static constexpr const char *name{ "Balance" };
1052 
1054  static constexpr const char *description{ R"description(Color balance settings)description" };
1055 
1058  {
1059  public:
1062 
1064  static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1065 
1067  static constexpr const char *name{ "Blue" };
1068 
1070  static constexpr const char *description{
1071  R"description(Digital gain applied to blue channel)description"
1072  };
1073 
1075  using ValueType = double;
1076 
1078  static constexpr Range<double> validRange()
1079  {
1080  return { 1.0, 8.0 };
1081  }
1082 
1084  Blue() = default;
1085 
1087  explicit constexpr Blue(double value)
1088  : m_opt{ verifyValue(value) }
1089  {}
1090 
1095  double value() const;
1096 
1098  bool hasValue() const;
1099 
1101  void reset();
1102 
1104  std::string toString() const;
1105 
1107  bool operator==(const Blue &other) const
1108  {
1109  return m_opt == other.m_opt;
1110  }
1111 
1113  bool operator!=(const Blue &other) const
1114  {
1115  return m_opt != other.m_opt;
1116  }
1117 
1119  bool operator<(const Blue &other) const
1120  {
1121  return m_opt < other.m_opt;
1122  }
1123 
1125  bool operator>(const Blue &other) const
1126  {
1127  return m_opt > other.m_opt;
1128  }
1129 
1131  friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1132  {
1133  return stream << value.toString();
1134  }
1135 
1136  private:
1137  void setFromString(const std::string &value);
1138 
1139  constexpr ValueType static verifyValue(const ValueType &value)
1140  {
1141  return validRange().isInRange(value)
1142  ? value
1143  : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1144  + " } is not in range ["
1145  + std::to_string(validRange().min()) + ", "
1146  + std::to_string(validRange().max()) + "]" };
1147  }
1148 
1149  Zivid::DataModel::Detail::Optional<double> m_opt;
1150 
1151  friend struct DataModel::Detail::Befriend<Blue>;
1152  };
1153 
1156  {
1157  public:
1160 
1162  static constexpr const char *path{ "Processing/Color/Balance/Green" };
1163 
1165  static constexpr const char *name{ "Green" };
1166 
1168  static constexpr const char *description{
1169  R"description(Digital gain applied to green channel)description"
1170  };
1171 
1173  using ValueType = double;
1174 
1176  static constexpr Range<double> validRange()
1177  {
1178  return { 1.0, 8.0 };
1179  }
1180 
1182  Green() = default;
1183 
1185  explicit constexpr Green(double value)
1186  : m_opt{ verifyValue(value) }
1187  {}
1188 
1193  double value() const;
1194 
1196  bool hasValue() const;
1197 
1199  void reset();
1200 
1202  std::string toString() const;
1203 
1205  bool operator==(const Green &other) const
1206  {
1207  return m_opt == other.m_opt;
1208  }
1209 
1211  bool operator!=(const Green &other) const
1212  {
1213  return m_opt != other.m_opt;
1214  }
1215 
1217  bool operator<(const Green &other) const
1218  {
1219  return m_opt < other.m_opt;
1220  }
1221 
1223  bool operator>(const Green &other) const
1224  {
1225  return m_opt > other.m_opt;
1226  }
1227 
1229  friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1230  {
1231  return stream << value.toString();
1232  }
1233 
1234  private:
1235  void setFromString(const std::string &value);
1236 
1237  constexpr ValueType static verifyValue(const ValueType &value)
1238  {
1239  return validRange().isInRange(value)
1240  ? value
1241  : throw std::out_of_range{ "Green{ " + std::to_string(value)
1242  + " } is not in range ["
1243  + std::to_string(validRange().min()) + ", "
1244  + std::to_string(validRange().max()) + "]" };
1245  }
1246 
1247  Zivid::DataModel::Detail::Optional<double> m_opt;
1248 
1249  friend struct DataModel::Detail::Befriend<Green>;
1250  };
1251 
1254  {
1255  public:
1258 
1260  static constexpr const char *path{ "Processing/Color/Balance/Red" };
1261 
1263  static constexpr const char *name{ "Red" };
1264 
1266  static constexpr const char *description{
1267  R"description(Digital gain applied to red channel)description"
1268  };
1269 
1271  using ValueType = double;
1272 
1274  static constexpr Range<double> validRange()
1275  {
1276  return { 1.0, 8.0 };
1277  }
1278 
1280  Red() = default;
1281 
1283  explicit constexpr Red(double value)
1284  : m_opt{ verifyValue(value) }
1285  {}
1286 
1291  double value() const;
1292 
1294  bool hasValue() const;
1295 
1297  void reset();
1298 
1300  std::string toString() const;
1301 
1303  bool operator==(const Red &other) const
1304  {
1305  return m_opt == other.m_opt;
1306  }
1307 
1309  bool operator!=(const Red &other) const
1310  {
1311  return m_opt != other.m_opt;
1312  }
1313 
1315  bool operator<(const Red &other) const
1316  {
1317  return m_opt < other.m_opt;
1318  }
1319 
1321  bool operator>(const Red &other) const
1322  {
1323  return m_opt > other.m_opt;
1324  }
1325 
1327  friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1328  {
1329  return stream << value.toString();
1330  }
1331 
1332  private:
1333  void setFromString(const std::string &value);
1334 
1335  constexpr ValueType static verifyValue(const ValueType &value)
1336  {
1337  return validRange().isInRange(value)
1338  ? value
1339  : throw std::out_of_range{ "Red{ " + std::to_string(value)
1340  + " } is not in range ["
1341  + std::to_string(validRange().min()) + ", "
1342  + std::to_string(validRange().max()) + "]" };
1343  }
1344 
1345  Zivid::DataModel::Detail::Optional<double> m_opt;
1346 
1347  friend struct DataModel::Detail::Befriend<Red>;
1348  };
1349 
1353 
1356 
1370 #ifndef NO_DOC
1371  template<typename... Args,
1372  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1373  typename std::enable_if<Zivid::Detail::TypeTraits::AllArgsAreInTuple<
1374  Descendants,
1375  typename std::decay<Args>::type...>::value,
1376  int>::type = 0>
1377 #else
1378  template<typename... Args>
1379 #endif
1380  explicit Balance(Args &&...args)
1381  {
1382  using namespace Zivid::Detail::TypeTraits;
1383 
1384  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1385  "Found duplicate types among the arguments passed to Balance(...). "
1386  "Types should be listed at most once.");
1387 
1388  set(std::forward<Args>(args)...);
1389  }
1390 
1403 #ifndef NO_DOC
1404  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1405 #else
1406  template<typename... Args>
1407 #endif
1408  void set(Args &&...args)
1409  {
1410  using namespace Zivid::Detail::TypeTraits;
1411 
1412  using AllArgsAreDescendantNodes =
1413  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1414  static_assert(AllArgsAreDescendantNodes::value,
1415  "All arguments passed to set(...) must be descendant nodes.");
1416 
1417  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1418  "Found duplicate types among the arguments passed to set(...). "
1419  "Types should be listed at most once.");
1420 
1421  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1422  }
1423 
1437 #ifndef NO_DOC
1438  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1439 #else
1440  template<typename... Args>
1441 #endif
1442  Balance copyWith(Args &&...args) const
1443  {
1444  using namespace Zivid::Detail::TypeTraits;
1445 
1446  using AllArgsAreDescendantNodes =
1447  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1448  static_assert(AllArgsAreDescendantNodes::value,
1449  "All arguments passed to copyWith(...) must be descendant nodes.");
1450 
1451  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1452  "Found duplicate types among the arguments passed to copyWith(...). "
1453  "Types should be listed at most once.");
1454 
1455  auto copy{ *this };
1456  copy.set(std::forward<Args>(args)...);
1457  return copy;
1458  }
1459 
1461  const Blue &blue() const
1462  {
1463  return m_blue;
1464  }
1465 
1468  {
1469  return m_blue;
1470  }
1471 
1473  Balance &set(const Blue &value)
1474  {
1475  m_blue = value;
1476  return *this;
1477  }
1478 
1480  const Green &green() const
1481  {
1482  return m_green;
1483  }
1484 
1487  {
1488  return m_green;
1489  }
1490 
1492  Balance &set(const Green &value)
1493  {
1494  m_green = value;
1495  return *this;
1496  }
1497 
1499  const Red &red() const
1500  {
1501  return m_red;
1502  }
1503 
1506  {
1507  return m_red;
1508  }
1509 
1511  Balance &set(const Red &value)
1512  {
1513  m_red = value;
1514  return *this;
1515  }
1516 
1517  template<
1518  typename T,
1519  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1520  int>::type = 0>
1522  {
1523  return m_blue;
1524  }
1525 
1526  template<
1527  typename T,
1528  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1529  int>::type = 0>
1531  {
1532  return m_green;
1533  }
1534 
1535  template<
1536  typename T,
1537  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1538  int>::type = 0>
1540  {
1541  return m_red;
1542  }
1543 
1544  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1546  {
1547  return m_blue;
1548  }
1549 
1550  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1552  {
1553  return m_green;
1554  }
1555 
1556  template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1558  {
1559  return m_red;
1560  }
1561 
1563  template<typename F>
1564  void forEach(const F &f) const
1565  {
1566  f(m_blue);
1567  f(m_green);
1568  f(m_red);
1569  }
1570 
1572  template<typename F>
1573  void forEach(const F &f)
1574  {
1575  f(m_blue);
1576  f(m_green);
1577  f(m_red);
1578  }
1579 
1581  bool operator==(const Balance &other) const;
1582 
1584  bool operator!=(const Balance &other) const;
1585 
1587  std::string toString() const;
1588 
1590  friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1591  {
1592  return stream << value.toString();
1593  }
1594 
1595  private:
1596  void setFromString(const std::string &value);
1597 
1598  void setFromString(const std::string &fullPath, const std::string &value);
1599 
1600  std::string getString(const std::string &fullPath) const;
1601 
1602  Blue m_blue;
1603  Green m_green;
1604  Red m_red;
1605 
1606  friend struct DataModel::Detail::Befriend<Balance>;
1607  };
1608 
1613  {
1614  public:
1617 
1619  static constexpr const char *path{ "Processing/Color/Gamma" };
1620 
1622  static constexpr const char *name{ "Gamma" };
1623 
1625  static constexpr const char *description{
1626  R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
1627 greater than 1 makes the colors darker.
1628 )description"
1629  };
1630 
1632  using ValueType = double;
1633 
1635  static constexpr Range<double> validRange()
1636  {
1637  return { 0.25, 1.5 };
1638  }
1639 
1641  Gamma() = default;
1642 
1644  explicit constexpr Gamma(double value)
1645  : m_opt{ verifyValue(value) }
1646  {}
1647 
1652  double value() const;
1653 
1655  bool hasValue() const;
1656 
1658  void reset();
1659 
1661  std::string toString() const;
1662 
1664  bool operator==(const Gamma &other) const
1665  {
1666  return m_opt == other.m_opt;
1667  }
1668 
1670  bool operator!=(const Gamma &other) const
1671  {
1672  return m_opt != other.m_opt;
1673  }
1674 
1676  bool operator<(const Gamma &other) const
1677  {
1678  return m_opt < other.m_opt;
1679  }
1680 
1682  bool operator>(const Gamma &other) const
1683  {
1684  return m_opt > other.m_opt;
1685  }
1686 
1688  friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
1689  {
1690  return stream << value.toString();
1691  }
1692 
1693  private:
1694  void setFromString(const std::string &value);
1695 
1696  constexpr ValueType static verifyValue(const ValueType &value)
1697  {
1698  return validRange().isInRange(value)
1699  ? value
1700  : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
1701  + std::to_string(validRange().min()) + ", "
1702  + std::to_string(validRange().max()) + "]" };
1703  }
1704 
1705  Zivid::DataModel::Detail::Optional<double> m_opt;
1706 
1707  friend struct DataModel::Detail::Befriend<Gamma>;
1708  };
1709 
1715 
1718 
1734 #ifndef NO_DOC
1735  template<typename... Args,
1736  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1737  typename std::enable_if<
1738  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
1739  typename std::decay<Args>::type...>::value,
1740  int>::type = 0>
1741 #else
1742  template<typename... Args>
1743 #endif
1744  explicit Color(Args &&...args)
1745  {
1746  using namespace Zivid::Detail::TypeTraits;
1747 
1748  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1749  "Found duplicate types among the arguments passed to Color(...). "
1750  "Types should be listed at most once.");
1751 
1752  set(std::forward<Args>(args)...);
1753  }
1754 
1769 #ifndef NO_DOC
1770  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1771 #else
1772  template<typename... Args>
1773 #endif
1774  void set(Args &&...args)
1775  {
1776  using namespace Zivid::Detail::TypeTraits;
1777 
1778  using AllArgsAreDescendantNodes =
1779  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1780  static_assert(AllArgsAreDescendantNodes::value,
1781  "All arguments passed to set(...) must be descendant nodes.");
1782 
1783  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1784  "Found duplicate types among the arguments passed to set(...). "
1785  "Types should be listed at most once.");
1786 
1787  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1788  }
1789 
1805 #ifndef NO_DOC
1806  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1807 #else
1808  template<typename... Args>
1809 #endif
1810  Color copyWith(Args &&...args) const
1811  {
1812  using namespace Zivid::Detail::TypeTraits;
1813 
1814  using AllArgsAreDescendantNodes =
1815  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1816  static_assert(AllArgsAreDescendantNodes::value,
1817  "All arguments passed to copyWith(...) must be descendant nodes.");
1818 
1819  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1820  "Found duplicate types among the arguments passed to copyWith(...). "
1821  "Types should be listed at most once.");
1822 
1823  auto copy{ *this };
1824  copy.set(std::forward<Args>(args)...);
1825  return copy;
1826  }
1827 
1829  const Balance &balance() const
1830  {
1831  return m_balance;
1832  }
1833 
1836  {
1837  return m_balance;
1838  }
1839 
1841  Color &set(const Balance &value)
1842  {
1843  m_balance = value;
1844  return *this;
1845  }
1846 
1848  Color &set(const Balance::Blue &value)
1849  {
1850  m_balance.set(value);
1851  return *this;
1852  }
1853 
1855  Color &set(const Balance::Green &value)
1856  {
1857  m_balance.set(value);
1858  return *this;
1859  }
1860 
1862  Color &set(const Balance::Red &value)
1863  {
1864  m_balance.set(value);
1865  return *this;
1866  }
1867 
1869  const Gamma &gamma() const
1870  {
1871  return m_gamma;
1872  }
1873 
1876  {
1877  return m_gamma;
1878  }
1879 
1881  Color &set(const Gamma &value)
1882  {
1883  m_gamma = value;
1884  return *this;
1885  }
1886 
1887  template<typename T,
1888  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value,
1889  int>::type = 0>
1891  {
1892  return m_balance;
1893  }
1894 
1895  template<typename T,
1896  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1897  int>::type = 0>
1899  {
1900  return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
1901  }
1902 
1903  template<typename T,
1904  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1905  int>::type = 0>
1907  {
1908  return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
1909  }
1910 
1911  template<typename T,
1912  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1913  int>::type = 0>
1915  {
1916  return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
1917  }
1918 
1919  template<typename T,
1920  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value,
1921  int>::type = 0>
1923  {
1924  return m_gamma;
1925  }
1926 
1927  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1929  {
1930  return m_balance;
1931  }
1932 
1933  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1935  {
1936  return m_gamma;
1937  }
1938 
1940  template<typename F>
1941  void forEach(const F &f) const
1942  {
1943  f(m_balance);
1944  f(m_gamma);
1945  }
1946 
1948  template<typename F>
1949  void forEach(const F &f)
1950  {
1951  f(m_balance);
1952  f(m_gamma);
1953  }
1954 
1956  bool operator==(const Color &other) const;
1957 
1959  bool operator!=(const Color &other) const;
1960 
1962  std::string toString() const;
1963 
1965  friend std::ostream &operator<<(std::ostream &stream, const Color &value)
1966  {
1967  return stream << value.toString();
1968  }
1969 
1970  private:
1971  void setFromString(const std::string &value);
1972 
1973  void setFromString(const std::string &fullPath, const std::string &value);
1974 
1975  std::string getString(const std::string &fullPath) const;
1976 
1977  Balance m_balance;
1978  Gamma m_gamma;
1979 
1980  friend struct DataModel::Detail::Befriend<Color>;
1981  };
1982 
1989 
1992 
2009 #ifndef NO_DOC
2010  template<typename... Args,
2011  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2012  typename std::enable_if<
2013  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
2014  typename std::decay<Args>::type...>::value,
2015  int>::type = 0>
2016 #else
2017  template<typename... Args>
2018 #endif
2019  explicit Processing(Args &&...args)
2020  {
2021  using namespace Zivid::Detail::TypeTraits;
2022 
2023  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2024  "Found duplicate types among the arguments passed to Processing(...). "
2025  "Types should be listed at most once.");
2026 
2027  set(std::forward<Args>(args)...);
2028  }
2029 
2045 #ifndef NO_DOC
2046  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2047 #else
2048  template<typename... Args>
2049 #endif
2050  void set(Args &&...args)
2051  {
2052  using namespace Zivid::Detail::TypeTraits;
2053 
2054  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2055  static_assert(AllArgsAreDescendantNodes::value,
2056  "All arguments passed to set(...) must be descendant nodes.");
2057 
2058  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2059  "Found duplicate types among the arguments passed to set(...). "
2060  "Types should be listed at most once.");
2061 
2062  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2063  }
2064 
2081 #ifndef NO_DOC
2082  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2083 #else
2084  template<typename... Args>
2085 #endif
2086  Processing copyWith(Args &&...args) const
2087  {
2088  using namespace Zivid::Detail::TypeTraits;
2089 
2090  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2091  static_assert(AllArgsAreDescendantNodes::value,
2092  "All arguments passed to copyWith(...) must be descendant nodes.");
2093 
2094  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2095  "Found duplicate types among the arguments passed to copyWith(...). "
2096  "Types should be listed at most once.");
2097 
2098  auto copy{ *this };
2099  copy.set(std::forward<Args>(args)...);
2100  return copy;
2101  }
2102 
2104  const Color &color() const
2105  {
2106  return m_color;
2107  }
2108 
2111  {
2112  return m_color;
2113  }
2114 
2116  Processing &set(const Color &value)
2117  {
2118  m_color = value;
2119  return *this;
2120  }
2121 
2124  {
2125  m_color.set(value);
2126  return *this;
2127  }
2128 
2131  {
2132  m_color.set(value);
2133  return *this;
2134  }
2135 
2138  {
2139  m_color.set(value);
2140  return *this;
2141  }
2142 
2145  {
2146  m_color.set(value);
2147  return *this;
2148  }
2149 
2151  Processing &set(const Color::Gamma &value)
2152  {
2153  m_color.set(value);
2154  return *this;
2155  }
2156 
2157  template<typename T,
2158  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2160  {
2161  return m_color;
2162  }
2163 
2164  template<
2165  typename T,
2166  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2168  {
2169  return m_color.get<Settings2D::Processing::Color::Balance>();
2170  }
2171 
2172  template<typename T,
2173  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
2174  int>::type = 0>
2176  {
2177  return m_color.get<Settings2D::Processing::Color::Balance::Blue>();
2178  }
2179 
2180  template<typename T,
2181  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
2182  int>::type = 0>
2184  {
2185  return m_color.get<Settings2D::Processing::Color::Balance::Green>();
2186  }
2187 
2188  template<typename T,
2189  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
2190  int>::type = 0>
2192  {
2193  return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2194  }
2195 
2196  template<
2197  typename T,
2198  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2200  {
2201  return m_color.get<Settings2D::Processing::Color::Gamma>();
2202  }
2203 
2204  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2206  {
2207  return m_color;
2208  }
2209 
2211  template<typename F>
2212  void forEach(const F &f) const
2213  {
2214  f(m_color);
2215  }
2216 
2218  template<typename F>
2219  void forEach(const F &f)
2220  {
2221  f(m_color);
2222  }
2223 
2225  bool operator==(const Processing &other) const;
2226 
2228  bool operator!=(const Processing &other) const;
2229 
2231  std::string toString() const;
2232 
2234  friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2235  {
2236  return stream << value.toString();
2237  }
2238 
2239  private:
2240  void setFromString(const std::string &value);
2241 
2242  void setFromString(const std::string &fullPath, const std::string &value);
2243 
2244  std::string getString(const std::string &fullPath) const;
2245 
2246  Color m_color;
2247 
2248  friend struct DataModel::Detail::Befriend<Processing>;
2249  };
2250 
2259 
2262 
2264  explicit Settings2D(const std::string &fileName);
2265 
2284 #ifndef NO_DOC
2285  template<
2286  typename... Args,
2287  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2288  typename std::enable_if<
2289  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2290  int>::type = 0>
2291 #else
2292  template<typename... Args>
2293 #endif
2294  explicit Settings2D(Args &&...args)
2295  {
2296  using namespace Zivid::Detail::TypeTraits;
2297 
2298  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2299  "Found duplicate types among the arguments passed to Settings2D(...). "
2300  "Types should be listed at most once.");
2301 
2302  set(std::forward<Args>(args)...);
2303  }
2304 
2322 #ifndef NO_DOC
2323  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2324 #else
2325  template<typename... Args>
2326 #endif
2327  void set(Args &&...args)
2328  {
2329  using namespace Zivid::Detail::TypeTraits;
2330 
2331  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2332  static_assert(AllArgsAreDescendantNodes::value,
2333  "All arguments passed to set(...) must be descendant nodes.");
2334 
2335  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2336  "Found duplicate types among the arguments passed to set(...). "
2337  "Types should be listed at most once.");
2338 
2339  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2340  }
2341 
2360 #ifndef NO_DOC
2361  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2362 #else
2363  template<typename... Args>
2364 #endif
2365  Settings2D copyWith(Args &&...args) const
2366  {
2367  using namespace Zivid::Detail::TypeTraits;
2368 
2369  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2370  static_assert(AllArgsAreDescendantNodes::value,
2371  "All arguments passed to copyWith(...) must be descendant nodes.");
2372 
2373  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2374  "Found duplicate types among the arguments passed to copyWith(...). "
2375  "Types should be listed at most once.");
2376 
2377  auto copy{ *this };
2378  copy.set(std::forward<Args>(args)...);
2379  return copy;
2380  }
2381 
2384  {
2385  return m_acquisitions;
2386  }
2387 
2390  {
2391  return m_acquisitions;
2392  }
2393 
2395  Settings2D &set(const Acquisitions &value)
2396  {
2397  m_acquisitions = value;
2398  return *this;
2399  }
2400 
2402  const Processing &processing() const
2403  {
2404  return m_processing;
2405  }
2406 
2409  {
2410  return m_processing;
2411  }
2412 
2414  Settings2D &set(const Processing &value)
2415  {
2416  m_processing = value;
2417  return *this;
2418  }
2419 
2422  {
2423  m_processing.set(value);
2424  return *this;
2425  }
2426 
2429  {
2430  m_processing.set(value);
2431  return *this;
2432  }
2433 
2436  {
2437  m_processing.set(value);
2438  return *this;
2439  }
2440 
2443  {
2444  m_processing.set(value);
2445  return *this;
2446  }
2447 
2450  {
2451  m_processing.set(value);
2452  return *this;
2453  }
2454 
2457  {
2458  m_processing.set(value);
2459  return *this;
2460  }
2461 
2462  template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
2464  {
2465  return m_acquisitions;
2466  }
2467 
2468  template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
2470  {
2471  return m_processing;
2472  }
2473 
2474  template<typename T,
2475  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2477  {
2478  return m_processing.get<Settings2D::Processing::Color>();
2479  }
2480 
2481  template<typename T,
2482  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2484  {
2485  return m_processing.get<Settings2D::Processing::Color::Balance>();
2486  }
2487 
2488  template<typename T,
2489  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
2490  int>::type = 0>
2492  {
2493  return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
2494  }
2495 
2496  template<typename T,
2497  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
2498  int>::type = 0>
2500  {
2501  return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
2502  }
2503 
2504  template<
2505  typename T,
2506  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
2508  {
2509  return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
2510  }
2511 
2512  template<typename T,
2513  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2515  {
2516  return m_processing.get<Settings2D::Processing::Color::Gamma>();
2517  }
2518 
2519  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2521  {
2522  return m_acquisitions;
2523  }
2524 
2525  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2527  {
2528  return m_processing;
2529  }
2530 
2532  template<typename F>
2533  void forEach(const F &f) const
2534  {
2535  f(m_acquisitions);
2536  f(m_processing);
2537  }
2538 
2540  template<typename F>
2541  void forEach(const F &f)
2542  {
2543  f(m_acquisitions);
2544  f(m_processing);
2545  }
2546 
2548  bool operator==(const Settings2D &other) const;
2549 
2551  bool operator!=(const Settings2D &other) const;
2552 
2554  std::string toString() const;
2555 
2557  friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
2558  {
2559  return stream << value.toString();
2560  }
2561 
2563  void save(const std::string &fileName) const;
2564 
2566  void load(const std::string &fileName);
2567 
2568  private:
2569  void setFromString(const std::string &value);
2570 
2571  void setFromString(const std::string &fullPath, const std::string &value);
2572 
2573  std::string getString(const std::string &fullPath) const;
2574 
2575  Acquisitions m_acquisitions;
2576  Processing m_processing;
2577 
2578  friend struct DataModel::Detail::Befriend<Settings2D>;
2579  };
2580 
2581 #ifndef NO_DOC
2582  template<>
2583  struct Settings2D::Version<3>
2584  {
2585  using Type = Settings2D;
2586  };
2587 #endif
2588 
2589 } // namespace Zivid
2590 
2591 #ifdef _MSC_VER
2592 # pragma warning(pop)
2593 #endif
2594 
2595 #ifndef NO_DOC
2596 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2597 namespace std // NOLINT
2598 {
2599  template<>
2600  struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
2601  {};
2602 
2603  template<size_t i>
2604  struct tuple_element<i, Zivid::Settings2D::Processing>
2605  {
2606  static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
2607 
2608  using type // NOLINT
2609  = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
2610  };
2611 
2612  template<>
2613  struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
2614  {};
2615 
2616  template<size_t i>
2617  struct tuple_element<i, Zivid::Settings2D::Processing::Color>
2618  {
2619  static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 2");
2620 
2621  using type // NOLINT
2622  = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
2623  };
2624 
2625  template<>
2626  struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
2627  {};
2628 
2629  template<size_t i>
2630  struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
2631  {
2632  static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
2633  "Index must be less than 3");
2634 
2635  using type // NOLINT
2636  = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
2637  };
2638 
2639  template<>
2640  struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 2>
2641  {};
2642 
2643  template<size_t i>
2644  struct tuple_element<i, Zivid::Settings2D>
2645  {
2646  static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 2");
2647 
2648  using type // NOLINT
2649  = decltype(declval<Zivid::Settings2D>().get<i>());
2650  };
2651 
2652 } // namespace std
2653 # endif
2654 #endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Class describing a range of values for a given type T
Definition: Range.h:102
Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to the effe...
Definition: Settings2D.h:170
void reset()
Reset the node to unset state
bool operator!=(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:227
bool operator<(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:233
constexpr Aperture(double value)
Constructor
Definition: Settings2D.h:201
std::string toString() const
Get the value as string
double value() const
Get the value
bool operator>(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:239
Aperture()=default
Default constructor
double ValueType
The type of the underlying value
Definition: Settings2D.h:189
bool operator==(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:221
static constexpr Range< double > validRange()
The range of valid values for Aperture
Definition: Settings2D.h:192
friend std::ostream & operator<<(std::ostream &stream, const Aperture &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:245
bool hasValue() const
Check if the value is set
Brightness controls the light output from the projector.
Definition: Settings2D.h:281
bool operator==(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:342
bool operator>(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:360
bool operator<(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:354
constexpr Brightness(double value)
Constructor
Definition: Settings2D.h:322
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:366
std::string toString() const
Get the value as string
static constexpr Range< double > validRange()
The range of valid values for Brightness
Definition: Settings2D.h:313
bool operator!=(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:348
double value() const
Get the value
Brightness()=default
Default constructor
bool hasValue() const
Check if the value is set
void reset()
Reset the node to unset state
double ValueType
The type of the underlying value
Definition: Settings2D.h:310
Exposure time for the image
Definition: Settings2D.h:390
bool operator>(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:455
std::chrono::microseconds ValueType
The type of the underlying value
Definition: Settings2D.h:405
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ExposureTime
Definition: Settings2D.h:408
void reset()
Reset the node to unset state
constexpr ExposureTime(std::chrono::microseconds value)
Constructor
Definition: Settings2D.h:417
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:461
std::chrono::microseconds value() const
Get the value
bool operator<(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:449
bool operator!=(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:443
std::string toString() const
Get the value as string
ExposureTime()=default
Default constructor
bool operator==(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:437
bool hasValue() const
Check if the value is set
Analog gain in the camera
Definition: Settings2D.h:486
bool operator>(const Gain &other) const
Comparison operator
Definition: Settings2D.h:551
bool operator!=(const Gain &other) const
Comparison operator
Definition: Settings2D.h:539
bool operator==(const Gain &other) const
Comparison operator
Definition: Settings2D.h:533
double ValueType
The type of the underlying value
Definition: Settings2D.h:501
Gain()=default
Default constructor
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const Gain &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:557
void reset()
Reset the node to unset state
static constexpr Range< double > validRange()
The range of valid values for Gain
Definition: Settings2D.h:504
constexpr Gain(double value)
Constructor
Definition: Settings2D.h:513
double value() const
Get the value
bool hasValue() const
Check if the value is set
bool operator<(const Gain &other) const
Comparison operator
Definition: Settings2D.h:545
Settings for a single acquisition
Definition: Settings2D.h:152
const Settings2D::Acquisition::ExposureTime & get() const
Definition: Settings2D.h:785
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition: Settings2D.h:582
Acquisition & set(const ExposureTime &value)
Set ExposureTime
Definition: Settings2D.h:742
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:823
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:833
Acquisition & set(const Gain &value)
Set Gain
Definition: Settings2D.h:761
bool operator!=(const Acquisition &other) const
Inequality operator
std::string toString() const
Get the value as string
bool operator==(const Acquisition &other) const
Equality operator
const Settings2D::Acquisition::Brightness & get() const
Definition: Settings2D.h:777
Acquisition & set(const Aperture &value)
Set Aperture
Definition: Settings2D.h:704
Gain & gain()
Get Gain
Definition: Settings2D.h:755
Acquisition copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: Settings2D.h:674
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:640
const Brightness & brightness() const
Get Brightness
Definition: Settings2D.h:711
Acquisition & set(const Brightness &value)
Set Brightness
Definition: Settings2D.h:723
Acquisition()
Default constructor
const Settings2D::Acquisition::Gain & get() const
Definition: Settings2D.h:792
Acquisition(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:611
ExposureTime & exposureTime()
Get ExposureTime
Definition: Settings2D.h:736
const Settings2D::Acquisition::Aperture & get() const
Definition: Settings2D.h:769
const Gain & gain() const
Get Gain
Definition: Settings2D.h:749
const ExposureTime & exposureTime() const
Get ExposureTime
Definition: Settings2D.h:730
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:851
Brightness & brightness()
Get Brightness
Definition: Settings2D.h:717
Aperture & aperture()
Get Aperture
Definition: Settings2D.h:698
const Aperture & aperture() const
Get Aperture
Definition: Settings2D.h:692
List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mo...
Definition: Settings2D.h:873
const Settings2D::Acquisition & operator[](std::size_t pos) const
Returns a const reference to the element at position pos in the list
const std::vector< Settings2D::Acquisition > & value() const
Get the value
Settings2D::Acquisition & at(std::size_t pos)
Returns a reference to the element at position pos in the list
const Settings2D::Acquisition & at(std::size_t pos) const
Returns a const reference to the element at position pos in the list
Acquisitions(std::initializer_list< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:907
Acquisitions(std::vector< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:902
void forEach(const F &f)
Run the given function on each element in the list
Definition: Settings2D.h:964
bool operator==(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:983
void forEach(const F &f) const
Run the given function on each element in the list
Definition: Settings2D.h:974
Settings2D::Acquisition & operator[](std::size_t pos)
Returns a reference to the element at position pos in the list
std::vector< Settings2D::Acquisition > ValueType
The type of the underlying value
Definition: Settings2D.h:890
std::string toString() const
Get the value as string
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Acquisitions
Definition: Settings2D.h:893
std::size_t size() const noexcept
Get the size of the list
bool operator!=(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:989
Acquisitions()=default
Default constructor
friend std::ostream & operator<<(std::ostream &stream, const Acquisitions &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:995
Digital gain applied to blue channel
Definition: Settings2D.h:1058
bool operator==(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1107
void reset()
Reset the node to unset state
static constexpr Range< double > validRange()
The range of valid values for Blue
Definition: Settings2D.h:1078
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1131
double ValueType
The type of the underlying value
Definition: Settings2D.h:1075
bool operator>(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1125
std::string toString() const
Get the value as string
constexpr Blue(double value)
Constructor
Definition: Settings2D.h:1087
bool operator!=(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1113
bool hasValue() const
Check if the value is set
bool operator<(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1119
Digital gain applied to green channel
Definition: Settings2D.h:1156
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1229
double ValueType
The type of the underlying value
Definition: Settings2D.h:1173
static constexpr Range< double > validRange()
The range of valid values for Green
Definition: Settings2D.h:1176
bool operator==(const Green &other) const
Comparison operator
Definition: Settings2D.h:1205
std::string toString() const
Get the value as string
constexpr Green(double value)
Constructor
Definition: Settings2D.h:1185
bool operator<(const Green &other) const
Comparison operator
Definition: Settings2D.h:1217
bool hasValue() const
Check if the value is set
bool operator!=(const Green &other) const
Comparison operator
Definition: Settings2D.h:1211
bool operator>(const Green &other) const
Comparison operator
Definition: Settings2D.h:1223
void reset()
Reset the node to unset state
Digital gain applied to red channel
Definition: Settings2D.h:1254
double ValueType
The type of the underlying value
Definition: Settings2D.h:1271
static constexpr Range< double > validRange()
The range of valid values for Red
Definition: Settings2D.h:1274
bool operator<(const Red &other) const
Comparison operator
Definition: Settings2D.h:1315
std::string toString() const
Get the value as string
bool hasValue() const
Check if the value is set
bool operator!=(const Red &other) const
Comparison operator
Definition: Settings2D.h:1309
constexpr Red(double value)
Constructor
Definition: Settings2D.h:1283
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1327
bool operator==(const Red &other) const
Comparison operator
Definition: Settings2D.h:1303
void reset()
Reset the node to unset state
bool operator>(const Red &other) const
Comparison operator
Definition: Settings2D.h:1321
Color balance settings
Definition: Settings2D.h:1042
Red & red()
Get Red
Definition: Settings2D.h:1505
Balance(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1380
bool operator!=(const Balance &other) const
Inequality operator
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition: Settings2D.h:1352
const Blue & blue() const
Get Blue
Definition: Settings2D.h:1461
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1573
const Green & green() const
Get Green
Definition: Settings2D.h:1480
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1564
bool operator==(const Balance &other) const
Equality operator
Balance & set(const Blue &value)
Set Blue
Definition: Settings2D.h:1473
Balance & set(const Green &value)
Set Green
Definition: Settings2D.h:1492
Balance copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: Settings2D.h:1442
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1539
const Red & red() const
Get Red
Definition: Settings2D.h:1499
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1590
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1521
Balance & set(const Red &value)
Set Red
Definition: Settings2D.h:1511
Blue & blue()
Get Blue
Definition: Settings2D.h:1467
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1530
std::string toString() const
Get the value as string
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1408
Green & green()
Get Green
Definition: Settings2D.h:1486
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition: Settings2D.h:1613
double ValueType
The type of the underlying value
Definition: Settings2D.h:1632
bool operator>(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1682
bool operator==(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1664
bool operator!=(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1670
bool hasValue() const
Check if the value is set
std::string toString() const
Get the value as string
bool operator<(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1676
static constexpr Range< double > validRange()
The range of valid values for Gamma
Definition: Settings2D.h:1635
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1688
void reset()
Reset the node to unset state
constexpr Gamma(double value)
Constructor
Definition: Settings2D.h:1644
Gamma()=default
Default constructor
Color settings
Definition: Settings2D.h:1026
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1774
bool operator!=(const Color &other) const
Inequality operator
const Balance & balance() const
Get Balance
Definition: Settings2D.h:1829
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1906
bool operator==(const Color &other) const
Equality operator
Gamma & gamma()
Get Gamma
Definition: Settings2D.h:1875
std::string toString() const
Get the value as string
Color & set(const Balance::Green &value)
Set Balance::Green
Definition: Settings2D.h:1855
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1914
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1941
Color(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1744
Color & set(const Gamma &value)
Set Gamma
Definition: Settings2D.h:1881
Color & set(const Balance::Blue &value)
Set Balance::Blue
Definition: Settings2D.h:1848
std::tuple< Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:1714
Color & set(const Balance::Red &value)
Set Balance::Red
Definition: Settings2D.h:1862
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1965
Color copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: Settings2D.h:1810
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:1922
const Gamma & gamma() const
Get Gamma
Definition: Settings2D.h:1869
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1949
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:1890
Balance & balance()
Get Balance
Definition: Settings2D.h:1835
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1898
Color & set(const Balance &value)
Set Balance
Definition: Settings2D.h:1841
Processing related settings
Definition: Settings2D.h:1010
bool operator!=(const Processing &other) const
Inequality operator
bool operator==(const Processing &other) const
Equality operator
Processing & set(const Color::Balance &value)
Set Color::Balance
Definition: Settings2D.h:2123
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2167
Processing & set(const Color &value)
Set Color
Definition: Settings2D.h:2116
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2212
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2183
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2050
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red
Definition: Settings2D.h:2144
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue
Definition: Settings2D.h:2130
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2159
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2234
Processing copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: Settings2D.h:2086
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2191
std::string toString() const
Get the value as string
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green
Definition: Settings2D.h:2137
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2219
Processing()
Default constructor
std::tuple< Settings2D::Processing::Color, Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:1988
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2199
const Color & color() const
Get Color
Definition: Settings2D.h:2104
Processing(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2019
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2175
Color & color()
Get Color
Definition: Settings2D.h:2110
Processing & set(const Color::Gamma &value)
Set Color::Gamma
Definition: Settings2D.h:2151
Settings used when capturing 2D images with a Zivid camera
Definition: Settings2D.h:120
std::tuple< Settings2D::Acquisitions, Settings2D::Processing, Settings2D::Processing::Color, Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:2258
Acquisitions & acquisitions()
Get Acquisitions
Definition: Settings2D.h:2389
void save(const std::string &fileName) const
Save to the given file
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2514
const Acquisitions & acquisitions() const
Get Acquisitions
Definition: Settings2D.h:2383
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2541
Settings2D(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2294
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2499
Settings2D()
Default constructor
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2507
Settings2D(const std::string &fileName)
Construct Settings2D by loading from file
void load(const std::string &fileName)
Load from the given file
bool operator!=(const Settings2D &other) const
Inequality operator
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2476
Settings2D & set(const Processing &value)
Set Processing
Definition: Settings2D.h:2414
const Settings2D::Acquisitions & get() const
Definition: Settings2D.h:2463
Settings2D & set(const Processing::Color &value)
Set Processing::Color
Definition: Settings2D.h:2421
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma
Definition: Settings2D.h:2456
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2327
Processing & processing()
Get Processing
Definition: Settings2D.h:2408
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2557
Settings2D copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: Settings2D.h:2365
const Processing & processing() const
Get Processing
Definition: Settings2D.h:2402
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green
Definition: Settings2D.h:2442
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2491
std::string toString() const
Get the value as string
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2533
bool operator==(const Settings2D &other) const
Equality operator
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue
Definition: Settings2D.h:2435
const Settings2D::Processing & get() const
Definition: Settings2D.h:2469
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2483
Settings2D & set(const Acquisitions &value)
Set Acquisitions
Definition: Settings2D.h:2395
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red
Definition: Settings2D.h:2449
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance
Definition: Settings2D.h:2428
NodeType
Definition: NodeType.h:100
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:200
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99