Zivid C++ API 2.18.0+1b44dbef-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{ 9 };
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
2052
2053 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2055 {
2056 public:
2059
2061 static constexpr const char *path{ "Processing/Color/Experimental/Mode" };
2062
2064 static constexpr const char *name{ "Mode" };
2065
2067 static constexpr const char *description{
2068 R"description(This setting controls how the color image is computed.
2069
2070`automatic` is the default option. It performs tone mapping for HDR captures, but not for
2071single-acquisition captures. Use this mode with a single acquisition if you want to have
2072the most control over the colors in the image.
2073
2074`toneMapping` uses all the acquisitions to create one merged and normalized color image. For
2075HDR captures the dynamic range of the captured images is usually higher than the 8-bit color
2076image range. `toneMapping` will map the HDR color data to the 8-bit color output range by
2077applying a scaling factor. `toneMapping` can also be used for single-acquisition captures to
2078normalize the captured color image to the full 8-bit output. Note that when using `toneMapping`
2079mode the color values can be inconsistent over repeated captures if you move, add or remove
2080objects in the scene. For the most control over the colors in the single-acquisition case,
2081select the `automatic` mode.
2082)description"
2083 };
2084
2086 enum class ValueType
2087 {
2090 };
2091 static const Mode automatic;
2092 static const Mode toneMapping;
2093
2095 static std::set<ValueType> validValues()
2096 {
2098 }
2099
2101 Mode() = default;
2102
2104 explicit constexpr Mode(ValueType value)
2105 : m_opt{ verifyValue(value) }
2106 {}
2107
2113
2115 bool hasValue() const;
2116
2118 void reset();
2119
2121 std::string toString() const;
2122
2124 friend std::ostream &operator<<(std::ostream &stream, const Mode::ValueType &value)
2125 {
2126 return stream << Mode{ value }.toString();
2127 }
2128
2130 bool operator==(const Mode &other) const
2131 {
2132 return m_opt == other.m_opt;
2133 }
2134
2136 bool operator!=(const Mode &other) const
2137 {
2138 return m_opt != other.m_opt;
2139 }
2140
2142 friend std::ostream &operator<<(std::ostream &stream, const Mode &value)
2143 {
2144 return stream << value.toString();
2145 }
2146
2147 private:
2148 void setFromString(const std::string &value);
2149
2150 constexpr ValueType static verifyValue(const ValueType &value)
2151 {
2152 return value == ValueType::automatic || value == ValueType::toneMapping
2153 ? value
2154 : throw std::invalid_argument{
2155 "Invalid value: Mode{ "
2156 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
2157 + " }"
2158 };
2159 }
2160
2161 std::optional<ValueType> m_opt;
2162
2163 friend struct DataModel::Detail::Befriend<Mode>;
2164 };
2165
2166 using Descendants = std::tuple<Settings2D::Processing::Color::Experimental::Mode>;
2167
2170
2182#ifndef NO_DOC
2183 template<
2184 typename... Args,
2185 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2186 typename std::enable_if<
2187 Zivid::Detail::TypeTraits::
2188 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2189 int>::type = 0>
2190#else
2191 template<typename... Args>
2192#endif
2193 explicit Experimental(Args &&...args)
2194 {
2195 using namespace Zivid::Detail::TypeTraits;
2196
2197 static_assert(
2198 AllArgsDecayedAreUnique<Args...>::value,
2199 "Found duplicate types among the arguments passed to Experimental(...). "
2200 "Types should be listed at most once.");
2201
2202 set(std::forward<Args>(args)...);
2203 }
2204
2215#ifndef NO_DOC
2216 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2217#else
2218 template<typename... Args>
2219#endif
2220 void set(Args &&...args)
2221 {
2222 using namespace Zivid::Detail::TypeTraits;
2223
2224 using AllArgsAreDescendantNodes =
2225 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2226 static_assert(
2227 AllArgsAreDescendantNodes::value,
2228 "All arguments passed to set(...) must be descendant nodes.");
2229
2230 static_assert(
2231 AllArgsDecayedAreUnique<Args...>::value,
2232 "Found duplicate types among the arguments passed to set(...). "
2233 "Types should be listed at most once.");
2234
2235 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2236 }
2237
2249#ifndef NO_DOC
2250 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2251#else
2252 template<typename... Args>
2253#endif
2254 Experimental copyWith(Args &&...args) const
2255 {
2256 using namespace Zivid::Detail::TypeTraits;
2257
2258 using AllArgsAreDescendantNodes =
2259 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2260 static_assert(
2261 AllArgsAreDescendantNodes::value,
2262 "All arguments passed to copyWith(...) must be descendant nodes.");
2263
2264 static_assert(
2265 AllArgsDecayedAreUnique<Args...>::value,
2266 "Found duplicate types among the arguments passed to copyWith(...). "
2267 "Types should be listed at most once.");
2268
2269 auto copy{ *this };
2270 copy.set(std::forward<Args>(args)...);
2271 return copy;
2272 }
2273
2275 const Mode &mode() const
2276 {
2277 return m_mode;
2278 }
2279
2282 {
2283 return m_mode;
2284 }
2285
2287 Experimental &set(const Mode &value)
2288 {
2289 m_mode = value;
2290 return *this;
2291 }
2292
2293 template<
2294 typename T,
2295 typename std::enable_if<
2296 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
2297 int>::type = 0>
2299 {
2300 return m_mode;
2301 }
2302
2303 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2305 {
2306 return m_mode;
2307 }
2308
2310 template<typename F>
2311 void forEach(const F &f) const
2312 {
2313 f(m_mode);
2314 }
2315
2317 template<typename F>
2318 void forEach(const F &f)
2319 {
2320 f(m_mode);
2321 }
2322
2324 bool operator==(const Experimental &other) const;
2325
2327 bool operator!=(const Experimental &other) const;
2328
2330 std::string toString() const;
2331
2333 friend std::ostream &operator<<(std::ostream &stream, const Experimental &value)
2334 {
2335 return stream << value.toString();
2336 }
2337
2338 private:
2339 void setFromString(const std::string &value);
2340
2341 void setFromString(const std::string &fullPath, const std::string &value);
2342
2343 std::string getString(const std::string &fullPath) const;
2344
2345 Mode m_mode;
2346
2347 friend struct DataModel::Detail::Befriend<Experimental>;
2348 };
2349
2353
2354 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2356 {
2357 public:
2360
2362 static constexpr const char *path{ "Processing/Color/Gamma" };
2363
2365 static constexpr const char *name{ "Gamma" };
2366
2368 static constexpr const char *description{
2369 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
2370greater than 1 makes the colors darker.
2371)description"
2372 };
2373
2375 using ValueType = double;
2376
2378 static constexpr Range<double> validRange()
2379 {
2380 return { 0.25, 1.5 };
2381 }
2382
2384 Gamma() = default;
2385
2387 explicit constexpr Gamma(double value)
2388 : m_opt{ verifyValue(value) }
2389 {}
2390
2395 double value() const;
2396
2398 bool hasValue() const;
2399
2401 void reset();
2402
2404 std::string toString() const;
2405
2407 bool operator==(const Gamma &other) const
2408 {
2409 return m_opt == other.m_opt;
2410 }
2411
2413 bool operator!=(const Gamma &other) const
2414 {
2415 return m_opt != other.m_opt;
2416 }
2417
2419 bool operator<(const Gamma &other) const
2420 {
2421 return m_opt < other.m_opt;
2422 }
2423
2425 bool operator>(const Gamma &other) const
2426 {
2427 return m_opt > other.m_opt;
2428 }
2429
2431 bool operator<=(const Gamma &other) const
2432 {
2433 return m_opt <= other.m_opt;
2434 }
2435
2437 bool operator>=(const Gamma &other) const
2438 {
2439 return m_opt >= other.m_opt;
2440 }
2441
2443 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
2444 {
2445 return stream << value.toString();
2446 }
2447
2448 private:
2449 void setFromString(const std::string &value);
2450
2451 constexpr ValueType static verifyValue(const ValueType &value)
2452 {
2453 return validRange().isInRange(value)
2454 ? value
2455 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
2456 + std::to_string(validRange().min()) + ", "
2457 + std::to_string(validRange().max()) + "]" };
2458 }
2459
2460 std::optional<double> m_opt;
2461
2462 friend struct DataModel::Detail::Befriend<Gamma>;
2463 };
2464
2465 using Descendants = std::tuple<
2473
2476
2494#ifndef NO_DOC
2495 template<
2496 typename... Args,
2497 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2498 typename std::enable_if<
2499 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2500 value,
2501 int>::type = 0>
2502#else
2503 template<typename... Args>
2504#endif
2505 explicit Color(Args &&...args)
2506 {
2507 using namespace Zivid::Detail::TypeTraits;
2508
2509 static_assert(
2510 AllArgsDecayedAreUnique<Args...>::value,
2511 "Found duplicate types among the arguments passed to Color(...). "
2512 "Types should be listed at most once.");
2513
2514 set(std::forward<Args>(args)...);
2515 }
2516
2533#ifndef NO_DOC
2534 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2535#else
2536 template<typename... Args>
2537#endif
2538 void set(Args &&...args)
2539 {
2540 using namespace Zivid::Detail::TypeTraits;
2541
2542 using AllArgsAreDescendantNodes =
2543 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2544 static_assert(
2545 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2546
2547 static_assert(
2548 AllArgsDecayedAreUnique<Args...>::value,
2549 "Found duplicate types among the arguments passed to set(...). "
2550 "Types should be listed at most once.");
2551
2552 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2553 }
2554
2572#ifndef NO_DOC
2573 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2574#else
2575 template<typename... Args>
2576#endif
2577 Color copyWith(Args &&...args) const
2578 {
2579 using namespace Zivid::Detail::TypeTraits;
2580
2581 using AllArgsAreDescendantNodes =
2582 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2583 static_assert(
2584 AllArgsAreDescendantNodes::value,
2585 "All arguments passed to copyWith(...) must be descendant nodes.");
2586
2587 static_assert(
2588 AllArgsDecayedAreUnique<Args...>::value,
2589 "Found duplicate types among the arguments passed to copyWith(...). "
2590 "Types should be listed at most once.");
2591
2592 auto copy{ *this };
2593 copy.set(std::forward<Args>(args)...);
2594 return copy;
2595 }
2596
2598 const Balance &balance() const
2599 {
2600 return m_balance;
2601 }
2602
2605 {
2606 return m_balance;
2607 }
2608
2610 Color &set(const Balance &value)
2611 {
2612 m_balance = value;
2613 return *this;
2614 }
2615
2617 Color &set(const Balance::Blue &value)
2618 {
2619 m_balance.set(value);
2620 return *this;
2621 }
2622
2624 Color &set(const Balance::Green &value)
2625 {
2626 m_balance.set(value);
2627 return *this;
2628 }
2629
2631 Color &set(const Balance::Red &value)
2632 {
2633 m_balance.set(value);
2634 return *this;
2635 }
2636
2639 {
2640 return m_experimental;
2641 }
2642
2645 {
2646 return m_experimental;
2647 }
2648
2650 Color &set(const Experimental &value)
2651 {
2652 m_experimental = value;
2653 return *this;
2654 }
2655
2658 {
2659 m_experimental.set(value);
2660 return *this;
2661 }
2662
2664 const Gamma &gamma() const
2665 {
2666 return m_gamma;
2667 }
2668
2671 {
2672 return m_gamma;
2673 }
2674
2676 Color &set(const Gamma &value)
2677 {
2678 m_gamma = value;
2679 return *this;
2680 }
2681
2682 template<
2683 typename T,
2684 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
2685 0>
2687 {
2688 return m_balance;
2689 }
2690
2691 template<
2692 typename T,
2693 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2694 type = 0>
2696 {
2697 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
2698 }
2699
2700 template<
2701 typename T,
2702 typename std::
2703 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
2705 {
2706 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
2707 }
2708
2709 template<
2710 typename T,
2711 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2712 type = 0>
2714 {
2715 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
2716 }
2717
2718 template<
2719 typename T,
2720 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
2721 type = 0>
2723 {
2724 return m_experimental;
2725 }
2726
2727 template<
2728 typename T,
2729 typename std::enable_if<
2730 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
2731 int>::type = 0>
2733 {
2734 return m_experimental.get<Settings2D::Processing::Color::Experimental::Mode>();
2735 }
2736
2737 template<
2738 typename T,
2739 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
2740 0>
2742 {
2743 return m_gamma;
2744 }
2745
2746 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2748 {
2749 return m_balance;
2750 }
2751
2752 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2754 {
2755 return m_experimental;
2756 }
2757
2758 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2760 {
2761 return m_gamma;
2762 }
2763
2765 template<typename F>
2766 void forEach(const F &f) const
2767 {
2768 f(m_balance);
2769 f(m_experimental);
2770 f(m_gamma);
2771 }
2772
2774 template<typename F>
2775 void forEach(const F &f)
2776 {
2777 f(m_balance);
2778 f(m_experimental);
2779 f(m_gamma);
2780 }
2781
2783 bool operator==(const Color &other) const;
2784
2786 bool operator!=(const Color &other) const;
2787
2789 std::string toString() const;
2790
2792 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
2793 {
2794 return stream << value.toString();
2795 }
2796
2797 private:
2798 void setFromString(const std::string &value);
2799
2800 void setFromString(const std::string &fullPath, const std::string &value);
2801
2802 std::string getString(const std::string &fullPath) const;
2803
2804 Balance m_balance;
2805 Experimental m_experimental;
2806 Gamma m_gamma;
2807
2808 friend struct DataModel::Detail::Befriend<Color>;
2809 };
2810
2811 using Descendants = std::tuple<
2820
2823
2842#ifndef NO_DOC
2843 template<
2844 typename... Args,
2845 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2846 typename std::enable_if<
2847 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2848 value,
2849 int>::type = 0>
2850#else
2851 template<typename... Args>
2852#endif
2853 explicit Processing(Args &&...args)
2854 {
2855 using namespace Zivid::Detail::TypeTraits;
2856
2857 static_assert(
2858 AllArgsDecayedAreUnique<Args...>::value,
2859 "Found duplicate types among the arguments passed to Processing(...). "
2860 "Types should be listed at most once.");
2861
2862 set(std::forward<Args>(args)...);
2863 }
2864
2882#ifndef NO_DOC
2883 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2884#else
2885 template<typename... Args>
2886#endif
2887 void set(Args &&...args)
2888 {
2889 using namespace Zivid::Detail::TypeTraits;
2890
2891 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2892 static_assert(
2893 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2894
2895 static_assert(
2896 AllArgsDecayedAreUnique<Args...>::value,
2897 "Found duplicate types among the arguments passed to set(...). "
2898 "Types should be listed at most once.");
2899
2900 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2901 }
2902
2921#ifndef NO_DOC
2922 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2923#else
2924 template<typename... Args>
2925#endif
2926 Processing copyWith(Args &&...args) const
2927 {
2928 using namespace Zivid::Detail::TypeTraits;
2929
2930 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2931 static_assert(
2932 AllArgsAreDescendantNodes::value,
2933 "All arguments passed to copyWith(...) must be descendant nodes.");
2934
2935 static_assert(
2936 AllArgsDecayedAreUnique<Args...>::value,
2937 "Found duplicate types among the arguments passed to copyWith(...). "
2938 "Types should be listed at most once.");
2939
2940 auto copy{ *this };
2941 copy.set(std::forward<Args>(args)...);
2942 return copy;
2943 }
2944
2946 const Color &color() const
2947 {
2948 return m_color;
2949 }
2950
2953 {
2954 return m_color;
2955 }
2956
2958 Processing &set(const Color &value)
2959 {
2960 m_color = value;
2961 return *this;
2962 }
2963
2966 {
2967 m_color.set(value);
2968 return *this;
2969 }
2970
2973 {
2974 m_color.set(value);
2975 return *this;
2976 }
2977
2980 {
2981 m_color.set(value);
2982 return *this;
2983 }
2984
2987 {
2988 m_color.set(value);
2989 return *this;
2990 }
2991
2994 {
2995 m_color.set(value);
2996 return *this;
2997 }
2998
3001 {
3002 m_color.set(value);
3003 return *this;
3004 }
3005
3008 {
3009 m_color.set(value);
3010 return *this;
3011 }
3012
3013 template<
3014 typename T,
3015 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
3017 {
3018 return m_color;
3019 }
3020
3021 template<
3022 typename T,
3023 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
3025 {
3027 }
3028
3029 template<
3030 typename T,
3031 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
3032 type = 0>
3034 {
3036 }
3037
3038 template<
3039 typename T,
3040 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
3041 type = 0>
3043 {
3045 }
3046
3047 template<
3048 typename T,
3049 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
3050 type = 0>
3052 {
3053 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
3054 }
3055
3056 template<
3057 typename T,
3058 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
3059 type = 0>
3061 {
3063 }
3064
3065 template<
3066 typename T,
3067 typename std::
3068 enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::type = 0>
3070 {
3072 }
3073
3074 template<
3075 typename T,
3076 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
3078 {
3079 return m_color.get<Settings2D::Processing::Color::Gamma>();
3080 }
3081
3082 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3084 {
3085 return m_color;
3086 }
3087
3089 template<typename F>
3090 void forEach(const F &f) const
3091 {
3092 f(m_color);
3093 }
3094
3096 template<typename F>
3097 void forEach(const F &f)
3098 {
3099 f(m_color);
3100 }
3101
3103 bool operator==(const Processing &other) const;
3104
3106 bool operator!=(const Processing &other) const;
3107
3109 std::string toString() const;
3110
3112 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
3113 {
3114 return stream << value.toString();
3115 }
3116
3117 private:
3118 void setFromString(const std::string &value);
3119
3120 void setFromString(const std::string &fullPath, const std::string &value);
3121
3122 std::string getString(const std::string &fullPath) const;
3123
3124 Color m_color;
3125
3126 friend struct DataModel::Detail::Befriend<Processing>;
3127 };
3128
3131
3132 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3134 {
3135 public:
3138
3140 static constexpr const char *path{ "Sampling" };
3141
3143 static constexpr const char *name{ "Sampling" };
3144
3146 static constexpr const char *description{ R"description(Sampling settings.
3147)description" };
3148
3166
3167 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3169 {
3170 public:
3173
3175 static constexpr const char *path{ "Sampling/Color" };
3176
3178 static constexpr const char *name{ "Color" };
3179
3181 static constexpr const char *description{ R"description(Choose how to sample colors for the 2D image.
3182
3183- `rgb` option gives an image with full colors.
3184- `grayscale` option gives a grayscale (r=g=b) image, which
3185 can be acquired faster than full colors.
3186- `rgbStrongAmbientLight` option gives an image with full colors and reduced
3187 color noise. This option should be chosen only for applications which
3188 suffer from high color noise and with high amounts of ambient light in the
3189 scene.
3190- `rgbAmbientSuppression` option gives an image with full colors while
3191 suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient
3192 light by default, and therefore do not need the additional option
3193 `rgbAmbientSuppression`.
3194
3195
3196The `grayscale`, `rgbStrongAmbientLight` and `rgbAmbientSuppression` options are not available on all camera models.
3197)description" };
3198
3200 enum class ValueType
3201 {
3206 };
3207 static const Color rgb;
3208 static const Color grayscale;
3211
3213 static std::set<ValueType> validValues()
3214 {
3215 return { ValueType::rgb,
3219 }
3220
3222 Color() = default;
3223
3225 explicit constexpr Color(ValueType value)
3226 : m_opt{ verifyValue(value) }
3227 {}
3228
3234
3236 bool hasValue() const;
3237
3239 void reset();
3240
3242 std::string toString() const;
3243
3245 friend std::ostream &operator<<(std::ostream &stream, const Color::ValueType &value)
3246 {
3247 return stream << Color{ value }.toString();
3248 }
3249
3251 bool operator==(const Color &other) const
3252 {
3253 return m_opt == other.m_opt;
3254 }
3255
3257 bool operator!=(const Color &other) const
3258 {
3259 return m_opt != other.m_opt;
3260 }
3261
3263 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
3264 {
3265 return stream << value.toString();
3266 }
3267
3268 private:
3269 void setFromString(const std::string &value);
3270
3271 constexpr ValueType static verifyValue(const ValueType &value)
3272 {
3273 return value == ValueType::rgb || value == ValueType::grayscale
3274 || value == ValueType::rgbStrongAmbientLight
3275 || value == ValueType::rgbAmbientSuppression
3276 ? value
3277 : throw std::invalid_argument{
3278 "Invalid value: Color{ "
3279 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
3280 };
3281 }
3282
3283 std::optional<ValueType> m_opt;
3284
3285 friend struct DataModel::Detail::Befriend<Color>;
3286 };
3287
3296
3297 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3299 {
3300 public:
3303
3305 static constexpr const char *path{ "Sampling/Interval" };
3306
3308 static constexpr const char *name{ "Interval" };
3309
3311 static constexpr const char *description{
3312 R"description(Sampling interval controls the interval between successive sensor operations (e.g.,
3313structured light pattern projection and image exposure), aligned to external
3314frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners
3315at 100 Hz). The requested interval is a target: the sensor operations will happen
3316at this rate if the it can fit the chosen exposure time plus some processing overhead.
3317Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple
3318(e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).
3319)description"
3320 };
3321
3326
3327 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3329 {
3330 public:
3333
3335 static constexpr const char *path{ "Sampling/Interval/Duration" };
3336
3338 static constexpr const char *name{ "Duration" };
3339
3341 static constexpr const char *description{
3342 R"description(Duration between successive sensor operations, in microseconds. The effective interval
3343might be rounded up to the nearest suitable integer multiple and will never be shorter
3344than exposure time plus some processing overhead.
3345)description"
3346 };
3347
3349 using ValueType = std::chrono::microseconds;
3350
3353 {
3354 return { std::chrono::microseconds{ 1000 }, std::chrono::microseconds{ 10000 } };
3355 }
3356
3358 Duration() = default;
3359
3361 explicit constexpr Duration(std::chrono::microseconds value)
3362 : m_opt{ verifyValue(value) }
3363 {}
3364
3369 std::chrono::microseconds value() const;
3370
3372 bool hasValue() const;
3373
3375 void reset();
3376
3378 std::string toString() const;
3379
3381 bool operator==(const Duration &other) const
3382 {
3383 return m_opt == other.m_opt;
3384 }
3385
3387 bool operator!=(const Duration &other) const
3388 {
3389 return m_opt != other.m_opt;
3390 }
3391
3393 bool operator<(const Duration &other) const
3394 {
3395 return m_opt < other.m_opt;
3396 }
3397
3399 bool operator>(const Duration &other) const
3400 {
3401 return m_opt > other.m_opt;
3402 }
3403
3405 bool operator<=(const Duration &other) const
3406 {
3407 return m_opt <= other.m_opt;
3408 }
3409
3411 bool operator>=(const Duration &other) const
3412 {
3413 return m_opt >= other.m_opt;
3414 }
3415
3417 friend std::ostream &operator<<(std::ostream &stream, const Duration &value)
3418 {
3419 return stream << value.toString();
3420 }
3421
3422 private:
3423 void setFromString(const std::string &value);
3424
3425 constexpr ValueType static verifyValue(const ValueType &value)
3426 {
3427 return validRange().isInRange(value)
3428 ? value
3429 : throw std::out_of_range{ "Duration{ " + std::to_string(value.count())
3430 + " } is not in range ["
3431 + std::to_string(validRange().min().count()) + ", "
3432 + std::to_string(validRange().max().count()) + "]" };
3433 }
3434
3435 std::optional<std::chrono::microseconds> m_opt;
3436
3437 friend struct DataModel::Detail::Befriend<Duration>;
3438 };
3439
3441
3442 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3444 {
3445 public:
3448
3450 static constexpr const char *path{ "Sampling/Interval/Enabled" };
3451
3453 static constexpr const char *name{ "Enabled" };
3454
3456 static constexpr const char *description{
3457 R"description(Enable or disable sampling interval.)description"
3458 };
3459
3461 using ValueType = bool;
3462 static const Enabled yes;
3463 static const Enabled no;
3464
3466 static std::set<bool> validValues()
3467 {
3468 return { false, true };
3469 }
3470
3472 Enabled() = default;
3473
3475 explicit constexpr Enabled(bool value)
3476 : m_opt{ value }
3477 {}
3478
3483 bool value() const;
3484
3486 bool hasValue() const;
3487
3489 void reset();
3490
3492 std::string toString() const;
3493
3495 bool operator==(const Enabled &other) const
3496 {
3497 return m_opt == other.m_opt;
3498 }
3499
3501 bool operator!=(const Enabled &other) const
3502 {
3503 return m_opt != other.m_opt;
3504 }
3505
3507 friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)
3508 {
3509 return stream << value.toString();
3510 }
3511
3512 private:
3513 void setFromString(const std::string &value);
3514
3515 std::optional<bool> m_opt;
3516
3517 friend struct DataModel::Detail::Befriend<Enabled>;
3518 };
3519
3521 std::tuple<Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled>;
3522
3525
3538#ifndef NO_DOC
3539 template<
3540 typename... Args,
3541 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3542 typename std::enable_if<
3543 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3544 value,
3545 int>::type = 0>
3546#else
3547 template<typename... Args>
3548#endif
3549 explicit Interval(Args &&...args)
3550 {
3551 using namespace Zivid::Detail::TypeTraits;
3552
3553 static_assert(
3554 AllArgsDecayedAreUnique<Args...>::value,
3555 "Found duplicate types among the arguments passed to Interval(...). "
3556 "Types should be listed at most once.");
3557
3558 set(std::forward<Args>(args)...);
3559 }
3560
3572#ifndef NO_DOC
3573 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3574#else
3575 template<typename... Args>
3576#endif
3577 void set(Args &&...args)
3578 {
3579 using namespace Zivid::Detail::TypeTraits;
3580
3581 using AllArgsAreDescendantNodes =
3582 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3583 static_assert(
3584 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3585
3586 static_assert(
3587 AllArgsDecayedAreUnique<Args...>::value,
3588 "Found duplicate types among the arguments passed to set(...). "
3589 "Types should be listed at most once.");
3590
3591 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3592 }
3593
3606#ifndef NO_DOC
3607 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3608#else
3609 template<typename... Args>
3610#endif
3611 Interval copyWith(Args &&...args) const
3612 {
3613 using namespace Zivid::Detail::TypeTraits;
3614
3615 using AllArgsAreDescendantNodes =
3616 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3617 static_assert(
3618 AllArgsAreDescendantNodes::value,
3619 "All arguments passed to copyWith(...) must be descendant nodes.");
3620
3621 static_assert(
3622 AllArgsDecayedAreUnique<Args...>::value,
3623 "Found duplicate types among the arguments passed to copyWith(...). "
3624 "Types should be listed at most once.");
3625
3626 auto copy{ *this };
3627 copy.set(std::forward<Args>(args)...);
3628 return copy;
3629 }
3630
3632 const Duration &duration() const
3633 {
3634 return m_duration;
3635 }
3636
3639 {
3640 return m_duration;
3641 }
3642
3644 Interval &set(const Duration &value)
3645 {
3646 m_duration = value;
3647 return *this;
3648 }
3649
3651 const Enabled &isEnabled() const
3652 {
3653 return m_enabled;
3654 }
3655
3658 {
3659 return m_enabled;
3660 }
3661
3663 Interval &set(const Enabled &value)
3664 {
3665 m_enabled = value;
3666 return *this;
3667 }
3668
3669 template<
3670 typename T,
3671 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::
3672 type = 0>
3674 {
3675 return m_duration;
3676 }
3677
3678 template<
3679 typename T,
3680 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::
3681 type = 0>
3683 {
3684 return m_enabled;
3685 }
3686
3687 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3689 {
3690 return m_duration;
3691 }
3692
3693 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3695 {
3696 return m_enabled;
3697 }
3698
3700 template<typename F>
3701 void forEach(const F &f) const
3702 {
3703 f(m_duration);
3704 f(m_enabled);
3705 }
3706
3708 template<typename F>
3709 void forEach(const F &f)
3710 {
3711 f(m_duration);
3712 f(m_enabled);
3713 }
3714
3716 bool operator==(const Interval &other) const;
3717
3719 bool operator!=(const Interval &other) const;
3720
3722 std::string toString() const;
3723
3725 friend std::ostream &operator<<(std::ostream &stream, const Interval &value)
3726 {
3727 return stream << value.toString();
3728 }
3729
3730 private:
3731 void setFromString(const std::string &value);
3732
3733 void setFromString(const std::string &fullPath, const std::string &value);
3734
3735 std::string getString(const std::string &fullPath) const;
3736
3737 Duration m_duration;
3738 Enabled m_enabled;
3739
3740 friend struct DataModel::Detail::Befriend<Interval>;
3741 };
3742
3746
3747 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3749 {
3750 public:
3753
3755 static constexpr const char *path{ "Sampling/Pixel" };
3756
3758 static constexpr const char *name{ "Pixel" };
3759
3761 static constexpr const char *description{
3762 R"description(Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampled.
3763When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.
3764)description"
3765 };
3766
3768 enum class ValueType
3769 {
3777 };
3778 static const Pixel all;
3780 static const Pixel redSubsample2x2;
3782 static const Pixel redSubsample4x4;
3783 static const Pixel by2x2;
3784 static const Pixel by4x4;
3785
3787 static std::set<ValueType> validValues()
3788 {
3789 return { ValueType::all,
3796 }
3797
3799 Pixel() = default;
3800
3802 explicit constexpr Pixel(ValueType value)
3803 : m_opt{ verifyValue(value) }
3804 {}
3805
3811
3813 bool hasValue() const;
3814
3816 void reset();
3817
3819 std::string toString() const;
3820
3822 friend std::ostream &operator<<(std::ostream &stream, const Pixel::ValueType &value)
3823 {
3824 return stream << Pixel{ value }.toString();
3825 }
3826
3828 bool operator==(const Pixel &other) const
3829 {
3830 return m_opt == other.m_opt;
3831 }
3832
3834 bool operator!=(const Pixel &other) const
3835 {
3836 return m_opt != other.m_opt;
3837 }
3838
3840 friend std::ostream &operator<<(std::ostream &stream, const Pixel &value)
3841 {
3842 return stream << value.toString();
3843 }
3844
3845 private:
3846 void setFromString(const std::string &value);
3847
3848 constexpr ValueType static verifyValue(const ValueType &value)
3849 {
3850 return value == ValueType::all || value == ValueType::blueSubsample2x2
3851 || value == ValueType::redSubsample2x2 || value == ValueType::blueSubsample4x4
3852 || value == ValueType::redSubsample4x4 || value == ValueType::by2x2
3853 || value == ValueType::by4x4
3854 ? value
3855 : throw std::invalid_argument{
3856 "Invalid value: Pixel{ "
3857 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
3858 };
3859 }
3860
3861 std::optional<ValueType> m_opt;
3862
3863 friend struct DataModel::Detail::Befriend<Pixel>;
3864 };
3865
3866 using Descendants = std::tuple<
3872
3875
3891#ifndef NO_DOC
3892 template<
3893 typename... Args,
3894 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3895 typename std::enable_if<
3896 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3897 value,
3898 int>::type = 0>
3899#else
3900 template<typename... Args>
3901#endif
3902 explicit Sampling(Args &&...args)
3903 {
3904 using namespace Zivid::Detail::TypeTraits;
3905
3906 static_assert(
3907 AllArgsDecayedAreUnique<Args...>::value,
3908 "Found duplicate types among the arguments passed to Sampling(...). "
3909 "Types should be listed at most once.");
3910
3911 set(std::forward<Args>(args)...);
3912 }
3913
3928#ifndef NO_DOC
3929 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3930#else
3931 template<typename... Args>
3932#endif
3933 void set(Args &&...args)
3934 {
3935 using namespace Zivid::Detail::TypeTraits;
3936
3937 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3938 static_assert(
3939 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3940
3941 static_assert(
3942 AllArgsDecayedAreUnique<Args...>::value,
3943 "Found duplicate types among the arguments passed to set(...). "
3944 "Types should be listed at most once.");
3945
3946 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3947 }
3948
3964#ifndef NO_DOC
3965 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3966#else
3967 template<typename... Args>
3968#endif
3969 Sampling copyWith(Args &&...args) const
3970 {
3971 using namespace Zivid::Detail::TypeTraits;
3972
3973 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3974 static_assert(
3975 AllArgsAreDescendantNodes::value,
3976 "All arguments passed to copyWith(...) must be descendant nodes.");
3977
3978 static_assert(
3979 AllArgsDecayedAreUnique<Args...>::value,
3980 "Found duplicate types among the arguments passed to copyWith(...). "
3981 "Types should be listed at most once.");
3982
3983 auto copy{ *this };
3984 copy.set(std::forward<Args>(args)...);
3985 return copy;
3986 }
3987
3989 const Color &color() const
3990 {
3991 return m_color;
3992 }
3993
3996 {
3997 return m_color;
3998 }
3999
4001 Sampling &set(const Color &value)
4002 {
4003 m_color = value;
4004 return *this;
4005 }
4006
4008 const Interval &interval() const
4009 {
4010 return m_interval;
4011 }
4012
4015 {
4016 return m_interval;
4017 }
4018
4020 Sampling &set(const Interval &value)
4021 {
4022 m_interval = value;
4023 return *this;
4024 }
4025
4028 {
4029 m_interval.set(value);
4030 return *this;
4031 }
4032
4035 {
4036 m_interval.set(value);
4037 return *this;
4038 }
4039
4041 const Pixel &pixel() const
4042 {
4043 return m_pixel;
4044 }
4045
4048 {
4049 return m_pixel;
4050 }
4051
4053 Sampling &set(const Pixel &value)
4054 {
4055 m_pixel = value;
4056 return *this;
4057 }
4058
4059 template<
4060 typename T,
4061 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
4063 {
4064 return m_color;
4065 }
4066
4067 template<
4068 typename T,
4069 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
4071 {
4072 return m_interval;
4073 }
4074
4075 template<
4076 typename T,
4077 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type =
4078 0>
4080 {
4081 return m_interval.get<Settings2D::Sampling::Interval::Duration>();
4082 }
4083
4084 template<
4085 typename T,
4086 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
4088 {
4089 return m_interval.get<Settings2D::Sampling::Interval::Enabled>();
4090 }
4091
4092 template<
4093 typename T,
4094 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
4096 {
4097 return m_pixel;
4098 }
4099
4100 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4102 {
4103 return m_color;
4104 }
4105
4106 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4108 {
4109 return m_interval;
4110 }
4111
4112 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4114 {
4115 return m_pixel;
4116 }
4117
4119 template<typename F>
4120 void forEach(const F &f) const
4121 {
4122 f(m_color);
4123 f(m_interval);
4124 f(m_pixel);
4125 }
4126
4128 template<typename F>
4129 void forEach(const F &f)
4130 {
4131 f(m_color);
4132 f(m_interval);
4133 f(m_pixel);
4134 }
4135
4137 bool operator==(const Sampling &other) const;
4138
4140 bool operator!=(const Sampling &other) const;
4141
4143 std::string toString() const;
4144
4146 friend std::ostream &operator<<(std::ostream &stream, const Sampling &value)
4147 {
4148 return stream << value.toString();
4149 }
4150
4151 private:
4152 void setFromString(const std::string &value);
4153
4154 void setFromString(const std::string &fullPath, const std::string &value);
4155
4156 std::string getString(const std::string &fullPath) const;
4157
4158 Color m_color;
4159 Interval m_interval;
4160 Pixel m_pixel;
4161
4162 friend struct DataModel::Detail::Befriend<Sampling>;
4163 };
4164
4165 using Descendants = std::tuple<
4184
4187
4189 explicit Settings2D(const std::string &fileName);
4190
4196 [[nodiscard]] static Settings2D fromSerialized(const std::string &value);
4197
4203 std::string serialize() const;
4204
4233#ifndef NO_DOC
4234 template<
4235 typename... Args,
4236 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
4237 typename std::enable_if<
4238 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
4239 int>::type = 0>
4240#else
4241 template<typename... Args>
4242#endif
4243 explicit Settings2D(Args &&...args)
4244 {
4245 using namespace Zivid::Detail::TypeTraits;
4246
4247 static_assert(
4248 AllArgsDecayedAreUnique<Args...>::value,
4249 "Found duplicate types among the arguments passed to Settings2D(...). "
4250 "Types should be listed at most once.");
4251
4252 set(std::forward<Args>(args)...);
4253 }
4254
4282#ifndef NO_DOC
4283 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
4284#else
4285 template<typename... Args>
4286#endif
4287 void set(Args &&...args)
4288 {
4289 using namespace Zivid::Detail::TypeTraits;
4290
4291 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4292 static_assert(
4293 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
4294
4295 static_assert(
4296 AllArgsDecayedAreUnique<Args...>::value,
4297 "Found duplicate types among the arguments passed to set(...). "
4298 "Types should be listed at most once.");
4299
4300 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4301 }
4302
4331#ifndef NO_DOC
4332 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4333#else
4334 template<typename... Args>
4335#endif
4336 Settings2D copyWith(Args &&...args) const
4337 {
4338 using namespace Zivid::Detail::TypeTraits;
4339
4340 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4341 static_assert(
4342 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
4343
4344 static_assert(
4345 AllArgsDecayedAreUnique<Args...>::value,
4346 "Found duplicate types among the arguments passed to copyWith(...). "
4347 "Types should be listed at most once.");
4348
4349 auto copy{ *this };
4350 copy.set(std::forward<Args>(args)...);
4351 return copy;
4352 }
4353
4356 {
4357 return m_acquisitions;
4358 }
4359
4362 {
4363 return m_acquisitions;
4364 }
4365
4368 {
4369 m_acquisitions = value;
4370 return *this;
4371 }
4372
4375 {
4376 return m_diagnostics;
4377 }
4378
4381 {
4382 return m_diagnostics;
4383 }
4384
4387 {
4388 m_diagnostics = value;
4389 return *this;
4390 }
4391
4394 {
4395 m_diagnostics.set(value);
4396 return *this;
4397 }
4398
4400 const Processing &processing() const
4401 {
4402 return m_processing;
4403 }
4404
4407 {
4408 return m_processing;
4409 }
4410
4413 {
4414 m_processing = value;
4415 return *this;
4416 }
4417
4420 {
4421 m_processing.set(value);
4422 return *this;
4423 }
4424
4427 {
4428 m_processing.set(value);
4429 return *this;
4430 }
4431
4434 {
4435 m_processing.set(value);
4436 return *this;
4437 }
4438
4441 {
4442 m_processing.set(value);
4443 return *this;
4444 }
4445
4448 {
4449 m_processing.set(value);
4450 return *this;
4451 }
4452
4455 {
4456 m_processing.set(value);
4457 return *this;
4458 }
4459
4462 {
4463 m_processing.set(value);
4464 return *this;
4465 }
4466
4469 {
4470 m_processing.set(value);
4471 return *this;
4472 }
4473
4475 const Sampling &sampling() const
4476 {
4477 return m_sampling;
4478 }
4479
4482 {
4483 return m_sampling;
4484 }
4485
4487 Settings2D &set(const Sampling &value)
4488 {
4489 m_sampling = value;
4490 return *this;
4491 }
4492
4495 {
4496 m_sampling.set(value);
4497 return *this;
4498 }
4499
4502 {
4503 m_sampling.set(value);
4504 return *this;
4505 }
4506
4509 {
4510 m_sampling.set(value);
4511 return *this;
4512 }
4513
4516 {
4517 m_sampling.set(value);
4518 return *this;
4519 }
4520
4523 {
4524 m_sampling.set(value);
4525 return *this;
4526 }
4527
4528 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
4530 {
4531 return m_acquisitions;
4532 }
4533
4534 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Diagnostics>::value, int>::type = 0>
4536 {
4537 return m_diagnostics;
4538 }
4539
4540 template<
4541 typename T,
4542 typename std::enable_if<std::is_same<T, Settings2D::Diagnostics::Enabled>::value, int>::type = 0>
4544 {
4545 return m_diagnostics.get<Settings2D::Diagnostics::Enabled>();
4546 }
4547
4548 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
4550 {
4551 return m_processing;
4552 }
4553
4554 template<
4555 typename T,
4556 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
4558 {
4559 return m_processing.get<Settings2D::Processing::Color>();
4560 }
4561
4562 template<
4563 typename T,
4564 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
4566 {
4567 return m_processing.get<Settings2D::Processing::Color::Balance>();
4568 }
4569
4570 template<
4571 typename T,
4572 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
4573 0>
4575 {
4576 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
4577 }
4578
4579 template<
4580 typename T,
4581 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
4582 0>
4584 {
4585 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
4586 }
4587
4588 template<
4589 typename T,
4590 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
4592 {
4593 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
4594 }
4595
4596 template<
4597 typename T,
4598 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::type = 0>
4600 {
4601 return m_processing.get<Settings2D::Processing::Color::Experimental>();
4602 }
4603
4604 template<
4605 typename T,
4606 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::
4607 type = 0>
4609 {
4610 return m_processing.get<Settings2D::Processing::Color::Experimental::Mode>();
4611 }
4612
4613 template<
4614 typename T,
4615 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
4617 {
4618 return m_processing.get<Settings2D::Processing::Color::Gamma>();
4619 }
4620
4621 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Sampling>::value, int>::type = 0>
4623 {
4624 return m_sampling;
4625 }
4626
4627 template<
4628 typename T,
4629 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
4631 {
4632 return m_sampling.get<Settings2D::Sampling::Color>();
4633 }
4634
4635 template<
4636 typename T,
4637 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
4639 {
4640 return m_sampling.get<Settings2D::Sampling::Interval>();
4641 }
4642
4643 template<
4644 typename T,
4645 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type = 0>
4647 {
4648 return m_sampling.get<Settings2D::Sampling::Interval::Duration>();
4649 }
4650
4651 template<
4652 typename T,
4653 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
4655 {
4656 return m_sampling.get<Settings2D::Sampling::Interval::Enabled>();
4657 }
4658
4659 template<
4660 typename T,
4661 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
4663 {
4664 return m_sampling.get<Settings2D::Sampling::Pixel>();
4665 }
4666
4667 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4669 {
4670 return m_acquisitions;
4671 }
4672
4673 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4675 {
4676 return m_diagnostics;
4677 }
4678
4679 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4681 {
4682 return m_processing;
4683 }
4684
4685 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
4687 {
4688 return m_sampling;
4689 }
4690
4692 template<typename F>
4693 void forEach(const F &f) const
4694 {
4695 f(m_acquisitions);
4696 f(m_diagnostics);
4697 f(m_processing);
4698 f(m_sampling);
4699 }
4700
4702 template<typename F>
4703 void forEach(const F &f)
4704 {
4705 f(m_acquisitions);
4706 f(m_diagnostics);
4707 f(m_processing);
4708 f(m_sampling);
4709 }
4710
4712 bool operator==(const Settings2D &other) const;
4713
4715 bool operator!=(const Settings2D &other) const;
4716
4718 std::string toString() const;
4719
4721 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
4722 {
4723 return stream << value.toString();
4724 }
4725
4727 void save(const std::string &fileName) const;
4728
4730 void load(const std::string &fileName);
4731
4732 private:
4733 void setFromString(const std::string &value);
4734
4735 void setFromString(const std::string &fullPath, const std::string &value);
4736
4737 std::string getString(const std::string &fullPath) const;
4738
4739 Acquisitions m_acquisitions;
4740 Diagnostics m_diagnostics;
4741 Processing m_processing;
4742 Sampling m_sampling;
4743
4744 friend struct DataModel::Detail::Befriend<Settings2D>;
4745 };
4746
4747#ifndef NO_DOC
4748 template<>
4749 struct Settings2D::Version<9>
4750 {
4751 using Type = Settings2D;
4752 };
4753#endif
4754
4755} // namespace Zivid
4756
4757#ifndef NO_DOC
4759namespace Zivid::Detail
4760{
4761
4762 ZIVID_CORE_EXPORT void save(const Zivid::Settings2D &dataModel, std::ostream &ostream);
4763 ZIVID_CORE_EXPORT void load(Zivid::Settings2D &dataModel, std::istream &istream);
4764
4765} // namespace Zivid::Detail
4766#endif
4767
4768#ifdef _MSC_VER
4769# pragma warning(pop)
4770#endif
4771
4772#ifndef NO_DOC
4773# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
4774namespace std // NOLINT
4775{
4776
4777 template<>
4778 struct tuple_size<Zivid::Settings2D::Diagnostics> : integral_constant<size_t, 1>
4779 {};
4780
4781 template<size_t i>
4782 struct tuple_element<i, Zivid::Settings2D::Diagnostics>
4783 {
4784 static_assert(i < tuple_size<Zivid::Settings2D::Diagnostics>::value, "Index must be less than 1");
4785
4786 using type // NOLINT
4787 = decltype(declval<Zivid::Settings2D::Diagnostics>().get<i>());
4788 };
4789
4790 template<>
4791 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
4792 {};
4793
4794 template<size_t i>
4795 struct tuple_element<i, Zivid::Settings2D::Processing>
4796 {
4797 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
4798
4799 using type // NOLINT
4800 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
4801 };
4802
4803 template<>
4804 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 3>
4805 {};
4806
4807 template<size_t i>
4808 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
4809 {
4810 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 3");
4811
4812 using type // NOLINT
4813 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
4814 };
4815
4816 template<>
4817 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
4818 {};
4819
4820 template<size_t i>
4821 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
4822 {
4823 static_assert(
4824 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
4825 "Index must be less than 3");
4826
4827 using type // NOLINT
4828 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
4829 };
4830
4831 template<>
4832 struct tuple_size<Zivid::Settings2D::Processing::Color::Experimental> : integral_constant<size_t, 1>
4833 {};
4834
4835 template<size_t i>
4836 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Experimental>
4837 {
4838 static_assert(
4839 i < tuple_size<Zivid::Settings2D::Processing::Color::Experimental>::value,
4840 "Index must be less than 1");
4841
4842 using type // NOLINT
4843 = decltype(declval<Zivid::Settings2D::Processing::Color::Experimental>().get<i>());
4844 };
4845
4846 template<>
4847 struct tuple_size<Zivid::Settings2D::Sampling> : integral_constant<size_t, 3>
4848 {};
4849
4850 template<size_t i>
4851 struct tuple_element<i, Zivid::Settings2D::Sampling>
4852 {
4853 static_assert(i < tuple_size<Zivid::Settings2D::Sampling>::value, "Index must be less than 3");
4854
4855 using type // NOLINT
4856 = decltype(declval<Zivid::Settings2D::Sampling>().get<i>());
4857 };
4858
4859 template<>
4860 struct tuple_size<Zivid::Settings2D::Sampling::Interval> : integral_constant<size_t, 2>
4861 {};
4862
4863 template<size_t i>
4864 struct tuple_element<i, Zivid::Settings2D::Sampling::Interval>
4865 {
4866 static_assert(i < tuple_size<Zivid::Settings2D::Sampling::Interval>::value, "Index must be less than 2");
4867
4868 using type // NOLINT
4869 = decltype(declval<Zivid::Settings2D::Sampling::Interval>().get<i>());
4870 };
4871
4872 template<>
4873 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 4>
4874 {};
4875
4876 template<size_t i>
4877 struct tuple_element<i, Zivid::Settings2D>
4878 {
4879 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 4");
4880
4881 using type // NOLINT
4882 = decltype(declval<Zivid::Settings2D>().get<i>());
4883 };
4884
4885} // namespace std
4886# endif
4887#endif
4888
4889// If we have access to the DataModel library, automatically include internal DataModel
4890// header. This header is necessary for serialization and deserialization.
4891#if defined(__has_include) && !defined(NO_DOC)
4892# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
4893# include "Zivid/Settings2DInternal.h"
4894# endif
4895#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
This setting controls how the color image is computed.
Definition Settings2D.h:2055
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2061
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2058
friend std::ostream & operator<<(std::ostream &stream, const Mode &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2142
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2064
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2067
static const Mode toneMapping
toneMapping
Definition Settings2D.h:2092
bool operator==(const Mode &other) const
Comparison operator.
Definition Settings2D.h:2130
static const Mode automatic
automatic
Definition Settings2D.h:2091
bool operator!=(const Mode &other) const
Comparison operator.
Definition Settings2D.h:2136
void reset()
Reset the node to unset state.
constexpr Mode(ValueType value)
Constructor.
Definition Settings2D.h:2104
bool hasValue() const
Check if the value is set.
static std::set< ValueType > validValues()
All valid values of Mode.
Definition Settings2D.h:2095
friend std::ostream & operator<<(std::ostream &stream, const Mode::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:2124
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition Settings2D.h:2087
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:2318
Mode & mode()
Get Mode.
Definition Settings2D.h:2281
const Mode & mode() const
Get Mode.
Definition Settings2D.h:2275
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
friend std::ostream & operator<<(std::ostream &stream, const Experimental &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2333
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:2311
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2220
std::tuple< Settings2D::Processing::Color::Experimental::Mode > Descendants
Definition Settings2D.h:2166
std::string toString() const
Get the value as string.
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:2298
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:2287
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:2254
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition Settings2D.h:2356
double ValueType
The type of the underlying value.
Definition Settings2D.h:2375
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2359
static constexpr Range< double > validRange()
The range of valid values for Gamma.
Definition Settings2D.h:2378
bool operator>(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2425
bool operator==(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2407
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2443
bool operator!=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2413
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2368
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:2419
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2365
void reset()
Reset the node to unset state.
bool operator>=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2437
constexpr Gamma(double value)
Constructor.
Definition Settings2D.h:2387
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2362
Gamma()=default
Default constructor.
bool operator<=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2431
double value() const
Get the value.
Color settings.
Definition Settings2D.h:1380
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2538
Color & set(const Balance::Green &value)
Set Balance::Green.
Definition Settings2D.h:2624
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:2638
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:2598
Color & set(const Balance::Blue &value)
Set Balance::Blue.
Definition Settings2D.h:2617
Balance & balance()
Get Balance.
Definition Settings2D.h:2604
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:2766
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2792
Experimental & experimental()
Get Experimental.
Definition Settings2D.h:2644
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:2732
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:2741
Color & set(const Experimental::Mode &value)
Set Experimental::Mode.
Definition Settings2D.h:2657
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:2704
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1389
Gamma & gamma()
Get Gamma.
Definition Settings2D.h:2670
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1383
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:2713
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:2722
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:2577
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:2686
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::Mode, Settings2D::Processing::Color::Gamma > Descendants
Definition Settings2D.h:2465
const Gamma & gamma() const
Get Gamma.
Definition Settings2D.h:2664
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:2695
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1392
Color & set(const Balance &value)
Set Balance.
Definition Settings2D.h:2610
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2775
Color & set(const Gamma &value)
Set Gamma.
Definition Settings2D.h:2676
Color & set(const Experimental &value)
Set Experimental.
Definition Settings2D.h:2650
Color & set(const Balance::Red &value)
Set Balance::Red.
Definition Settings2D.h:2631
2D processing settings.
Definition Settings2D.h:1362
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:3016
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:3007
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:2958
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:2993
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:3024
Processing & set(const Color::Experimental::Mode &value)
Set Color::Experimental::Mode.
Definition Settings2D.h:3000
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3112
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:3060
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:3090
Color & color()
Get Color.
Definition Settings2D.h:2952
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2887
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::Mode, Settings2D::Processing::Color::Gamma > Descendants
Definition Settings2D.h:2811
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue.
Definition Settings2D.h:2972
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:3069
Processing & set(const Color::Balance &value)
Set Color::Balance.
Definition Settings2D.h:2965
const Color & color() const
Get Color.
Definition Settings2D.h:2946
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red.
Definition Settings2D.h:2986
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:3077
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:3051
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:2926
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:3033
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:3042
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:3097
Processing()
Default constructor.
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green.
Definition Settings2D.h:2979
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:3169
ValueType
The type of the underlying value.
Definition Settings2D.h:3201
@ grayscale
Definition Settings2D.h:3203
@ rgbStrongAmbientLight
Definition Settings2D.h:3204
@ rgbAmbientSuppression
Definition Settings2D.h:3205
Color()=default
Default constructor.
void reset()
Reset the node to unset state.
static const Color grayscale
grayscale
Definition Settings2D.h:3208
static std::set< ValueType > validValues()
All valid values of Color.
Definition Settings2D.h:3213
static const Color rgbAmbientSuppression
rgbAmbientSuppression
Definition Settings2D.h:3210
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3172
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:3263
constexpr Color(ValueType value)
Constructor.
Definition Settings2D.h:3225
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3181
bool hasValue() const
Check if the value is set.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3175
static const Color rgb
rgb
Definition Settings2D.h:3207
bool operator==(const Color &other) const
Comparison operator.
Definition Settings2D.h:3251
bool operator!=(const Color &other) const
Comparison operator.
Definition Settings2D.h:3257
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3178
std::string toString() const
Get the value as string.
static const Color rgbStrongAmbientLight
rgbStrongAmbientLight
Definition Settings2D.h:3209
friend std::ostream & operator<<(std::ostream &stream, const Color::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:3245
Duration between successive sensor operations, in microseconds. The effective interval might be round...
Definition Settings2D.h:3329
friend std::ostream & operator<<(std::ostream &stream, const Duration &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3417
std::chrono::microseconds ValueType
The type of the underlying value.
Definition Settings2D.h:3349
bool operator<(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3393
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3338
bool operator==(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3381
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:3399
Duration()=default
Default constructor.
bool operator!=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3387
constexpr Duration(std::chrono::microseconds value)
Constructor.
Definition Settings2D.h:3361
bool operator>=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3411
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3335
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for Duration.
Definition Settings2D.h:3352
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3332
bool operator<=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3405
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3341
bool hasValue() const
Check if the value is set.
Enable or disable sampling interval.
Definition Settings2D.h:3444
static const Enabled no
Off/disabled.
Definition Settings2D.h:3463
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3447
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3456
Enabled()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3450
bool operator==(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3495
void reset()
Reset the node to unset state.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3453
constexpr Enabled(bool value)
Constructor.
Definition Settings2D.h:3475
std::string toString() const
Get the value as string.
static std::set< bool > validValues()
All valid values of Enabled.
Definition Settings2D.h:3466
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:3507
static const Enabled yes
On/enabled.
Definition Settings2D.h:3462
bool ValueType
The type of the underlying value.
Definition Settings2D.h:3461
bool operator!=(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3501
Sampling interval controls the interval between successive sensor operations (e.g....
Definition Settings2D.h:3299
friend std::ostream & operator<<(std::ostream &stream, const Interval &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3725
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3311
Enabled & isEnabled()
Get Enabled.
Definition Settings2D.h:3657
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3305
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:3611
bool operator==(const Interval &other) const
Equality operator.
Interval & set(const Duration &value)
Set Duration.
Definition Settings2D.h:3644
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3709
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:3701
Duration & duration()
Get Duration.
Definition Settings2D.h:3638
std::tuple< Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled > Descendants
Definition Settings2D.h:3520
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:3682
bool operator!=(const Interval &other) const
Inequality operator.
const Duration & duration() const
Get Duration.
Definition Settings2D.h:3632
Interval & set(const Enabled &value)
Set Enabled.
Definition Settings2D.h:3663
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3308
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3302
const Enabled & isEnabled() const
Get Enabled.
Definition Settings2D.h:3651
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3577
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:3673
Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampl...
Definition Settings2D.h:3749
static const Pixel redSubsample4x4
redSubsample4x4
Definition Settings2D.h:3782
static const Pixel by2x2
by2x2
Definition Settings2D.h:3783
Pixel()=default
Default constructor.
constexpr Pixel(ValueType value)
Constructor.
Definition Settings2D.h:3802
ValueType
The type of the underlying value.
Definition Settings2D.h:3769
@ by4x4
Definition Settings2D.h:3776
@ redSubsample2x2
Definition Settings2D.h:3772
@ blueSubsample4x4
Definition Settings2D.h:3773
@ blueSubsample2x2
Definition Settings2D.h:3771
@ by2x2
Definition Settings2D.h:3775
@ redSubsample4x4
Definition Settings2D.h:3774
static const Pixel by4x4
by4x4
Definition Settings2D.h:3784
bool operator!=(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:3834
ValueType value() const
Get the value.
bool operator==(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:3828
static const Pixel redSubsample2x2
redSubsample2x2
Definition Settings2D.h:3780
static const Pixel all
all
Definition Settings2D.h:3778
static std::set< ValueType > validValues()
All valid values of Pixel.
Definition Settings2D.h:3787
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3758
std::string toString() const
Get the value as string.
static const Pixel blueSubsample2x2
blueSubsample2x2
Definition Settings2D.h:3779
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3752
friend std::ostream & operator<<(std::ostream &stream, const Pixel::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:3822
friend std::ostream & operator<<(std::ostream &stream, const Pixel &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3840
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3761
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3755
void reset()
Reset the node to unset state.
static const Pixel blueSubsample4x4
blueSubsample4x4
Definition Settings2D.h:3781
bool hasValue() const
Check if the value is set.
Sampling settings.
Definition Settings2D.h:3134
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:4129
bool operator==(const Sampling &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3933
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:4079
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3137
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:4095
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:4087
Sampling & set(const Interval::Enabled &value)
Set Interval::Enabled.
Definition Settings2D.h:4034
Sampling & set(const Pixel &value)
Set Pixel.
Definition Settings2D.h:4053
const Pixel & pixel() const
Get Pixel.
Definition Settings2D.h:4041
Pixel & pixel()
Get Pixel.
Definition Settings2D.h:4047
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3140
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:4120
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:4062
friend std::ostream & operator<<(std::ostream &stream, const Sampling &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:4146
bool operator!=(const Sampling &other) const
Inequality operator.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3146
Sampling & set(const Interval::Duration &value)
Set Interval::Duration.
Definition Settings2D.h:4027
const Color & color() const
Get Color.
Definition Settings2D.h:3989
Sampling & set(const Interval &value)
Set Interval.
Definition Settings2D.h:4020
Sampling & set(const Color &value)
Set Color.
Definition Settings2D.h:4001
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:3969
Color & color()
Get Color.
Definition Settings2D.h:3995
const Interval & interval() const
Get Interval.
Definition Settings2D.h:4008
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:4070
Interval & interval()
Get Interval.
Definition Settings2D.h:4014
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:3866
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3143
Settings used when capturing 2D images with a Zivid camera.
Definition Settings2D.h:79
Settings2D & set(const Processing &value)
Set Processing.
Definition Settings2D.h:4412
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:4662
static constexpr size_t version
Definition Settings2D.h:95
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:4557
Settings2D & set(const Sampling::Interval::Enabled &value)
Set Sampling::Interval::Enabled.
Definition Settings2D.h:4515
Sampling & sampling()
Get Sampling.
Definition Settings2D.h:4481
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:4630
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:4591
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:4583
Settings2D & set(const Sampling::Color &value)
Set Sampling::Color.
Definition Settings2D.h:4494
const Settings2D::Diagnostics::Enabled & get() const
Definition Settings2D.h:4543
const Diagnostics & diagnostics() const
Get Diagnostics.
Definition Settings2D.h:4374
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:4574
const Acquisitions & acquisitions() const
Get Acquisitions.
Definition Settings2D.h:4355
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:4703
Settings2D & set(const Diagnostics::Enabled &value)
Set Diagnostics::Enabled.
Definition Settings2D.h:4393
Settings2D & set(const Sampling::Interval &value)
Set Sampling::Interval.
Definition Settings2D.h:4501
Diagnostics & diagnostics()
Get Diagnostics.
Definition Settings2D.h:4380
Settings2D & set(const Sampling &value)
Set Sampling.
Definition Settings2D.h:4487
Settings2D(Args &&...args)
Constructor taking variadic number of arguments.
Definition Settings2D.h:4243
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:4638
const Settings2D::Diagnostics & get() const
Definition Settings2D.h:4535
const Settings2D::Acquisitions & get() const
Definition Settings2D.h:4529
Settings2D()
Default constructor.
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:4616
Settings2D & set(const Acquisitions &value)
Set Acquisitions.
Definition Settings2D.h:4367
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:4508
const Settings2D::Sampling & get() const
Definition Settings2D.h:4622
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:4646
void load(const std::string &fileName)
Load from the given file.
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:4565
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green.
Definition Settings2D.h:4440
bool operator!=(const Settings2D &other) const
Inequality operator.
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance.
Definition Settings2D.h:4426
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:4599
const Settings2D::Processing & get() const
Definition Settings2D.h:4549
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:4447
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:4287
Processing & processing()
Get Processing.
Definition Settings2D.h:4406
const Processing & processing() const
Get Processing.
Definition Settings2D.h:4400
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::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:4165
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:4336
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue.
Definition Settings2D.h:4433
Settings2D & set(const Processing::Color::Experimental::Mode &value)
Set Processing::Color::Experimental::Mode.
Definition Settings2D.h:4461
Acquisitions & acquisitions()
Get Acquisitions.
Definition Settings2D.h:4361
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:4454
Settings2D & set(const Sampling::Pixel &value)
Set Sampling::Pixel.
Definition Settings2D.h:4522
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:4693
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:4654
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:4608
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:4475
Settings2D & set(const Diagnostics &value)
Set Diagnostics.
Definition Settings2D.h:4386
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:4721
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:4419
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma.
Definition Settings2D.h:4468
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