Zivid C++ API 2.17.1+7516d437-1
Settings2D.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2025 (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{ 8 };
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
1070
1071 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1073 {
1074 public:
1077
1079 static constexpr const char *path{ "Processing" };
1080
1082 static constexpr const char *name{ "Processing" };
1083
1085 static constexpr const char *description{ R"description(2D processing settings.)description" };
1086
1088
1089 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1091 {
1092 public:
1095
1097 static constexpr const char *path{ "Processing/Color" };
1098
1100 static constexpr const char *name{ "Color" };
1101
1103 static constexpr const char *description{ R"description(Color settings.)description" };
1104
1106
1107 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1109 {
1110 public:
1113
1115 static constexpr const char *path{ "Processing/Color/Balance" };
1116
1118 static constexpr const char *name{ "Balance" };
1119
1121 static constexpr const char *description{ R"description(Color balance settings.)description" };
1122
1124
1125 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1127 {
1128 public:
1131
1133 static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1134
1136 static constexpr const char *name{ "Blue" };
1137
1139 static constexpr const char *description{
1140 R"description(Digital gain applied to blue channel.)description"
1141 };
1142
1144 using ValueType = double;
1145
1147 static constexpr Range<double> validRange()
1148 {
1149 return { 1.0, 8.0 };
1150 }
1151
1153 Blue() = default;
1154
1156 explicit constexpr Blue(double value)
1157 : m_opt{ verifyValue(value) }
1158 {}
1159
1164 double value() const;
1165
1167 bool hasValue() const;
1168
1170 void reset();
1171
1173 std::string toString() const;
1174
1176 bool operator==(const Blue &other) const
1177 {
1178 return m_opt == other.m_opt;
1179 }
1180
1182 bool operator!=(const Blue &other) const
1183 {
1184 return m_opt != other.m_opt;
1185 }
1186
1188 bool operator<(const Blue &other) const
1189 {
1190 return m_opt < other.m_opt;
1191 }
1192
1194 bool operator>(const Blue &other) const
1195 {
1196 return m_opt > other.m_opt;
1197 }
1198
1200 bool operator<=(const Blue &other) const
1201 {
1202 return m_opt <= other.m_opt;
1203 }
1204
1206 bool operator>=(const Blue &other) const
1207 {
1208 return m_opt >= other.m_opt;
1209 }
1210
1212 friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1213 {
1214 return stream << value.toString();
1215 }
1216
1217 private:
1218 void setFromString(const std::string &value);
1219
1220 constexpr ValueType static verifyValue(const ValueType &value)
1221 {
1222 return validRange().isInRange(value)
1223 ? value
1224 : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1225 + " } is not in range ["
1226 + std::to_string(validRange().min()) + ", "
1227 + std::to_string(validRange().max()) + "]" };
1228 }
1229
1230 std::optional<double> m_opt;
1231
1232 friend struct DataModel::Detail::Befriend<Blue>;
1233 };
1234
1236
1237 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1239 {
1240 public:
1243
1245 static constexpr const char *path{ "Processing/Color/Balance/Green" };
1246
1248 static constexpr const char *name{ "Green" };
1249
1251 static constexpr const char *description{
1252 R"description(Digital gain applied to green channel.)description"
1253 };
1254
1256 using ValueType = double;
1257
1259 static constexpr Range<double> validRange()
1260 {
1261 return { 1.0, 8.0 };
1262 }
1263
1265 Green() = default;
1266
1268 explicit constexpr Green(double value)
1269 : m_opt{ verifyValue(value) }
1270 {}
1271
1276 double value() const;
1277
1279 bool hasValue() const;
1280
1282 void reset();
1283
1285 std::string toString() const;
1286
1288 bool operator==(const Green &other) const
1289 {
1290 return m_opt == other.m_opt;
1291 }
1292
1294 bool operator!=(const Green &other) const
1295 {
1296 return m_opt != other.m_opt;
1297 }
1298
1300 bool operator<(const Green &other) const
1301 {
1302 return m_opt < other.m_opt;
1303 }
1304
1306 bool operator>(const Green &other) const
1307 {
1308 return m_opt > other.m_opt;
1309 }
1310
1312 bool operator<=(const Green &other) const
1313 {
1314 return m_opt <= other.m_opt;
1315 }
1316
1318 bool operator>=(const Green &other) const
1319 {
1320 return m_opt >= other.m_opt;
1321 }
1322
1324 friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1325 {
1326 return stream << value.toString();
1327 }
1328
1329 private:
1330 void setFromString(const std::string &value);
1331
1332 constexpr ValueType static verifyValue(const ValueType &value)
1333 {
1334 return validRange().isInRange(value)
1335 ? value
1336 : throw std::out_of_range{ "Green{ " + std::to_string(value)
1337 + " } is not in range ["
1338 + std::to_string(validRange().min()) + ", "
1339 + std::to_string(validRange().max()) + "]" };
1340 }
1341
1342 std::optional<double> m_opt;
1343
1344 friend struct DataModel::Detail::Befriend<Green>;
1345 };
1346
1348
1349 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1351 {
1352 public:
1355
1357 static constexpr const char *path{ "Processing/Color/Balance/Red" };
1358
1360 static constexpr const char *name{ "Red" };
1361
1363 static constexpr const char *description{
1364 R"description(Digital gain applied to red channel.)description"
1365 };
1366
1368 using ValueType = double;
1369
1371 static constexpr Range<double> validRange()
1372 {
1373 return { 1.0, 8.0 };
1374 }
1375
1377 Red() = default;
1378
1380 explicit constexpr Red(double value)
1381 : m_opt{ verifyValue(value) }
1382 {}
1383
1388 double value() const;
1389
1391 bool hasValue() const;
1392
1394 void reset();
1395
1397 std::string toString() const;
1398
1400 bool operator==(const Red &other) const
1401 {
1402 return m_opt == other.m_opt;
1403 }
1404
1406 bool operator!=(const Red &other) const
1407 {
1408 return m_opt != other.m_opt;
1409 }
1410
1412 bool operator<(const Red &other) const
1413 {
1414 return m_opt < other.m_opt;
1415 }
1416
1418 bool operator>(const Red &other) const
1419 {
1420 return m_opt > other.m_opt;
1421 }
1422
1424 bool operator<=(const Red &other) const
1425 {
1426 return m_opt <= other.m_opt;
1427 }
1428
1430 bool operator>=(const Red &other) const
1431 {
1432 return m_opt >= other.m_opt;
1433 }
1434
1436 friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1437 {
1438 return stream << value.toString();
1439 }
1440
1441 private:
1442 void setFromString(const std::string &value);
1443
1444 constexpr ValueType static verifyValue(const ValueType &value)
1445 {
1446 return validRange().isInRange(value)
1447 ? value
1448 : throw std::out_of_range{ "Red{ " + std::to_string(value)
1449 + " } is not in range ["
1450 + std::to_string(validRange().min()) + ", "
1451 + std::to_string(validRange().max()) + "]" };
1452 }
1453
1454 std::optional<double> m_opt;
1455
1456 friend struct DataModel::Detail::Befriend<Red>;
1457 };
1458
1459 using Descendants = std::tuple<
1463
1466
1480#ifndef NO_DOC
1481 template<
1482 typename... Args,
1483 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1484 typename std::enable_if<
1485 Zivid::Detail::TypeTraits::
1486 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1487 int>::type = 0>
1488#else
1489 template<typename... Args>
1490#endif
1491 explicit Balance(Args &&...args)
1492 {
1493 using namespace Zivid::Detail::TypeTraits;
1494
1495 static_assert(
1496 AllArgsDecayedAreUnique<Args...>::value,
1497 "Found duplicate types among the arguments passed to Balance(...). "
1498 "Types should be listed at most once.");
1499
1500 set(std::forward<Args>(args)...);
1501 }
1502
1515#ifndef NO_DOC
1516 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1517#else
1518 template<typename... Args>
1519#endif
1520 void set(Args &&...args)
1521 {
1522 using namespace Zivid::Detail::TypeTraits;
1523
1524 using AllArgsAreDescendantNodes =
1525 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1526 static_assert(
1527 AllArgsAreDescendantNodes::value,
1528 "All arguments passed to set(...) must be descendant nodes.");
1529
1530 static_assert(
1531 AllArgsDecayedAreUnique<Args...>::value,
1532 "Found duplicate types among the arguments passed to set(...). "
1533 "Types should be listed at most once.");
1534
1535 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1536 }
1537
1551#ifndef NO_DOC
1552 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1553#else
1554 template<typename... Args>
1555#endif
1556 Balance copyWith(Args &&...args) const
1557 {
1558 using namespace Zivid::Detail::TypeTraits;
1559
1560 using AllArgsAreDescendantNodes =
1561 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1562 static_assert(
1563 AllArgsAreDescendantNodes::value,
1564 "All arguments passed to copyWith(...) must be descendant nodes.");
1565
1566 static_assert(
1567 AllArgsDecayedAreUnique<Args...>::value,
1568 "Found duplicate types among the arguments passed to copyWith(...). "
1569 "Types should be listed at most once.");
1570
1571 auto copy{ *this };
1572 copy.set(std::forward<Args>(args)...);
1573 return copy;
1574 }
1575
1577 const Blue &blue() const
1578 {
1579 return m_blue;
1580 }
1581
1584 {
1585 return m_blue;
1586 }
1587
1589 Balance &set(const Blue &value)
1590 {
1591 m_blue = value;
1592 return *this;
1593 }
1594
1596 const Green &green() const
1597 {
1598 return m_green;
1599 }
1600
1603 {
1604 return m_green;
1605 }
1606
1608 Balance &set(const Green &value)
1609 {
1610 m_green = value;
1611 return *this;
1612 }
1613
1615 const Red &red() const
1616 {
1617 return m_red;
1618 }
1619
1622 {
1623 return m_red;
1624 }
1625
1627 Balance &set(const Red &value)
1628 {
1629 m_red = value;
1630 return *this;
1631 }
1632
1633 template<
1634 typename T,
1635 typename std::enable_if<
1636 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1637 int>::type = 0>
1639 {
1640 return m_blue;
1641 }
1642
1643 template<
1644 typename T,
1645 typename std::enable_if<
1646 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1647 int>::type = 0>
1649 {
1650 return m_green;
1651 }
1652
1653 template<
1654 typename T,
1655 typename std::enable_if<
1656 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1657 int>::type = 0>
1659 {
1660 return m_red;
1661 }
1662
1663 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1665 {
1666 return m_blue;
1667 }
1668
1669 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1671 {
1672 return m_green;
1673 }
1674
1675 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1677 {
1678 return m_red;
1679 }
1680
1682 template<typename F>
1683 void forEach(const F &f) const
1684 {
1685 f(m_blue);
1686 f(m_green);
1687 f(m_red);
1688 }
1689
1691 template<typename F>
1692 void forEach(const F &f)
1693 {
1694 f(m_blue);
1695 f(m_green);
1696 f(m_red);
1697 }
1698
1700 bool operator==(const Balance &other) const;
1701
1703 bool operator!=(const Balance &other) const;
1704
1706 std::string toString() const;
1707
1709 friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1710 {
1711 return stream << value.toString();
1712 }
1713
1714 private:
1715 void setFromString(const std::string &value);
1716
1717 void setFromString(const std::string &fullPath, const std::string &value);
1718
1719 std::string getString(const std::string &fullPath) const;
1720
1721 Blue m_blue;
1722 Green m_green;
1723 Red m_red;
1724
1725 friend struct DataModel::Detail::Befriend<Balance>;
1726 };
1727
1729
1730 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1732 {
1733 public:
1736
1738 static constexpr const char *path{ "Processing/Color/Experimental" };
1739
1741 static constexpr const char *name{ "Experimental" };
1742
1744 static constexpr const char *description{
1745 R"description(Experimental color settings. These may be renamed, moved or deleted in the future.)description"
1746 };
1747
1763
1764 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1766 {
1767 public:
1770
1772 static constexpr const char *path{ "Processing/Color/Experimental/Mode" };
1773
1775 static constexpr const char *name{ "Mode" };
1776
1778 static constexpr const char *description{
1779 R"description(This setting controls how the color image is computed.
1780
1781`automatic` is the default option. It performs tone mapping for HDR captures, but not for
1782single-acquisition captures. Use this mode with a single acquisition if you want to have
1783the most control over the colors in the image.
1784
1785`toneMapping` uses all the acquisitions to create one merged and normalized color image. For
1786HDR captures the dynamic range of the captured images is usually higher than the 8-bit color
1787image range. `toneMapping` will map the HDR color data to the 8-bit color output range by
1788applying a scaling factor. `toneMapping` can also be used for single-acquisition captures to
1789normalize the captured color image to the full 8-bit output. Note that when using `toneMapping`
1790mode the color values can be inconsistent over repeated captures if you move, add or remove
1791objects in the scene. For the most control over the colors in the single-acquisition case,
1792select the `automatic` mode.
1793)description"
1794 };
1795
1797 enum class ValueType
1798 {
1801 };
1802 static const Mode automatic;
1803 static const Mode toneMapping;
1804
1806 static std::set<ValueType> validValues()
1807 {
1809 }
1810
1812 Mode() = default;
1813
1815 explicit constexpr Mode(ValueType value)
1816 : m_opt{ verifyValue(value) }
1817 {}
1818
1824
1826 bool hasValue() const;
1827
1829 void reset();
1830
1832 std::string toString() const;
1833
1835 friend std::ostream &operator<<(std::ostream &stream, const Mode::ValueType &value)
1836 {
1837 return stream << Mode{ value }.toString();
1838 }
1839
1841 bool operator==(const Mode &other) const
1842 {
1843 return m_opt == other.m_opt;
1844 }
1845
1847 bool operator!=(const Mode &other) const
1848 {
1849 return m_opt != other.m_opt;
1850 }
1851
1853 friend std::ostream &operator<<(std::ostream &stream, const Mode &value)
1854 {
1855 return stream << value.toString();
1856 }
1857
1858 private:
1859 void setFromString(const std::string &value);
1860
1861 constexpr ValueType static verifyValue(const ValueType &value)
1862 {
1863 return value == ValueType::automatic || value == ValueType::toneMapping
1864 ? value
1865 : throw std::invalid_argument{
1866 "Invalid value: Mode{ "
1867 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value))
1868 + " }"
1869 };
1870 }
1871
1872 std::optional<ValueType> m_opt;
1873
1874 friend struct DataModel::Detail::Befriend<Mode>;
1875 };
1876
1877 using Descendants = std::tuple<Settings2D::Processing::Color::Experimental::Mode>;
1878
1881
1893#ifndef NO_DOC
1894 template<
1895 typename... Args,
1896 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1897 typename std::enable_if<
1898 Zivid::Detail::TypeTraits::
1899 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1900 int>::type = 0>
1901#else
1902 template<typename... Args>
1903#endif
1904 explicit Experimental(Args &&...args)
1905 {
1906 using namespace Zivid::Detail::TypeTraits;
1907
1908 static_assert(
1909 AllArgsDecayedAreUnique<Args...>::value,
1910 "Found duplicate types among the arguments passed to Experimental(...). "
1911 "Types should be listed at most once.");
1912
1913 set(std::forward<Args>(args)...);
1914 }
1915
1926#ifndef NO_DOC
1927 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1928#else
1929 template<typename... Args>
1930#endif
1931 void set(Args &&...args)
1932 {
1933 using namespace Zivid::Detail::TypeTraits;
1934
1935 using AllArgsAreDescendantNodes =
1936 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1937 static_assert(
1938 AllArgsAreDescendantNodes::value,
1939 "All arguments passed to set(...) must be descendant nodes.");
1940
1941 static_assert(
1942 AllArgsDecayedAreUnique<Args...>::value,
1943 "Found duplicate types among the arguments passed to set(...). "
1944 "Types should be listed at most once.");
1945
1946 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1947 }
1948
1960#ifndef NO_DOC
1961 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1962#else
1963 template<typename... Args>
1964#endif
1965 Experimental copyWith(Args &&...args) const
1966 {
1967 using namespace Zivid::Detail::TypeTraits;
1968
1969 using AllArgsAreDescendantNodes =
1970 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1971 static_assert(
1972 AllArgsAreDescendantNodes::value,
1973 "All arguments passed to copyWith(...) must be descendant nodes.");
1974
1975 static_assert(
1976 AllArgsDecayedAreUnique<Args...>::value,
1977 "Found duplicate types among the arguments passed to copyWith(...). "
1978 "Types should be listed at most once.");
1979
1980 auto copy{ *this };
1981 copy.set(std::forward<Args>(args)...);
1982 return copy;
1983 }
1984
1986 const Mode &mode() const
1987 {
1988 return m_mode;
1989 }
1990
1993 {
1994 return m_mode;
1995 }
1996
1998 Experimental &set(const Mode &value)
1999 {
2000 m_mode = value;
2001 return *this;
2002 }
2003
2004 template<
2005 typename T,
2006 typename std::enable_if<
2007 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
2008 int>::type = 0>
2010 {
2011 return m_mode;
2012 }
2013
2014 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2016 {
2017 return m_mode;
2018 }
2019
2021 template<typename F>
2022 void forEach(const F &f) const
2023 {
2024 f(m_mode);
2025 }
2026
2028 template<typename F>
2029 void forEach(const F &f)
2030 {
2031 f(m_mode);
2032 }
2033
2035 bool operator==(const Experimental &other) const;
2036
2038 bool operator!=(const Experimental &other) const;
2039
2041 std::string toString() const;
2042
2044 friend std::ostream &operator<<(std::ostream &stream, const Experimental &value)
2045 {
2046 return stream << value.toString();
2047 }
2048
2049 private:
2050 void setFromString(const std::string &value);
2051
2052 void setFromString(const std::string &fullPath, const std::string &value);
2053
2054 std::string getString(const std::string &fullPath) const;
2055
2056 Mode m_mode;
2057
2058 friend struct DataModel::Detail::Befriend<Experimental>;
2059 };
2060
2064
2065 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2067 {
2068 public:
2071
2073 static constexpr const char *path{ "Processing/Color/Gamma" };
2074
2076 static constexpr const char *name{ "Gamma" };
2077
2079 static constexpr const char *description{
2080 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
2081greater than 1 makes the colors darker.
2082)description"
2083 };
2084
2086 using ValueType = double;
2087
2089 static constexpr Range<double> validRange()
2090 {
2091 return { 0.25, 1.5 };
2092 }
2093
2095 Gamma() = default;
2096
2098 explicit constexpr Gamma(double value)
2099 : m_opt{ verifyValue(value) }
2100 {}
2101
2106 double value() const;
2107
2109 bool hasValue() const;
2110
2112 void reset();
2113
2115 std::string toString() const;
2116
2118 bool operator==(const Gamma &other) const
2119 {
2120 return m_opt == other.m_opt;
2121 }
2122
2124 bool operator!=(const Gamma &other) const
2125 {
2126 return m_opt != other.m_opt;
2127 }
2128
2130 bool operator<(const Gamma &other) const
2131 {
2132 return m_opt < other.m_opt;
2133 }
2134
2136 bool operator>(const Gamma &other) const
2137 {
2138 return m_opt > other.m_opt;
2139 }
2140
2142 bool operator<=(const Gamma &other) const
2143 {
2144 return m_opt <= other.m_opt;
2145 }
2146
2148 bool operator>=(const Gamma &other) const
2149 {
2150 return m_opt >= other.m_opt;
2151 }
2152
2154 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
2155 {
2156 return stream << value.toString();
2157 }
2158
2159 private:
2160 void setFromString(const std::string &value);
2161
2162 constexpr ValueType static verifyValue(const ValueType &value)
2163 {
2164 return validRange().isInRange(value)
2165 ? value
2166 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
2167 + std::to_string(validRange().min()) + ", "
2168 + std::to_string(validRange().max()) + "]" };
2169 }
2170
2171 std::optional<double> m_opt;
2172
2173 friend struct DataModel::Detail::Befriend<Gamma>;
2174 };
2175
2176 using Descendants = std::tuple<
2184
2187
2205#ifndef NO_DOC
2206 template<
2207 typename... Args,
2208 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2209 typename std::enable_if<
2210 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2211 value,
2212 int>::type = 0>
2213#else
2214 template<typename... Args>
2215#endif
2216 explicit Color(Args &&...args)
2217 {
2218 using namespace Zivid::Detail::TypeTraits;
2219
2220 static_assert(
2221 AllArgsDecayedAreUnique<Args...>::value,
2222 "Found duplicate types among the arguments passed to Color(...). "
2223 "Types should be listed at most once.");
2224
2225 set(std::forward<Args>(args)...);
2226 }
2227
2244#ifndef NO_DOC
2245 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2246#else
2247 template<typename... Args>
2248#endif
2249 void set(Args &&...args)
2250 {
2251 using namespace Zivid::Detail::TypeTraits;
2252
2253 using AllArgsAreDescendantNodes =
2254 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2255 static_assert(
2256 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2257
2258 static_assert(
2259 AllArgsDecayedAreUnique<Args...>::value,
2260 "Found duplicate types among the arguments passed to set(...). "
2261 "Types should be listed at most once.");
2262
2263 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2264 }
2265
2283#ifndef NO_DOC
2284 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2285#else
2286 template<typename... Args>
2287#endif
2288 Color copyWith(Args &&...args) const
2289 {
2290 using namespace Zivid::Detail::TypeTraits;
2291
2292 using AllArgsAreDescendantNodes =
2293 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2294 static_assert(
2295 AllArgsAreDescendantNodes::value,
2296 "All arguments passed to copyWith(...) must be descendant nodes.");
2297
2298 static_assert(
2299 AllArgsDecayedAreUnique<Args...>::value,
2300 "Found duplicate types among the arguments passed to copyWith(...). "
2301 "Types should be listed at most once.");
2302
2303 auto copy{ *this };
2304 copy.set(std::forward<Args>(args)...);
2305 return copy;
2306 }
2307
2309 const Balance &balance() const
2310 {
2311 return m_balance;
2312 }
2313
2316 {
2317 return m_balance;
2318 }
2319
2321 Color &set(const Balance &value)
2322 {
2323 m_balance = value;
2324 return *this;
2325 }
2326
2328 Color &set(const Balance::Blue &value)
2329 {
2330 m_balance.set(value);
2331 return *this;
2332 }
2333
2335 Color &set(const Balance::Green &value)
2336 {
2337 m_balance.set(value);
2338 return *this;
2339 }
2340
2342 Color &set(const Balance::Red &value)
2343 {
2344 m_balance.set(value);
2345 return *this;
2346 }
2347
2350 {
2351 return m_experimental;
2352 }
2353
2356 {
2357 return m_experimental;
2358 }
2359
2361 Color &set(const Experimental &value)
2362 {
2363 m_experimental = value;
2364 return *this;
2365 }
2366
2369 {
2370 m_experimental.set(value);
2371 return *this;
2372 }
2373
2375 const Gamma &gamma() const
2376 {
2377 return m_gamma;
2378 }
2379
2382 {
2383 return m_gamma;
2384 }
2385
2387 Color &set(const Gamma &value)
2388 {
2389 m_gamma = value;
2390 return *this;
2391 }
2392
2393 template<
2394 typename T,
2395 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
2396 0>
2398 {
2399 return m_balance;
2400 }
2401
2402 template<
2403 typename T,
2404 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2405 type = 0>
2407 {
2408 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
2409 }
2410
2411 template<
2412 typename T,
2413 typename std::
2414 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
2416 {
2417 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
2418 }
2419
2420 template<
2421 typename T,
2422 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2423 type = 0>
2425 {
2426 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
2427 }
2428
2429 template<
2430 typename T,
2431 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
2432 type = 0>
2434 {
2435 return m_experimental;
2436 }
2437
2438 template<
2439 typename T,
2440 typename std::enable_if<
2441 std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value,
2442 int>::type = 0>
2444 {
2445 return m_experimental.get<Settings2D::Processing::Color::Experimental::Mode>();
2446 }
2447
2448 template<
2449 typename T,
2450 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
2451 0>
2453 {
2454 return m_gamma;
2455 }
2456
2457 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2459 {
2460 return m_balance;
2461 }
2462
2463 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2465 {
2466 return m_experimental;
2467 }
2468
2469 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2471 {
2472 return m_gamma;
2473 }
2474
2476 template<typename F>
2477 void forEach(const F &f) const
2478 {
2479 f(m_balance);
2480 f(m_experimental);
2481 f(m_gamma);
2482 }
2483
2485 template<typename F>
2486 void forEach(const F &f)
2487 {
2488 f(m_balance);
2489 f(m_experimental);
2490 f(m_gamma);
2491 }
2492
2494 bool operator==(const Color &other) const;
2495
2497 bool operator!=(const Color &other) const;
2498
2500 std::string toString() const;
2501
2503 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
2504 {
2505 return stream << value.toString();
2506 }
2507
2508 private:
2509 void setFromString(const std::string &value);
2510
2511 void setFromString(const std::string &fullPath, const std::string &value);
2512
2513 std::string getString(const std::string &fullPath) const;
2514
2515 Balance m_balance;
2516 Experimental m_experimental;
2517 Gamma m_gamma;
2518
2519 friend struct DataModel::Detail::Befriend<Color>;
2520 };
2521
2522 using Descendants = std::tuple<
2531
2534
2553#ifndef NO_DOC
2554 template<
2555 typename... Args,
2556 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2557 typename std::enable_if<
2558 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2559 value,
2560 int>::type = 0>
2561#else
2562 template<typename... Args>
2563#endif
2564 explicit Processing(Args &&...args)
2565 {
2566 using namespace Zivid::Detail::TypeTraits;
2567
2568 static_assert(
2569 AllArgsDecayedAreUnique<Args...>::value,
2570 "Found duplicate types among the arguments passed to Processing(...). "
2571 "Types should be listed at most once.");
2572
2573 set(std::forward<Args>(args)...);
2574 }
2575
2593#ifndef NO_DOC
2594 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2595#else
2596 template<typename... Args>
2597#endif
2598 void set(Args &&...args)
2599 {
2600 using namespace Zivid::Detail::TypeTraits;
2601
2602 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2603 static_assert(
2604 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2605
2606 static_assert(
2607 AllArgsDecayedAreUnique<Args...>::value,
2608 "Found duplicate types among the arguments passed to set(...). "
2609 "Types should be listed at most once.");
2610
2611 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2612 }
2613
2632#ifndef NO_DOC
2633 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2634#else
2635 template<typename... Args>
2636#endif
2637 Processing copyWith(Args &&...args) const
2638 {
2639 using namespace Zivid::Detail::TypeTraits;
2640
2641 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2642 static_assert(
2643 AllArgsAreDescendantNodes::value,
2644 "All arguments passed to copyWith(...) must be descendant nodes.");
2645
2646 static_assert(
2647 AllArgsDecayedAreUnique<Args...>::value,
2648 "Found duplicate types among the arguments passed to copyWith(...). "
2649 "Types should be listed at most once.");
2650
2651 auto copy{ *this };
2652 copy.set(std::forward<Args>(args)...);
2653 return copy;
2654 }
2655
2657 const Color &color() const
2658 {
2659 return m_color;
2660 }
2661
2664 {
2665 return m_color;
2666 }
2667
2669 Processing &set(const Color &value)
2670 {
2671 m_color = value;
2672 return *this;
2673 }
2674
2677 {
2678 m_color.set(value);
2679 return *this;
2680 }
2681
2684 {
2685 m_color.set(value);
2686 return *this;
2687 }
2688
2691 {
2692 m_color.set(value);
2693 return *this;
2694 }
2695
2698 {
2699 m_color.set(value);
2700 return *this;
2701 }
2702
2705 {
2706 m_color.set(value);
2707 return *this;
2708 }
2709
2712 {
2713 m_color.set(value);
2714 return *this;
2715 }
2716
2719 {
2720 m_color.set(value);
2721 return *this;
2722 }
2723
2724 template<
2725 typename T,
2726 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2728 {
2729 return m_color;
2730 }
2731
2732 template<
2733 typename T,
2734 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2736 {
2738 }
2739
2740 template<
2741 typename T,
2742 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2743 type = 0>
2745 {
2747 }
2748
2749 template<
2750 typename T,
2751 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
2752 type = 0>
2754 {
2756 }
2757
2758 template<
2759 typename T,
2760 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2761 type = 0>
2763 {
2764 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2765 }
2766
2767 template<
2768 typename T,
2769 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::
2770 type = 0>
2772 {
2774 }
2775
2776 template<
2777 typename T,
2778 typename std::
2779 enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::type = 0>
2781 {
2783 }
2784
2785 template<
2786 typename T,
2787 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2789 {
2790 return m_color.get<Settings2D::Processing::Color::Gamma>();
2791 }
2792
2793 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2795 {
2796 return m_color;
2797 }
2798
2800 template<typename F>
2801 void forEach(const F &f) const
2802 {
2803 f(m_color);
2804 }
2805
2807 template<typename F>
2808 void forEach(const F &f)
2809 {
2810 f(m_color);
2811 }
2812
2814 bool operator==(const Processing &other) const;
2815
2817 bool operator!=(const Processing &other) const;
2818
2820 std::string toString() const;
2821
2823 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2824 {
2825 return stream << value.toString();
2826 }
2827
2828 private:
2829 void setFromString(const std::string &value);
2830
2831 void setFromString(const std::string &fullPath, const std::string &value);
2832
2833 std::string getString(const std::string &fullPath) const;
2834
2835 Color m_color;
2836
2837 friend struct DataModel::Detail::Befriend<Processing>;
2838 };
2839
2842
2843 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2845 {
2846 public:
2849
2851 static constexpr const char *path{ "Sampling" };
2852
2854 static constexpr const char *name{ "Sampling" };
2855
2857 static constexpr const char *description{ R"description(Sampling settings.
2858)description" };
2859
2877
2878 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2880 {
2881 public:
2884
2886 static constexpr const char *path{ "Sampling/Color" };
2887
2889 static constexpr const char *name{ "Color" };
2890
2892 static constexpr const char *description{ R"description(Choose how to sample colors for the 2D image.
2893
2894- `rgb` option gives an image with full colors.
2895- `grayscale` option gives a grayscale (r=g=b) image, which
2896 can be acquired faster than full colors.
2897- `rgbStrongAmbientLight` option gives an image with full colors and reduced
2898 color noise. This option should be chosen only for applications which
2899 suffer from high color noise and with high amounts of ambient light in the
2900 scene.
2901- `rgbAmbientSuppression` option gives an image with full colors while
2902 suppressing the ambient light. The Zivid 2+R and Zivid 3 cameras suppress ambient
2903 light by default, and therefore do not need the additional option
2904 `rgbAmbientSuppression`.
2905
2906
2907The `grayscale`, `rgbStrongAmbientLight` and `rgbAmbientSuppression` options are not available on all camera models.
2908)description" };
2909
2911 enum class ValueType
2912 {
2917 };
2918 static const Color rgb;
2919 static const Color grayscale;
2922
2924 static std::set<ValueType> validValues()
2925 {
2926 return { ValueType::rgb,
2930 }
2931
2933 Color() = default;
2934
2936 explicit constexpr Color(ValueType value)
2937 : m_opt{ verifyValue(value) }
2938 {}
2939
2945
2947 bool hasValue() const;
2948
2950 void reset();
2951
2953 std::string toString() const;
2954
2956 friend std::ostream &operator<<(std::ostream &stream, const Color::ValueType &value)
2957 {
2958 return stream << Color{ value }.toString();
2959 }
2960
2962 bool operator==(const Color &other) const
2963 {
2964 return m_opt == other.m_opt;
2965 }
2966
2968 bool operator!=(const Color &other) const
2969 {
2970 return m_opt != other.m_opt;
2971 }
2972
2974 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
2975 {
2976 return stream << value.toString();
2977 }
2978
2979 private:
2980 void setFromString(const std::string &value);
2981
2982 constexpr ValueType static verifyValue(const ValueType &value)
2983 {
2984 return value == ValueType::rgb || value == ValueType::grayscale
2985 || value == ValueType::rgbStrongAmbientLight
2986 || value == ValueType::rgbAmbientSuppression
2987 ? value
2988 : throw std::invalid_argument{
2989 "Invalid value: Color{ "
2990 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2991 };
2992 }
2993
2994 std::optional<ValueType> m_opt;
2995
2996 friend struct DataModel::Detail::Befriend<Color>;
2997 };
2998
3007
3008 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3010 {
3011 public:
3014
3016 static constexpr const char *path{ "Sampling/Interval" };
3017
3019 static constexpr const char *name{ "Interval" };
3020
3022 static constexpr const char *description{
3023 R"description(Sampling interval controls the interval between successive sensor operations (e.g.,
3024structured light pattern projection and image exposure), aligned to external
3025frequencies (e.g., 50 Hz, 60 Hz grid) or to other devices (e.g., barcode scanners
3026at 100 Hz). The requested interval is a target: the sensor operations will happen
3027at this rate if the it can fit the chosen exposure time plus some processing overhead.
3028Otherwise, the sampling interval is rounded up to the nearest suitable integer multiple
3029(e.g., n * 10 ms for 100 Hz and n * 8.33 ms for 120 Hz).
3030)description"
3031 };
3032
3037
3038 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3040 {
3041 public:
3044
3046 static constexpr const char *path{ "Sampling/Interval/Duration" };
3047
3049 static constexpr const char *name{ "Duration" };
3050
3052 static constexpr const char *description{
3053 R"description(Duration between successive sensor operations, in microseconds. The effective interval
3054might be rounded up to the nearest suitable integer multiple and will never be shorter
3055than exposure time plus some processing overhead.
3056)description"
3057 };
3058
3060 using ValueType = std::chrono::microseconds;
3061
3064 {
3065 return { std::chrono::microseconds{ 1000 }, std::chrono::microseconds{ 10000 } };
3066 }
3067
3069 Duration() = default;
3070
3072 explicit constexpr Duration(std::chrono::microseconds value)
3073 : m_opt{ verifyValue(value) }
3074 {}
3075
3080 std::chrono::microseconds value() const;
3081
3083 bool hasValue() const;
3084
3086 void reset();
3087
3089 std::string toString() const;
3090
3092 bool operator==(const Duration &other) const
3093 {
3094 return m_opt == other.m_opt;
3095 }
3096
3098 bool operator!=(const Duration &other) const
3099 {
3100 return m_opt != other.m_opt;
3101 }
3102
3104 bool operator<(const Duration &other) const
3105 {
3106 return m_opt < other.m_opt;
3107 }
3108
3110 bool operator>(const Duration &other) const
3111 {
3112 return m_opt > other.m_opt;
3113 }
3114
3116 bool operator<=(const Duration &other) const
3117 {
3118 return m_opt <= other.m_opt;
3119 }
3120
3122 bool operator>=(const Duration &other) const
3123 {
3124 return m_opt >= other.m_opt;
3125 }
3126
3128 friend std::ostream &operator<<(std::ostream &stream, const Duration &value)
3129 {
3130 return stream << value.toString();
3131 }
3132
3133 private:
3134 void setFromString(const std::string &value);
3135
3136 constexpr ValueType static verifyValue(const ValueType &value)
3137 {
3138 return validRange().isInRange(value)
3139 ? value
3140 : throw std::out_of_range{ "Duration{ " + std::to_string(value.count())
3141 + " } is not in range ["
3142 + std::to_string(validRange().min().count()) + ", "
3143 + std::to_string(validRange().max().count()) + "]" };
3144 }
3145
3146 std::optional<std::chrono::microseconds> m_opt;
3147
3148 friend struct DataModel::Detail::Befriend<Duration>;
3149 };
3150
3152
3153 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3155 {
3156 public:
3159
3161 static constexpr const char *path{ "Sampling/Interval/Enabled" };
3162
3164 static constexpr const char *name{ "Enabled" };
3165
3167 static constexpr const char *description{
3168 R"description(Enable or disable sampling interval.)description"
3169 };
3170
3172 using ValueType = bool;
3173 static const Enabled yes;
3174 static const Enabled no;
3175
3177 static std::set<bool> validValues()
3178 {
3179 return { false, true };
3180 }
3181
3183 Enabled() = default;
3184
3186 explicit constexpr Enabled(bool value)
3187 : m_opt{ value }
3188 {}
3189
3194 bool value() const;
3195
3197 bool hasValue() const;
3198
3200 void reset();
3201
3203 std::string toString() const;
3204
3206 bool operator==(const Enabled &other) const
3207 {
3208 return m_opt == other.m_opt;
3209 }
3210
3212 bool operator!=(const Enabled &other) const
3213 {
3214 return m_opt != other.m_opt;
3215 }
3216
3218 friend std::ostream &operator<<(std::ostream &stream, const Enabled &value)
3219 {
3220 return stream << value.toString();
3221 }
3222
3223 private:
3224 void setFromString(const std::string &value);
3225
3226 std::optional<bool> m_opt;
3227
3228 friend struct DataModel::Detail::Befriend<Enabled>;
3229 };
3230
3232 std::tuple<Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled>;
3233
3236
3249#ifndef NO_DOC
3250 template<
3251 typename... Args,
3252 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3253 typename std::enable_if<
3254 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3255 value,
3256 int>::type = 0>
3257#else
3258 template<typename... Args>
3259#endif
3260 explicit Interval(Args &&...args)
3261 {
3262 using namespace Zivid::Detail::TypeTraits;
3263
3264 static_assert(
3265 AllArgsDecayedAreUnique<Args...>::value,
3266 "Found duplicate types among the arguments passed to Interval(...). "
3267 "Types should be listed at most once.");
3268
3269 set(std::forward<Args>(args)...);
3270 }
3271
3283#ifndef NO_DOC
3284 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3285#else
3286 template<typename... Args>
3287#endif
3288 void set(Args &&...args)
3289 {
3290 using namespace Zivid::Detail::TypeTraits;
3291
3292 using AllArgsAreDescendantNodes =
3293 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3294 static_assert(
3295 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3296
3297 static_assert(
3298 AllArgsDecayedAreUnique<Args...>::value,
3299 "Found duplicate types among the arguments passed to set(...). "
3300 "Types should be listed at most once.");
3301
3302 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3303 }
3304
3317#ifndef NO_DOC
3318 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3319#else
3320 template<typename... Args>
3321#endif
3322 Interval copyWith(Args &&...args) const
3323 {
3324 using namespace Zivid::Detail::TypeTraits;
3325
3326 using AllArgsAreDescendantNodes =
3327 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3328 static_assert(
3329 AllArgsAreDescendantNodes::value,
3330 "All arguments passed to copyWith(...) must be descendant nodes.");
3331
3332 static_assert(
3333 AllArgsDecayedAreUnique<Args...>::value,
3334 "Found duplicate types among the arguments passed to copyWith(...). "
3335 "Types should be listed at most once.");
3336
3337 auto copy{ *this };
3338 copy.set(std::forward<Args>(args)...);
3339 return copy;
3340 }
3341
3343 const Duration &duration() const
3344 {
3345 return m_duration;
3346 }
3347
3350 {
3351 return m_duration;
3352 }
3353
3355 Interval &set(const Duration &value)
3356 {
3357 m_duration = value;
3358 return *this;
3359 }
3360
3362 const Enabled &isEnabled() const
3363 {
3364 return m_enabled;
3365 }
3366
3369 {
3370 return m_enabled;
3371 }
3372
3374 Interval &set(const Enabled &value)
3375 {
3376 m_enabled = value;
3377 return *this;
3378 }
3379
3380 template<
3381 typename T,
3382 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::
3383 type = 0>
3385 {
3386 return m_duration;
3387 }
3388
3389 template<
3390 typename T,
3391 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::
3392 type = 0>
3394 {
3395 return m_enabled;
3396 }
3397
3398 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3400 {
3401 return m_duration;
3402 }
3403
3404 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3406 {
3407 return m_enabled;
3408 }
3409
3411 template<typename F>
3412 void forEach(const F &f) const
3413 {
3414 f(m_duration);
3415 f(m_enabled);
3416 }
3417
3419 template<typename F>
3420 void forEach(const F &f)
3421 {
3422 f(m_duration);
3423 f(m_enabled);
3424 }
3425
3427 bool operator==(const Interval &other) const;
3428
3430 bool operator!=(const Interval &other) const;
3431
3433 std::string toString() const;
3434
3436 friend std::ostream &operator<<(std::ostream &stream, const Interval &value)
3437 {
3438 return stream << value.toString();
3439 }
3440
3441 private:
3442 void setFromString(const std::string &value);
3443
3444 void setFromString(const std::string &fullPath, const std::string &value);
3445
3446 std::string getString(const std::string &fullPath) const;
3447
3448 Duration m_duration;
3449 Enabled m_enabled;
3450
3451 friend struct DataModel::Detail::Befriend<Interval>;
3452 };
3453
3457
3458 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
3460 {
3461 public:
3464
3466 static constexpr const char *path{ "Sampling/Pixel" };
3467
3469 static constexpr const char *name{ "Pixel" };
3470
3472 static constexpr const char *description{
3473 R"description(Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampled.
3474When doing 2D+3D capture, picking the same value that is used for 3D is generally recommended.
3475)description"
3476 };
3477
3479 enum class ValueType
3480 {
3488 };
3489 static const Pixel all;
3491 static const Pixel redSubsample2x2;
3493 static const Pixel redSubsample4x4;
3494 static const Pixel by2x2;
3495 static const Pixel by4x4;
3496
3498 static std::set<ValueType> validValues()
3499 {
3500 return { ValueType::all,
3507 }
3508
3510 Pixel() = default;
3511
3513 explicit constexpr Pixel(ValueType value)
3514 : m_opt{ verifyValue(value) }
3515 {}
3516
3522
3524 bool hasValue() const;
3525
3527 void reset();
3528
3530 std::string toString() const;
3531
3533 friend std::ostream &operator<<(std::ostream &stream, const Pixel::ValueType &value)
3534 {
3535 return stream << Pixel{ value }.toString();
3536 }
3537
3539 bool operator==(const Pixel &other) const
3540 {
3541 return m_opt == other.m_opt;
3542 }
3543
3545 bool operator!=(const Pixel &other) const
3546 {
3547 return m_opt != other.m_opt;
3548 }
3549
3551 friend std::ostream &operator<<(std::ostream &stream, const Pixel &value)
3552 {
3553 return stream << value.toString();
3554 }
3555
3556 private:
3557 void setFromString(const std::string &value);
3558
3559 constexpr ValueType static verifyValue(const ValueType &value)
3560 {
3561 return value == ValueType::all || value == ValueType::blueSubsample2x2
3562 || value == ValueType::redSubsample2x2 || value == ValueType::blueSubsample4x4
3563 || value == ValueType::redSubsample4x4 || value == ValueType::by2x2
3564 || value == ValueType::by4x4
3565 ? value
3566 : throw std::invalid_argument{
3567 "Invalid value: Pixel{ "
3568 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
3569 };
3570 }
3571
3572 std::optional<ValueType> m_opt;
3573
3574 friend struct DataModel::Detail::Befriend<Pixel>;
3575 };
3576
3577 using Descendants = std::tuple<
3583
3586
3602#ifndef NO_DOC
3603 template<
3604 typename... Args,
3605 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3606 typename std::enable_if<
3607 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
3608 value,
3609 int>::type = 0>
3610#else
3611 template<typename... Args>
3612#endif
3613 explicit Sampling(Args &&...args)
3614 {
3615 using namespace Zivid::Detail::TypeTraits;
3616
3617 static_assert(
3618 AllArgsDecayedAreUnique<Args...>::value,
3619 "Found duplicate types among the arguments passed to Sampling(...). "
3620 "Types should be listed at most once.");
3621
3622 set(std::forward<Args>(args)...);
3623 }
3624
3639#ifndef NO_DOC
3640 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3641#else
3642 template<typename... Args>
3643#endif
3644 void set(Args &&...args)
3645 {
3646 using namespace Zivid::Detail::TypeTraits;
3647
3648 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3649 static_assert(
3650 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3651
3652 static_assert(
3653 AllArgsDecayedAreUnique<Args...>::value,
3654 "Found duplicate types among the arguments passed to set(...). "
3655 "Types should be listed at most once.");
3656
3657 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
3658 }
3659
3675#ifndef NO_DOC
3676 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
3677#else
3678 template<typename... Args>
3679#endif
3680 Sampling copyWith(Args &&...args) const
3681 {
3682 using namespace Zivid::Detail::TypeTraits;
3683
3684 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3685 static_assert(
3686 AllArgsAreDescendantNodes::value,
3687 "All arguments passed to copyWith(...) must be descendant nodes.");
3688
3689 static_assert(
3690 AllArgsDecayedAreUnique<Args...>::value,
3691 "Found duplicate types among the arguments passed to copyWith(...). "
3692 "Types should be listed at most once.");
3693
3694 auto copy{ *this };
3695 copy.set(std::forward<Args>(args)...);
3696 return copy;
3697 }
3698
3700 const Color &color() const
3701 {
3702 return m_color;
3703 }
3704
3707 {
3708 return m_color;
3709 }
3710
3712 Sampling &set(const Color &value)
3713 {
3714 m_color = value;
3715 return *this;
3716 }
3717
3719 const Interval &interval() const
3720 {
3721 return m_interval;
3722 }
3723
3726 {
3727 return m_interval;
3728 }
3729
3731 Sampling &set(const Interval &value)
3732 {
3733 m_interval = value;
3734 return *this;
3735 }
3736
3739 {
3740 m_interval.set(value);
3741 return *this;
3742 }
3743
3746 {
3747 m_interval.set(value);
3748 return *this;
3749 }
3750
3752 const Pixel &pixel() const
3753 {
3754 return m_pixel;
3755 }
3756
3759 {
3760 return m_pixel;
3761 }
3762
3764 Sampling &set(const Pixel &value)
3765 {
3766 m_pixel = value;
3767 return *this;
3768 }
3769
3770 template<
3771 typename T,
3772 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
3774 {
3775 return m_color;
3776 }
3777
3778 template<
3779 typename T,
3780 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
3782 {
3783 return m_interval;
3784 }
3785
3786 template<
3787 typename T,
3788 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type =
3789 0>
3791 {
3792 return m_interval.get<Settings2D::Sampling::Interval::Duration>();
3793 }
3794
3795 template<
3796 typename T,
3797 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
3799 {
3800 return m_interval.get<Settings2D::Sampling::Interval::Enabled>();
3801 }
3802
3803 template<
3804 typename T,
3805 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
3807 {
3808 return m_pixel;
3809 }
3810
3811 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3813 {
3814 return m_color;
3815 }
3816
3817 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3819 {
3820 return m_interval;
3821 }
3822
3823 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3825 {
3826 return m_pixel;
3827 }
3828
3830 template<typename F>
3831 void forEach(const F &f) const
3832 {
3833 f(m_color);
3834 f(m_interval);
3835 f(m_pixel);
3836 }
3837
3839 template<typename F>
3840 void forEach(const F &f)
3841 {
3842 f(m_color);
3843 f(m_interval);
3844 f(m_pixel);
3845 }
3846
3848 bool operator==(const Sampling &other) const;
3849
3851 bool operator!=(const Sampling &other) const;
3852
3854 std::string toString() const;
3855
3857 friend std::ostream &operator<<(std::ostream &stream, const Sampling &value)
3858 {
3859 return stream << value.toString();
3860 }
3861
3862 private:
3863 void setFromString(const std::string &value);
3864
3865 void setFromString(const std::string &fullPath, const std::string &value);
3866
3867 std::string getString(const std::string &fullPath) const;
3868
3869 Color m_color;
3870 Interval m_interval;
3871 Pixel m_pixel;
3872
3873 friend struct DataModel::Detail::Befriend<Sampling>;
3874 };
3875
3876 using Descendants = std::tuple<
3893
3896
3898 explicit Settings2D(const std::string &fileName);
3899
3905 [[nodiscard]] static Settings2D fromSerialized(const std::string &value);
3906
3912 std::string serialize() const;
3913
3940#ifndef NO_DOC
3941 template<
3942 typename... Args,
3943 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
3944 typename std::enable_if<
3945 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
3946 int>::type = 0>
3947#else
3948 template<typename... Args>
3949#endif
3950 explicit Settings2D(Args &&...args)
3951 {
3952 using namespace Zivid::Detail::TypeTraits;
3953
3954 static_assert(
3955 AllArgsDecayedAreUnique<Args...>::value,
3956 "Found duplicate types among the arguments passed to Settings2D(...). "
3957 "Types should be listed at most once.");
3958
3959 set(std::forward<Args>(args)...);
3960 }
3961
3987#ifndef NO_DOC
3988 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
3989#else
3990 template<typename... Args>
3991#endif
3992 void set(Args &&...args)
3993 {
3994 using namespace Zivid::Detail::TypeTraits;
3995
3996 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3997 static_assert(
3998 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
3999
4000 static_assert(
4001 AllArgsDecayedAreUnique<Args...>::value,
4002 "Found duplicate types among the arguments passed to set(...). "
4003 "Types should be listed at most once.");
4004
4005 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
4006 }
4007
4034#ifndef NO_DOC
4035 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
4036#else
4037 template<typename... Args>
4038#endif
4039 Settings2D copyWith(Args &&...args) const
4040 {
4041 using namespace Zivid::Detail::TypeTraits;
4042
4043 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
4044 static_assert(
4045 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
4046
4047 static_assert(
4048 AllArgsDecayedAreUnique<Args...>::value,
4049 "Found duplicate types among the arguments passed to copyWith(...). "
4050 "Types should be listed at most once.");
4051
4052 auto copy{ *this };
4053 copy.set(std::forward<Args>(args)...);
4054 return copy;
4055 }
4056
4059 {
4060 return m_acquisitions;
4061 }
4062
4065 {
4066 return m_acquisitions;
4067 }
4068
4071 {
4072 m_acquisitions = value;
4073 return *this;
4074 }
4075
4077 const Processing &processing() const
4078 {
4079 return m_processing;
4080 }
4081
4084 {
4085 return m_processing;
4086 }
4087
4090 {
4091 m_processing = value;
4092 return *this;
4093 }
4094
4097 {
4098 m_processing.set(value);
4099 return *this;
4100 }
4101
4104 {
4105 m_processing.set(value);
4106 return *this;
4107 }
4108
4111 {
4112 m_processing.set(value);
4113 return *this;
4114 }
4115
4118 {
4119 m_processing.set(value);
4120 return *this;
4121 }
4122
4125 {
4126 m_processing.set(value);
4127 return *this;
4128 }
4129
4132 {
4133 m_processing.set(value);
4134 return *this;
4135 }
4136
4139 {
4140 m_processing.set(value);
4141 return *this;
4142 }
4143
4146 {
4147 m_processing.set(value);
4148 return *this;
4149 }
4150
4152 const Sampling &sampling() const
4153 {
4154 return m_sampling;
4155 }
4156
4159 {
4160 return m_sampling;
4161 }
4162
4164 Settings2D &set(const Sampling &value)
4165 {
4166 m_sampling = value;
4167 return *this;
4168 }
4169
4172 {
4173 m_sampling.set(value);
4174 return *this;
4175 }
4176
4179 {
4180 m_sampling.set(value);
4181 return *this;
4182 }
4183
4186 {
4187 m_sampling.set(value);
4188 return *this;
4189 }
4190
4193 {
4194 m_sampling.set(value);
4195 return *this;
4196 }
4197
4200 {
4201 m_sampling.set(value);
4202 return *this;
4203 }
4204
4205 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
4207 {
4208 return m_acquisitions;
4209 }
4210
4211 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
4213 {
4214 return m_processing;
4215 }
4216
4217 template<
4218 typename T,
4219 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
4221 {
4222 return m_processing.get<Settings2D::Processing::Color>();
4223 }
4224
4225 template<
4226 typename T,
4227 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
4229 {
4230 return m_processing.get<Settings2D::Processing::Color::Balance>();
4231 }
4232
4233 template<
4234 typename T,
4235 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
4236 0>
4238 {
4239 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
4240 }
4241
4242 template<
4243 typename T,
4244 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
4245 0>
4247 {
4248 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
4249 }
4250
4251 template<
4252 typename T,
4253 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
4255 {
4256 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
4257 }
4258
4259 template<
4260 typename T,
4261 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental>::value, int>::type = 0>
4263 {
4264 return m_processing.get<Settings2D::Processing::Color::Experimental>();
4265 }
4266
4267 template<
4268 typename T,
4269 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Experimental::Mode>::value, int>::
4270 type = 0>
4272 {
4273 return m_processing.get<Settings2D::Processing::Color::Experimental::Mode>();
4274 }
4275
4276 template<
4277 typename T,
4278 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
4280 {
4281 return m_processing.get<Settings2D::Processing::Color::Gamma>();
4282 }
4283
4284 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Sampling>::value, int>::type = 0>
4286 {
4287 return m_sampling;
4288 }
4289
4290 template<
4291 typename T,
4292 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
4294 {
4295 return m_sampling.get<Settings2D::Sampling::Color>();
4296 }
4297
4298 template<
4299 typename T,
4300 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval>::value, int>::type = 0>
4302 {
4303 return m_sampling.get<Settings2D::Sampling::Interval>();
4304 }
4305
4306 template<
4307 typename T,
4308 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Duration>::value, int>::type = 0>
4310 {
4311 return m_sampling.get<Settings2D::Sampling::Interval::Duration>();
4312 }
4313
4314 template<
4315 typename T,
4316 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Interval::Enabled>::value, int>::type = 0>
4318 {
4319 return m_sampling.get<Settings2D::Sampling::Interval::Enabled>();
4320 }
4321
4322 template<
4323 typename T,
4324 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
4326 {
4327 return m_sampling.get<Settings2D::Sampling::Pixel>();
4328 }
4329
4330 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
4332 {
4333 return m_acquisitions;
4334 }
4335
4336 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
4338 {
4339 return m_processing;
4340 }
4341
4342 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
4344 {
4345 return m_sampling;
4346 }
4347
4349 template<typename F>
4350 void forEach(const F &f) const
4351 {
4352 f(m_acquisitions);
4353 f(m_processing);
4354 f(m_sampling);
4355 }
4356
4358 template<typename F>
4359 void forEach(const F &f)
4360 {
4361 f(m_acquisitions);
4362 f(m_processing);
4363 f(m_sampling);
4364 }
4365
4367 bool operator==(const Settings2D &other) const;
4368
4370 bool operator!=(const Settings2D &other) const;
4371
4373 std::string toString() const;
4374
4376 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
4377 {
4378 return stream << value.toString();
4379 }
4380
4382 void save(const std::string &fileName) const;
4383
4385 void load(const std::string &fileName);
4386
4387 private:
4388 void setFromString(const std::string &value);
4389
4390 void setFromString(const std::string &fullPath, const std::string &value);
4391
4392 std::string getString(const std::string &fullPath) const;
4393
4394 Acquisitions m_acquisitions;
4395 Processing m_processing;
4396 Sampling m_sampling;
4397
4398 friend struct DataModel::Detail::Befriend<Settings2D>;
4399 };
4400
4401#ifndef NO_DOC
4402 template<>
4403 struct Settings2D::Version<8>
4404 {
4405 using Type = Settings2D;
4406 };
4407#endif
4408
4409} // namespace Zivid
4410
4411#ifndef NO_DOC
4413namespace Zivid::Detail
4414{
4415
4416 ZIVID_CORE_EXPORT void save(const Zivid::Settings2D &dataModel, std::ostream &ostream);
4417 ZIVID_CORE_EXPORT void load(Zivid::Settings2D &dataModel, std::istream &istream);
4418
4419 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::Settings2D &source);
4420 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::Settings2D &dest, const std::vector<uint8_t> &data);
4421
4422} // namespace Zivid::Detail
4423#endif
4424
4425#ifdef _MSC_VER
4426# pragma warning(pop)
4427#endif
4428
4429#ifndef NO_DOC
4430# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
4431namespace std // NOLINT
4432{
4433
4434 template<>
4435 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
4436 {};
4437
4438 template<size_t i>
4439 struct tuple_element<i, Zivid::Settings2D::Processing>
4440 {
4441 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
4442
4443 using type // NOLINT
4444 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
4445 };
4446
4447 template<>
4448 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 3>
4449 {};
4450
4451 template<size_t i>
4452 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
4453 {
4454 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 3");
4455
4456 using type // NOLINT
4457 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
4458 };
4459
4460 template<>
4461 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
4462 {};
4463
4464 template<size_t i>
4465 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
4466 {
4467 static_assert(
4468 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
4469 "Index must be less than 3");
4470
4471 using type // NOLINT
4472 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
4473 };
4474
4475 template<>
4476 struct tuple_size<Zivid::Settings2D::Processing::Color::Experimental> : integral_constant<size_t, 1>
4477 {};
4478
4479 template<size_t i>
4480 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Experimental>
4481 {
4482 static_assert(
4483 i < tuple_size<Zivid::Settings2D::Processing::Color::Experimental>::value,
4484 "Index must be less than 1");
4485
4486 using type // NOLINT
4487 = decltype(declval<Zivid::Settings2D::Processing::Color::Experimental>().get<i>());
4488 };
4489
4490 template<>
4491 struct tuple_size<Zivid::Settings2D::Sampling> : integral_constant<size_t, 3>
4492 {};
4493
4494 template<size_t i>
4495 struct tuple_element<i, Zivid::Settings2D::Sampling>
4496 {
4497 static_assert(i < tuple_size<Zivid::Settings2D::Sampling>::value, "Index must be less than 3");
4498
4499 using type // NOLINT
4500 = decltype(declval<Zivid::Settings2D::Sampling>().get<i>());
4501 };
4502
4503 template<>
4504 struct tuple_size<Zivid::Settings2D::Sampling::Interval> : integral_constant<size_t, 2>
4505 {};
4506
4507 template<size_t i>
4508 struct tuple_element<i, Zivid::Settings2D::Sampling::Interval>
4509 {
4510 static_assert(i < tuple_size<Zivid::Settings2D::Sampling::Interval>::value, "Index must be less than 2");
4511
4512 using type // NOLINT
4513 = decltype(declval<Zivid::Settings2D::Sampling::Interval>().get<i>());
4514 };
4515
4516 template<>
4517 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 3>
4518 {};
4519
4520 template<size_t i>
4521 struct tuple_element<i, Zivid::Settings2D>
4522 {
4523 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 3");
4524
4525 using type // NOLINT
4526 = decltype(declval<Zivid::Settings2D>().get<i>());
4527 };
4528
4529} // namespace std
4530# endif
4531#endif
4532
4533// If we have access to the DataModel library, automatically include internal DataModel
4534// header. This header is necessary for serialization and deserialization.
4535#if defined(__has_include) && !defined(NO_DOC)
4536# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
4537# include "Zivid/Settings2DInternal.h"
4538# endif
4539#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.
Digital gain applied to blue channel.
Definition Settings2D.h:1127
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1136
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1212
bool operator<=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1200
bool operator==(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1176
void reset()
Reset the node to unset state.
double ValueType
The type of the underlying value.
Definition Settings2D.h:1144
bool operator>(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1194
std::string toString() const
Get the value as string.
constexpr Blue(double value)
Constructor.
Definition Settings2D.h:1156
bool operator!=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1182
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1139
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1130
bool hasValue() const
Check if the value is set.
static constexpr Range< double > validRange()
The range of valid values for Blue.
Definition Settings2D.h:1147
bool operator<(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1188
bool operator>=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1206
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1133
Digital gain applied to green channel.
Definition Settings2D.h:1239
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1242
double ValueType
The type of the underlying value.
Definition Settings2D.h:1256
static constexpr Range< double > validRange()
The range of valid values for Green.
Definition Settings2D.h:1259
bool operator==(const Green &other) const
Comparison operator.
Definition Settings2D.h:1288
std::string toString() const
Get the value as string.
constexpr Green(double value)
Constructor.
Definition Settings2D.h:1268
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1248
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1324
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1251
bool operator<(const Green &other) const
Comparison operator.
Definition Settings2D.h:1300
bool hasValue() const
Check if the value is set.
bool operator<=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1312
bool operator>=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1318
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1245
bool operator!=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1294
bool operator>(const Green &other) const
Comparison operator.
Definition Settings2D.h:1306
void reset()
Reset the node to unset state.
Digital gain applied to red channel.
Definition Settings2D.h:1351
double ValueType
The type of the underlying value.
Definition Settings2D.h:1368
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1436
bool operator>=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1430
bool operator<(const Red &other) const
Comparison operator.
Definition Settings2D.h:1412
bool operator<=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1424
std::string toString() const
Get the value as string.
static constexpr Range< double > validRange()
The range of valid values for Red.
Definition Settings2D.h:1371
bool hasValue() const
Check if the value is set.
bool operator!=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1406
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1360
constexpr Red(double value)
Constructor.
Definition Settings2D.h:1380
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1354
bool operator==(const Red &other) const
Comparison operator.
Definition Settings2D.h:1400
void reset()
Reset the node to unset state.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1357
bool operator>(const Red &other) const
Comparison operator.
Definition Settings2D.h:1418
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1363
Color balance settings.
Definition Settings2D.h:1109
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:1658
Blue & blue()
Get Blue.
Definition Settings2D.h:1583
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:1692
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:1683
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition Settings2D.h:1459
const Blue & blue() const
Get Blue.
Definition Settings2D.h:1577
bool operator==(const Balance &other) const
Equality operator.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1112
Balance & set(const Blue &value)
Set Blue.
Definition Settings2D.h:1589
Red & red()
Get Red.
Definition Settings2D.h:1621
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1115
Green & green()
Get Green.
Definition Settings2D.h:1602
Balance & set(const Green &value)
Set Green.
Definition Settings2D.h:1608
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:1556
const Green & green() const
Get Green.
Definition Settings2D.h:1596
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1121
Balance & set(const Red &value)
Set Red.
Definition Settings2D.h:1627
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:1648
const Red & red() const
Get Red.
Definition Settings2D.h:1615
std::string toString() const
Get the value as string.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1520
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:1709
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:1638
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1118
This setting controls how the color image is computed.
Definition Settings2D.h:1766
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1772
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1769
friend std::ostream & operator<<(std::ostream &stream, const Mode &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1853
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1775
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1778
static const Mode toneMapping
toneMapping
Definition Settings2D.h:1803
bool operator==(const Mode &other) const
Comparison operator.
Definition Settings2D.h:1841
static const Mode automatic
automatic
Definition Settings2D.h:1802
bool operator!=(const Mode &other) const
Comparison operator.
Definition Settings2D.h:1847
void reset()
Reset the node to unset state.
constexpr Mode(ValueType value)
Constructor.
Definition Settings2D.h:1815
bool hasValue() const
Check if the value is set.
static std::set< ValueType > validValues()
All valid values of Mode.
Definition Settings2D.h:1806
friend std::ostream & operator<<(std::ostream &stream, const Mode::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:1835
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition Settings2D.h:1798
Experimental color settings. These may be renamed, moved or deleted in the future.
Definition Settings2D.h:1732
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1738
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2029
Mode & mode()
Get Mode.
Definition Settings2D.h:1992
const Mode & mode() const
Get Mode.
Definition Settings2D.h:1986
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1735
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1744
friend std::ostream & operator<<(std::ostream &stream, const Experimental &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2044
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:2022
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1931
std::tuple< Settings2D::Processing::Color::Experimental::Mode > Descendants
Definition Settings2D.h:1877
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1741
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:2009
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:1998
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:1965
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition Settings2D.h:2067
double ValueType
The type of the underlying value.
Definition Settings2D.h:2086
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2070
static constexpr Range< double > validRange()
The range of valid values for Gamma.
Definition Settings2D.h:2089
bool operator>(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2136
bool operator==(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2118
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2154
bool operator!=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2124
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2079
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:2130
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2076
void reset()
Reset the node to unset state.
bool operator>=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2148
constexpr Gamma(double value)
Constructor.
Definition Settings2D.h:2098
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2073
Gamma()=default
Default constructor.
bool operator<=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:2142
double value() const
Get the value.
Color settings.
Definition Settings2D.h:1091
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2249
Color & set(const Balance::Green &value)
Set Balance::Green.
Definition Settings2D.h:2335
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:2349
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1097
std::string toString() const
Get the value as string.
const Balance & balance() const
Get Balance.
Definition Settings2D.h:2309
Color & set(const Balance::Blue &value)
Set Balance::Blue.
Definition Settings2D.h:2328
Balance & balance()
Get Balance.
Definition Settings2D.h:2315
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:2477
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2503
Experimental & experimental()
Get Experimental.
Definition Settings2D.h:2355
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:2443
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:2452
Color & set(const Experimental::Mode &value)
Set Experimental::Mode.
Definition Settings2D.h:2368
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:2415
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1100
Gamma & gamma()
Get Gamma.
Definition Settings2D.h:2381
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1094
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:2424
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:2433
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:2288
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:2397
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:2176
const Gamma & gamma() const
Get Gamma.
Definition Settings2D.h:2375
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:2406
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1103
Color & set(const Balance &value)
Set Balance.
Definition Settings2D.h:2321
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2486
Color & set(const Gamma &value)
Set Gamma.
Definition Settings2D.h:2387
Color & set(const Experimental &value)
Set Experimental.
Definition Settings2D.h:2361
Color & set(const Balance::Red &value)
Set Balance::Red.
Definition Settings2D.h:2342
2D processing settings.
Definition Settings2D.h:1073
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:2727
static constexpr const char * description
The description for this value.
Definition Settings2D.h:1085
Processing & set(const Color::Gamma &value)
Set Color::Gamma.
Definition Settings2D.h:2718
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:2669
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:1076
Processing & set(const Color::Experimental &value)
Set Color::Experimental.
Definition Settings2D.h:2704
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:2735
Processing & set(const Color::Experimental::Mode &value)
Set Color::Experimental::Mode.
Definition Settings2D.h:2711
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2823
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:2771
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:2801
Color & color()
Get Color.
Definition Settings2D.h:2663
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2598
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:2522
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue.
Definition Settings2D.h:2683
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:1079
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:2780
Processing & set(const Color::Balance &value)
Set Color::Balance.
Definition Settings2D.h:2676
const Color & color() const
Get Color.
Definition Settings2D.h:2657
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red.
Definition Settings2D.h:2697
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:2788
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:2762
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:2637
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:2744
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:2753
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:2808
Processing()
Default constructor.
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green.
Definition Settings2D.h:2690
static constexpr const char * name
The name of this value.
Definition Settings2D.h:1082
Choose how to sample colors for the 2D image.
Definition Settings2D.h:2880
ValueType
The type of the underlying value.
Definition Settings2D.h:2912
@ grayscale
Definition Settings2D.h:2914
@ rgbStrongAmbientLight
Definition Settings2D.h:2915
@ rgbAmbientSuppression
Definition Settings2D.h:2916
Color()=default
Default constructor.
void reset()
Reset the node to unset state.
static const Color grayscale
grayscale
Definition Settings2D.h:2919
static std::set< ValueType > validValues()
All valid values of Color.
Definition Settings2D.h:2924
static const Color rgbAmbientSuppression
rgbAmbientSuppression
Definition Settings2D.h:2921
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2883
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:2974
constexpr Color(ValueType value)
Constructor.
Definition Settings2D.h:2936
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2892
bool hasValue() const
Check if the value is set.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2886
static const Color rgb
rgb
Definition Settings2D.h:2918
bool operator==(const Color &other) const
Comparison operator.
Definition Settings2D.h:2962
bool operator!=(const Color &other) const
Comparison operator.
Definition Settings2D.h:2968
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2889
std::string toString() const
Get the value as string.
static const Color rgbStrongAmbientLight
rgbStrongAmbientLight
Definition Settings2D.h:2920
friend std::ostream & operator<<(std::ostream &stream, const Color::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:2956
Duration between successive sensor operations, in microseconds. The effective interval might be round...
Definition Settings2D.h:3040
friend std::ostream & operator<<(std::ostream &stream, const Duration &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3128
std::chrono::microseconds ValueType
The type of the underlying value.
Definition Settings2D.h:3060
bool operator<(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3104
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3049
bool operator==(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3092
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:3110
Duration()=default
Default constructor.
bool operator!=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3098
constexpr Duration(std::chrono::microseconds value)
Constructor.
Definition Settings2D.h:3072
bool operator>=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3122
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3046
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for Duration.
Definition Settings2D.h:3063
std::string toString() const
Get the value as string.
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3043
bool operator<=(const Duration &other) const
Comparison operator.
Definition Settings2D.h:3116
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3052
bool hasValue() const
Check if the value is set.
Enable or disable sampling interval.
Definition Settings2D.h:3155
static const Enabled no
Off/disabled.
Definition Settings2D.h:3174
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3158
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3167
Enabled()=default
Default constructor.
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3161
bool operator==(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3206
void reset()
Reset the node to unset state.
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3164
constexpr Enabled(bool value)
Constructor.
Definition Settings2D.h:3186
std::string toString() const
Get the value as string.
static std::set< bool > validValues()
All valid values of Enabled.
Definition Settings2D.h:3177
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:3218
static const Enabled yes
On/enabled.
Definition Settings2D.h:3173
bool ValueType
The type of the underlying value.
Definition Settings2D.h:3172
bool operator!=(const Enabled &other) const
Comparison operator.
Definition Settings2D.h:3212
Sampling interval controls the interval between successive sensor operations (e.g....
Definition Settings2D.h:3010
friend std::ostream & operator<<(std::ostream &stream, const Interval &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3436
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3022
Enabled & isEnabled()
Get Enabled.
Definition Settings2D.h:3368
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3016
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:3322
bool operator==(const Interval &other) const
Equality operator.
Interval & set(const Duration &value)
Set Duration.
Definition Settings2D.h:3355
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3420
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:3412
Duration & duration()
Get Duration.
Definition Settings2D.h:3349
std::tuple< Settings2D::Sampling::Interval::Duration, Settings2D::Sampling::Interval::Enabled > Descendants
Definition Settings2D.h:3231
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:3393
bool operator!=(const Interval &other) const
Inequality operator.
const Duration & duration() const
Get Duration.
Definition Settings2D.h:3343
Interval & set(const Enabled &value)
Set Enabled.
Definition Settings2D.h:3374
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3019
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3013
const Enabled & isEnabled() const
Get Enabled.
Definition Settings2D.h:3362
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3288
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:3384
Set the pixel sampling to use for the 2D capture. This setting defines how the camera sensor is sampl...
Definition Settings2D.h:3460
static const Pixel redSubsample4x4
redSubsample4x4
Definition Settings2D.h:3493
static const Pixel by2x2
by2x2
Definition Settings2D.h:3494
Pixel()=default
Default constructor.
constexpr Pixel(ValueType value)
Constructor.
Definition Settings2D.h:3513
ValueType
The type of the underlying value.
Definition Settings2D.h:3480
@ by4x4
Definition Settings2D.h:3487
@ redSubsample2x2
Definition Settings2D.h:3483
@ blueSubsample4x4
Definition Settings2D.h:3484
@ blueSubsample2x2
Definition Settings2D.h:3482
@ by2x2
Definition Settings2D.h:3486
@ redSubsample4x4
Definition Settings2D.h:3485
static const Pixel by4x4
by4x4
Definition Settings2D.h:3495
bool operator!=(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:3545
ValueType value() const
Get the value.
bool operator==(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:3539
static const Pixel redSubsample2x2
redSubsample2x2
Definition Settings2D.h:3491
static const Pixel all
all
Definition Settings2D.h:3489
static std::set< ValueType > validValues()
All valid values of Pixel.
Definition Settings2D.h:3498
static constexpr const char * name
The name of this value.
Definition Settings2D.h:3469
std::string toString() const
Get the value as string.
static const Pixel blueSubsample2x2
blueSubsample2x2
Definition Settings2D.h:3490
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:3463
friend std::ostream & operator<<(std::ostream &stream, const Pixel::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:3533
friend std::ostream & operator<<(std::ostream &stream, const Pixel &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:3551
static constexpr const char * description
The description for this value.
Definition Settings2D.h:3472
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:3466
void reset()
Reset the node to unset state.
static const Pixel blueSubsample4x4
blueSubsample4x4
Definition Settings2D.h:3492
bool hasValue() const
Check if the value is set.
Sampling settings.
Definition Settings2D.h:2845
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3840
bool operator==(const Sampling &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3644
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:3790
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition Settings2D.h:2848
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:3806
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:3798
Sampling & set(const Interval::Enabled &value)
Set Interval::Enabled.
Definition Settings2D.h:3745
Sampling & set(const Pixel &value)
Set Pixel.
Definition Settings2D.h:3764
const Pixel & pixel() const
Get Pixel.
Definition Settings2D.h:3752
Pixel & pixel()
Get Pixel.
Definition Settings2D.h:3758
static constexpr const char * path
The full path for this value.
Definition Settings2D.h:2851
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:3831
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:3773
friend std::ostream & operator<<(std::ostream &stream, const Sampling &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3857
bool operator!=(const Sampling &other) const
Inequality operator.
static constexpr const char * description
The description for this value.
Definition Settings2D.h:2857
Sampling & set(const Interval::Duration &value)
Set Interval::Duration.
Definition Settings2D.h:3738
const Color & color() const
Get Color.
Definition Settings2D.h:3700
Sampling & set(const Interval &value)
Set Interval.
Definition Settings2D.h:3731
Sampling & set(const Color &value)
Set Color.
Definition Settings2D.h:3712
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:3680
Color & color()
Get Color.
Definition Settings2D.h:3706
const Interval & interval() const
Get Interval.
Definition Settings2D.h:3719
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:3781
Interval & interval()
Get Interval.
Definition Settings2D.h:3725
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:3577
static constexpr const char * name
The name of this value.
Definition Settings2D.h:2854
Settings used when capturing 2D images with a Zivid camera.
Definition Settings2D.h:79
Settings2D & set(const Processing &value)
Set Processing.
Definition Settings2D.h:4089
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:4325
static constexpr size_t version
Definition Settings2D.h:95
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:4220
Settings2D & set(const Sampling::Interval::Enabled &value)
Set Sampling::Interval::Enabled.
Definition Settings2D.h:4192
Sampling & sampling()
Get Sampling.
Definition Settings2D.h:4158
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:4293
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:4254
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:4246
Settings2D & set(const Sampling::Color &value)
Set Sampling::Color.
Definition Settings2D.h:4171
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:4237
const Acquisitions & acquisitions() const
Get Acquisitions.
Definition Settings2D.h:4058
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:4359
std::tuple< Settings2D::Acquisitions, Settings2D::Processing, Settings2D::Processing::Color, Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::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:3876
Settings2D & set(const Sampling::Interval &value)
Set Sampling::Interval.
Definition Settings2D.h:4178
Settings2D & set(const Sampling &value)
Set Sampling.
Definition Settings2D.h:4164
Settings2D(Args &&...args)
Constructor taking variadic number of arguments.
Definition Settings2D.h:3950
const Settings2D::Sampling::Interval & get() const
Definition Settings2D.h:4301
const Settings2D::Acquisitions & get() const
Definition Settings2D.h:4206
Settings2D()
Default constructor.
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:4279
Settings2D & set(const Acquisitions &value)
Set Acquisitions.
Definition Settings2D.h:4070
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:4185
const Settings2D::Sampling & get() const
Definition Settings2D.h:4285
const Settings2D::Sampling::Interval::Duration & get() const
Definition Settings2D.h:4309
void load(const std::string &fileName)
Load from the given file.
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:4228
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green.
Definition Settings2D.h:4117
bool operator!=(const Settings2D &other) const
Inequality operator.
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance.
Definition Settings2D.h:4103
const Settings2D::Processing::Color::Experimental & get() const
Definition Settings2D.h:4262
const Settings2D::Processing & get() const
Definition Settings2D.h:4212
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:4124
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:3992
Processing & processing()
Get Processing.
Definition Settings2D.h:4083
const Processing & processing() const
Get Processing.
Definition Settings2D.h:4077
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:4039
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue.
Definition Settings2D.h:4110
Settings2D & set(const Processing::Color::Experimental::Mode &value)
Set Processing::Color::Experimental::Mode.
Definition Settings2D.h:4138
Acquisitions & acquisitions()
Get Acquisitions.
Definition Settings2D.h:4064
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:4131
Settings2D & set(const Sampling::Pixel &value)
Set Sampling::Pixel.
Definition Settings2D.h:4199
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:4350
const Settings2D::Sampling::Interval::Enabled & get() const
Definition Settings2D.h:4317
const Settings2D::Processing::Color::Experimental::Mode & get() const
Definition Settings2D.h:4271
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:4152
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:4376
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:4096
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma.
Definition Settings2D.h:4145
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:84