Zivid C++ API 2.19.0+b5c53d0f-1
Settings2D.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2026 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <optional>
53#include <set>
54#include <sstream>
55#include <string>
56#include <tuple>
57#include <utility>
58#include <vector>
59
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
72namespace Zivid
73{
74
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "Settings2D" };
89
91 static constexpr const char *description{
92 R"description(Settings used when capturing 2D images with a Zivid camera.)description"
93 };
94
95 static constexpr size_t version{ 10 };
96
97#ifndef NO_DOC
98 template<size_t>
99 struct Version;
100
101 using LatestVersion = Zivid::Settings2D;
102
103 // Short identifier. This value is not guaranteed to be universally unique
104 // Todo(ZIVID-2808): Move this to internal DataModelExt header
105 static constexpr std::array<uint8_t, 3> binaryId{ 's', 't', '2' };
106
107#endif
108
114
115 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
117 {
118 public:
121
123 static constexpr const char *path{ "Acquisition" };
124
126 static constexpr const char *name{ "Acquisition" };
127
129 static constexpr const char *description{ R"description(Settings for one 2D acquisition.
130
131When capturing 2D HDR, all 2D acquisitions must have the same Aperture setting. Use Exposure Time
132or Gain to control the exposure instead.
133)description" };
134
141
142 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
144 {
145 public:
148
150 static constexpr const char *path{ "Acquisition/Aperture" };
151
153 static constexpr const char *name{ "Aperture" };
154
156 static constexpr const char *description{
157 R"description(Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to
158the effective aperture diameter).
159
160When capturing 2D HDR, all 2D acquisitions must have the same Aperture setting. Use Exposure Time
161or Gain to control the exposure instead.
162)description"
163 };
164
166 using ValueType = double;
167
169 static constexpr Range<double> validRange()
170 {
171 return { 1.4, 32.0 };
172 }
173
175 Aperture() = default;
176
178 explicit constexpr Aperture(double value)
179 : m_opt{ verifyValue(value) }
180 {}
181
186 double value() const;
187
189 bool hasValue() const;
190
192 void reset();
193
195 std::string toString() const;
196
198 bool operator==(const Aperture &other) const
199 {
200 return m_opt == other.m_opt;
201 }
202
204 bool operator!=(const Aperture &other) const
205 {
206 return m_opt != other.m_opt;
207 }
208
210 bool operator<(const Aperture &other) const
211 {
212 return m_opt < other.m_opt;
213 }
214
216 bool operator>(const Aperture &other) const
217 {
218 return m_opt > other.m_opt;
219 }
220
222 bool operator<=(const Aperture &other) const
223 {
224 return m_opt <= other.m_opt;
225 }
226
228 bool operator>=(const Aperture &other) const
229 {
230 return m_opt >= other.m_opt;
231 }
232
234 friend std::ostream &operator<<(std::ostream &stream, const Aperture &value)
235 {
236 return stream << value.toString();
237 }
238
239 private:
240 void setFromString(const std::string &value);
241
242 constexpr ValueType static verifyValue(const ValueType &value)
243 {
244 return validRange().isInRange(value)
245 ? value
246 : throw std::out_of_range{ "Aperture{ " + std::to_string(value) + " } is not in range ["
247 + std::to_string(validRange().min()) + ", "
248 + std::to_string(validRange().max()) + "]" };
249 }
250
251 std::optional<double> m_opt;
252
253 friend struct DataModel::Detail::Befriend<Aperture>;
254 };
255
267
268 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
270 {
271 public:
274
276 static constexpr const char *path{ "Acquisition/Brightness" };
277
279 static constexpr const char *name{ "Brightness" };
280
282 static constexpr const char *description{
283 R"description(Brightness controls the light output from the projector.
284
285Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
286or in case of high levels of ambient lighting.
287
288When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
289can capture) will be reduced. The duty cycle in boost mode is 50%. The duty cycle is calculated
290over a 10 second period. This limitation is enforced automatically by the camera. Calling capture
291when the duty cycle limit has been reached will cause the camera to first wait (sleep) for a
292duration of time to cool down, before capture will start.
293)description"
294 };
295
297 using ValueType = double;
298
300 static constexpr Range<double> validRange()
301 {
302 return { 0, 3.0 };
303 }
304
306 Brightness() = default;
307
309 explicit constexpr Brightness(double value)
310 : m_opt{ verifyValue(value) }
311 {}
312
317 double value() const;
318
320 bool hasValue() const;
321
323 void reset();
324
326 std::string toString() const;
327
329 bool operator==(const Brightness &other) const
330 {
331 return m_opt == other.m_opt;
332 }
333
335 bool operator!=(const Brightness &other) const
336 {
337 return m_opt != other.m_opt;
338 }
339
341 bool operator<(const Brightness &other) const
342 {
343 return m_opt < other.m_opt;
344 }
345
347 bool operator>(const Brightness &other) const
348 {
349 return m_opt > other.m_opt;
350 }
351
353 bool operator<=(const Brightness &other) const
354 {
355 return m_opt <= other.m_opt;
356 }
357
359 bool operator>=(const Brightness &other) const
360 {
361 return m_opt >= other.m_opt;
362 }
363
365 friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
366 {
367 return stream << value.toString();
368 }
369
370 private:
371 void setFromString(const std::string &value);
372
373 constexpr ValueType static verifyValue(const ValueType &value)
374 {
375 return validRange().isInRange(value)
376 ? value
377 : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
378 + " } is not in range [" + std::to_string(validRange().min())
379 + ", " + std::to_string(validRange().max()) + "]" };
380 }
381
382 std::optional<double> m_opt;
383
384 friend struct DataModel::Detail::Befriend<Brightness>;
385 };
386
388
389 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
391 {
392 public:
395
397 static constexpr const char *path{ "Acquisition/ExposureTime" };
398
400 static constexpr const char *name{ "ExposureTime" };
401
403 static constexpr const char *description{ R"description(Exposure time for the image.)description" };
404
406 using ValueType = std::chrono::microseconds;
407
410 {
411 return { std::chrono::microseconds{ 200 }, std::chrono::microseconds{ 100000 } };
412 }
413
415 ExposureTime() = default;
416
418 explicit constexpr ExposureTime(std::chrono::microseconds value)
419 : m_opt{ verifyValue(value) }
420 {}
421
426 std::chrono::microseconds value() const;
427
429 bool hasValue() const;
430
432 void reset();
433
435 std::string toString() const;
436
438 bool operator==(const ExposureTime &other) const
439 {
440 return m_opt == other.m_opt;
441 }
442
444 bool operator!=(const ExposureTime &other) const
445 {
446 return m_opt != other.m_opt;
447 }
448
450 bool operator<(const ExposureTime &other) const
451 {
452 return m_opt < other.m_opt;
453 }
454
456 bool operator>(const ExposureTime &other) const
457 {
458 return m_opt > other.m_opt;
459 }
460
462 bool operator<=(const ExposureTime &other) const
463 {
464 return m_opt <= other.m_opt;
465 }
466
468 bool operator>=(const ExposureTime &other) const
469 {
470 return m_opt >= other.m_opt;
471 }
472
474 friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
475 {
476 return stream << value.toString();
477 }
478
479 private:
480 void setFromString(const std::string &value);
481
482 constexpr ValueType static verifyValue(const ValueType &value)
483 {
484 return validRange().isInRange(value)
485 ? value
486 : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
487 + " } is not in range ["
488 + std::to_string(validRange().min().count()) + ", "
489 + std::to_string(validRange().max().count()) + "]" };
490 }
491
492 std::optional<std::chrono::microseconds> m_opt;
493
494 friend struct DataModel::Detail::Befriend<ExposureTime>;
495 };
496
498
499 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
501 {
502 public:
505
507 static constexpr const char *path{ "Acquisition/Gain" };
508
510 static constexpr const char *name{ "Gain" };
511
513 static constexpr const char *description{ R"description(Analog gain in the camera.)description" };
514
516 using ValueType = double;
517
519 static constexpr Range<double> validRange()
520 {
521 return { 1, 16 };
522 }
523
525 Gain() = default;
526
528 explicit constexpr Gain(double value)
529 : m_opt{ verifyValue(value) }
530 {}
531
536 double value() const;
537
539 bool hasValue() const;
540
542 void reset();
543
545 std::string toString() const;
546
548 bool operator==(const Gain &other) const
549 {
550 return m_opt == other.m_opt;
551 }
552
554 bool operator!=(const Gain &other) const
555 {
556 return m_opt != other.m_opt;
557 }
558
560 bool operator<(const Gain &other) const
561 {
562 return m_opt < other.m_opt;
563 }
564
566 bool operator>(const Gain &other) const
567 {
568 return m_opt > other.m_opt;
569 }
570
572 bool operator<=(const Gain &other) const
573 {
574 return m_opt <= other.m_opt;
575 }
576
578 bool operator>=(const Gain &other) const
579 {
580 return m_opt >= other.m_opt;
581 }
582
584 friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
585 {
586 return stream << value.toString();
587 }
588
589 private:
590 void setFromString(const std::string &value);
591
592 constexpr ValueType static verifyValue(const ValueType &value)
593 {
594 return validRange().isInRange(value)
595 ? value
596 : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
597 + std::to_string(validRange().min()) + ", "
598 + std::to_string(validRange().max()) + "]" };
599 }
600
601 std::optional<double> m_opt;
602
603 friend struct DataModel::Detail::Befriend<Gain>;
604 };
605
606 using Descendants = std::tuple<
611
614
629#ifndef NO_DOC
630 template<
631 typename... Args,
632 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
633 typename std::enable_if<
634 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
635 value,
636 int>::type = 0>
637#else
638 template<typename... Args>
639#endif
640 explicit Acquisition(Args &&...args)
641 {
642 using namespace Zivid::Detail::TypeTraits;
643
644 static_assert(
645 AllArgsDecayedAreUnique<Args...>::value,
646 "Found duplicate types among the arguments passed to Acquisition(...). "
647 "Types should be listed at most once.");
648
649 set(std::forward<Args>(args)...);
650 }
651
665#ifndef NO_DOC
666 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
667#else
668 template<typename... Args>
669#endif
670 void set(Args &&...args)
671 {
672 using namespace Zivid::Detail::TypeTraits;
673
674 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
675 static_assert(
676 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
677
678 static_assert(
679 AllArgsDecayedAreUnique<Args...>::value,
680 "Found duplicate types among the arguments passed to set(...). "
681 "Types should be listed at most once.");
682
683 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
684 }
685
700#ifndef NO_DOC
701 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
702#else
703 template<typename... Args>
704#endif
705 Acquisition copyWith(Args &&...args) const
706 {
707 using namespace Zivid::Detail::TypeTraits;
708
709 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
710 static_assert(
711 AllArgsAreDescendantNodes::value,
712 "All arguments passed to copyWith(...) must be descendant nodes.");
713
714 static_assert(
715 AllArgsDecayedAreUnique<Args...>::value,
716 "Found duplicate types among the arguments passed to copyWith(...). "
717 "Types should be listed at most once.");
718
719 auto copy{ *this };
720 copy.set(std::forward<Args>(args)...);
721 return copy;
722 }
723
725 const Aperture &aperture() const
726 {
727 return m_aperture;
728 }
729
732 {
733 return m_aperture;
734 }
735
737 Acquisition &set(const Aperture &value)
738 {
739 m_aperture = value;
740 return *this;
741 }
742
744 const Brightness &brightness() const
745 {
746 return m_brightness;
747 }
748
751 {
752 return m_brightness;
753 }
754
757 {
758 m_brightness = value;
759 return *this;
760 }
761
764 {
765 return m_exposureTime;
766 }
767
770 {
771 return m_exposureTime;
772 }
773
776 {
777 m_exposureTime = value;
778 return *this;
779 }
780
782 const Gain &gain() const
783 {
784 return m_gain;
785 }
786
789 {
790 return m_gain;
791 }
792
794 Acquisition &set(const Gain &value)
795 {
796 m_gain = value;
797 return *this;
798 }
799
800 template<
801 typename T,
802 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
804 {
805 return m_aperture;
806 }
807
808 template<
809 typename T,
810 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
812 {
813 return m_brightness;
814 }
815
816 template<
817 typename T,
818 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
820 {
821 return m_exposureTime;
822 }
823
824 template<
825 typename T,
826 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
828 {
829 return m_gain;
830 }
831
832 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
834 {
835 return m_aperture;
836 }
837
838 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
840 {
841 return m_brightness;
842 }
843
844 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
846 {
847 return m_exposureTime;
848 }
849
850 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
852 {
853 return m_gain;
854 }
855
857 template<typename F>
858 void forEach(const F &f) const
859 {
860 f(m_aperture);
861 f(m_brightness);
862 f(m_exposureTime);
863 f(m_gain);
864 }
865
867 template<typename F>
868 void forEach(const F &f)
869 {
870 f(m_aperture);
871 f(m_brightness);
872 f(m_exposureTime);
873 f(m_gain);
874 }
875
877 bool operator==(const Acquisition &other) const;
878
880 bool operator!=(const Acquisition &other) const;
881
883 std::string toString() const;
884
886 friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
887 {
888 return stream << value.toString();
889 }
890
891 private:
892 void setFromString(const std::string &value);
893
894 void setFromString(const std::string &fullPath, const std::string &value);
895
896 std::string getString(const std::string &fullPath) const;
897
898 Aperture m_aperture;
899 Brightness m_brightness;
900 ExposureTime m_exposureTime;
901 Gain m_gain;
902
903 friend struct DataModel::Detail::Befriend<Acquisition>;
904 };
905
907
908 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
910 {
911 public:
914
916 static constexpr const char *path{ "Acquisitions" };
917
919 static constexpr const char *name{ "Acquisitions" };
920
922 static constexpr const char *description{
923 R"description(List of acquisitions used for 2D capture.)description"
924 };
925
927 using ValueType = std::vector<Settings2D::Acquisition>;
928
931 {
932 return { 0, std::numeric_limits<ValueType::size_type>::max() };
933 }
934
936 Acquisitions() = default;
937
939 explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
940 : m_value{ std::move(value) }
941 {}
942
944 explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
946 {}
947
949 const std::vector<Settings2D::Acquisition> &value() const;
950
952 std::string toString() const;
953
955 std::size_t size() const noexcept;
956
958 bool isEmpty() const noexcept;
959
965 template<typename... Args>
966 void emplaceBack(Args &&...args)
967 {
968 m_value.emplace_back(std::forward<Args>(args)...);
969 }
970
976 Settings2D::Acquisition &at(std::size_t pos);
977
983 const Settings2D::Acquisition &at(std::size_t pos) const;
984
991
997 const Settings2D::Acquisition &operator[](std::size_t pos) const;
998
1000 template<typename F>
1001 void forEach(const F &f)
1002 {
1003 for(auto &child : m_value)
1004 {
1005 f(child);
1006 }
1007 }
1008
1010 template<typename F>
1011 void forEach(const F &f) const
1012 {
1013 for(const auto &child : m_value)
1014 {
1015 f(child);
1016 }
1017 }
1018
1020 using Iterator = std::vector<Settings2D::Acquisition>::iterator;
1021
1023 Iterator begin() noexcept;
1024
1026 Iterator end() noexcept;
1027
1029 using ConstIterator = std::vector<Settings2D::Acquisition>::const_iterator;
1030
1032 ConstIterator begin() const noexcept;
1033
1035 ConstIterator end() const noexcept;
1036
1038 ConstIterator cbegin() const noexcept;
1039
1041 ConstIterator cend() const noexcept;
1042
1044 bool operator==(const Acquisitions &other) const
1045 {
1046 return m_value == other.m_value;
1047 }
1048
1050 bool operator!=(const Acquisitions &other) const
1051 {
1052 return m_value != other.m_value;
1053 }
1054
1056 friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
1057 {
1058 return stream << value.toString();
1059 }
1060
1061 private:
1062 void setFromString(const std::string &value);
1063
1064 std::vector<Settings2D::Acquisition> m_value{};
1065
1066 friend struct DataModel::Detail::Befriend<Acquisitions>;
1067 };
1068
1076
1077 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1079 {
1080 public:
1083
1085 static constexpr const char *path{ "Diagnostics" };
1086
1088 static constexpr const char *name{ "Diagnostics" };
1089
1091 static constexpr const char *description{
1092 R"description(When Diagnostics is enabled, additional diagnostic data is recorded during capture and included when saving
1093the frame to a .zdf file. This enables Zivid's Customer Success team to provide better assistance and more
1094thorough troubleshooting.
1095
1096Enabling Diagnostics increases the capture time and the RAM usage. It will also increase the size of the
1097.zdf file. It is recommended to enable Diagnostics only when reporting issues to Zivid's support team.
1098)description"
1099 };
1100
1102
1103 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1105 {
1106 public:
1109
1111 static constexpr const char *path{ "Diagnostics/Enabled" };
1112
1114 static constexpr const char *name{ "Enabled" };
1115
1117 static constexpr const char *description{ R"description(Enable or disable diagnostics.)description" };
1118
1120 using ValueType = bool;
1121 static const Enabled yes;
1122 static const Enabled no;
1123
1125 static std::set<bool> validValues()
1126 {
1127 return { false, true };
1128 }
1129
1131 Enabled() = default;
1132
1134 explicit constexpr Enabled(bool value)
1135 : m_opt{ value }
1136 {}
1137
1142 bool value() const;
1143
1145 bool hasValue() const;
1146
1148 void reset();
1149
1151 std::string toString() const;
1152
1154 bool operator==(const Enabled &other) const
1155 {
1156 return m_opt == other.m_opt;
1157 }
1158
1160 bool operator!=(const Enabled &other) const
1161 {
1162 return m_opt != other.m_opt;
1163 }
1164
1166 friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)
1167 {
1168 return stream << value.toString();
1169 }
1170
1171 private:
1172 void setFromString(const std::string &value);
1173
1174 std::optional<bool> m_opt;
1175
1176 friend struct DataModel::Detail::Befriend<Enabled>;
1177 };
1178
1179 using Descendants = std::tuple<Settings2D::Diagnostics::Enabled>;
1180
1183
1195#ifndef NO_DOC
1196 template<
1197 typename... Args,
1198 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1199 typename std::enable_if<
1200 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1201 value,
1202 int>::type = 0>
1203#else
1204 template<typename... Args>
1205#endif
1206 explicit Diagnostics(Args &&...args)
1207 {
1208 using namespace Zivid::Detail::TypeTraits;
1209
1210 static_assert(
1211 AllArgsDecayedAreUnique<Args...>::value,
1212 "Found duplicate types among the arguments passed to Diagnostics(...). "
1213 "Types should be listed at most once.");
1214
1215 set(std::forward<Args>(args)...);
1216 }
1217
1228#ifndef NO_DOC
1229 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1230#else
1231 template<typename... Args>
1232#endif
1233 void set(Args &&...args)
1234 {
1235 using namespace Zivid::Detail::TypeTraits;
1236
1237 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1238 static_assert(
1239 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1240
1241 static_assert(
1242 AllArgsDecayedAreUnique<Args...>::value,
1243 "Found duplicate types among the arguments passed to set(...). "
1244 "Types should be listed at most once.");
1245
1246 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1247 }
1248
1260#ifndef NO_DOC
1261 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1262#else
1263 template<typename... Args>
1264#endif
1265 Diagnostics copyWith(Args &&...args) const
1266 {
1267 using namespace Zivid::Detail::TypeTraits;
1268
1269 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1270 static_assert(
1271 AllArgsAreDescendantNodes::value,
1272 "All arguments passed to copyWith(...) must be descendant nodes.");
1273
1274 static_assert(
1275 AllArgsDecayedAreUnique<Args...>::value,
1276 "Found duplicate types among the arguments passed to copyWith(...). "
1277 "Types should be listed at most once.");
1278
1279 auto copy{ *this };
1280 copy.set(std::forward<Args>(args)...);
1281 return copy;
1282 }
1283
1285 const Enabled &isEnabled() const
1286 {
1287 return m_enabled;
1288 }
1289
1292 {
1293 return m_enabled;
1294 }
1295
1297 Diagnostics &set(const Enabled &value)
1298 {
1299 m_enabled = value;
1300 return *this;
1301 }
1302
1303 template<
1304 typename T,
1305 typename std::enable_if<std::is_same<T, Settings2D::Diagnostics::Enabled>::value, int>::type = 0>
1307 {
1308 return m_enabled;
1309 }
1310
1311 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1313 {
1314 return m_enabled;
1315 }
1316
1318 template<typename F>
1319 void forEach(const F &f) const
1320 {
1321 f(m_enabled);
1322 }
1323
1325 template<typename F>
1326 void forEach(const F &f)
1327 {
1328 f(m_enabled);
1329 }
1330
1332 bool operator==(const Diagnostics &other) const;
1333
1335 bool operator!=(const Diagnostics &other) const;
1336
1338 std::string toString() const;
1339
1341 friend std::ostream &operator<<(std::ostream &stream, const Diagnostics &value)
1342 {
1343 return stream << value.toString();
1344 }
1345
1346 private:
1347 void setFromString(const std::string &value);
1348
1349 void setFromString(const std::string &fullPath, const std::string &value);
1350
1351 std::string getString(const std::string &fullPath) const;
1352
1353 Enabled m_enabled;
1354
1355 friend struct DataModel::Detail::Befriend<Diagnostics>;
1356 };
1357
1359
1360 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1362 {
1363 public:
1366
1368 static constexpr const char *path{ "Processing" };
1369
1371 static constexpr const char *name{ "Processing" };
1372
1374 static constexpr const char *description{ R"description(2D processing settings.)description" };
1375
1377
1378 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1380 {
1381 public:
1384
1386 static constexpr const char *path{ "Processing/Color" };
1387
1389 static constexpr const char *name{ "Color" };
1390
1392 static constexpr const char *description{ R"description(Color settings.)description" };
1393
1395
1396 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1398 {
1399 public:
1402
1404 static constexpr const char *path{ "Processing/Color/Balance" };
1405
1407 static constexpr const char *name{ "Balance" };
1408
1410 static constexpr const char *description{ R"description(Color balance settings.)description" };
1411
1413
1414 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1416 {
1417 public:
1420
1422 static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1423
1425 static constexpr const char *name{ "Blue" };
1426
1428 static constexpr const char *description{
1429 R"description(Digital gain applied to blue channel.)description"
1430 };
1431
1433 using ValueType = double;
1434
1436 static constexpr Range<double> validRange()
1437 {
1438 return { 1.0, 8.0 };
1439 }
1440
1442 Blue() = default;
1443
1445 explicit constexpr Blue(double value)
1446 : m_opt{ verifyValue(value) }
1447 {}
1448
1453 double value() const;
1454
1456 bool hasValue() const;
1457
1459 void reset();
1460
1462 std::string toString() const;
1463
1465 bool operator==(const Blue &other) const
1466 {
1467 return m_opt == other.m_opt;
1468 }
1469
1471 bool operator!=(const Blue &other) const
1472 {
1473 return m_opt != other.m_opt;
1474 }
1475
1477 bool operator<(const Blue &other) const
1478 {
1479 return m_opt < other.m_opt;
1480 }
1481
1483 bool operator>(const Blue &other) const
1484 {
1485 return m_opt > other.m_opt;
1486 }
1487
1489 bool operator<=(const Blue &other) const
1490 {
1491 return m_opt <= other.m_opt;
1492 }
1493
1495 bool operator>=(const Blue &other) const
1496 {
1497 return m_opt >= other.m_opt;
1498 }
1499
1501 friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1502 {
1503 return stream << value.toString();
1504 }
1505
1506 private:
1507 void setFromString(const std::string &value);
1508
1509 constexpr ValueType static verifyValue(const ValueType &value)
1510 {
1511 return validRange().isInRange(value)
1512 ? value
1513 : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1514 + " } is not in range ["
1515 + std::to_string(validRange().min()) + ", "
1516 + std::to_string(validRange().max()) + "]" };
1517 }
1518
1519 std::optional<double> m_opt;
1520
1521 friend struct DataModel::Detail::Befriend<Blue>;
1522 };
1523
1525
1526 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1528 {
1529 public:
1532
1534 static constexpr const char *path{ "Processing/Color/Balance/Green" };
1535
1537 static constexpr const char *name{ "Green" };
1538
1540 static constexpr const char *description{
1541 R"description(Digital gain applied to green channel.)description"
1542 };
1543
1545 using ValueType = double;
1546
1548 static constexpr Range<double> validRange()
1549 {
1550 return { 1.0, 8.0 };
1551 }
1552
1554 Green() = default;
1555
1557 explicit constexpr Green(double value)
1558 : m_opt{ verifyValue(value) }
1559 {}
1560
1565 double value() const;
1566
1568 bool hasValue() const;
1569
1571 void reset();
1572
1574 std::string toString() const;
1575
1577 bool operator==(const Green &other) const
1578 {
1579 return m_opt == other.m_opt;
1580 }
1581
1583 bool operator!=(const Green &other) const
1584 {
1585 return m_opt != other.m_opt;
1586 }
1587
1589 bool operator<(const Green &other) const
1590 {
1591 return m_opt < other.m_opt;
1592 }
1593
1595 bool operator>(const Green &other) const
1596 {
1597 return m_opt > other.m_opt;
1598 }
1599
1601 bool operator<=(const Green &other) const
1602 {
1603 return m_opt <= other.m_opt;
1604 }
1605
1607 bool operator>=(const Green &other) const
1608 {
1609 return m_opt >= other.m_opt;
1610 }
1611
1613 friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1614 {
1615 return stream << value.toString();
1616 }
1617
1618 private:
1619 void setFromString(const std::string &value);
1620
1621 constexpr ValueType static verifyValue(const ValueType &value)
1622 {
1623 return validRange().isInRange(value)
1624 ? value
1625 : throw std::out_of_range{ "Green{ " + std::to_string(value)
1626 + " } is not in range ["
1627 + std::to_string(validRange().min()) + ", "
1628 + std::to_string(validRange().max()) + "]" };
1629 }
1630
1631 std::optional<double> m_opt;
1632
1633 friend struct DataModel::Detail::Befriend<Green>;
1634 };
1635
1637
1638 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1640 {
1641 public:
1644
1646 static constexpr const char *path{ "Processing/Color/Balance/Red" };
1647
1649 static constexpr const char *name{ "Red" };
1650
1652 static constexpr const char *description{
1653 R"description(Digital gain applied to red channel.)description"
1654 };
1655
1657 using ValueType = double;
1658
1660 static constexpr Range<double> validRange()
1661 {
1662 return { 1.0, 8.0 };
1663 }
1664
1666 Red() = default;
1667
1669 explicit constexpr Red(double value)
1670 : m_opt{ verifyValue(value) }
1671 {}
1672
1677 double value() const;
1678
1680 bool hasValue() const;
1681
1683 void reset();
1684
1686 std::string toString() const;
1687
1689 bool operator==(const Red &other) const
1690 {
1691 return m_opt == other.m_opt;
1692 }
1693
1695 bool operator!=(const Red &other) const
1696 {
1697 return m_opt != other.m_opt;
1698 }
1699
1701 bool operator<(const Red &other) const
1702 {
1703 return m_opt < other.m_opt;
1704 }
1705
1707 bool operator>(const Red &other) const
1708 {
1709 return m_opt > other.m_opt;
1710 }
1711
1713 bool operator<=(const Red &other) const
1714 {
1715 return m_opt <= other.m_opt;
1716 }
1717
1719 bool operator>=(const Red &other) const
1720 {
1721 return m_opt >= other.m_opt;
1722 }
1723
1725 friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1726 {
1727 return stream << value.toString();
1728 }
1729
1730 private:
1731 void setFromString(const std::string &value);
1732
1733 constexpr ValueType static verifyValue(const ValueType &value)
1734 {
1735 return validRange().isInRange(value)
1736 ? value
1737 : throw std::out_of_range{ "Red{ " + std::to_string(value)
1738 + " } is not in range ["
1739 + std::to_string(validRange().min()) + ", "
1740 + std::to_string(validRange().max()) + "]" };
1741 }
1742
1743 std::optional<double> m_opt;
1744
1745 friend struct DataModel::Detail::Befriend<Red>;
1746 };
1747
1748 using Descendants = std::tuple<
1752
1755
1769#ifndef NO_DOC
1770 template<
1771 typename... Args,
1772 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1773 typename std::enable_if<
1774 Zivid::Detail::TypeTraits::
1775 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1776 int>::type = 0>
1777#else
1778 template<typename... Args>
1779#endif
1780 explicit Balance(Args &&...args)
1781 {
1782 using namespace Zivid::Detail::TypeTraits;
1783
1784 static_assert(
1785 AllArgsDecayedAreUnique<Args...>::value,
1786 "Found duplicate types among the arguments passed to Balance(...). "
1787 "Types should be listed at most once.");
1788
1789 set(std::forward<Args>(args)...);
1790 }
1791
1804#ifndef NO_DOC
1805 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1806#else
1807 template<typename... Args>
1808#endif
1809 void set(Args &&...args)
1810 {
1811 using namespace Zivid::Detail::TypeTraits;
1812
1813 using AllArgsAreDescendantNodes =
1814 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1815 static_assert(
1816 AllArgsAreDescendantNodes::value,
1817 "All arguments passed to set(...) must be descendant nodes.");
1818
1819 static_assert(
1820 AllArgsDecayedAreUnique<Args...>::value,
1821 "Found duplicate types among the arguments passed to set(...). "
1822 "Types should be listed at most once.");
1823
1824 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1825 }
1826
1840#ifndef NO_DOC
1841 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1842#else
1843 template<typename... Args>
1844#endif
1845 Balance copyWith(Args &&...args) const
1846 {
1847 using namespace Zivid::Detail::TypeTraits;
1848
1849 using AllArgsAreDescendantNodes =
1850 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1851 static_assert(
1852 AllArgsAreDescendantNodes::value,
1853 "All arguments passed to copyWith(...) must be descendant nodes.");
1854
1855 static_assert(
1856 AllArgsDecayedAreUnique<Args...>::value,
1857 "Found duplicate types among the arguments passed to copyWith(...). "
1858 "Types should be listed at most once.");
1859
1860 auto copy{ *this };
1861 copy.set(std::forward<Args>(args)...);
1862 return copy;
1863 }
1864
1866 const Blue &blue() const
1867 {
1868 return m_blue;
1869 }
1870
1873 {
1874 return m_blue;
1875 }
1876
1878 Balance &set(const Blue &value)
1879 {
1880 m_blue = value;
1881 return *this;
1882 }
1883
1885 const Green &green() const
1886 {
1887 return m_green;
1888 }
1889
1892 {
1893 return m_green;
1894 }
1895
1897 Balance &set(const Green &value)
1898 {
1899 m_green = value;
1900 return *this;
1901 }
1902
1904 const Red &red() const
1905 {
1906 return m_red;
1907 }
1908
1911 {
1912 return m_red;
1913 }
1914
1916 Balance &set(const Red &value)
1917 {
1918 m_red = value;
1919 return *this;
1920 }
1921
1922 template<
1923 typename T,
1924 typename std::enable_if<
1925 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1926 int>::type = 0>
1928 {
1929 return m_blue;
1930 }
1931
1932 template<
1933 typename T,
1934 typename std::enable_if<
1935 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1936 int>::type = 0>
1938 {
1939 return m_green;
1940 }
1941
1942 template<
1943 typename T,
1944 typename std::enable_if<
1945 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1946 int>::type = 0>
1948 {
1949 return m_red;
1950 }
1951
1952 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1954 {
1955 return m_blue;
1956 }
1957
1958 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1960 {
1961 return m_green;
1962 }
1963
1964 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1966 {
1967 return m_red;
1968 }
1969
1971 template<typename F>
1972 void forEach(const F &f) const
1973 {
1974 f(m_blue);
1975 f(m_green);
1976 f(m_red);
1977 }
1978
1980 template<typename F>
1981 void forEach(const F &f)
1982 {
1983 f(m_blue);
1984 f(m_green);
1985 f(m_red);
1986 }
1987
1989 bool operator==(const Balance &other) const;
1990
1992 bool operator!=(const Balance &other) const;
1993
1995 std::string toString() const;
1996
1998 friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1999 {
2000 return stream << value.toString();
2001 }
2002
2003 private:
2004 void setFromString(const std::string &value);
2005
2006 void setFromString(const std::string &fullPath, const std::string &value);
2007
2008 std::string getString(const std::string &fullPath) const;
2009
2010 Blue m_blue;
2011 Green m_green;
2012 Red m_red;
2013
2014 friend struct DataModel::Detail::Befriend<Balance>;
2015 };
2016
2018
2019 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2021 {
2022 public:
2025
2027 static constexpr const char *path{ "Processing/Color/Experimental" };
2028
2030 static constexpr const char *name{ "Experimental" };
2031
2033 static constexpr const char *description{
2034 R"description(Experimental color settings. These may be renamed, moved or deleted in the future.)description"
2035 };
2036
2041
2042 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2044 {
2045 public:
2048
2050 static constexpr const char *path{ "Processing/Color/Experimental/HighlightSuppression" };
2051
2053 static constexpr const char *name{ "HighlightSuppression" };
2054
2056 static constexpr const char *description{
2057 R"description(Suppress highlights caused by the projector. Suppressed areas will appear with structure
2058and detail restored, but with reduced color information relative to the rest of the image.
2059This feature is available for Zivid 2+R and Zivid 3 cameras.
2060)description"
2061 };
2062
2064
2065 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2067 {
2068 public:
2071
2073 static constexpr const char *path{
2074 "Processing/Color/Experimental/HighlightSuppression/Enabled"
2075 };
2076
2078 static constexpr const char *name{ "Enabled" };
2079
2081 static constexpr const char *description{
2082 R"description(Enable or disable the highlight suppression.)description"
2083 };
2084
2086 using ValueType = bool;
2087 static const Enabled yes;
2088 static const Enabled no;
2089
2091 static std::set<bool> validValues()
2092 {
2093 return { false, true };
2094 }
2095
2097 Enabled() = default;
2098
2100 explicit constexpr Enabled(bool value)
2101 : m_opt{ value }
2102 {}
2103
2108 bool value() const;
2109
2111 bool hasValue() const;
2112
2114 void reset();
2115
2117 std::string toString() const;
2118
2120 bool operator==(const Enabled &other) const
2121 {
2122 return m_opt == other.m_opt;
2123 }
2124
2126 bool operator!=(const Enabled &other) const
2127 {
2128 return m_opt != other.m_opt;
2129 }
2130
2132 friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)
2133 {
2134 return stream << value.toString();
2135 }
2136
2137 private:
2138 void setFromString(const std::string &value);
2139
2140 std::optional<bool> m_opt;
2141
2142 friend struct DataModel::Detail::Befriend<Enabled>;
2143 };
2144
2146 std::tuple<Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled>;
2147
2150
2162#ifndef NO_DOC
2163 template<
2164 typename... Args,
2165 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2166 typename std::enable_if<
2167 Zivid::Detail::TypeTraits::
2168 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2169 int>::type = 0>
2170#else
2171 template<typename... Args>
2172#endif
2173 explicit HighlightSuppression(Args &&...args)
2174 {
2175 using namespace Zivid::Detail::TypeTraits;
2176
2177 static_assert(
2178 AllArgsDecayedAreUnique<Args...>::value,
2179 "Found duplicate types among the arguments passed to HighlightSuppression(...). "
2180 "Types should be listed at most once.");
2181
2182 set(std::forward<Args>(args)...);
2183 }
2184
2195#ifndef NO_DOC
2196 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2197#else
2198 template<typename... Args>
2199#endif
2200 void set(Args &&...args)
2201 {
2202 using namespace Zivid::Detail::TypeTraits;
2203
2204 using AllArgsAreDescendantNodes =
2205 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2206 static_assert(
2207 AllArgsAreDescendantNodes::value,
2208 "All arguments passed to set(...) must be descendant nodes.");
2209
2210 static_assert(
2211 AllArgsDecayedAreUnique<Args...>::value,
2212 "Found duplicate types among the arguments passed to set(...). "
2213 "Types should be listed at most once.");
2214
2215 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2216 }
2217
2229#ifndef NO_DOC
2230 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2231#else
2232 template<typename... Args>
2233#endif
2234 HighlightSuppression copyWith(Args &&...args) const
2235 {
2236 using namespace Zivid::Detail::TypeTraits;
2237
2238 using AllArgsAreDescendantNodes =
2239 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2240 static_assert(
2241 AllArgsAreDescendantNodes::value,
2242 "All arguments passed to copyWith(...) must be descendant nodes.");
2243
2244 static_assert(
2245 AllArgsDecayedAreUnique<Args...>::value,
2246 "Found duplicate types among the arguments passed to copyWith(...). "
2247 "Types should be listed at most once.");
2248
2249 auto copy{ *this };
2250 copy.set(std::forward<Args>(args)...);
2251 return copy;
2252 }
2253
2255 const Enabled &isEnabled() const
2256 {
2257 return m_enabled;
2258 }
2259
2262 {
2263 return m_enabled;
2264 }
2265
2268 {
2269 m_enabled = value;
2270 return *this;
2271 }
2272
2273 template<
2274 typename T,
2275 typename std::enable_if<
2276 std::is_same<
2277 T,
2279 int>::type = 0>
2281 {
2282 return m_enabled;
2283 }
2284
2285 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2287 {
2288 return m_enabled;
2289 }
2290
2292 template<typename F>
2293 void forEach(const F &f) const
2294 {
2295 f(m_enabled);
2296 }
2297
2299 template<typename F>
2300 void forEach(const F &f)
2301 {
2302 f(m_enabled);
2303 }
2304
2306 bool operator==(const HighlightSuppression &other) const;
2307
2309 bool operator!=(const HighlightSuppression &other) const;
2310
2312 std::string toString() const;
2313
2315 friend std::ostream &operator<<(std::ostream &stream, const HighlightSuppression &value)
2316 {
2317 return stream << value.toString();
2318 }
2319
2320 private:
2321 void setFromString(const std::string &value);
2322
2323 void setFromString(const std::string &fullPath, const std::string &value);
2324
2325 std::string getString(const std::string &fullPath) const;
2326
2327 Enabled m_enabled;
2328
2329 friend struct DataModel::Detail::Befriend<HighlightSuppression>;
2330 };
2331
2347
2348 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2350 {
2351 public:
2354
2356 static constexpr const char *path{ "Processing/Color/Experimental/Mode" };
2357
2359 static constexpr const char *name{ "Mode" };
2360
2362 static constexpr const char *description{
2363 R"description(This setting controls how the color image is computed.
2364
2365`automatic` is the default option. It performs tone mapping for HDR captures, but not for
2366single-acquisition captures. Use this mode with a single acquisition if you want to have
2367the most control over the colors in the image.
2368
2369`toneMapping` uses all the acquisitions to create one merged and normalized color image. For
2370HDR captures the dynamic range of the captured images is usually higher than the 8-bit color
2371image range. `toneMapping` will map the HDR color data to the 8-bit color output range by
2372applying a scaling factor. `toneMapping` can also be used for single-acquisition captures to
2373normalize the captured color image to the full 8-bit output. Note that when using `toneMapping`
2374mode the color values can be inconsistent over repeated captures if you move, add or remove
2375objects in the scene. For the most control over the colors in the single-acquisition case,
2376select the `automatic` mode.
2377)description"
2378 };
2379
2381 enum class ValueType
2382 {
2385 };
2386 static const Mode automatic;
2387 static const Mode toneMapping;
2388
2390 static std::set<ValueType> validValues()
2391 {
2393 }
2394
2396 Mode() = default;
2397
2399 explicit constexpr Mode(ValueType value)
2400 : m_opt{ verifyValue(value) }
2401 {}
2402
2408
2410 bool hasValue() const;
2411
2413 void reset();
2414
2416 std::string toString() const;
2417
2419 friend std::ostream &operator<<(std::ostream &stream, const Mode::ValueType &value)
2420 {
2421 return stream << Mode{ value }.toString();
2422 }
2423
2425 bool operator==(const Mode &other) const
2426 {
2427 return m_opt == other.m_opt;
2428 }
2429
2431 bool operator!=(const Mode &other) const
2432 {
2433 return m_opt != other.m_opt;
2434 }
2435
2437 friend std::ostream &operator<<(std::ostream &stream, const Mode &value)
2438 {
2439 return stream << value.toString();
2440 }
2441
2442 private:
2443 void setFromString(const std::string &value);
2444
2445 constexpr ValueType static verifyValue(const ValueType &value)
2446 {
2447 return value == ValueType::automatic || value == ValueType::toneMapping
2448 ? value
2449 : throw std::invalid_argument{
2450 "Invalid value: Mode{ "
2451 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
2452 + " }"
2453 };
2454 }
2455
2456 std::optional<ValueType> m_opt;
2457
2458 friend struct DataModel::Detail::Befriend<Mode>;
2459 };
2460
2461 using Descendants = std::tuple<
2465
2468
2482#ifndef NO_DOC
2483 template<
2484 typename... Args,
2485 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2486 typename std::enable_if<
2487 Zivid::Detail::TypeTraits::
2488 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2489 int>::type = 0>
2490#else
2491 template<typename... Args>
2492#endif
2493 explicit Experimental(Args &&...args)
2494 {
2495 using namespace Zivid::Detail::TypeTraits;
2496
2497 static_assert(
2498 AllArgsDecayedAreUnique<Args...>::value,
2499 "Found duplicate types among the arguments passed to Experimental(...). "
2500 "Types should be listed at most once.");
2501
2502 set(std::forward<Args>(args)...);
2503 }
2504
2517#ifndef NO_DOC
2518 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2519#else
2520 template<typename... Args>
2521#endif
2522 void set(Args &&...args)
2523 {
2524 using namespace Zivid::Detail::TypeTraits;
2525
2526 using AllArgsAreDescendantNodes =
2527 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2528 static_assert(
2529 AllArgsAreDescendantNodes::value,
2530 "All arguments passed to set(...) must be descendant nodes.");
2531
2532 static_assert(
2533 AllArgsDecayedAreUnique<Args...>::value,
2534 "Found duplicate types among the arguments passed to set(...). "
2535 "Types should be listed at most once.");
2536
2537 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2538 }
2539
2553#ifndef NO_DOC
2554 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2555#else
2556 template<typename... Args>
2557#endif
2558 Experimental copyWith(Args &&...args) const
2559 {
2560 using namespace Zivid::Detail::TypeTraits;
2561
2562 using AllArgsAreDescendantNodes =
2563 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2564 static_assert(
2565 AllArgsAreDescendantNodes::value,
2566 "All arguments passed to copyWith(...) must be descendant nodes.");
2567
2568 static_assert(
2569 AllArgsDecayedAreUnique<Args...>::value,
2570 "Found duplicate types among the arguments passed to copyWith(...). "
2571 "Types should be listed at most once.");
2572
2573 auto copy{ *this };
2574 copy.set(std::forward<Args>(args)...);
2575 return copy;
2576 }
2577
2580 {
2581 return m_highlightSuppression;
2582 }
2583
2586 {
2587 return m_highlightSuppression;
2588 }
2589
2592 {
2593 m_highlightSuppression = value;
2594 return *this;
2595 }
2596
2599 {
2600 m_highlightSuppression.set(value);
2601 return *this;
2602 }
2603
2605 const Mode &mode() const
2606 {
2607 return m_mode;
2608 }
2609
2612 {
2613 return m_mode;
2614 }
2615
2617 Experimental &set(const Mode &value)
2618 {
2619 m_mode = value;
2620 return *this;
2621 }
2622
2623 template<
2624 typename T,
2625 typename std::enable_if<
2626 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression>::value,
2627 int>::type = 0>
2629 {
2630 return m_highlightSuppression;
2631 }
2632
2633 template<
2634 typename T,
2635 typename std::enable_if<
2636 std::is_same<
2637 T,
2639 int>::type = 0>
2641 {
2642 return m_highlightSuppression
2644 }
2645
2646 template<
2647 typename T,
2648 typename std::enable_if<
2649 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
2650 int>::type = 0>
2652 {
2653 return m_mode;
2654 }
2655
2656 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2658 {
2659 return m_highlightSuppression;
2660 }
2661
2662 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2664 {
2665 return m_mode;
2666 }
2667
2669 template<typename F>
2670 void forEach(const F &f) const
2671 {
2672 f(m_highlightSuppression);
2673 f(m_mode);
2674 }
2675
2677 template<typename F>
2678 void forEach(const F &f)
2679 {
2680 f(m_highlightSuppression);
2681 f(m_mode);
2682 }
2683
2685 bool operator==(const Experimental &other) const;
2686
2688 bool operator!=(const Experimental &other) const;
2689
2691 std::string toString() const;
2692
2694 friend std::ostream &operator<<(std::ostream &stream, const Experimental &value)
2695 {
2696 return stream << value.toString();
2697 }
2698
2699 private:
2700 void setFromString(const std::string &value);
2701
2702 void setFromString(const std::string &fullPath, const std::string &value);
2703
2704 std::string getString(const std::string &fullPath) const;
2705
2706 HighlightSuppression m_highlightSuppression;
2707 Mode m_mode;
2708
2709 friend struct DataModel::Detail::Befriend<Experimental>;
2710 };
2711
2715
2716 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2718 {
2719 public:
2722
2724 static constexpr const char *path{ "Processing/Color/Gamma" };
2725
2727 static constexpr const char *name{ "Gamma" };
2728
2730 static constexpr const char *description{
2731 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
2732greater than 1 makes the colors darker.
2733)description"
2734 };
2735
2737 using ValueType = double;
2738
2740 static constexpr Range<double> validRange()
2741 {
2742 return { 0.25, 1.5 };
2743 }
2744
2746 Gamma() = default;
2747
2749 explicit constexpr Gamma(double value)
2750 : m_opt{ verifyValue(value) }
2751 {}
2752
2757 double value() const;
2758
2760 bool hasValue() const;
2761
2763 void reset();
2764
2766 std::string toString() const;
2767
2769 bool operator==(const Gamma &other) const
2770 {
2771 return m_opt == other.m_opt;
2772 }
2773
2775 bool operator!=(const Gamma &other) const
2776 {
2777 return m_opt != other.m_opt;
2778 }
2779
2781 bool operator<(const Gamma &other) const
2782 {
2783 return m_opt < other.m_opt;
2784 }
2785
2787 bool operator>(const Gamma &other) const
2788 {
2789 return m_opt > other.m_opt;
2790 }
2791
2793 bool operator<=(const Gamma &other) const
2794 {
2795 return m_opt <= other.m_opt;
2796 }
2797
2799 bool operator>=(const Gamma &other) const
2800 {
2801 return m_opt >= other.m_opt;
2802 }
2803
2805 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
2806 {
2807 return stream << value.toString();
2808 }
2809
2810 private:
2811 void setFromString(const std::string &value);
2812
2813 constexpr ValueType static verifyValue(const ValueType &value)
2814 {
2815 return validRange().isInRange(value)
2816 ? value
2817 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
2818 + std::to_string(validRange().min()) + ", "
2819 + std::to_string(validRange().max()) + "]" };
2820 }
2821
2822 std::optional<double> m_opt;
2823
2824 friend struct DataModel::Detail::Befriend<Gamma>;
2825 };
2826
2827 using Descendants = std::tuple<
2837
2840
2860#ifndef NO_DOC
2861 template<
2862 typename... Args,
2863 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2864 typename std::enable_if<
2865 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2866 value,
2867 int>::type = 0>
2868#else
2869 template<typename... Args>
2870#endif
2871 explicit Color(Args &&...args)
2872 {
2873 using namespace Zivid::Detail::TypeTraits;
2874
2875 static_assert(
2876 AllArgsDecayedAreUnique<Args...>::value,
2877 "Found duplicate types among the arguments passed to Color(...). "
2878 "Types should be listed at most once.");
2879
2880 set(std::forward<Args>(args)...);
2881 }
2882
2901#ifndef NO_DOC
2902 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2903#else
2904 template<typename... Args>
2905#endif
2906 void set(Args &&...args)
2907 {
2908 using namespace Zivid::Detail::TypeTraits;
2909
2910 using AllArgsAreDescendantNodes =
2911 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2912 static_assert(
2913 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2914
2915 static_assert(
2916 AllArgsDecayedAreUnique<Args...>::value,
2917 "Found duplicate types among the arguments passed to set(...). "
2918 "Types should be listed at most once.");
2919
2920 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2921 }
2922
2942#ifndef NO_DOC
2943 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2944#else
2945 template<typename... Args>
2946#endif
2947 Color copyWith(Args &&...args) const
2948 {
2949 using namespace Zivid::Detail::TypeTraits;
2950
2951 using AllArgsAreDescendantNodes =
2952 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2953 static_assert(
2954 AllArgsAreDescendantNodes::value,
2955 "All arguments passed to copyWith(...) must be descendant nodes.");
2956
2957 static_assert(
2958 AllArgsDecayedAreUnique<Args...>::value,
2959 "Found duplicate types among the arguments passed to copyWith(...). "
2960 "Types should be listed at most once.");
2961
2962 auto copy{ *this };
2963 copy.set(std::forward<Args>(args)...);
2964 return copy;
2965 }
2966
2968 const Balance &balance() const
2969 {
2970 return m_balance;
2971 }
2972
2975 {
2976 return m_balance;
2977 }
2978
2980 Color &set(const Balance &value)
2981 {
2982 m_balance = value;
2983 return *this;
2984 }
2985
2987 Color &set(const Balance::Blue &value)
2988 {
2989 m_balance.set(value);
2990 return *this;
2991 }
2992
2994 Color &set(const Balance::Green &value)
2995 {
2996 m_balance.set(value);
2997 return *this;
2998 }
2999
3001 Color &set(const Balance::Red &value)
3002 {
3003 m_balance.set(value);
3004 return *this;
3005 }
3006
3009 {
3010 return m_experimental;
3011 }
3012
3015 {
3016 return m_experimental;
3017 }
3018
3020 Color &set(const Experimental &value)
3021 {
3022 m_experimental = value;
3023 return *this;
3024 }
3025
3028 {
3029 m_experimental.set(value);
3030 return *this;
3031 }
3032
3035 {
3036 m_experimental.set(value);
3037 return *this;
3038 }
3039
3042 {
3043 m_experimental.set(value);
3044 return *this;
3045 }
3046
3048 const Gamma &gamma() const
3049 {
3050 return m_gamma;
3051 }
3052
3055 {
3056 return m_gamma;
3057 }
3058
3060 Color &set(const Gamma &value)
3061 {
3062 m_gamma = value;
3063 return *this;
3064 }
3065
3066 template<
3067 typename T,
3068 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
3069 0>
3071 {
3072 return m_balance;
3073 }
3074
3075 template<
3076 typename T,
3077 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
3078 type = 0>
3080 {
3081 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
3082 }
3083
3084 template<
3085 typename T,
3086 typename std::
3087 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
3089 {
3090 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
3091 }
3092
3093 template<
3094 typename T,
3095 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
3096 type = 0>
3098 {
3099 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
3100 }
3101
3102 template<
3103 typename T,
3104 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
3105 type = 0>
3107 {
3108 return m_experimental;
3109 }
3110
3111 template<
3112 typename T,
3113 typename std::enable_if<
3114 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression>::value,
3115 int>::type = 0>
3117 {
3119 }
3120
3121 template<
3122 typename T,
3123 typename std::enable_if<
3124 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled>::
3125 value,
3126 int>::type = 0>
3128 {
3129 return m_experimental
3131 }
3132
3133 template<
3134 typename T,
3135 typename std::enable_if<
3136 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
3137 int>::type = 0>
3139 {
3140 return m_experimental.get<Settings2D::Processing::Color::Experimental::Mode>();
3141 }
3142
3143 template<
3144 typename T,
3145 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
3146 0>
3148 {
3149 return m_gamma;
3150 }
3151
3152 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3154 {
3155 return m_balance;
3156 }
3157
3158 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3160 {
3161 return m_experimental;
3162 }
3163
3164 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3166 {
3167 return m_gamma;
3168 }
3169
3171 template<typename F>
3172 void forEach(const F &f) const
3173 {
3174 f(m_balance);
3175 f(m_experimental);
3176 f(m_gamma);
3177 }
3178
3180 template<typename F>
3181 void forEach(const F &f)
3182 {
3183 f(m_balance);
3184 f(m_experimental);
3185 f(m_gamma);
3186 }
3187
3189 bool operator==(const Color &other) const;
3190
3192 bool operator!=(const Color &other) const;
3193
3195 std::string toString() const;
3196
3198 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
3199 {
3200 return stream << value.toString();
3201 }
3202
3203 private:
3204 void setFromString(const std::string &value);
3205
3206 void setFromString(const std::string &fullPath, const std::string &value);
3207
3208 std::string getString(const std::string &fullPath) const;
3209
3210 Balance m_balance;
3211 Experimental m_experimental;
3212 Gamma m_gamma;
3213
3214 friend struct DataModel::Detail::Befriend<Color>;
3215 };
3216
3217 using Descendants = std::tuple<
3228
3231
3252#ifndef NO_DOC
3253 template<
3254 typename... Args,
3255 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3256 typename std::enable_if<
3257 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3258 value,
3259 int>::type = 0>
3260#else
3261 template<typename... Args>
3262#endif
3263 explicit Processing(Args &&...args)
3264 {
3265 using namespace Zivid::Detail::TypeTraits;
3266
3267 static_assert(
3268 AllArgsDecayedAreUnique<Args...>::value,
3269 "Found duplicate types among the arguments passed to Processing(...). "
3270 "Types should be listed at most once.");
3271
3272 set(std::forward<Args>(args)...);
3273 }
3274
3294#ifndef NO_DOC
3295 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3296#else
3297 template<typename... Args>
3298#endif
3299 void set(Args &&...args)
3300 {
3301 using namespace Zivid::Detail::TypeTraits;
3302
3303 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3304 static_assert(
3305 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3306
3307 static_assert(
3308 AllArgsDecayedAreUnique<Args...>::value,
3309 "Found duplicate types among the arguments passed to set(...). "
3310 "Types should be listed at most once.");
3311
3312 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3313 }
3314
3335#ifndef NO_DOC
3336 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3337#else
3338 template<typename... Args>
3339#endif
3340 Processing copyWith(Args &&...args) const
3341 {
3342 using namespace Zivid::Detail::TypeTraits;
3343
3344 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3345 static_assert(
3346 AllArgsAreDescendantNodes::value,
3347 "All arguments passed to copyWith(...) must be descendant nodes.");
3348
3349 static_assert(
3350 AllArgsDecayedAreUnique<Args...>::value,
3351 "Found duplicate types among the arguments passed to copyWith(...). "
3352 "Types should be listed at most once.");
3353
3354 auto copy{ *this };
3355 copy.set(std::forward<Args>(args)...);
3356 return copy;
3357 }
3358
3360 const Color &color() const
3361 {
3362 return m_color;
3363 }
3364
3367 {
3368 return m_color;
3369 }
3370
3372 Processing &set(const Color &value)
3373 {
3374 m_color = value;
3375 return *this;
3376 }
3377
3380 {
3381 m_color.set(value);
3382 return *this;
3383 }
3384
3387 {
3388 m_color.set(value);
3389 return *this;
3390 }
3391
3394 {
3395 m_color.set(value);
3396 return *this;
3397 }
3398
3401 {
3402 m_color.set(value);
3403 return *this;
3404 }
3405
3408 {
3409 m_color.set(value);
3410 return *this;
3411 }
3412
3415 {
3416 m_color.set(value);
3417 return *this;
3418 }
3419
3422 {
3423 m_color.set(value);
3424 return *this;
3425 }
3426
3429 {
3430 m_color.set(value);
3431 return *this;
3432 }
3433
3436 {
3437 m_color.set(value);
3438 return *this;
3439 }
3440
3441 template<
3442 typename T,
3443 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
3445 {
3446 return m_color;
3447 }
3448
3449 template<
3450 typename T,
3451 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
3453 {
3455 }
3456
3457 template<
3458 typename T,
3459 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
3460 type = 0>
3462 {
3464 }
3465
3466 template<
3467 typename T,
3468 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
3469 type = 0>
3471 {
3473 }
3474
3475 template<
3476 typename T,
3477 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
3478 type = 0>
3480 {
3481 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
3482 }
3483
3484 template<
3485 typename T,
3486 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
3487 type = 0>
3489 {
3491 }
3492
3493 template<
3494 typename T,
3495 typename std::enable_if<
3496 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression>::value,
3497 int>::type = 0>
3499 {
3501 }
3502
3503 template<
3504 typename T,
3505 typename std::enable_if<
3506 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled>::value,
3507 int>::type = 0>
3509 {
3511 }
3512
3513 template<
3514 typename T,
3515 typename std::
3516 enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::type = 0>
3518 {
3520 }
3521
3522 template<
3523 typename T,
3524 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
3526 {
3527 return m_color.get<Settings2D::Processing::Color::Gamma>();
3528 }
3529
3530 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3532 {
3533 return m_color;
3534 }
3535
3537 template<typename F>
3538 void forEach(const F &f) const
3539 {
3540 f(m_color);
3541 }
3542
3544 template<typename F>
3545 void forEach(const F &f)
3546 {
3547 f(m_color);
3548 }
3549
3551 bool operator==(const Processing &other) const;
3552
3554 bool operator!=(const Processing &other) const;
3555
3557 std::string toString() const;
3558
3560 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
3561 {
3562 return stream << value.toString();
3563 }
3564
3565 private:
3566 void setFromString(const std::string &value);
3567
3568 void setFromString(const std::string &fullPath, const std::string &value);
3569
3570 std::string getString(const std::string &fullPath) const;
3571
3572 Color m_color;
3573
3574 friend struct DataModel::Detail::Befriend<Processing>;
3575 };
3576
3579
3580 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3582 {
3583 public:
3586
3588 static constexpr const char *path{ "Sampling" };
3589
3591 static constexpr const char *name{ "Sampling" };
3592
3594 static constexpr const char *description{ R"description(Sampling settings.
3595)description" };
3596
3614
3615 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3617 {
3618 public:
3621
3623 static constexpr const char *path{ "Sampling/Color" };
3624
3626 static constexpr const char *name{ "Color" };
3627
3629 static constexpr const char *description{ R"description(Choose how to sample colors for the 2D image.
3630
3631- `rgb` option gives an image with full colors.
3632- `grayscale` option gives a grayscale (r=g=b) image, which
3633 can be acquired faster than full colors.
3634- `rgbStrongAmbientLight` option gives an image with full colors and reduced
3635 color noise. This option should be chosen only for applications which
3636 suffer from high color noise and with high amounts of ambient light in the
3637 scene.
3638- `rgbAmbientSuppression` option gives an image with full colors while
3639 suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient
3640 light by default, and therefore do not need the additional option
3641 `rgbAmbientSuppression`.
3642
3643
3644The `grayscale`, `rgbStrongAmbientLight` and `rgbAmbientSuppression` options are not available on all camera models.
3645)description" };
3646
3648 enum class ValueType
3649 {
3654 };
3655 static const Color rgb;
3656 static const Color grayscale;
3659
3661 static std::set<ValueType> validValues()
3662 {
3663 return { ValueType::rgb,
3667 }
3668
3670 Color() = default;
3671
3673 explicit constexpr Color(ValueType value)
3674 : m_opt{ verifyValue(value) }
3675 {}
3676
3682
3684 bool hasValue() const;
3685
3687 void reset();
3688
3690 std::string toString() const;
3691
3693 friend std::ostream &operator<<(std::ostream &stream, const Color::ValueType &value)
3694 {
3695 return stream << Color{ value }.toString();
3696 }
3697
3699 bool operator==(const Color &other) const
3700 {
3701 return m_opt == other.m_opt;
3702 }
3703
3705 bool operator!=(const Color &other) const
3706 {
3707 return m_opt != other.m_opt;
3708 }
3709
3711 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
3712 {
3713 return stream << value.toString();
3714 }
3715
3716 private:
3717 void setFromString(const std::string &value);
3718
3719 constexpr ValueType static verifyValue(const ValueType &value)
3720 {
3721 return value == ValueType::rgb || value == ValueType::grayscale
3722 || value == ValueType::rgbStrongAmbientLight
3723 || value == ValueType::rgbAmbientSuppression
3724 ? value
3725 : throw std::invalid_argument{
3726 "Invalid value: Color{ "
3727 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
3728 };
3729 }
3730
3731 std::optional<ValueType> m_opt;
3732
3733 friend struct DataModel::Detail::Befriend<Color>;
3734 };
3735
3744
3745 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3747 {
3748 public:
3751
3753 static constexpr const char *path{ "Sampling/Interval" };
3754
3756 static constexpr const char *name{ "Interval" };
3757
3759 static constexpr const char *description{
3760 R"description(Sampling interval controls the interval between successive sensor operations (e.g.,
3761structured light pattern projection and image exposure), aligned to external
3762frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners
3763at 100 Hz). The requested interval is a target: the sensor operations will happen
3764at this rate if the it can fit the chosen exposure time plus some processing overhead.
3765Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple
3766(e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).
3767)description"
3768 };
3769
3774
3775 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3777 {
3778 public:
3781
3783 static constexpr const char *path{ "Sampling/Interval/Duration" };
3784
3786 static constexpr const char *name{ "Duration" };
3787
3789 static constexpr const char *description{
3790 R"description(Duration between successive sensor operations, in microseconds. The effective interval
3791might be rounded up to the nearest suitable integer multiple and will never be shorter
3792than exposure time plus some processing overhead.
3793)description"
3794 };
3795
3797 using ValueType = std::chrono::microseconds;
3798
3801 {
3802 return { std::chrono::microseconds{ 1000 }, std::chrono::microseconds{ 10000 } };
3803 }
3804
3806 Duration() = default;
3807
3809 explicit constexpr Duration(std::chrono::microseconds value)
3810 : m_opt{ verifyValue(value) }
3811 {}
3812
3817 std::chrono::microseconds value() const;
3818
3820 bool hasValue() const;
3821
3823 void reset();
3824
3826 std::string toString() const;
3827
3829 bool operator==(const Duration &other) const
3830 {
3831 return m_opt == other.m_opt;
3832 }
3833
3835 bool operator!=(const Duration &other) const
3836 {
3837 return m_opt != other.m_opt;
3838 }
3839
3841 bool operator<(const Duration &other) const
3842 {
3843 return m_opt < other.m_opt;
3844 }
3845
3847 bool operator>(const Duration &other) const
3848 {
3849 return m_opt > other.m_opt;
3850 }
3851
3853 bool operator<=(const Duration &other) const
3854 {
3855 return m_opt <= other.m_opt;
3856 }
3857
3859 bool operator>=(const Duration &other) const
3860 {
3861 return m_opt >= other.m_opt;
3862 }
3863
3865 friend std::ostream &operator<<(std::ostream &stream, const Duration &value)
3866 {
3867 return stream << value.toString();
3868 }
3869
3870 private:
3871 void setFromString(const std::string &value);
3872
3873 constexpr ValueType static verifyValue(const ValueType &value)
3874 {
3875 return validRange().isInRange(value)
3876 ? value
3877 : throw std::out_of_range{ "Duration{ " + std::to_string(value.count())
3878 + " } is not in range ["
3879 + std::to_string(validRange().min().count()) + ", "
3880 + std::to_string(validRange().max().count()) + "]" };
3881 }
3882
3883 std::optional<std::chrono::microseconds> m_opt;
3884
3885 friend struct DataModel::Detail::Befriend<Duration>;
3886 };
3887
3889
3890 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3892 {
3893 public:
3896
3898 static constexpr const char *path{ "Sampling/Interval/Enabled" };
3899
3901 static constexpr const char *name{ "Enabled" };
3902
3904 static constexpr const char *description{
3905 R"description(Enable or disable sampling interval.)description"
3906 };
3907
3909 using ValueType = bool;
3910 static const Enabled yes;
3911 static const Enabled no;
3912
3914 static std::set<bool> validValues()
3915 {
3916 return { false, true };
3917 }
3918
3920 Enabled() = default;
3921
3923 explicit constexpr Enabled(bool value)
3924 : m_opt{ value }
3925 {}
3926
3931 bool value() const;
3932
3934 bool hasValue() const;
3935
3937 void reset();
3938
3940 std::string toString() const;
3941
3943 bool operator==(const Enabled &other) const
3944 {
3945 return m_opt == other.m_opt;
3946 }
3947
3949 bool operator!=(const Enabled &other) const
3950 {
3951 return m_opt != other.m_opt;
3952 }
3953
3955 friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)
3956 {
3957 return stream << value.toString();
3958 }
3959
3960 private:
3961 void setFromString(const std::string &value);
3962
3963 std::optional<bool> m_opt;
3964
3965 friend struct DataModel::Detail::Befriend<Enabled>;
3966 };
3967
3969 std::tuple<Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled>;
3970
3973
3986#ifndef NO_DOC
3987 template<
3988 typename... Args,
3989 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3990 typename std::enable_if<
3991 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3992 value,
3993 int>::type = 0>
3994#else
3995 template<typename... Args>
3996#endif
3997 explicit Interval(Args &&...args)
3998 {
3999 using namespace Zivid::Detail::TypeTraits;
4000
4001 static_assert(
4002 AllArgsDecayedAreUnique<Args...>::value,
4003 "Found duplicate types among the arguments passed to Interval(...). "
4004 "Types should be listed at most once.");
4005
4006 set(std::forward<Args>(args)...);
4007 }
4008
4020#ifndef NO_DOC
4021 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
4022#else
4023 template<typename... Args>
4024#endif
4025 void set(Args &&...args)
4026 {
4027 using namespace Zivid::Detail::TypeTraits;
4028
4029 using AllArgsAreDescendantNodes =
4030 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4031 static_assert(
4032 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
4033
4034 static_assert(
4035 AllArgsDecayedAreUnique<Args...>::value,
4036 "Found duplicate types among the arguments passed to set(...). "
4037 "Types should be listed at most once.");
4038
4039 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4040 }
4041
4054#ifndef NO_DOC
4055 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4056#else
4057 template<typename... Args>
4058#endif
4059 Interval copyWith(Args &&...args) const
4060 {
4061 using namespace Zivid::Detail::TypeTraits;
4062
4063 using AllArgsAreDescendantNodes =
4064 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4065 static_assert(
4066 AllArgsAreDescendantNodes::value,
4067 "All arguments passed to copyWith(...) must be descendant nodes.");
4068
4069 static_assert(
4070 AllArgsDecayedAreUnique<Args...>::value,
4071 "Found duplicate types among the arguments passed to copyWith(...). "
4072 "Types should be listed at most once.");
4073
4074 auto copy{ *this };
4075 copy.set(std::forward<Args>(args)...);
4076 return copy;
4077 }
4078
4080 const Duration &duration() const
4081 {
4082 return m_duration;
4083 }
4084
4087 {
4088 return m_duration;
4089 }
4090
4092 Interval &set(const Duration &value)
4093 {
4094 m_duration = value;
4095 return *this;
4096 }
4097
4099 const Enabled &isEnabled() const
4100 {
4101 return m_enabled;
4102 }
4103
4106 {
4107 return m_enabled;
4108 }
4109
4111 Interval &set(const Enabled &value)
4112 {
4113 m_enabled = value;
4114 return *this;
4115 }
4116
4117 template<
4118 typename T,
4119 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::
4120 type = 0>
4122 {
4123 return m_duration;
4124 }
4125
4126 template<
4127 typename T,
4128 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::
4129 type = 0>
4131 {
4132 return m_enabled;
4133 }
4134
4135 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4137 {
4138 return m_duration;
4139 }
4140
4141 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4143 {
4144 return m_enabled;
4145 }
4146
4148 template<typename F>
4149 void forEach(const F &f) const
4150 {
4151 f(m_duration);
4152 f(m_enabled);
4153 }
4154
4156 template<typename F>
4157 void forEach(const F &f)
4158 {
4159 f(m_duration);
4160 f(m_enabled);
4161 }
4162
4164 bool operator==(const Interval &other) const;
4165
4167 bool operator!=(const Interval &other) const;
4168
4170 std::string toString() const;
4171
4173 friend std::ostream &operator<<(std::ostream &stream, const Interval &value)
4174 {
4175 return stream << value.toString();
4176 }
4177
4178 private:
4179 void setFromString(const std::string &value);
4180
4181 void setFromString(const std::string &fullPath, const std::string &value);
4182
4183 std::string getString(const std::string &fullPath) const;
4184
4185 Duration m_duration;
4186 Enabled m_enabled;
4187
4188 friend struct DataModel::Detail::Befriend<Interval>;
4189 };
4190
4194
4195 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
4197 {
4198 public:
4201
4203 static constexpr const char *path{ "Sampling/Pixel" };
4204
4206 static constexpr const char *name{ "Pixel" };
4207
4209 static constexpr const char *description{
4210 R"description(Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampled.
4211When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.
4212)description"
4213 };
4214
4216 enum class ValueType
4217 {
4225 };
4226 static const Pixel all;
4228 static const Pixel redSubsample2x2;
4230 static const Pixel redSubsample4x4;
4231 static const Pixel by2x2;
4232 static const Pixel by4x4;
4233
4235 static std::set<ValueType> validValues()
4236 {
4237 return { ValueType::all,
4244 }
4245
4247 Pixel() = default;
4248
4250 explicit constexpr Pixel(ValueType value)
4251 : m_opt{ verifyValue(value) }
4252 {}
4253
4259
4261 bool hasValue() const;
4262
4264 void reset();
4265
4267 std::string toString() const;
4268
4270 friend std::ostream &operator<<(std::ostream &stream, const Pixel::ValueType &value)
4271 {
4272 return stream << Pixel{ value }.toString();
4273 }
4274
4276 bool operator==(const Pixel &other) const
4277 {
4278 return m_opt == other.m_opt;
4279 }
4280
4282 bool operator!=(const Pixel &other) const
4283 {
4284 return m_opt != other.m_opt;
4285 }
4286
4288 friend std::ostream &operator<<(std::ostream &stream, const Pixel &value)
4289 {
4290 return stream << value.toString();
4291 }
4292
4293 private:
4294 void setFromString(const std::string &value);
4295
4296 constexpr ValueType static verifyValue(const ValueType &value)
4297 {
4298 return value == ValueType::all || value == ValueType::blueSubsample2x2
4299 || value == ValueType::redSubsample2x2 || value == ValueType::blueSubsample4x4
4300 || value == ValueType::redSubsample4x4 || value == ValueType::by2x2
4301 || value == ValueType::by4x4
4302 ? value
4303 : throw std::invalid_argument{
4304 "Invalid value: Pixel{ "
4305 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
4306 };
4307 }
4308
4309 std::optional<ValueType> m_opt;
4310
4311 friend struct DataModel::Detail::Befriend<Pixel>;
4312 };
4313
4314 using Descendants = std::tuple<
4320
4323
4339#ifndef NO_DOC
4340 template<
4341 typename... Args,
4342 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
4343 typename std::enable_if<
4344 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
4345 value,
4346 int>::type = 0>
4347#else
4348 template<typename... Args>
4349#endif
4350 explicit Sampling(Args &&...args)
4351 {
4352 using namespace Zivid::Detail::TypeTraits;
4353
4354 static_assert(
4355 AllArgsDecayedAreUnique<Args...>::value,
4356 "Found duplicate types among the arguments passed to Sampling(...). "
4357 "Types should be listed at most once.");
4358
4359 set(std::forward<Args>(args)...);
4360 }
4361
4376#ifndef NO_DOC
4377 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
4378#else
4379 template<typename... Args>
4380#endif
4381 void set(Args &&...args)
4382 {
4383 using namespace Zivid::Detail::TypeTraits;
4384
4385 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4386 static_assert(
4387 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
4388
4389 static_assert(
4390 AllArgsDecayedAreUnique<Args...>::value,
4391 "Found duplicate types among the arguments passed to set(...). "
4392 "Types should be listed at most once.");
4393
4394 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4395 }
4396
4412#ifndef NO_DOC
4413 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4414#else
4415 template<typename... Args>
4416#endif
4417 Sampling copyWith(Args &&...args) const
4418 {
4419 using namespace Zivid::Detail::TypeTraits;
4420
4421 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4422 static_assert(
4423 AllArgsAreDescendantNodes::value,
4424 "All arguments passed to copyWith(...) must be descendant nodes.");
4425
4426 static_assert(
4427 AllArgsDecayedAreUnique<Args...>::value,
4428 "Found duplicate types among the arguments passed to copyWith(...). "
4429 "Types should be listed at most once.");
4430
4431 auto copy{ *this };
4432 copy.set(std::forward<Args>(args)...);
4433 return copy;
4434 }
4435
4437 const Color &color() const
4438 {
4439 return m_color;
4440 }
4441
4444 {
4445 return m_color;
4446 }
4447
4449 Sampling &set(const Color &value)
4450 {
4451 m_color = value;
4452 return *this;
4453 }
4454
4456 const Interval &interval() const
4457 {
4458 return m_interval;
4459 }
4460
4463 {
4464 return m_interval;
4465 }
4466
4468 Sampling &set(const Interval &value)
4469 {
4470 m_interval = value;
4471 return *this;
4472 }
4473
4476 {
4477 m_interval.set(value);
4478 return *this;
4479 }
4480
4483 {
4484 m_interval.set(value);
4485 return *this;
4486 }
4487
4489 const Pixel &pixel() const
4490 {
4491 return m_pixel;
4492 }
4493
4496 {
4497 return m_pixel;
4498 }
4499
4501 Sampling &set(const Pixel &value)
4502 {
4503 m_pixel = value;
4504 return *this;
4505 }
4506
4507 template<
4508 typename T,
4509 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
4511 {
4512 return m_color;
4513 }
4514
4515 template<
4516 typename T,
4517 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
4519 {
4520 return m_interval;
4521 }
4522
4523 template<
4524 typename T,
4525 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type =
4526 0>
4528 {
4529 return m_interval.get<Settings2D::Sampling::Interval::Duration>();
4530 }
4531
4532 template<
4533 typename T,
4534 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
4536 {
4537 return m_interval.get<Settings2D::Sampling::Interval::Enabled>();
4538 }
4539
4540 template<
4541 typename T,
4542 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
4544 {
4545 return m_pixel;
4546 }
4547
4548 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4550 {
4551 return m_color;
4552 }
4553
4554 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4556 {
4557 return m_interval;
4558 }
4559
4560 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4562 {
4563 return m_pixel;
4564 }
4565
4567 template<typename F>
4568 void forEach(const F &f) const
4569 {
4570 f(m_color);
4571 f(m_interval);
4572 f(m_pixel);
4573 }
4574
4576 template<typename F>
4577 void forEach(const F &f)
4578 {
4579 f(m_color);
4580 f(m_interval);
4581 f(m_pixel);
4582 }
4583
4585 bool operator==(const Sampling &other) const;
4586
4588 bool operator!=(const Sampling &other) const;
4589
4591 std::string toString() const;
4592
4594 friend std::ostream &operator<<(std::ostream &stream, const Sampling &value)
4595 {
4596 return stream << value.toString();
4597 }
4598
4599 private:
4600 void setFromString(const std::string &value);
4601
4602 void setFromString(const std::string &fullPath, const std::string &value);
4603
4604 std::string getString(const std::string &fullPath) const;
4605
4606 Color m_color;
4607 Interval m_interval;
4608 Pixel m_pixel;
4609
4610 friend struct DataModel::Detail::Befriend<Sampling>;
4611 };
4612
4613 using Descendants = std::tuple<
4634
4637
4639 explicit Settings2D(const std::string &fileName);
4640
4646 [[nodiscard]] static Settings2D fromSerialized(const std::string &value);
4647
4653 std::string serialize() const;
4654
4685#ifndef NO_DOC
4686 template<
4687 typename... Args,
4688 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
4689 typename std::enable_if<
4690 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
4691 int>::type = 0>
4692#else
4693 template<typename... Args>
4694#endif
4695 explicit Settings2D(Args &&...args)
4696 {
4697 using namespace Zivid::Detail::TypeTraits;
4698
4699 static_assert(
4700 AllArgsDecayedAreUnique<Args...>::value,
4701 "Found duplicate types among the arguments passed to Settings2D(...). "
4702 "Types should be listed at most once.");
4703
4704 set(std::forward<Args>(args)...);
4705 }
4706
4736#ifndef NO_DOC
4737 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
4738#else
4739 template<typename... Args>
4740#endif
4741 void set(Args &&...args)
4742 {
4743 using namespace Zivid::Detail::TypeTraits;
4744
4745 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4746 static_assert(
4747 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
4748
4749 static_assert(
4750 AllArgsDecayedAreUnique<Args...>::value,
4751 "Found duplicate types among the arguments passed to set(...). "
4752 "Types should be listed at most once.");
4753
4754 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4755 }
4756
4787#ifndef NO_DOC
4788 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4789#else
4790 template<typename... Args>
4791#endif
4792 Settings2D copyWith(Args &&...args) const
4793 {
4794 using namespace Zivid::Detail::TypeTraits;
4795
4796 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4797 static_assert(
4798 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
4799
4800 static_assert(
4801 AllArgsDecayedAreUnique<Args...>::value,
4802 "Found duplicate types among the arguments passed to copyWith(...). "
4803 "Types should be listed at most once.");
4804
4805 auto copy{ *this };
4806 copy.set(std::forward<Args>(args)...);
4807 return copy;
4808 }
4809
4812 {
4813 return m_acquisitions;
4814 }
4815
4818 {
4819 return m_acquisitions;
4820 }
4821
4824 {
4825 m_acquisitions = value;
4826 return *this;
4827 }
4828
4831 {
4832 return m_diagnostics;
4833 }
4834
4837 {
4838 return m_diagnostics;
4839 }
4840
4843 {
4844 m_diagnostics = value;
4845 return *this;
4846 }
4847
4850 {
4851 m_diagnostics.set(value);
4852 return *this;
4853 }
4854
4856 const Processing &processing() const
4857 {
4858 return m_processing;
4859 }
4860
4863 {
4864 return m_processing;
4865 }
4866
4869 {
4870 m_processing = value;
4871 return *this;
4872 }
4873
4876 {
4877 m_processing.set(value);
4878 return *this;
4879 }
4880
4883 {
4884 m_processing.set(value);
4885 return *this;
4886 }
4887
4890 {
4891 m_processing.set(value);
4892 return *this;
4893 }
4894
4897 {
4898 m_processing.set(value);
4899 return *this;
4900 }
4901
4904 {
4905 m_processing.set(value);
4906 return *this;
4907 }
4908
4911 {
4912 m_processing.set(value);
4913 return *this;
4914 }
4915
4918 {
4919 m_processing.set(value);
4920 return *this;
4921 }
4922
4925 {
4926 m_processing.set(value);
4927 return *this;
4928 }
4929
4932 {
4933 m_processing.set(value);
4934 return *this;
4935 }
4936
4939 {
4940 m_processing.set(value);
4941 return *this;
4942 }
4943
4945 const Sampling &sampling() const
4946 {
4947 return m_sampling;
4948 }
4949
4952 {
4953 return m_sampling;
4954 }
4955
4957 Settings2D &set(const Sampling &value)
4958 {
4959 m_sampling = value;
4960 return *this;
4961 }
4962
4965 {
4966 m_sampling.set(value);
4967 return *this;
4968 }
4969
4972 {
4973 m_sampling.set(value);
4974 return *this;
4975 }
4976
4979 {
4980 m_sampling.set(value);
4981 return *this;
4982 }
4983
4986 {
4987 m_sampling.set(value);
4988 return *this;
4989 }
4990
4993 {
4994 m_sampling.set(value);
4995 return *this;
4996 }
4997
4998 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
5000 {
5001 return m_acquisitions;
5002 }
5003
5004 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Diagnostics>::value, int>::type = 0>
5006 {
5007 return m_diagnostics;
5008 }
5009
5010 template<
5011 typename T,
5012 typename std::enable_if<std::is_same<T, Settings2D::Diagnostics::Enabled>::value, int>::type = 0>
5014 {
5015 return m_diagnostics.get<Settings2D::Diagnostics::Enabled>();
5016 }
5017
5018 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
5020 {
5021 return m_processing;
5022 }
5023
5024 template<
5025 typename T,
5026 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
5028 {
5029 return m_processing.get<Settings2D::Processing::Color>();
5030 }
5031
5032 template<
5033 typename T,
5034 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
5036 {
5037 return m_processing.get<Settings2D::Processing::Color::Balance>();
5038 }
5039
5040 template<
5041 typename T,
5042 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
5043 0>
5045 {
5046 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
5047 }
5048
5049 template<
5050 typename T,
5051 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
5052 0>
5054 {
5055 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
5056 }
5057
5058 template<
5059 typename T,
5060 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
5062 {
5063 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
5064 }
5065
5066 template<
5067 typename T,
5068 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::type = 0>
5070 {
5071 return m_processing.get<Settings2D::Processing::Color::Experimental>();
5072 }
5073
5074 template<
5075 typename T,
5076 typename std::enable_if<
5077 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression>::value,
5078 int>::type = 0>
5080 {
5082 }
5083
5084 template<
5085 typename T,
5086 typename std::enable_if<
5087 std::is_same<T, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled>::value,
5088 int>::type = 0>
5090 {
5092 }
5093
5094 template<
5095 typename T,
5096 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::
5097 type = 0>
5099 {
5100 return m_processing.get<Settings2D::Processing::Color::Experimental::Mode>();
5101 }
5102
5103 template<
5104 typename T,
5105 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
5107 {
5108 return m_processing.get<Settings2D::Processing::Color::Gamma>();
5109 }
5110
5111 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Sampling>::value, int>::type = 0>
5113 {
5114 return m_sampling;
5115 }
5116
5117 template<
5118 typename T,
5119 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
5121 {
5122 return m_sampling.get<Settings2D::Sampling::Color>();
5123 }
5124
5125 template<
5126 typename T,
5127 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
5129 {
5130 return m_sampling.get<Settings2D::Sampling::Interval>();
5131 }
5132
5133 template<
5134 typename T,
5135 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type = 0>
5137 {
5138 return m_sampling.get<Settings2D::Sampling::Interval::Duration>();
5139 }
5140
5141 template<
5142 typename T,
5143 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
5145 {
5146 return m_sampling.get<Settings2D::Sampling::Interval::Enabled>();
5147 }
5148
5149 template<
5150 typename T,
5151 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
5153 {
5154 return m_sampling.get<Settings2D::Sampling::Pixel>();
5155 }
5156
5157 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
5159 {
5160 return m_acquisitions;
5161 }
5162
5163 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
5165 {
5166 return m_diagnostics;
5167 }
5168
5169 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
5171 {
5172 return m_processing;
5173 }
5174
5175 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
5177 {
5178 return m_sampling;
5179 }
5180
5182 template<typename F>
5183 void forEach(const F &f) const
5184 {
5185 f(m_acquisitions);
5186 f(m_diagnostics);
5187 f(m_processing);
5188 f(m_sampling);
5189 }
5190
5192 template<typename F>
5193 void forEach(const F &f)
5194 {
5195 f(m_acquisitions);
5196 f(m_diagnostics);
5197 f(m_processing);
5198 f(m_sampling);
5199 }
5200
5202 bool operator==(const Settings2D &other) const;
5203
5205 bool operator!=(const Settings2D &other) const;
5206
5208 std::string toString() const;
5209
5211 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
5212 {
5213 return stream << value.toString();
5214 }
5215
5217 void save(const std::string &fileName) const;
5218
5220 void load(const std::string &fileName);
5221
5222 private:
5223 void setFromString(const std::string &value);
5224
5225 void setFromString(const std::string &fullPath, const std::string &value);
5226
5227 std::string getString(const std::string &fullPath) const;
5228
5229 Acquisitions m_acquisitions;
5230 Diagnostics m_diagnostics;
5231 Processing m_processing;
5232 Sampling m_sampling;
5233
5234 friend struct DataModel::Detail::Befriend<Settings2D>;
5235 };
5236
5237#ifndef NO_DOC
5238 template<>
5239 struct Settings2D::Version<10>
5240 {
5241 using Type = Settings2D;
5242 };
5243#endif
5244
5245} // namespace Zivid
5246
5247#ifndef NO_DOC
5249namespace Zivid::Detail
5250{
5251
5252 ZIVID_CORE_EXPORT void save(const Zivid::Settings2D &dataModel, std::ostream &ostream);
5253 ZIVID_CORE_EXPORT void load(Zivid::Settings2D &dataModel, std::istream &istream);
5254
5255} // namespace Zivid::Detail
5256#endif
5257
5258#ifdef _MSC_VER
5259# pragma warning(pop)
5260#endif
5261
5262#ifndef NO_DOC
5263# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
5264namespace std // NOLINT
5265{
5266
5267 template<>
5268 struct tuple_size<Zivid::Settings2D::Diagnostics> : integral_constant<size_t, 1>
5269 {};
5270
5271 template<size_t i>
5272 struct tuple_element<i, Zivid::Settings2D::Diagnostics>
5273 {
5274 static_assert(i < tuple_size<Zivid::Settings2D::Diagnostics>::value, "Index must be less than 1");
5275
5276 using type // NOLINT
5277 = decltype(declval<Zivid::Settings2D::Diagnostics>().get<i>());
5278 };
5279
5280 template<>
5281 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
5282 {};
5283
5284 template<size_t i>
5285 struct tuple_element<i, Zivid::Settings2D::Processing>
5286 {
5287 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
5288
5289 using type // NOLINT
5290 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
5291 };
5292
5293 template<>
5294 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 3>
5295 {};
5296
5297 template<size_t i>
5298 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
5299 {
5300 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 3");
5301
5302 using type // NOLINT
5303 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
5304 };
5305
5306 template<>
5307 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
5308 {};
5309
5310 template<size_t i>
5311 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
5312 {
5313 static_assert(
5314 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
5315 "Index must be less than 3");
5316
5317 using type // NOLINT
5318 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
5319 };
5320
5321 template<>
5322 struct tuple_size<Zivid::Settings2D::Processing::Color::Experimental> : integral_constant<size_t, 2>
5323 {};
5324
5325 template<size_t i>
5326 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Experimental>
5327 {
5328 static_assert(
5329 i < tuple_size<Zivid::Settings2D::Processing::Color::Experimental>::value,
5330 "Index must be less than 2");
5331
5332 using type // NOLINT
5333 = decltype(declval<Zivid::Settings2D::Processing::Color::Experimental>().get<i>());
5334 };
5335
5336 template<>
5337 struct tuple_size<Zivid::Settings2D::Processing::Color::Experimental::HighlightSuppression>
5338 : integral_constant<size_t, 1>
5339 {};
5340
5341 template<size_t i>
5342 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Experimental::HighlightSuppression>
5343 {
5344 static_assert(
5345 i < tuple_size<Zivid::Settings2D::Processing::Color::Experimental::HighlightSuppression>::value,
5346 "Index must be less than 1");
5347
5348 using type // NOLINT
5349 = decltype(declval<Zivid::Settings2D::Processing::Color::Experimental::HighlightSuppression>().get<i>());
5350 };
5351
5352 template<>
5353 struct tuple_size<Zivid::Settings2D::Sampling> : integral_constant<size_t, 3>
5354 {};
5355
5356 template<size_t i>
5357 struct tuple_element<i, Zivid::Settings2D::Sampling>
5358 {
5359 static_assert(i < tuple_size<Zivid::Settings2D::Sampling>::value, "Index must be less than 3");
5360
5361 using type // NOLINT
5362 = decltype(declval<Zivid::Settings2D::Sampling>().get<i>());
5363 };
5364
5365 template<>
5366 struct tuple_size<Zivid::Settings2D::Sampling::Interval> : integral_constant<size_t, 2>
5367 {};
5368
5369 template<size_t i>
5370 struct tuple_element<i, Zivid::Settings2D::Sampling::Interval>
5371 {
5372 static_assert(i < tuple_size<Zivid::Settings2D::Sampling::Interval>::value, "Index must be less than 2");
5373
5374 using type // NOLINT
5375 = decltype(declval<Zivid::Settings2D::Sampling::Interval>().get<i>());
5376 };
5377
5378 template<>
5379 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 4>
5380 {};
5381
5382 template<size_t i>
5383 struct tuple_element<i, Zivid::Settings2D>
5384 {
5385 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 4");
5386
5387 using type // NOLINT
5388 = decltype(declval<Zivid::Settings2D>().get<i>());
5389 };
5390
5391} // namespace std
5392# endif
5393#endif
5394
5395// If we have access to the DataModel library, automatically include internal DataModel
5396// header. This header is necessary for serialization and deserialization.
5397#if defined(__has_include) && !defined(NO_DOC)
5398# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
5399# include "Zivid/Settings2DInternal.h"
5400# endif
5401#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Class describing a range of values for a given type T.
Definition Range.h:75
Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to the effe...
Definition Settings2D.h:144
void reset()
Reset the node to unset state.
bool operator!=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:204
static constexpr const char * name
The name of this value.
Definition Settings2D.h:153
friend std::ostream & operator<<(std::ostream &stream, const Aperture &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:234
bool operator<(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:210
constexpr Aperture(double value)
Constructor.
Definition Settings2D.h:178
static constexpr Range< double > validRange()
The range of valid values for Aperture.
Definition Settings2D.h:169
bool operator>=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:228
bool operator<=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:222
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:150
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:216
Aperture()=default
Default constructor.
double ValueType
The type of the underlying value.
Definition Settings2D.h:166
bool operator==(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:198
static constexpr const char * description
The description for this value.
Definition Settings2D.h:156
bool hasValue() const
Check if the value is set.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:147
Brightness controls the light output from the projector.
Definition Settings2D.h:270
bool operator==(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:329
bool operator<=(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:353
bool operator>(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:347
bool operator<(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:341
static constexpr Range< double > validRange()
The range of valid values for Brightness.
Definition Settings2D.h:300
static constexpr const char * name
The name of this value.
Definition Settings2D.h:279
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:273
constexpr Brightness(double value)
Constructor.
Definition Settings2D.h:309
std::string toString() const
Get the value as string.
bool operator!=(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:335
bool operator>=(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:359
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:365
static constexpr const char * description
The description for this value.
Definition Settings2D.h:282
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:297
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:276
Exposure time for the image.
Definition Settings2D.h:391
static constexpr const char * description
The description for this value.
Definition Settings2D.h:403
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:394
bool operator>(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:456
static constexpr const char * name
The name of this value.
Definition Settings2D.h:400
std::chrono::microseconds ValueType
The type of the underlying value.
Definition Settings2D.h:406
bool operator>=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:468
void reset()
Reset the node to unset state.
constexpr ExposureTime(std::chrono::microseconds value)
Constructor.
Definition Settings2D.h:418
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:397
std::chrono::microseconds value() const
Get the value.
bool operator<(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:450
bool operator<=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:462
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ExposureTime.
Definition Settings2D.h:409
bool operator!=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:444
std::string toString() const
Get the value as string.
ExposureTime()=default
Default constructor.
bool operator==(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:438
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:474
bool hasValue() const
Check if the value is set.
Analog gain in the camera.
Definition Settings2D.h:501
bool operator>(const Gain &other) const
Comparison operator.
Definition Settings2D.h:566
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:504
bool operator!=(const Gain &other) const
Comparison operator.
Definition Settings2D.h:554
bool operator==(const Gain &other) const
Comparison operator.
Definition Settings2D.h:548
friend std::ostream & operator<<(std::ostream &stream, const Gain &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:584
double ValueType
The type of the underlying value.
Definition Settings2D.h:516
Gain()=default
Default constructor.
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:513
void reset()
Reset the node to unset state.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:510
constexpr Gain(double value)
Constructor.
Definition Settings2D.h:528
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:578
bool operator<=(const Gain &other) const
Comparison operator.
Definition Settings2D.h:572
static constexpr Range< double > validRange()
The range of valid values for Gain.
Definition Settings2D.h:519
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:507
bool operator<(const Gain &other) const
Comparison operator.
Definition Settings2D.h:560
Settings for one 2D acquisition.
Definition Settings2D.h:117
const Settings2D::Acquisition::Gain & get() const
Definition Settings2D.h:827
const ExposureTime & exposureTime() const
Get ExposureTime.
Definition Settings2D.h:763
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:858
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:868
const Settings2D::Acquisition::Aperture & get() const
Definition Settings2D.h:803
ExposureTime & exposureTime()
Get ExposureTime.
Definition Settings2D.h:769
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:886
bool operator!=(const Acquisition &other) const
Inequality operator.
Acquisition & set(const Gain &value)
Set Gain.
Definition Settings2D.h:794
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:126
Acquisition & set(const Aperture &value)
Set Aperture.
Definition Settings2D.h:737
Gain & gain()
Get Gain.
Definition Settings2D.h:788
bool operator==(const Acquisition &other) const
Equality operator.
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:705
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:670
const Settings2D::Acquisition::ExposureTime & get() const
Definition Settings2D.h:819
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:123
Acquisition()
Default constructor.
Aperture & aperture()
Get Aperture.
Definition Settings2D.h:731
static constexpr const char * description
The description for this value.
Definition Settings2D.h:129
const Aperture & aperture() const
Get Aperture.
Definition Settings2D.h:725
Acquisition & set(const Brightness &value)
Set Brightness.
Definition Settings2D.h:756
const Brightness & brightness() const
Get Brightness.
Definition Settings2D.h:744
Brightness & brightness()
Get Brightness.
Definition Settings2D.h:750
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition Settings2D.h:606
const Gain & gain() const
Get Gain.
Definition Settings2D.h:782
const Settings2D::Acquisition::Brightness & get() const
Definition Settings2D.h:811
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:120
Acquisition & set(const ExposureTime &value)
Set ExposureTime.
Definition Settings2D.h:775
List of acquisitions used for 2D capture.
Definition Settings2D.h:910
const Settings2D::Acquisition & at(std::size_t pos) const
Returns a const reference to the element at position pos in the list.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Acquisitions.
Definition Settings2D.h:930
Acquisitions(std::initializer_list< Settings2D::Acquisition > value)
Constructor.
Definition Settings2D.h:944
static constexpr const char * description
The description for this value.
Definition Settings2D.h:922
Settings2D::Acquisition & operator[](std::size_t pos)
Returns a reference to the element at position pos in the list.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:916
const Settings2D::Acquisition & operator[](std::size_t pos) const
Returns a const reference to the element at position pos in the list.
ConstIterator cbegin() const noexcept
Returns a constant iterator to the first element of the list.
Acquisitions(std::vector< Settings2D::Acquisition > value)
Constructor.
Definition Settings2D.h:939
void forEach(const F &f)
Run the given function on each element in the list.
Definition Settings2D.h:1001
ConstIterator cend() const noexcept
Returns a constant iterator to the element following the last element of the list.
Settings2D::Acquisition & at(std::size_t pos)
Returns a reference to the element at position pos in the list.
void forEach(const F &f) const
Run the given function on each element in the list.
Definition Settings2D.h:1011
std::vector< Settings2D::Acquisition > ValueType
The type of the underlying value.
Definition Settings2D.h:927
Iterator begin() noexcept
Returns an iterator to the first element of the list.
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Acquisitions &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1056
std::vector< Settings2D::Acquisition >::iterator Iterator
Iterator type for Acquisitions.
Definition Settings2D.h:1020
std::vector< Settings2D::Acquisition >::const_iterator ConstIterator
Constant iterator type for Acquisitions.
Definition Settings2D.h:1029
std::size_t size() const noexcept
Get the size of the list.
bool operator!=(const Acquisitions &other) const
Comparison operator.
Definition Settings2D.h:1050
Acquisitions()=default
Default constructor.
void emplaceBack(Args &&...args)
Appends a new element to the end of the list.
Definition Settings2D.h:966
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:913
static constexpr const char * name
The name of this value.
Definition Settings2D.h:919
Iterator end() noexcept
Returns an iterator to the element following the last element of the list.
bool isEmpty() const noexcept
Check if the list is empty.
const std::vector< Settings2D::Acquisition > & value() const
Get the value.
Enable or disable diagnostics.
Definition Settings2D.h:1105
static const Enabled no
Off/disabled.
Definition Settings2D.h:1122
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1117
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1108
static std::set< bool > validValues()
All valid values of Enabled.
Definition Settings2D.h:1125
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1114
bool operator!=(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:1160
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1111
void reset()
Reset the node to unset state.
bool value() const
Get the value.
static const Enabled yes
On/enabled.
Definition Settings2D.h:1121
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1166
Enabled()=default
Default constructor.
constexpr Enabled(bool value)
Constructor.
Definition Settings2D.h:1134
bool operator==(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:1154
bool hasValue() const
Check if the value is set.
bool ValueType
The type of the underlying value.
Definition Settings2D.h:1120
std::string toString() const
Get the value as string.
When Diagnostics is enabled, additional diagnostic data is recorded during capture and included when ...
Definition Settings2D.h:1079
friend std::ostream & operator<<(std::ostream &stream, const Diagnostics &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:1341
const Enabled & isEnabled() const
Get Enabled.
Definition Settings2D.h:1285
std::tuple< Settings2D::Diagnostics::Enabled > Descendants
Definition Settings2D.h:1179
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1091
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1233
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1085
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1088
Diagnostics copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:1265
const Settings2D::Diagnostics::Enabled & get() const
Definition Settings2D.h:1306
Diagnostics & set(const Enabled &value)
Set Enabled.
Definition Settings2D.h:1297
bool operator==(const Diagnostics &other) const
Equality operator.
Enabled & isEnabled()
Get Enabled.
Definition Settings2D.h:1291
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:1326
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:1319
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1082
bool operator!=(const Diagnostics &other) const
Inequality operator.
Diagnostics()
Default constructor.
Digital gain applied to blue channel.
Definition Settings2D.h:1416
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1425
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1501
bool operator<=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1489
bool operator==(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1465
void reset()
Reset the node to unset state.
double ValueType
The type of the underlying value.
Definition Settings2D.h:1433
bool operator>(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1483
std::string toString() const
Get the value as string.
constexpr Blue(double value)
Constructor.
Definition Settings2D.h:1445
bool operator!=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1471
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1428
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1419
bool hasValue() const
Check if the value is set.
static constexpr Range< double > validRange()
The range of valid values for Blue.
Definition Settings2D.h:1436
bool operator<(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1477
bool operator>=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1495
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1422
Digital gain applied to green channel.
Definition Settings2D.h:1528
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1531
double ValueType
The type of the underlying value.
Definition Settings2D.h:1545
static constexpr Range< double > validRange()
The range of valid values for Green.
Definition Settings2D.h:1548
bool operator==(const Green &other) const
Comparison operator.
Definition Settings2D.h:1577
std::string toString() const
Get the value as string.
constexpr Green(double value)
Constructor.
Definition Settings2D.h:1557
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1537
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1613
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1540
bool operator<(const Green &other) const
Comparison operator.
Definition Settings2D.h:1589
bool hasValue() const
Check if the value is set.
bool operator<=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1601
bool operator>=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1607
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1534
bool operator!=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1583
bool operator>(const Green &other) const
Comparison operator.
Definition Settings2D.h:1595
void reset()
Reset the node to unset state.
Digital gain applied to red channel.
Definition Settings2D.h:1640
double ValueType
The type of the underlying value.
Definition Settings2D.h:1657
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1725
bool operator>=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1719
bool operator<(const Red &other) const
Comparison operator.
Definition Settings2D.h:1701
bool operator<=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1713
std::string toString() const
Get the value as string.
static constexpr Range< double > validRange()
The range of valid values for Red.
Definition Settings2D.h:1660
bool hasValue() const
Check if the value is set.
bool operator!=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1695
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1649
constexpr Red(double value)
Constructor.
Definition Settings2D.h:1669
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1643
bool operator==(const Red &other) const
Comparison operator.
Definition Settings2D.h:1689
void reset()
Reset the node to unset state.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1646
bool operator>(const Red &other) const
Comparison operator.
Definition Settings2D.h:1707
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1652
Color balance settings.
Definition Settings2D.h:1398
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:1947
Blue & blue()
Get Blue.
Definition Settings2D.h:1872
bool operator!=(const Balance &other) const
Inequality operator.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:1981
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:1972
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition Settings2D.h:1748
const Blue & blue() const
Get Blue.
Definition Settings2D.h:1866
bool operator==(const Balance &other) const
Equality operator.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1401
Balance & set(const Blue &value)
Set Blue.
Definition Settings2D.h:1878
Red & red()
Get Red.
Definition Settings2D.h:1910
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1404
Green & green()
Get Green.
Definition Settings2D.h:1891
Balance & set(const Green &value)
Set Green.
Definition Settings2D.h:1897
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:1845
const Green & green() const
Get Green.
Definition Settings2D.h:1885
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1410
Balance & set(const Red &value)
Set Red.
Definition Settings2D.h:1916
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:1937
const Red & red() const
Get Red.
Definition Settings2D.h:1904
std::string toString() const
Get the value as string.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1809
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:1998
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:1927
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1407
Enable or disable the highlight suppression.
Definition Settings2D.h:2067
bool ValueType
The type of the underlying value.
Definition Settings2D.h:2086
bool operator!=(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:2126
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2078
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2073
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2070
static const Enabled no
Off/disabled.
Definition Settings2D.h:2088
constexpr Enabled(bool value)
Constructor.
Definition Settings2D.h:2100
static std::set< bool > validValues()
All valid values of Enabled.
Definition Settings2D.h:2091
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2132
static const Enabled yes
On/enabled.
Definition Settings2D.h:2087
bool operator==(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:2120
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2081
Suppress highlights caused by the projector. Suppressed areas will appear with structure and detail r...
Definition Settings2D.h:2044
friend std::ostream & operator<<(std::ostream &stream, const HighlightSuppression &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2315
HighlightSuppression copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:2234
HighlightSuppression & set(const Enabled &value)
Set Enabled.
Definition Settings2D.h:2267
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2047
std::tuple< Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled > Descendants
Definition Settings2D.h:2145
const Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled & get() const
Definition Settings2D.h:2280
bool operator==(const HighlightSuppression &other) const
Equality operator.
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:2293
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2056
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2200
bool operator!=(const HighlightSuppression &other) const
Inequality operator.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2050
Enabled & isEnabled()
Get Enabled.
Definition Settings2D.h:2261
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2300
const Enabled & isEnabled() const
Get Enabled.
Definition Settings2D.h:2255
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2053
This setting controls how the color image is computed.
Definition Settings2D.h:2350
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2356
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2353
friend std::ostream & operator<<(std::ostream &stream, const Mode &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2437
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2359
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2362
static const Mode toneMapping
toneMapping
Definition Settings2D.h:2387
bool operator==(const Mode &other) const
Comparison operator.
Definition Settings2D.h:2425
static const Mode automatic
automatic
Definition Settings2D.h:2386
bool operator!=(const Mode &other) const
Comparison operator.
Definition Settings2D.h:2431
void reset()
Reset the node to unset state.
constexpr Mode(ValueType value)
Constructor.
Definition Settings2D.h:2399
bool hasValue() const
Check if the value is set.
static std::set< ValueType > validValues()
All valid values of Mode.
Definition Settings2D.h:2390
friend std::ostream & operator<<(std::ostream &stream, const Mode::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:2419
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition Settings2D.h:2382
Experimental color settings. These may be renamed, moved or deleted in the future.
Definition Settings2D.h:2021
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2027
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2678
Mode & mode()
Get Mode.
Definition Settings2D.h:2611
const Mode & mode() const
Get Mode.
Definition Settings2D.h:2605
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2024
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2033
std::tuple< Settings2D::Processing::Color::Experimental::HighlightSuppression, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled, Settings2D::Processing::Color::Experimental::Mode > Descendants
Definition Settings2D.h:2461
friend std::ostream & operator<<(std::ostream &stream, const Experimental &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2694
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:2670
Experimental & set(const HighlightSuppression &value)
Set HighlightSuppression.
Definition Settings2D.h:2591
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2522
std::string toString() const
Get the value as string.
HighlightSuppression & highlightSuppression()
Get HighlightSuppression.
Definition Settings2D.h:2585
const HighlightSuppression & highlightSuppression() const
Get HighlightSuppression.
Definition Settings2D.h:2579
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2030
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:2651
const Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled & get() const
Definition Settings2D.h:2640
const Settings2D::Processing::Color::Experimental::HighlightSuppression & get() const
Definition Settings2D.h:2628
bool operator!=(const Experimental &other) const
Inequality operator.
bool operator==(const Experimental &other) const
Equality operator.
Experimental & set(const Mode &value)
Set Mode.
Definition Settings2D.h:2617
Experimental copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:2558
Experimental & set(const HighlightSuppression::Enabled &value)
Set HighlightSuppression::Enabled.
Definition Settings2D.h:2598
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition Settings2D.h:2718
double ValueType
The type of the underlying value.
Definition Settings2D.h:2737
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2721
static constexpr Range< double > validRange()
The range of valid values for Gamma.
Definition Settings2D.h:2740
bool operator>(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2787
bool operator==(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2769
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2805
bool operator!=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2775
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2730
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:2781
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2727
void reset()
Reset the node to unset state.
bool operator>=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2799
constexpr Gamma(double value)
Constructor.
Definition Settings2D.h:2749
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2724
Gamma()=default
Default constructor.
bool operator<=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2793
double value() const
Get the value.
Color settings.
Definition Settings2D.h:1380
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2906
Color & set(const Balance::Green &value)
Set Balance::Green.
Definition Settings2D.h:2994
bool operator!=(const Color &other) const
Inequality operator.
bool operator==(const Color &other) const
Equality operator.
const Experimental & experimental() const
Get Experimental.
Definition Settings2D.h:3008
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1386
std::string toString() const
Get the value as string.
const Balance & balance() const
Get Balance.
Definition Settings2D.h:2968
Color & set(const Balance::Blue &value)
Set Balance::Blue.
Definition Settings2D.h:2987
Balance & balance()
Get Balance.
Definition Settings2D.h:2974
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:3172
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3198
Experimental & experimental()
Get Experimental.
Definition Settings2D.h:3014
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:3138
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:3147
std::tuple< Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Experimental, Settings2D::Processing::Color::Experimental::HighlightSuppression, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled, Settings2D::Processing::Color::Experimental::Mode, Settings2D::Processing::Color::Gamma > Descendants
Definition Settings2D.h:2827
Color & set(const Experimental::Mode &value)
Set Experimental::Mode.
Definition Settings2D.h:3041
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:3088
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1389
Gamma & gamma()
Get Gamma.
Definition Settings2D.h:3054
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1383
Color & set(const Experimental::HighlightSuppression::Enabled &value)
Set Experimental::HighlightSuppression::Enabled.
Definition Settings2D.h:3034
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:3097
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:3106
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:2947
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:3070
Color & set(const Experimental::HighlightSuppression &value)
Set Experimental::HighlightSuppression.
Definition Settings2D.h:3027
const Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled & get() const
Definition Settings2D.h:3127
const Gamma & gamma() const
Get Gamma.
Definition Settings2D.h:3048
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:3079
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1392
Color & set(const Balance &value)
Set Balance.
Definition Settings2D.h:2980
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3181
const Settings2D::Processing::Color::Experimental::HighlightSuppression & get() const
Definition Settings2D.h:3116
Color & set(const Gamma &value)
Set Gamma.
Definition Settings2D.h:3060
Color & set(const Experimental &value)
Set Experimental.
Definition Settings2D.h:3020
Color & set(const Balance::Red &value)
Set Balance::Red.
Definition Settings2D.h:3001
2D processing settings.
Definition Settings2D.h:1362
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:3444
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1374
Processing & set(const Color::Gamma &value)
Set Color::Gamma.
Definition Settings2D.h:3435
bool operator!=(const Processing &other) const
Inequality operator.
bool operator==(const Processing &other) const
Equality operator.
Processing & set(const Color &value)
Set Color.
Definition Settings2D.h:3372
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1365
Processing & set(const Color::Experimental &value)
Set Color::Experimental.
Definition Settings2D.h:3407
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:3452
Processing & set(const Color::Experimental::Mode &value)
Set Color::Experimental::Mode.
Definition Settings2D.h:3428
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3560
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::Experimental, Settings2D::Processing::Color::Experimental::HighlightSuppression, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled, Settings2D::Processing::Color::Experimental::Mode, Settings2D::Processing::Color::Gamma > Descendants
Definition Settings2D.h:3217
Processing & set(const Color::Experimental::HighlightSuppression &value)
Set Color::Experimental::HighlightSuppression.
Definition Settings2D.h:3414
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:3488
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:3538
Color & color()
Get Color.
Definition Settings2D.h:3366
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3299
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue.
Definition Settings2D.h:3386
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1368
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:3517
const Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled & get() const
Definition Settings2D.h:3508
Processing & set(const Color::Balance &value)
Set Color::Balance.
Definition Settings2D.h:3379
const Color & color() const
Get Color.
Definition Settings2D.h:3360
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red.
Definition Settings2D.h:3400
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:3525
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:3479
const Settings2D::Processing::Color::Experimental::HighlightSuppression & get() const
Definition Settings2D.h:3498
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:3340
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:3461
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:3470
std::string toString() const
Get the value as string.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3545
Processing()
Default constructor.
Processing & set(const Color::Experimental::HighlightSuppression::Enabled &value)
Set Color::Experimental::HighlightSuppression::Enabled.
Definition Settings2D.h:3421
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green.
Definition Settings2D.h:3393
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1371
Choose how to sample colors for the 2D image.
Definition Settings2D.h:3617
ValueType
The type of the underlying value.
Definition Settings2D.h:3649
@ grayscale
Definition Settings2D.h:3651
@ rgbStrongAmbientLight
Definition Settings2D.h:3652
@ rgbAmbientSuppression
Definition Settings2D.h:3653
Color()=default
Default constructor.
void reset()
Reset the node to unset state.
static const Color grayscale
grayscale
Definition Settings2D.h:3656
static std::set< ValueType > validValues()
All valid values of Color.
Definition Settings2D.h:3661
static const Color rgbAmbientSuppression
rgbAmbientSuppression
Definition Settings2D.h:3658
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3620
ValueType value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3711
constexpr Color(ValueType value)
Constructor.
Definition Settings2D.h:3673
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3629
bool hasValue() const
Check if the value is set.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3623
static const Color rgb
rgb
Definition Settings2D.h:3655
bool operator==(const Color &other) const
Comparison operator.
Definition Settings2D.h:3699
bool operator!=(const Color &other) const
Comparison operator.
Definition Settings2D.h:3705
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3626
std::string toString() const
Get the value as string.
static const Color rgbStrongAmbientLight
rgbStrongAmbientLight
Definition Settings2D.h:3657
friend std::ostream & operator<<(std::ostream &stream, const Color::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:3693
Duration between successive sensor operations, in microseconds. The effective interval might be round...
Definition Settings2D.h:3777
friend std::ostream & operator<<(std::ostream &stream, const Duration &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3865
std::chrono::microseconds ValueType
The type of the underlying value.
Definition Settings2D.h:3797
bool operator<(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3841
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3786
bool operator==(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3829
std::chrono::microseconds value() const
Get the value.
void reset()
Reset the node to unset state.
bool operator>(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3847
Duration()=default
Default constructor.
bool operator!=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3835
constexpr Duration(std::chrono::microseconds value)
Constructor.
Definition Settings2D.h:3809
bool operator>=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3859
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3783
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for Duration.
Definition Settings2D.h:3800
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3780
bool operator<=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3853
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3789
bool hasValue() const
Check if the value is set.
Enable or disable sampling interval.
Definition Settings2D.h:3892
static const Enabled no
Off/disabled.
Definition Settings2D.h:3911
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3895
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3904
Enabled()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3898
bool operator==(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3943
void reset()
Reset the node to unset state.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3901
constexpr Enabled(bool value)
Constructor.
Definition Settings2D.h:3923
std::string toString() const
Get the value as string.
static std::set< bool > validValues()
All valid values of Enabled.
Definition Settings2D.h:3914
bool hasValue() const
Check if the value is set.
friend std::ostream & operator<<(std::ostream &stream, const Enabled &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3955
static const Enabled yes
On/enabled.
Definition Settings2D.h:3910
bool ValueType
The type of the underlying value.
Definition Settings2D.h:3909
bool operator!=(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3949
Sampling interval controls the interval between successive sensor operations (e.g....
Definition Settings2D.h:3747
friend std::ostream & operator<<(std::ostream &stream, const Interval &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:4173
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3759
Enabled & isEnabled()
Get Enabled.
Definition Settings2D.h:4105
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3753
Interval copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:4059
bool operator==(const Interval &other) const
Equality operator.
Interval & set(const Duration &value)
Set Duration.
Definition Settings2D.h:4092
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:4157
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:4149
Duration & duration()
Get Duration.
Definition Settings2D.h:4086
std::tuple< Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled > Descendants
Definition Settings2D.h:3968
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:4130
bool operator!=(const Interval &other) const
Inequality operator.
const Duration & duration() const
Get Duration.
Definition Settings2D.h:4080
Interval & set(const Enabled &value)
Set Enabled.
Definition Settings2D.h:4111
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3756
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3750
const Enabled & isEnabled() const
Get Enabled.
Definition Settings2D.h:4099
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:4025
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:4121
Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampl...
Definition Settings2D.h:4197
static const Pixel redSubsample4x4
redSubsample4x4
Definition Settings2D.h:4230
static const Pixel by2x2
by2x2
Definition Settings2D.h:4231
Pixel()=default
Default constructor.
constexpr Pixel(ValueType value)
Constructor.
Definition Settings2D.h:4250
ValueType
The type of the underlying value.
Definition Settings2D.h:4217
@ by4x4
Definition Settings2D.h:4224
@ redSubsample2x2
Definition Settings2D.h:4220
@ blueSubsample4x4
Definition Settings2D.h:4221
@ blueSubsample2x2
Definition Settings2D.h:4219
@ by2x2
Definition Settings2D.h:4223
@ redSubsample4x4
Definition Settings2D.h:4222
static const Pixel by4x4
by4x4
Definition Settings2D.h:4232
bool operator!=(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:4282
ValueType value() const
Get the value.
bool operator==(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:4276
static const Pixel redSubsample2x2
redSubsample2x2
Definition Settings2D.h:4228
static const Pixel all
all
Definition Settings2D.h:4226
static std::set< ValueType > validValues()
All valid values of Pixel.
Definition Settings2D.h:4235
static constexpr const char * name
The name of this value.
Definition Settings2D.h:4206
std::string toString() const
Get the value as string.
static const Pixel blueSubsample2x2
blueSubsample2x2
Definition Settings2D.h:4227
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:4200
friend std::ostream & operator<<(std::ostream &stream, const Pixel::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:4270
friend std::ostream & operator<<(std::ostream &stream, const Pixel &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:4288
static constexpr const char * description
The description for this value.
Definition Settings2D.h:4209
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:4203
void reset()
Reset the node to unset state.
static const Pixel blueSubsample4x4
blueSubsample4x4
Definition Settings2D.h:4229
bool hasValue() const
Check if the value is set.
Sampling settings.
Definition Settings2D.h:3582
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:4577
bool operator==(const Sampling &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:4381
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:4527
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3585
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:4543
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:4535
Sampling & set(const Interval::Enabled &value)
Set Interval::Enabled.
Definition Settings2D.h:4482
Sampling & set(const Pixel &value)
Set Pixel.
Definition Settings2D.h:4501
const Pixel & pixel() const
Get Pixel.
Definition Settings2D.h:4489
Pixel & pixel()
Get Pixel.
Definition Settings2D.h:4495
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3588
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:4568
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:4510
friend std::ostream & operator<<(std::ostream &stream, const Sampling &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:4594
bool operator!=(const Sampling &other) const
Inequality operator.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3594
Sampling & set(const Interval::Duration &value)
Set Interval::Duration.
Definition Settings2D.h:4475
const Color & color() const
Get Color.
Definition Settings2D.h:4437
Sampling & set(const Interval &value)
Set Interval.
Definition Settings2D.h:4468
Sampling & set(const Color &value)
Set Color.
Definition Settings2D.h:4449
Sampling copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:4417
Color & color()
Get Color.
Definition Settings2D.h:4443
const Interval & interval() const
Get Interval.
Definition Settings2D.h:4456
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:4518
Interval & interval()
Get Interval.
Definition Settings2D.h:4462
Sampling()
Default constructor.
std::tuple< Settings2D::Sampling::Color, Settings2D::Sampling::Interval, Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled, Settings2D::Sampling::Pixel > Descendants
Definition Settings2D.h:4314
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3591
Settings used when capturing 2D images with a Zivid camera.
Definition Settings2D.h:79
Settings2D & set(const Processing &value)
Set Processing.
Definition Settings2D.h:4868
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:5152
static constexpr size_t version
Definition Settings2D.h:95
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:5027
Settings2D & set(const Sampling::Interval::Enabled &value)
Set Sampling::Interval::Enabled.
Definition Settings2D.h:4985
Sampling & sampling()
Get Sampling.
Definition Settings2D.h:4951
const Settings2D::Processing::Color::Experimental::HighlightSuppression & get() const
Definition Settings2D.h:5079
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:5120
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:5061
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:5053
Settings2D & set(const Sampling::Color &value)
Set Sampling::Color.
Definition Settings2D.h:4964
const Settings2D::Diagnostics::Enabled & get() const
Definition Settings2D.h:5013
const Diagnostics & diagnostics() const
Get Diagnostics.
Definition Settings2D.h:4830
void save(const std::string &fileName) const
Save to the given file.
std::string serialize() const
Serialize to a string.
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:5044
const Acquisitions & acquisitions() const
Get Acquisitions.
Definition Settings2D.h:4811
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:5193
Settings2D & set(const Diagnostics::Enabled &value)
Set Diagnostics::Enabled.
Definition Settings2D.h:4849
Settings2D & set(const Sampling::Interval &value)
Set Sampling::Interval.
Definition Settings2D.h:4971
Diagnostics & diagnostics()
Get Diagnostics.
Definition Settings2D.h:4836
Settings2D & set(const Sampling &value)
Set Sampling.
Definition Settings2D.h:4957
Settings2D(Args &&...args)
Constructor taking variadic number of arguments.
Definition Settings2D.h:4695
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:5128
const Settings2D::Diagnostics & get() const
Definition Settings2D.h:5005
const Settings2D::Acquisitions & get() const
Definition Settings2D.h:4999
Settings2D()
Default constructor.
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:5106
Settings2D & set(const Acquisitions &value)
Set Acquisitions.
Definition Settings2D.h:4823
Settings2D(const std::string &fileName)
Construct Settings2D by loading from file.
Settings2D & set(const Sampling::Interval::Duration &value)
Set Sampling::Interval::Duration.
Definition Settings2D.h:4978
const Settings2D::Sampling & get() const
Definition Settings2D.h:5112
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:5136
void load(const std::string &fileName)
Load from the given file.
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:5035
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green.
Definition Settings2D.h:4896
bool operator!=(const Settings2D &other) const
Inequality operator.
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance.
Definition Settings2D.h:4882
Settings2D & set(const Processing::Color::Experimental::HighlightSuppression::Enabled &value)
Set Processing::Color::Experimental::HighlightSuppression::Enabled.
Definition Settings2D.h:4924
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:5069
Settings2D & set(const Processing::Color::Experimental::HighlightSuppression &value)
Set Processing::Color::Experimental::HighlightSuppression.
Definition Settings2D.h:4917
const Settings2D::Processing & get() const
Definition Settings2D.h:5019
static Settings2D fromSerialized(const std::string &value)
Construct a new Settings2D instance from a previously serialized string.
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red.
Definition Settings2D.h:4903
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:4741
Processing & processing()
Get Processing.
Definition Settings2D.h:4862
const Processing & processing() const
Get Processing.
Definition Settings2D.h:4856
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:4792
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue.
Definition Settings2D.h:4889
Settings2D & set(const Processing::Color::Experimental::Mode &value)
Set Processing::Color::Experimental::Mode.
Definition Settings2D.h:4931
Acquisitions & acquisitions()
Get Acquisitions.
Definition Settings2D.h:4817
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:82
std::string toString() const
Get the value as string.
Settings2D & set(const Processing::Color::Experimental &value)
Set Processing::Color::Experimental.
Definition Settings2D.h:4910
Settings2D & set(const Sampling::Pixel &value)
Set Sampling::Pixel.
Definition Settings2D.h:4992
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:5183
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:5144
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:5098
bool operator==(const Settings2D &other) const
Equality operator.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:85
const Sampling & sampling() const
Get Sampling.
Definition Settings2D.h:4945
Settings2D & set(const Diagnostics &value)
Set Diagnostics.
Definition Settings2D.h:4842
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:5211
const Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled & get() const
Definition Settings2D.h:5089
static constexpr const char * description
The description for this value.
Definition Settings2D.h:91
static constexpr const char * name
The name of this value.
Definition Settings2D.h:88
Settings2D & set(const Processing::Color &value)
Set Processing::Color.
Definition Settings2D.h:4875
std::tuple< Settings2D::Acquisitions, Settings2D::Diagnostics, Settings2D::Diagnostics::Enabled, 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::Experimental, Settings2D::Processing::Color::Experimental::HighlightSuppression, Settings2D::Processing::Color::Experimental::HighlightSuppression::Enabled, Settings2D::Processing::Color::Experimental::Mode, Settings2D::Processing::Color::Gamma, Settings2D::Sampling, Settings2D::Sampling::Color, Settings2D::Sampling::Interval, Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled, Settings2D::Sampling::Pixel > Descendants
Definition Settings2D.h:4613
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma.
Definition Settings2D.h:4938
NodeType
Definition NodeType.h:49
@ leafDataModelList
Definition NodeType.h:51
@ leafValue
Definition NodeType.h:52
@ group
Definition NodeType.h:50
Definition EnvironmentInfo.h:74
Definition Calibration.h:59
Get version information for the library.
Definition Version.h:58
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:85