Zivid C++ API  2.3.1+1a22cbf1-1
Defining the Future of 3D Machine Vision
Settings2D.h
Go to the documentation of this file.
1 
2 /*******************************************************************************
3  * This file is part of the Zivid 3D Camera API
4  *
5  * Copyright 2015-2022 (C) Zivid AS
6  * All rights reserved.
7  *
8  * Zivid Software License, v1.0
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * 3. Neither the name of Zivid AS nor the names of its contributors may be used
21  * to endorse or promote products derived from this software without specific
22  * prior written permission.
23  *
24  * 4. This software, with or without modification, must not be used with any
25  * other 3D camera than from Zivid AS.
26  *
27  * 5. Any software provided in binary form under this license must not be
28  * reverse engineered, decompiled, modified and/or disassembled.
29  *
30  * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
31  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32  * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33  * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
34  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
35  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
37  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40  *
41  * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
42  * Info: http://www.zivid.com
43  ******************************************************************************/
44 
45 #pragma once
46 
47 #include <array>
48 #include <chrono>
49 #include <cmath>
50 #include <ctime>
51 #include <iomanip>
52 #include <memory>
53 #include <set>
54 #include <sstream>
55 #include <string>
56 #include <tuple>
57 #include <utility>
58 #include <vector>
59 
62 #include "Zivid/DataModel/Traits.h"
65 #include "Zivid/Range.h"
66 
67 #ifdef _MSC_VER
68 # pragma warning(push)
69 # pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70 #endif
71 
72 namespace Zivid
73 {
76  {
77  public:
79  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
80 
82  static constexpr const char *path{ "" };
83 
85  static constexpr const char *name{ "Settings2D" };
86 
88  static constexpr const char *description{
89  R"description(Settings used when capturing 2D images with a Zivid camera)description"
90  };
91 
92  static constexpr size_t version{ 3 };
93 
94 #ifndef NO_DOC
95  template<size_t>
96  struct Version;
97 
98  using LatestVersion = Zivid::Settings2D;
99 
100  // Short identifier. This value is not guaranteed to be universally unique
101  // Todo(ZIVID-2808): Move this to internal DataModelExt header
102  static constexpr std::array<uint8_t, 3> binaryId{ 's', 't', '2' };
103 
104 #endif
105 
108  {
109  public:
111  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
112 
114  static constexpr const char *path{ "Acquisition" };
115 
117  static constexpr const char *name{ "Acquisition" };
118 
120  static constexpr const char *description{ R"description(Settings for a single acquisition)description" };
121 
126  {
127  public:
130 
132  static constexpr const char *path{ "Acquisition/Aperture" };
133 
135  static constexpr const char *name{ "Aperture" };
136 
138  static constexpr const char *description{
139  R"description(Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to
140 the effective aperture diameter).
141 )description"
142  };
143 
145  using ValueType = double;
146 
148  static constexpr Range<double> validRange()
149  {
150  return { 1.4, 32.0 };
151  }
152 
154  Aperture() = default;
155 
157  explicit constexpr Aperture(double value)
158  : m_opt{ verifyValue(value) }
159  {}
160 
165  double value() const;
166 
168  bool hasValue() const;
169 
171  void reset();
172 
174  std::string toString() const;
175 
177  bool operator==(const Aperture &other) const
178  {
179  return m_opt == other.m_opt;
180  }
181 
183  bool operator!=(const Aperture &other) const
184  {
185  return m_opt != other.m_opt;
186  }
187 
189  bool operator<(const Aperture &other) const
190  {
191  return m_opt < other.m_opt;
192  }
193 
195  bool operator>(const Aperture &other) const
196  {
197  return m_opt > other.m_opt;
198  }
199 
201  friend std::ostream &operator<<(std::ostream &stream, const Aperture &value)
202  {
203  return stream << value.toString();
204  }
205 
206  private:
207  void setFromString(const std::string &value);
208 
209  constexpr ValueType verifyValue(const ValueType &value) const
210  {
211  return validRange().isInRange(value)
212  ? value
213  : throw std::out_of_range{ "Aperture{ " + std::to_string(value) + " } is not in range ["
214  + std::to_string(validRange().min()) + ", "
215  + std::to_string(validRange().max()) + "]" };
216  }
217 
218  Zivid::DataModel::Detail::Optional<double> m_opt;
219 
220  friend struct DataModel::Detail::Befriend<Aperture>;
221  };
222 
237  {
238  public:
241 
243  static constexpr const char *path{ "Acquisition/Brightness" };
244 
246  static constexpr const char *name{ "Brightness" };
247 
249  static constexpr const char *description{
250  R"description(Brightness controls the light output from the projector.
251 
252 Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
253 or in case of high levels of ambient lighting. Brightness above 1.0 is supported on Zivid One
254 Plus and Zivid Two.
255 
256 When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
257 can capture) will be reduced. For Zivid One Plus the duty cycle in boost mode is 50%. For Zivid
258 Two the duty cycle is reduced linearly from 100% at brightness 1.0, to 50% at brightness 1.8.
259 The duty cycle is calculated over a 10 second period. This limitation is enforced automatically
260 by the camera. Calling capture when the duty cycle limit has been reached will cause the camera
261 to first wait (sleep) for a duration of time to cool down, before capture will start.
262 )description"
263  };
264 
266  using ValueType = double;
267 
269  static constexpr Range<double> validRange()
270  {
271  return { 0, 1.8 };
272  }
273 
275  Brightness() = default;
276 
278  explicit constexpr Brightness(double value)
279  : m_opt{ verifyValue(value) }
280  {}
281 
286  double value() const;
287 
289  bool hasValue() const;
290 
292  void reset();
293 
295  std::string toString() const;
296 
298  bool operator==(const Brightness &other) const
299  {
300  return m_opt == other.m_opt;
301  }
302 
304  bool operator!=(const Brightness &other) const
305  {
306  return m_opt != other.m_opt;
307  }
308 
310  bool operator<(const Brightness &other) const
311  {
312  return m_opt < other.m_opt;
313  }
314 
316  bool operator>(const Brightness &other) const
317  {
318  return m_opt > other.m_opt;
319  }
320 
322  friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
323  {
324  return stream << value.toString();
325  }
326 
327  private:
328  void setFromString(const std::string &value);
329 
330  constexpr ValueType verifyValue(const ValueType &value) const
331  {
332  return validRange().isInRange(value)
333  ? value
334  : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
335  + " } is not in range [" + std::to_string(validRange().min())
336  + ", " + std::to_string(validRange().max()) + "]" };
337  }
338 
339  Zivid::DataModel::Detail::Optional<double> m_opt;
340 
341  friend struct DataModel::Detail::Befriend<Brightness>;
342  };
343 
346  {
347  public:
350 
352  static constexpr const char *path{ "Acquisition/ExposureTime" };
353 
355  static constexpr const char *name{ "ExposureTime" };
356 
358  static constexpr const char *description{ R"description(Exposure time for the image)description" };
359 
361  using ValueType = std::chrono::microseconds;
362 
365  {
366  return { std::chrono::microseconds{ 1677 }, std::chrono::microseconds{ 100000 } };
367  }
368 
370  ExposureTime() = default;
371 
373  explicit constexpr ExposureTime(std::chrono::microseconds value)
374  : m_opt{ verifyValue(value) }
375  {}
376 
381  std::chrono::microseconds value() const;
382 
384  bool hasValue() const;
385 
387  void reset();
388 
390  std::string toString() const;
391 
393  bool operator==(const ExposureTime &other) const
394  {
395  return m_opt == other.m_opt;
396  }
397 
399  bool operator!=(const ExposureTime &other) const
400  {
401  return m_opt != other.m_opt;
402  }
403 
405  bool operator<(const ExposureTime &other) const
406  {
407  return m_opt < other.m_opt;
408  }
409 
411  bool operator>(const ExposureTime &other) const
412  {
413  return m_opt > other.m_opt;
414  }
415 
417  friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
418  {
419  return stream << value.toString();
420  }
421 
422  private:
423  void setFromString(const std::string &value);
424 
425  constexpr ValueType verifyValue(const ValueType &value) const
426  {
427  return validRange().isInRange(value)
428  ? value
429  : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
430  + " } is not in range ["
431  + std::to_string(validRange().min().count()) + ", "
432  + std::to_string(validRange().max().count()) + "]" };
433  }
434 
435  Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
436 
437  friend struct DataModel::Detail::Befriend<ExposureTime>;
438  };
439 
442  {
443  public:
446 
448  static constexpr const char *path{ "Acquisition/Gain" };
449 
451  static constexpr const char *name{ "Gain" };
452 
454  static constexpr const char *description{ R"description(Analog gain in the camera)description" };
455 
457  using ValueType = double;
458 
460  static constexpr Range<double> validRange()
461  {
462  return { 1, 16 };
463  }
464 
466  Gain() = default;
467 
469  explicit constexpr Gain(double value)
470  : m_opt{ verifyValue(value) }
471  {}
472 
477  double value() const;
478 
480  bool hasValue() const;
481 
483  void reset();
484 
486  std::string toString() const;
487 
489  bool operator==(const Gain &other) const
490  {
491  return m_opt == other.m_opt;
492  }
493 
495  bool operator!=(const Gain &other) const
496  {
497  return m_opt != other.m_opt;
498  }
499 
501  bool operator<(const Gain &other) const
502  {
503  return m_opt < other.m_opt;
504  }
505 
507  bool operator>(const Gain &other) const
508  {
509  return m_opt > other.m_opt;
510  }
511 
513  friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
514  {
515  return stream << value.toString();
516  }
517 
518  private:
519  void setFromString(const std::string &value);
520 
521  constexpr ValueType verifyValue(const ValueType &value) const
522  {
523  return validRange().isInRange(value)
524  ? value
525  : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
526  + std::to_string(validRange().min()) + ", "
527  + std::to_string(validRange().max()) + "]" };
528  }
529 
530  Zivid::DataModel::Detail::Optional<double> m_opt;
531 
532  friend struct DataModel::Detail::Befriend<Gain>;
533  };
534 
539 
542 
557 #ifndef NO_DOC
558  template<typename... Args,
559  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
560  typename std::enable_if<
561  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
562  typename std::decay<Args>::type...>::value,
563  int>::type = 0>
564 #else
565  template<typename... Args>
566 #endif
567  explicit Acquisition(Args &&...args)
568  {
569  using namespace Zivid::Detail::TypeTraits;
570 
571  static_assert(AllArgsDecayedAreUnique<Args...>::value,
572  "Found duplicate types among the arguments passed to Acquisition(...). "
573  "Types should be listed at most once.");
574 
575  set(std::forward<Args>(args)...);
576  }
577 
591 #ifndef NO_DOC
592  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
593 #else
594  template<typename... Args>
595 #endif
596  void set(Args &&...args)
597  {
598  using namespace Zivid::Detail::TypeTraits;
599 
600  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
601  static_assert(AllArgsAreDescendantNodes::value,
602  "All arguments passed to set(...) must be descendant nodes.");
603 
604  static_assert(AllArgsDecayedAreUnique<Args...>::value,
605  "Found duplicate types among the arguments passed to set(...). "
606  "Types should be listed at most once.");
607 
608  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
609  }
610 
625 #ifndef NO_DOC
626  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
627 #else
628  template<typename... Args>
629 #endif
630  Acquisition copyWith(Args &&...args) const
631  {
632  using namespace Zivid::Detail::TypeTraits;
633 
634  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
635  static_assert(AllArgsAreDescendantNodes::value,
636  "All arguments passed to copyWith(...) must be descendant nodes.");
637 
638  static_assert(AllArgsDecayedAreUnique<Args...>::value,
639  "Found duplicate types among the arguments passed to copyWith(...). "
640  "Types should be listed at most once.");
641 
642  auto copy{ *this };
643  copy.set(std::forward<Args>(args)...);
644  return copy;
645  }
646 
648  const Aperture &aperture() const
649  {
650  return m_aperture;
651  }
652 
655  {
656  return m_aperture;
657  }
658 
660  Acquisition &set(const Aperture &value)
661  {
662  m_aperture = value;
663  return *this;
664  }
665 
667  const Brightness &brightness() const
668  {
669  return m_brightness;
670  }
671 
674  {
675  return m_brightness;
676  }
677 
679  Acquisition &set(const Brightness &value)
680  {
681  m_brightness = value;
682  return *this;
683  }
684 
686  const ExposureTime &exposureTime() const
687  {
688  return m_exposureTime;
689  }
690 
693  {
694  return m_exposureTime;
695  }
696 
698  Acquisition &set(const ExposureTime &value)
699  {
700  m_exposureTime = value;
701  return *this;
702  }
703 
705  const Gain &gain() const
706  {
707  return m_gain;
708  }
709 
712  {
713  return m_gain;
714  }
715 
717  Acquisition &set(const Gain &value)
718  {
719  m_gain = value;
720  return *this;
721  }
722 
723  template<typename T,
724  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
726  {
727  return m_aperture;
728  }
729 
730  template<
731  typename T,
732  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
734  {
735  return m_brightness;
736  }
737 
738  template<
739  typename T,
740  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
742  {
743  return m_exposureTime;
744  }
745 
746  template<typename T,
747  typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
749  {
750  return m_gain;
751  }
752 
753  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
755  {
756  return m_aperture;
757  }
758 
759  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
761  {
762  return m_brightness;
763  }
764 
765  template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
767  {
768  return m_exposureTime;
769  }
770 
771  template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
773  {
774  return m_gain;
775  }
776 
778  template<typename F>
779  void forEach(const F &f) const
780  {
781  f(m_aperture);
782  f(m_brightness);
783  f(m_exposureTime);
784  f(m_gain);
785  }
786 
788  template<typename F>
789  void forEach(const F &f)
790  {
791  f(m_aperture);
792  f(m_brightness);
793  f(m_exposureTime);
794  f(m_gain);
795  }
796 
798  bool operator==(const Acquisition &other) const;
799 
801  bool operator!=(const Acquisition &other) const;
802 
804  std::string toString() const;
805 
807  friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
808  {
809  return stream << value.toString();
810  }
811 
812  private:
813  void setFromString(const std::string &value);
814 
815  void setFromString(const std::string &fullPath, const std::string &value);
816 
817  std::string getString(const std::string &fullPath) const;
818 
819  Aperture m_aperture;
820  Brightness m_brightness;
821  ExposureTime m_exposureTime;
822  Gain m_gain;
823 
824  friend struct DataModel::Detail::Befriend<Acquisition>;
825  };
826 
829  {
830  public:
833 
835  static constexpr const char *path{ "Acquisitions" };
836 
838  static constexpr const char *name{ "Acquisitions" };
839 
841  static constexpr const char *description{
842  R"description(List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mode.)description"
843  };
844 
846  using ValueType = std::vector<Settings2D::Acquisition>;
847 
850  {
851  return { 0, std::numeric_limits<ValueType::size_type>::max() };
852  }
853 
855  Acquisitions() = default;
856 
858  explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
859  : m_value{ std::move(value) }
860  {}
861 
863  explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
864  : Acquisitions{ ValueType{ value } }
865  {}
866 
868  const std::vector<Settings2D::Acquisition> &value() const;
869 
871  std::string toString() const;
872 
874  std::size_t size() const noexcept;
875 
877  bool isEmpty() const noexcept;
878 
884  template<typename... Args>
885  void emplaceBack(Args &&...args)
886  {
887  m_value.emplace_back(std::forward<Args>(args)...);
888  }
889 
895  Settings2D::Acquisition &at(std::size_t pos);
896 
902  const Settings2D::Acquisition &at(std::size_t pos) const;
903 
910 
916  const Settings2D::Acquisition &operator[](std::size_t pos) const;
917 
919  template<typename F>
920  void forEach(const F &f)
921  {
922  for(auto &child : m_value)
923  {
924  f(child);
925  }
926  }
927 
929  template<typename F>
930  void forEach(const F &f) const
931  {
932  for(const auto &child : m_value)
933  {
934  f(child);
935  }
936  }
937 
939  bool operator==(const Acquisitions &other) const
940  {
941  return m_value == other.m_value;
942  }
943 
945  bool operator!=(const Acquisitions &other) const
946  {
947  return m_value != other.m_value;
948  }
949 
951  friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
952  {
953  return stream << value.toString();
954  }
955 
956  private:
957  void setFromString(const std::string &value);
958 
959  std::vector<Settings2D::Acquisition> m_value{};
960 
961  friend struct DataModel::Detail::Befriend<Acquisitions>;
962  };
963 
966  {
967  public:
969  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
970 
972  static constexpr const char *path{ "Processing" };
973 
975  static constexpr const char *name{ "Processing" };
976 
978  static constexpr const char *description{ R"description(Processing related settings)description" };
979 
982  {
983  public:
985  static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
986 
988  static constexpr const char *path{ "Processing/Color" };
989 
991  static constexpr const char *name{ "Color" };
992 
994  static constexpr const char *description{ R"description(Color settings)description" };
995 
998  {
999  public:
1002 
1004  static constexpr const char *path{ "Processing/Color/Balance" };
1005 
1007  static constexpr const char *name{ "Balance" };
1008 
1010  static constexpr const char *description{ R"description(Color balance settings)description" };
1011 
1014  {
1015  public:
1018 
1020  static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1021 
1023  static constexpr const char *name{ "Blue" };
1024 
1026  static constexpr const char *description{
1027  R"description(Digital gain applied to blue channel)description"
1028  };
1029 
1031  using ValueType = double;
1032 
1034  static constexpr Range<double> validRange()
1035  {
1036  return { 1.0, 8.0 };
1037  }
1038 
1040  Blue() = default;
1041 
1043  explicit constexpr Blue(double value)
1044  : m_opt{ verifyValue(value) }
1045  {}
1046 
1051  double value() const;
1052 
1054  bool hasValue() const;
1055 
1057  void reset();
1058 
1060  std::string toString() const;
1061 
1063  bool operator==(const Blue &other) const
1064  {
1065  return m_opt == other.m_opt;
1066  }
1067 
1069  bool operator!=(const Blue &other) const
1070  {
1071  return m_opt != other.m_opt;
1072  }
1073 
1075  bool operator<(const Blue &other) const
1076  {
1077  return m_opt < other.m_opt;
1078  }
1079 
1081  bool operator>(const Blue &other) const
1082  {
1083  return m_opt > other.m_opt;
1084  }
1085 
1087  friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1088  {
1089  return stream << value.toString();
1090  }
1091 
1092  private:
1093  void setFromString(const std::string &value);
1094 
1095  constexpr ValueType verifyValue(const ValueType &value) const
1096  {
1097  return validRange().isInRange(value)
1098  ? value
1099  : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1100  + " } is not in range ["
1101  + std::to_string(validRange().min()) + ", "
1102  + std::to_string(validRange().max()) + "]" };
1103  }
1104 
1105  Zivid::DataModel::Detail::Optional<double> m_opt;
1106 
1107  friend struct DataModel::Detail::Befriend<Blue>;
1108  };
1109 
1112  {
1113  public:
1116 
1118  static constexpr const char *path{ "Processing/Color/Balance/Green" };
1119 
1121  static constexpr const char *name{ "Green" };
1122 
1124  static constexpr const char *description{
1125  R"description(Digital gain applied to green channel)description"
1126  };
1127 
1129  using ValueType = double;
1130 
1132  static constexpr Range<double> validRange()
1133  {
1134  return { 1.0, 8.0 };
1135  }
1136 
1138  Green() = default;
1139 
1141  explicit constexpr Green(double value)
1142  : m_opt{ verifyValue(value) }
1143  {}
1144 
1149  double value() const;
1150 
1152  bool hasValue() const;
1153 
1155  void reset();
1156 
1158  std::string toString() const;
1159 
1161  bool operator==(const Green &other) const
1162  {
1163  return m_opt == other.m_opt;
1164  }
1165 
1167  bool operator!=(const Green &other) const
1168  {
1169  return m_opt != other.m_opt;
1170  }
1171 
1173  bool operator<(const Green &other) const
1174  {
1175  return m_opt < other.m_opt;
1176  }
1177 
1179  bool operator>(const Green &other) const
1180  {
1181  return m_opt > other.m_opt;
1182  }
1183 
1185  friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1186  {
1187  return stream << value.toString();
1188  }
1189 
1190  private:
1191  void setFromString(const std::string &value);
1192 
1193  constexpr ValueType verifyValue(const ValueType &value) const
1194  {
1195  return validRange().isInRange(value)
1196  ? value
1197  : throw std::out_of_range{ "Green{ " + std::to_string(value)
1198  + " } is not in range ["
1199  + std::to_string(validRange().min()) + ", "
1200  + std::to_string(validRange().max()) + "]" };
1201  }
1202 
1203  Zivid::DataModel::Detail::Optional<double> m_opt;
1204 
1205  friend struct DataModel::Detail::Befriend<Green>;
1206  };
1207 
1210  {
1211  public:
1214 
1216  static constexpr const char *path{ "Processing/Color/Balance/Red" };
1217 
1219  static constexpr const char *name{ "Red" };
1220 
1222  static constexpr const char *description{
1223  R"description(Digital gain applied to red channel)description"
1224  };
1225 
1227  using ValueType = double;
1228 
1230  static constexpr Range<double> validRange()
1231  {
1232  return { 1.0, 8.0 };
1233  }
1234 
1236  Red() = default;
1237 
1239  explicit constexpr Red(double value)
1240  : m_opt{ verifyValue(value) }
1241  {}
1242 
1247  double value() const;
1248 
1250  bool hasValue() const;
1251 
1253  void reset();
1254 
1256  std::string toString() const;
1257 
1259  bool operator==(const Red &other) const
1260  {
1261  return m_opt == other.m_opt;
1262  }
1263 
1265  bool operator!=(const Red &other) const
1266  {
1267  return m_opt != other.m_opt;
1268  }
1269 
1271  bool operator<(const Red &other) const
1272  {
1273  return m_opt < other.m_opt;
1274  }
1275 
1277  bool operator>(const Red &other) const
1278  {
1279  return m_opt > other.m_opt;
1280  }
1281 
1283  friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1284  {
1285  return stream << value.toString();
1286  }
1287 
1288  private:
1289  void setFromString(const std::string &value);
1290 
1291  constexpr ValueType verifyValue(const ValueType &value) const
1292  {
1293  return validRange().isInRange(value)
1294  ? value
1295  : throw std::out_of_range{ "Red{ " + std::to_string(value)
1296  + " } is not in range ["
1297  + std::to_string(validRange().min()) + ", "
1298  + std::to_string(validRange().max()) + "]" };
1299  }
1300 
1301  Zivid::DataModel::Detail::Optional<double> m_opt;
1302 
1303  friend struct DataModel::Detail::Befriend<Red>;
1304  };
1305 
1309 
1312 
1326 #ifndef NO_DOC
1327  template<typename... Args,
1328  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1329  typename std::enable_if<Zivid::Detail::TypeTraits::AllArgsAreInTuple<
1330  Descendants,
1331  typename std::decay<Args>::type...>::value,
1332  int>::type = 0>
1333 #else
1334  template<typename... Args>
1335 #endif
1336  explicit Balance(Args &&...args)
1337  {
1338  using namespace Zivid::Detail::TypeTraits;
1339 
1340  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1341  "Found duplicate types among the arguments passed to Balance(...). "
1342  "Types should be listed at most once.");
1343 
1344  set(std::forward<Args>(args)...);
1345  }
1346 
1359 #ifndef NO_DOC
1360  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1361 #else
1362  template<typename... Args>
1363 #endif
1364  void set(Args &&...args)
1365  {
1366  using namespace Zivid::Detail::TypeTraits;
1367 
1368  using AllArgsAreDescendantNodes =
1369  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1370  static_assert(AllArgsAreDescendantNodes::value,
1371  "All arguments passed to set(...) must be descendant nodes.");
1372 
1373  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1374  "Found duplicate types among the arguments passed to set(...). "
1375  "Types should be listed at most once.");
1376 
1377  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1378  }
1379 
1393 #ifndef NO_DOC
1394  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1395 #else
1396  template<typename... Args>
1397 #endif
1398  Balance copyWith(Args &&...args) const
1399  {
1400  using namespace Zivid::Detail::TypeTraits;
1401 
1402  using AllArgsAreDescendantNodes =
1403  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1404  static_assert(AllArgsAreDescendantNodes::value,
1405  "All arguments passed to copyWith(...) must be descendant nodes.");
1406 
1407  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1408  "Found duplicate types among the arguments passed to copyWith(...). "
1409  "Types should be listed at most once.");
1410 
1411  auto copy{ *this };
1412  copy.set(std::forward<Args>(args)...);
1413  return copy;
1414  }
1415 
1417  const Blue &blue() const
1418  {
1419  return m_blue;
1420  }
1421 
1424  {
1425  return m_blue;
1426  }
1427 
1429  Balance &set(const Blue &value)
1430  {
1431  m_blue = value;
1432  return *this;
1433  }
1434 
1436  const Green &green() const
1437  {
1438  return m_green;
1439  }
1440 
1443  {
1444  return m_green;
1445  }
1446 
1448  Balance &set(const Green &value)
1449  {
1450  m_green = value;
1451  return *this;
1452  }
1453 
1455  const Red &red() const
1456  {
1457  return m_red;
1458  }
1459 
1462  {
1463  return m_red;
1464  }
1465 
1467  Balance &set(const Red &value)
1468  {
1469  m_red = value;
1470  return *this;
1471  }
1472 
1473  template<
1474  typename T,
1475  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1476  int>::type = 0>
1478  {
1479  return m_blue;
1480  }
1481 
1482  template<
1483  typename T,
1484  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1485  int>::type = 0>
1487  {
1488  return m_green;
1489  }
1490 
1491  template<
1492  typename T,
1493  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1494  int>::type = 0>
1496  {
1497  return m_red;
1498  }
1499 
1500  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1502  {
1503  return m_blue;
1504  }
1505 
1506  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1508  {
1509  return m_green;
1510  }
1511 
1512  template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1514  {
1515  return m_red;
1516  }
1517 
1519  template<typename F>
1520  void forEach(const F &f) const
1521  {
1522  f(m_blue);
1523  f(m_green);
1524  f(m_red);
1525  }
1526 
1528  template<typename F>
1529  void forEach(const F &f)
1530  {
1531  f(m_blue);
1532  f(m_green);
1533  f(m_red);
1534  }
1535 
1537  bool operator==(const Balance &other) const;
1538 
1540  bool operator!=(const Balance &other) const;
1541 
1543  std::string toString() const;
1544 
1546  friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1547  {
1548  return stream << value.toString();
1549  }
1550 
1551  private:
1552  void setFromString(const std::string &value);
1553 
1554  void setFromString(const std::string &fullPath, const std::string &value);
1555 
1556  std::string getString(const std::string &fullPath) const;
1557 
1558  Blue m_blue;
1559  Green m_green;
1560  Red m_red;
1561 
1562  friend struct DataModel::Detail::Befriend<Balance>;
1563  };
1564 
1569  {
1570  public:
1573 
1575  static constexpr const char *path{ "Processing/Color/Gamma" };
1576 
1578  static constexpr const char *name{ "Gamma" };
1579 
1581  static constexpr const char *description{
1582  R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
1583 greater than 1 makes the colors darker.
1584 )description"
1585  };
1586 
1588  using ValueType = double;
1589 
1591  static constexpr Range<double> validRange()
1592  {
1593  return { 0.25, 1.5 };
1594  }
1595 
1597  Gamma() = default;
1598 
1600  explicit constexpr Gamma(double value)
1601  : m_opt{ verifyValue(value) }
1602  {}
1603 
1608  double value() const;
1609 
1611  bool hasValue() const;
1612 
1614  void reset();
1615 
1617  std::string toString() const;
1618 
1620  bool operator==(const Gamma &other) const
1621  {
1622  return m_opt == other.m_opt;
1623  }
1624 
1626  bool operator!=(const Gamma &other) const
1627  {
1628  return m_opt != other.m_opt;
1629  }
1630 
1632  bool operator<(const Gamma &other) const
1633  {
1634  return m_opt < other.m_opt;
1635  }
1636 
1638  bool operator>(const Gamma &other) const
1639  {
1640  return m_opt > other.m_opt;
1641  }
1642 
1644  friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
1645  {
1646  return stream << value.toString();
1647  }
1648 
1649  private:
1650  void setFromString(const std::string &value);
1651 
1652  constexpr ValueType verifyValue(const ValueType &value) const
1653  {
1654  return validRange().isInRange(value)
1655  ? value
1656  : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
1657  + std::to_string(validRange().min()) + ", "
1658  + std::to_string(validRange().max()) + "]" };
1659  }
1660 
1661  Zivid::DataModel::Detail::Optional<double> m_opt;
1662 
1663  friend struct DataModel::Detail::Befriend<Gamma>;
1664  };
1665 
1671 
1674 
1690 #ifndef NO_DOC
1691  template<typename... Args,
1692  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1693  typename std::enable_if<
1694  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
1695  typename std::decay<Args>::type...>::value,
1696  int>::type = 0>
1697 #else
1698  template<typename... Args>
1699 #endif
1700  explicit Color(Args &&...args)
1701  {
1702  using namespace Zivid::Detail::TypeTraits;
1703 
1704  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1705  "Found duplicate types among the arguments passed to Color(...). "
1706  "Types should be listed at most once.");
1707 
1708  set(std::forward<Args>(args)...);
1709  }
1710 
1725 #ifndef NO_DOC
1726  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1727 #else
1728  template<typename... Args>
1729 #endif
1730  void set(Args &&...args)
1731  {
1732  using namespace Zivid::Detail::TypeTraits;
1733 
1734  using AllArgsAreDescendantNodes =
1735  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1736  static_assert(AllArgsAreDescendantNodes::value,
1737  "All arguments passed to set(...) must be descendant nodes.");
1738 
1739  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1740  "Found duplicate types among the arguments passed to set(...). "
1741  "Types should be listed at most once.");
1742 
1743  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1744  }
1745 
1761 #ifndef NO_DOC
1762  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1763 #else
1764  template<typename... Args>
1765 #endif
1766  Color copyWith(Args &&...args) const
1767  {
1768  using namespace Zivid::Detail::TypeTraits;
1769 
1770  using AllArgsAreDescendantNodes =
1771  AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1772  static_assert(AllArgsAreDescendantNodes::value,
1773  "All arguments passed to copyWith(...) must be descendant nodes.");
1774 
1775  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1776  "Found duplicate types among the arguments passed to copyWith(...). "
1777  "Types should be listed at most once.");
1778 
1779  auto copy{ *this };
1780  copy.set(std::forward<Args>(args)...);
1781  return copy;
1782  }
1783 
1785  const Balance &balance() const
1786  {
1787  return m_balance;
1788  }
1789 
1792  {
1793  return m_balance;
1794  }
1795 
1797  Color &set(const Balance &value)
1798  {
1799  m_balance = value;
1800  return *this;
1801  }
1802 
1804  Color &set(const Balance::Blue &value)
1805  {
1806  m_balance.set(value);
1807  return *this;
1808  }
1809 
1811  Color &set(const Balance::Green &value)
1812  {
1813  m_balance.set(value);
1814  return *this;
1815  }
1816 
1818  Color &set(const Balance::Red &value)
1819  {
1820  m_balance.set(value);
1821  return *this;
1822  }
1823 
1825  const Gamma &gamma() const
1826  {
1827  return m_gamma;
1828  }
1829 
1832  {
1833  return m_gamma;
1834  }
1835 
1837  Color &set(const Gamma &value)
1838  {
1839  m_gamma = value;
1840  return *this;
1841  }
1842 
1843  template<typename T,
1844  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value,
1845  int>::type = 0>
1847  {
1848  return m_balance;
1849  }
1850 
1851  template<typename T,
1852  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1853  int>::type = 0>
1855  {
1856  return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
1857  }
1858 
1859  template<typename T,
1860  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1861  int>::type = 0>
1863  {
1864  return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
1865  }
1866 
1867  template<typename T,
1868  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1869  int>::type = 0>
1871  {
1872  return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
1873  }
1874 
1875  template<typename T,
1876  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value,
1877  int>::type = 0>
1879  {
1880  return m_gamma;
1881  }
1882 
1883  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1885  {
1886  return m_balance;
1887  }
1888 
1889  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1891  {
1892  return m_gamma;
1893  }
1894 
1896  template<typename F>
1897  void forEach(const F &f) const
1898  {
1899  f(m_balance);
1900  f(m_gamma);
1901  }
1902 
1904  template<typename F>
1905  void forEach(const F &f)
1906  {
1907  f(m_balance);
1908  f(m_gamma);
1909  }
1910 
1912  bool operator==(const Color &other) const;
1913 
1915  bool operator!=(const Color &other) const;
1916 
1918  std::string toString() const;
1919 
1921  friend std::ostream &operator<<(std::ostream &stream, const Color &value)
1922  {
1923  return stream << value.toString();
1924  }
1925 
1926  private:
1927  void setFromString(const std::string &value);
1928 
1929  void setFromString(const std::string &fullPath, const std::string &value);
1930 
1931  std::string getString(const std::string &fullPath) const;
1932 
1933  Balance m_balance;
1934  Gamma m_gamma;
1935 
1936  friend struct DataModel::Detail::Befriend<Color>;
1937  };
1938 
1945 
1948 
1965 #ifndef NO_DOC
1966  template<typename... Args,
1967  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1968  typename std::enable_if<
1969  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants,
1970  typename std::decay<Args>::type...>::value,
1971  int>::type = 0>
1972 #else
1973  template<typename... Args>
1974 #endif
1975  explicit Processing(Args &&...args)
1976  {
1977  using namespace Zivid::Detail::TypeTraits;
1978 
1979  static_assert(AllArgsDecayedAreUnique<Args...>::value,
1980  "Found duplicate types among the arguments passed to Processing(...). "
1981  "Types should be listed at most once.");
1982 
1983  set(std::forward<Args>(args)...);
1984  }
1985 
2001 #ifndef NO_DOC
2002  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2003 #else
2004  template<typename... Args>
2005 #endif
2006  void set(Args &&...args)
2007  {
2008  using namespace Zivid::Detail::TypeTraits;
2009 
2010  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2011  static_assert(AllArgsAreDescendantNodes::value,
2012  "All arguments passed to set(...) must be descendant nodes.");
2013 
2014  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2015  "Found duplicate types among the arguments passed to set(...). "
2016  "Types should be listed at most once.");
2017 
2018  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2019  }
2020 
2037 #ifndef NO_DOC
2038  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2039 #else
2040  template<typename... Args>
2041 #endif
2042  Processing copyWith(Args &&...args) const
2043  {
2044  using namespace Zivid::Detail::TypeTraits;
2045 
2046  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2047  static_assert(AllArgsAreDescendantNodes::value,
2048  "All arguments passed to copyWith(...) must be descendant nodes.");
2049 
2050  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2051  "Found duplicate types among the arguments passed to copyWith(...). "
2052  "Types should be listed at most once.");
2053 
2054  auto copy{ *this };
2055  copy.set(std::forward<Args>(args)...);
2056  return copy;
2057  }
2058 
2060  const Color &color() const
2061  {
2062  return m_color;
2063  }
2064 
2067  {
2068  return m_color;
2069  }
2070 
2072  Processing &set(const Color &value)
2073  {
2074  m_color = value;
2075  return *this;
2076  }
2077 
2080  {
2081  m_color.set(value);
2082  return *this;
2083  }
2084 
2087  {
2088  m_color.set(value);
2089  return *this;
2090  }
2091 
2094  {
2095  m_color.set(value);
2096  return *this;
2097  }
2098 
2101  {
2102  m_color.set(value);
2103  return *this;
2104  }
2105 
2107  Processing &set(const Color::Gamma &value)
2108  {
2109  m_color.set(value);
2110  return *this;
2111  }
2112 
2113  template<typename T,
2114  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2116  {
2117  return m_color;
2118  }
2119 
2120  template<
2121  typename T,
2122  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2124  {
2125  return m_color.get<Settings2D::Processing::Color::Balance>();
2126  }
2127 
2128  template<typename T,
2129  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
2130  int>::type = 0>
2132  {
2133  return m_color.get<Settings2D::Processing::Color::Balance::Blue>();
2134  }
2135 
2136  template<typename T,
2137  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
2138  int>::type = 0>
2140  {
2141  return m_color.get<Settings2D::Processing::Color::Balance::Green>();
2142  }
2143 
2144  template<typename T,
2145  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
2146  int>::type = 0>
2148  {
2149  return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2150  }
2151 
2152  template<
2153  typename T,
2154  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2156  {
2157  return m_color.get<Settings2D::Processing::Color::Gamma>();
2158  }
2159 
2160  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2162  {
2163  return m_color;
2164  }
2165 
2167  template<typename F>
2168  void forEach(const F &f) const
2169  {
2170  f(m_color);
2171  }
2172 
2174  template<typename F>
2175  void forEach(const F &f)
2176  {
2177  f(m_color);
2178  }
2179 
2181  bool operator==(const Processing &other) const;
2182 
2184  bool operator!=(const Processing &other) const;
2185 
2187  std::string toString() const;
2188 
2190  friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2191  {
2192  return stream << value.toString();
2193  }
2194 
2195  private:
2196  void setFromString(const std::string &value);
2197 
2198  void setFromString(const std::string &fullPath, const std::string &value);
2199 
2200  std::string getString(const std::string &fullPath) const;
2201 
2202  Color m_color;
2203 
2204  friend struct DataModel::Detail::Befriend<Processing>;
2205  };
2206 
2215 
2218 
2220  explicit Settings2D(const std::string &fileName);
2221 
2240 #ifndef NO_DOC
2241  template<
2242  typename... Args,
2243  typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2244  typename std::enable_if<
2245  Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2246  int>::type = 0>
2247 #else
2248  template<typename... Args>
2249 #endif
2250  explicit Settings2D(Args &&...args)
2251  {
2252  using namespace Zivid::Detail::TypeTraits;
2253 
2254  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2255  "Found duplicate types among the arguments passed to Settings2D(...). "
2256  "Types should be listed at most once.");
2257 
2258  set(std::forward<Args>(args)...);
2259  }
2260 
2278 #ifndef NO_DOC
2279  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2280 #else
2281  template<typename... Args>
2282 #endif
2283  void set(Args &&...args)
2284  {
2285  using namespace Zivid::Detail::TypeTraits;
2286 
2287  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2288  static_assert(AllArgsAreDescendantNodes::value,
2289  "All arguments passed to set(...) must be descendant nodes.");
2290 
2291  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2292  "Found duplicate types among the arguments passed to set(...). "
2293  "Types should be listed at most once.");
2294 
2295  Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2296  }
2297 
2316 #ifndef NO_DOC
2317  template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2318 #else
2319  template<typename... Args>
2320 #endif
2321  Settings2D copyWith(Args &&...args) const
2322  {
2323  using namespace Zivid::Detail::TypeTraits;
2324 
2325  using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2326  static_assert(AllArgsAreDescendantNodes::value,
2327  "All arguments passed to copyWith(...) must be descendant nodes.");
2328 
2329  static_assert(AllArgsDecayedAreUnique<Args...>::value,
2330  "Found duplicate types among the arguments passed to copyWith(...). "
2331  "Types should be listed at most once.");
2332 
2333  auto copy{ *this };
2334  copy.set(std::forward<Args>(args)...);
2335  return copy;
2336  }
2337 
2340  {
2341  return m_acquisitions;
2342  }
2343 
2346  {
2347  return m_acquisitions;
2348  }
2349 
2351  Settings2D &set(const Acquisitions &value)
2352  {
2353  m_acquisitions = value;
2354  return *this;
2355  }
2356 
2358  const Processing &processing() const
2359  {
2360  return m_processing;
2361  }
2362 
2365  {
2366  return m_processing;
2367  }
2368 
2370  Settings2D &set(const Processing &value)
2371  {
2372  m_processing = value;
2373  return *this;
2374  }
2375 
2378  {
2379  m_processing.set(value);
2380  return *this;
2381  }
2382 
2385  {
2386  m_processing.set(value);
2387  return *this;
2388  }
2389 
2392  {
2393  m_processing.set(value);
2394  return *this;
2395  }
2396 
2399  {
2400  m_processing.set(value);
2401  return *this;
2402  }
2403 
2406  {
2407  m_processing.set(value);
2408  return *this;
2409  }
2410 
2413  {
2414  m_processing.set(value);
2415  return *this;
2416  }
2417 
2418  template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
2420  {
2421  return m_acquisitions;
2422  }
2423 
2424  template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
2426  {
2427  return m_processing;
2428  }
2429 
2430  template<typename T,
2431  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2433  {
2434  return m_processing.get<Settings2D::Processing::Color>();
2435  }
2436 
2437  template<typename T,
2438  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2440  {
2441  return m_processing.get<Settings2D::Processing::Color::Balance>();
2442  }
2443 
2444  template<typename T,
2445  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
2446  int>::type = 0>
2448  {
2449  return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
2450  }
2451 
2452  template<typename T,
2453  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
2454  int>::type = 0>
2456  {
2457  return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
2458  }
2459 
2460  template<
2461  typename T,
2462  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
2464  {
2465  return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
2466  }
2467 
2468  template<typename T,
2469  typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2471  {
2472  return m_processing.get<Settings2D::Processing::Color::Gamma>();
2473  }
2474 
2475  template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2477  {
2478  return m_acquisitions;
2479  }
2480 
2481  template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2483  {
2484  return m_processing;
2485  }
2486 
2488  template<typename F>
2489  void forEach(const F &f) const
2490  {
2491  f(m_acquisitions);
2492  f(m_processing);
2493  }
2494 
2496  template<typename F>
2497  void forEach(const F &f)
2498  {
2499  f(m_acquisitions);
2500  f(m_processing);
2501  }
2502 
2504  bool operator==(const Settings2D &other) const;
2505 
2507  bool operator!=(const Settings2D &other) const;
2508 
2510  std::string toString() const;
2511 
2513  friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
2514  {
2515  return stream << value.toString();
2516  }
2517 
2519  void save(const std::string &fileName) const;
2520 
2522  void load(const std::string &fileName);
2523 
2524  private:
2525  void setFromString(const std::string &value);
2526 
2527  void setFromString(const std::string &fullPath, const std::string &value);
2528 
2529  std::string getString(const std::string &fullPath) const;
2530 
2531  Acquisitions m_acquisitions;
2532  Processing m_processing;
2533 
2534  friend struct DataModel::Detail::Befriend<Settings2D>;
2535  };
2536 
2537 #ifndef NO_DOC
2538  template<>
2539  struct Settings2D::Version<3>
2540  {
2541  using Type = Settings2D;
2542  };
2543 #endif
2544 
2545 } // namespace Zivid
2546 
2547 #ifdef _MSC_VER
2548 # pragma warning(pop)
2549 #endif
2550 
2551 #ifndef NO_DOC
2552 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2553 namespace std // NOLINT
2554 {
2555  template<>
2556  struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
2557  {};
2558 
2559  template<size_t i>
2560  struct tuple_element<i, Zivid::Settings2D::Processing>
2561  {
2562  static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
2563 
2564  using type // NOLINT
2565  = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
2566  };
2567 
2568  template<>
2569  struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
2570  {};
2571 
2572  template<size_t i>
2573  struct tuple_element<i, Zivid::Settings2D::Processing::Color>
2574  {
2575  static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 2");
2576 
2577  using type // NOLINT
2578  = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
2579  };
2580 
2581  template<>
2582  struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
2583  {};
2584 
2585  template<size_t i>
2586  struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
2587  {
2588  static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
2589  "Index must be less than 3");
2590 
2591  using type // NOLINT
2592  = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
2593  };
2594 
2595  template<>
2596  struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 2>
2597  {};
2598 
2599  template<size_t i>
2600  struct tuple_element<i, Zivid::Settings2D>
2601  {
2602  static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 2");
2603 
2604  using type // NOLINT
2605  = decltype(declval<Zivid::Settings2D>().get<i>());
2606  };
2607 
2608 } // namespace std
2609 # endif
2610 #endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:57
Class describing a range of values for a given type T
Definition: Range.h:58
Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to the effe...
Definition: Settings2D.h:126
void reset()
Reset the node to unset state
bool operator!=(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:183
bool operator<(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:189
constexpr Aperture(double value)
Constructor
Definition: Settings2D.h:157
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:195
Aperture()=default
Default constructor
double ValueType
The type of the underlying value
Definition: Settings2D.h:145
bool operator==(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:177
static constexpr Range< double > validRange()
The range of valid values for Aperture
Definition: Settings2D.h:148
friend std::ostream & operator<<(std::ostream &stream, const Aperture &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:201
bool hasValue() const
Check if the value is set
Brightness controls the light output from the projector.
Definition: Settings2D.h:237
bool operator==(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:298
bool operator>(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:316
bool operator<(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:310
constexpr Brightness(double value)
Constructor
Definition: Settings2D.h:278
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:322
std::string toString() const
Get the value as string
static constexpr Range< double > validRange()
The range of valid values for Brightness
Definition: Settings2D.h:269
bool operator!=(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:304
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:266
Exposure time for the image
Definition: Settings2D.h:346
bool operator>(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:411
std::chrono::microseconds ValueType
The type of the underlying value
Definition: Settings2D.h:361
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ExposureTime
Definition: Settings2D.h:364
void reset()
Reset the node to unset state
constexpr ExposureTime(std::chrono::microseconds value)
Constructor
Definition: Settings2D.h:373
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:417
std::chrono::microseconds value() const
Get the value
bool operator<(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:405
bool operator!=(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:399
std::string toString() const
Get the value as string
ExposureTime()=default
Default constructor
bool operator==(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:393
bool hasValue() const
Check if the value is set
Analog gain in the camera
Definition: Settings2D.h:442
bool operator>(const Gain &other) const
Comparison operator
Definition: Settings2D.h:507
bool operator!=(const Gain &other) const
Comparison operator
Definition: Settings2D.h:495
bool operator==(const Gain &other) const
Comparison operator
Definition: Settings2D.h:489
double ValueType
The type of the underlying value
Definition: Settings2D.h:457
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:513
void reset()
Reset the node to unset state
static constexpr Range< double > validRange()
The range of valid values for Gain
Definition: Settings2D.h:460
constexpr Gain(double value)
Constructor
Definition: Settings2D.h:469
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:501
Settings for a single acquisition
Definition: Settings2D.h:108
const Settings2D::Acquisition::ExposureTime & get() const
Definition: Settings2D.h:741
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition: Settings2D.h:538
Acquisition & set(const ExposureTime &value)
Set ExposureTime
Definition: Settings2D.h:698
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:779
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:789
Acquisition & set(const Gain &value)
Set Gain
Definition: Settings2D.h:717
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:733
Acquisition & set(const Aperture &value)
Set Aperture
Definition: Settings2D.h:660
Gain & gain()
Get Gain
Definition: Settings2D.h:711
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:630
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:596
const Brightness & brightness() const
Get Brightness
Definition: Settings2D.h:667
Acquisition & set(const Brightness &value)
Set Brightness
Definition: Settings2D.h:679
Acquisition()
Default constructor
const Settings2D::Acquisition::Gain & get() const
Definition: Settings2D.h:748
Acquisition(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:567
ExposureTime & exposureTime()
Get ExposureTime
Definition: Settings2D.h:692
const Settings2D::Acquisition::Aperture & get() const
Definition: Settings2D.h:725
const Gain & gain() const
Get Gain
Definition: Settings2D.h:705
const ExposureTime & exposureTime() const
Get ExposureTime
Definition: Settings2D.h:686
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:807
Brightness & brightness()
Get Brightness
Definition: Settings2D.h:673
Aperture & aperture()
Get Aperture
Definition: Settings2D.h:654
const Aperture & aperture() const
Get Aperture
Definition: Settings2D.h:648
List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mo...
Definition: Settings2D.h:829
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:863
Acquisitions(std::vector< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:858
void forEach(const F &f)
Run the given function on each element in the list
Definition: Settings2D.h:920
bool operator==(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:939
void forEach(const F &f) const
Run the given function on each element in the list
Definition: Settings2D.h:930
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:846
std::string toString() const
Get the value as string
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Acquisitions
Definition: Settings2D.h:849
std::size_t size() const noexcept
Get the size of the list
bool operator!=(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:945
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:951
Digital gain applied to blue channel
Definition: Settings2D.h:1014
bool operator==(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1063
void reset()
Reset the node to unset state
static constexpr Range< double > validRange()
The range of valid values for Blue
Definition: Settings2D.h:1034
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1087
double ValueType
The type of the underlying value
Definition: Settings2D.h:1031
bool operator>(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1081
std::string toString() const
Get the value as string
constexpr Blue(double value)
Constructor
Definition: Settings2D.h:1043
bool operator!=(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1069
bool hasValue() const
Check if the value is set
bool operator<(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1075
Digital gain applied to green channel
Definition: Settings2D.h:1112
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1185
double ValueType
The type of the underlying value
Definition: Settings2D.h:1129
static constexpr Range< double > validRange()
The range of valid values for Green
Definition: Settings2D.h:1132
bool operator==(const Green &other) const
Comparison operator
Definition: Settings2D.h:1161
std::string toString() const
Get the value as string
constexpr Green(double value)
Constructor
Definition: Settings2D.h:1141
bool operator<(const Green &other) const
Comparison operator
Definition: Settings2D.h:1173
bool hasValue() const
Check if the value is set
bool operator!=(const Green &other) const
Comparison operator
Definition: Settings2D.h:1167
bool operator>(const Green &other) const
Comparison operator
Definition: Settings2D.h:1179
void reset()
Reset the node to unset state
Digital gain applied to red channel
Definition: Settings2D.h:1210
double ValueType
The type of the underlying value
Definition: Settings2D.h:1227
static constexpr Range< double > validRange()
The range of valid values for Red
Definition: Settings2D.h:1230
bool operator<(const Red &other) const
Comparison operator
Definition: Settings2D.h:1271
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:1265
constexpr Red(double value)
Constructor
Definition: Settings2D.h:1239
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1283
bool operator==(const Red &other) const
Comparison operator
Definition: Settings2D.h:1259
void reset()
Reset the node to unset state
bool operator>(const Red &other) const
Comparison operator
Definition: Settings2D.h:1277
Color balance settings
Definition: Settings2D.h:998
Red & red()
Get Red
Definition: Settings2D.h:1461
Balance(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1336
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:1308
const Blue & blue() const
Get Blue
Definition: Settings2D.h:1417
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1529
const Green & green() const
Get Green
Definition: Settings2D.h:1436
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:1520
bool operator==(const Balance &other) const
Equality operator
Balance & set(const Blue &value)
Set Blue
Definition: Settings2D.h:1429
Balance & set(const Green &value)
Set Green
Definition: Settings2D.h:1448
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:1398
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1495
const Red & red() const
Get Red
Definition: Settings2D.h:1455
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1546
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1477
Balance & set(const Red &value)
Set Red
Definition: Settings2D.h:1467
Blue & blue()
Get Blue
Definition: Settings2D.h:1423
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1486
std::string toString() const
Get the value as string
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1364
Green & green()
Get Green
Definition: Settings2D.h:1442
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition: Settings2D.h:1569
double ValueType
The type of the underlying value
Definition: Settings2D.h:1588
bool operator>(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1638
bool operator==(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1620
bool operator!=(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1626
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:1632
static constexpr Range< double > validRange()
The range of valid values for Gamma
Definition: Settings2D.h:1591
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1644
void reset()
Reset the node to unset state
constexpr Gamma(double value)
Constructor
Definition: Settings2D.h:1600
Gamma()=default
Default constructor
Color settings
Definition: Settings2D.h:982
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1730
bool operator!=(const Color &other) const
Inequality operator
const Balance & balance() const
Get Balance
Definition: Settings2D.h:1785
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1862
bool operator==(const Color &other) const
Equality operator
Gamma & gamma()
Get Gamma
Definition: Settings2D.h:1831
std::string toString() const
Get the value as string
Color & set(const Balance::Green &value)
Set Balance::Green
Definition: Settings2D.h:1811
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1870
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:1897
Color(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1700
Color & set(const Gamma &value)
Set Gamma
Definition: Settings2D.h:1837
Color & set(const Balance::Blue &value)
Set Balance::Blue
Definition: Settings2D.h:1804
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:1670
Color & set(const Balance::Red &value)
Set Balance::Red
Definition: Settings2D.h:1818
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1921
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:1766
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:1878
const Gamma & gamma() const
Get Gamma
Definition: Settings2D.h:1825
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1905
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:1846
Balance & balance()
Get Balance
Definition: Settings2D.h:1791
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1854
Color & set(const Balance &value)
Set Balance
Definition: Settings2D.h:1797
Processing related settings
Definition: Settings2D.h:966
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:2079
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2123
Processing & set(const Color &value)
Set Color
Definition: Settings2D.h:2072
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:2168
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2139
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2006
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red
Definition: Settings2D.h:2100
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue
Definition: Settings2D.h:2086
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2115
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2190
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:2042
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2147
std::string toString() const
Get the value as string
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green
Definition: Settings2D.h:2093
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2175
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:1944
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2155
const Color & color() const
Get Color
Definition: Settings2D.h:2060
Processing(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1975
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2131
Color & color()
Get Color
Definition: Settings2D.h:2066
Processing & set(const Color::Gamma &value)
Set Color::Gamma
Definition: Settings2D.h:2107
Settings used when capturing 2D images with a Zivid camera
Definition: Settings2D.h:76
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:2214
Acquisitions & acquisitions()
Get Acquisitions
Definition: Settings2D.h:2345
void save(const std::string &fileName) const
Save to the given file
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2470
const Acquisitions & acquisitions() const
Get Acquisitions
Definition: Settings2D.h:2339
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2497
Settings2D(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2250
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2455
Settings2D()
Default constructor
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2463
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:2432
Settings2D & set(const Processing &value)
Set Processing
Definition: Settings2D.h:2370
const Settings2D::Acquisitions & get() const
Definition: Settings2D.h:2419
Settings2D & set(const Processing::Color &value)
Set Processing::Color
Definition: Settings2D.h:2377
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma
Definition: Settings2D.h:2412
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2283
Processing & processing()
Get Processing
Definition: Settings2D.h:2364
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2513
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:2321
const Processing & processing() const
Get Processing
Definition: Settings2D.h:2358
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green
Definition: Settings2D.h:2398
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2447
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:2489
bool operator==(const Settings2D &other) const
Equality operator
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue
Definition: Settings2D.h:2391
const Settings2D::Processing & get() const
Definition: Settings2D.h:2425
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2439
Settings2D & set(const Acquisitions &value)
Set Acquisitions
Definition: Settings2D.h:2351
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red
Definition: Settings2D.h:2405
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance
Definition: Settings2D.h:2384
NodeType
Definition: NodeType.h:56
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:158
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:55