Zivid C++ API 2.8.1+dd4dffea-1
Defining the Future of 3D Machine Vision
Settings2D.h
Go to the documentation of this file.
1
2
3/*******************************************************************************
4
5 * This file is part of the Zivid 3D Camera API
6
7 *
8
9 * Copyright 2015-2022 (C) Zivid AS
10
11 * All rights reserved.
12
13 *
14
15 * Zivid Software License, v1.0
16
17 *
18
19 * Redistribution and use in source and binary forms, with or without
20
21 * modification, are permitted provided that the following conditions are met:
22
23 *
24
25 * 1. Redistributions of source code must retain the above copyright notice,
26
27 * this list of conditions and the following disclaimer.
28
29 *
30
31 * 2. Redistributions in binary form must reproduce the above copyright notice,
32
33 * this list of conditions and the following disclaimer in the documentation
34
35 * and/or other materials provided with the distribution.
36
37 *
38
39 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40
41 * to endorse or promote products derived from this software without specific
42
43 * prior written permission.
44
45 *
46
47 * 4. This software, with or without modification, must not be used with any
48
49 * other 3D camera than from Zivid AS.
50
51 *
52
53 * 5. Any software provided in binary form under this license must not be
54
55 * reverse engineered, decompiled, modified and/or disassembled.
56
57 *
58
59 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60
61 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
63 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
65 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
69 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70
71 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72
73 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
75 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78
79 *
80
81 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82
83 * Info: http://www.zivid.com
84
85 ******************************************************************************/
86
87
88
89#pragma once
90
91#include <array>
92#include <chrono>
93#include <cmath>
94#include <ctime>
95#include <iomanip>
96#include <memory>
97#include <set>
98#include <sstream>
99#include <string>
100#include <tuple>
101#include <utility>
102#include <vector>
103
109#include "Zivid/Range.h"
110
111#ifdef _MSC_VER
112# pragma warning(push)
113# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114#endif
115
116namespace Zivid
117{
118
121 {
122 public:
125
127 static constexpr const char *path{ "" };
128
130 static constexpr const char *name{ "Settings2D" };
131
133 static constexpr const char *description{
134 R"description(Settings used when capturing 2D images with a Zivid camera)description"
135 };
136
137 static constexpr size_t version{ 3 };
138
139#ifndef NO_DOC
140 template<size_t>
141 struct Version;
142
143 using LatestVersion = Zivid::Settings2D;
144
145 // Short identifier. This value is not guaranteed to be universally unique
146 // Todo(ZIVID-2808): Move this to internal DataModelExt header
147 static constexpr std::array<uint8_t, 3> binaryId{ 's', 't', '2' };
148
149#endif
150
153 {
154 public:
157
159 static constexpr const char *path{ "Acquisition" };
160
162 static constexpr const char *name{ "Acquisition" };
163
165 static constexpr const char *description{ R"description(Settings for a single acquisition)description" };
166
171 {
172 public:
175
177 static constexpr const char *path{ "Acquisition/Aperture" };
178
180 static constexpr const char *name{ "Aperture" };
181
183 static constexpr const char *description{
184 R"description(Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to
185the effective aperture diameter).
186)description"
187 };
188
190 using ValueType = double;
191
193 static constexpr Range<double> validRange()
194 {
195 return { 1.4, 32.0 };
196 }
197
199 Aperture() = default;
200
202 explicit constexpr Aperture(double value)
203 : m_opt{ verifyValue(value) }
204 {}
205
210 double value() const;
211
213 bool hasValue() const;
214
216 void reset();
217
219 std::string toString() const;
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 bool operator<(const Aperture &other) const
235 {
236 return m_opt < other.m_opt;
237 }
238
240 bool operator>(const Aperture &other) const
241 {
242 return m_opt > other.m_opt;
243 }
244
246 friend std::ostream &operator<<(std::ostream &stream, const Aperture &value)
247 {
248 return stream << value.toString();
249 }
250
251 private:
252 void setFromString(const std::string &value);
253
254 constexpr ValueType static verifyValue(const ValueType &value)
255 {
256 return validRange().isInRange(value)
257 ? value
258 : throw std::out_of_range{ "Aperture{ " + std::to_string(value) + " } is not in range ["
259 + std::to_string(validRange().min()) + ", "
260 + std::to_string(validRange().max()) + "]" };
261 }
262
263 Zivid::DataModel::Detail::Optional<double> m_opt;
264
265 friend struct DataModel::Detail::Befriend<Aperture>;
266 };
267
280 {
281 public:
284
286 static constexpr const char *path{ "Acquisition/Brightness" };
287
289 static constexpr const char *name{ "Brightness" };
290
292 static constexpr const char *description{
293 R"description(Brightness controls the light output from the projector.
294
295Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
296or in case of high levels of ambient lighting.
297
298When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
299can capture) will be reduced. The duty cycle in boost mode is 50%. The duty cycle is calculated
300over a 10 second period. This limitation is enforced automatically by the camera. Calling capture
301when the duty cycle limit has been reached will cause the camera to first wait (sleep) for a
302duration of time to cool down, before capture will start.
303)description"
304 };
305
307 using ValueType = double;
308
310 static constexpr Range<double> validRange()
311 {
312 return { 0, 1.8 };
313 }
314
316 Brightness() = default;
317
319 explicit constexpr Brightness(double value)
320 : m_opt{ verifyValue(value) }
321 {}
322
327 double value() const;
328
330 bool hasValue() const;
331
333 void reset();
334
336 std::string toString() const;
337
339 bool operator==(const Brightness &other) const
340 {
341 return m_opt == other.m_opt;
342 }
343
345 bool operator!=(const Brightness &other) const
346 {
347 return m_opt != other.m_opt;
348 }
349
351 bool operator<(const Brightness &other) const
352 {
353 return m_opt < other.m_opt;
354 }
355
357 bool operator>(const Brightness &other) const
358 {
359 return m_opt > other.m_opt;
360 }
361
363 friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
364 {
365 return stream << value.toString();
366 }
367
368 private:
369 void setFromString(const std::string &value);
370
371 constexpr ValueType static verifyValue(const ValueType &value)
372 {
373 return validRange().isInRange(value)
374 ? value
375 : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
376 + " } is not in range [" + std::to_string(validRange().min())
377 + ", " + std::to_string(validRange().max()) + "]" };
378 }
379
380 Zivid::DataModel::Detail::Optional<double> m_opt;
381
382 friend struct DataModel::Detail::Befriend<Brightness>;
383 };
384
387 {
388 public:
391
393 static constexpr const char *path{ "Acquisition/ExposureTime" };
394
396 static constexpr const char *name{ "ExposureTime" };
397
399 static constexpr const char *description{ R"description(Exposure time for the image)description" };
400
402 using ValueType = std::chrono::microseconds;
403
406 {
407 return { std::chrono::microseconds{ 1677 }, std::chrono::microseconds{ 100000 } };
408 }
409
411 ExposureTime() = default;
412
414 explicit constexpr ExposureTime(std::chrono::microseconds value)
415 : m_opt{ verifyValue(value) }
416 {}
417
422 std::chrono::microseconds value() const;
423
425 bool hasValue() const;
426
428 void reset();
429
431 std::string toString() const;
432
434 bool operator==(const ExposureTime &other) const
435 {
436 return m_opt == other.m_opt;
437 }
438
440 bool operator!=(const ExposureTime &other) const
441 {
442 return m_opt != other.m_opt;
443 }
444
446 bool operator<(const ExposureTime &other) const
447 {
448 return m_opt < other.m_opt;
449 }
450
452 bool operator>(const ExposureTime &other) const
453 {
454 return m_opt > other.m_opt;
455 }
456
458 friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
459 {
460 return stream << value.toString();
461 }
462
463 private:
464 void setFromString(const std::string &value);
465
466 constexpr ValueType static verifyValue(const ValueType &value)
467 {
468 return validRange().isInRange(value)
469 ? value
470 : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
471 + " } is not in range ["
472 + std::to_string(validRange().min().count()) + ", "
473 + std::to_string(validRange().max().count()) + "]" };
474 }
475
476 Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
477
478 friend struct DataModel::Detail::Befriend<ExposureTime>;
479 };
480
483 {
484 public:
487
489 static constexpr const char *path{ "Acquisition/Gain" };
490
492 static constexpr const char *name{ "Gain" };
493
495 static constexpr const char *description{ R"description(Analog gain in the camera)description" };
496
498 using ValueType = double;
499
501 static constexpr Range<double> validRange()
502 {
503 return { 1, 16 };
504 }
505
507 Gain() = default;
508
510 explicit constexpr Gain(double value)
511 : m_opt{ verifyValue(value) }
512 {}
513
518 double value() const;
519
521 bool hasValue() const;
522
524 void reset();
525
527 std::string toString() const;
528
530 bool operator==(const Gain &other) const
531 {
532 return m_opt == other.m_opt;
533 }
534
536 bool operator!=(const Gain &other) const
537 {
538 return m_opt != other.m_opt;
539 }
540
542 bool operator<(const Gain &other) const
543 {
544 return m_opt < other.m_opt;
545 }
546
548 bool operator>(const Gain &other) const
549 {
550 return m_opt > other.m_opt;
551 }
552
554 friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
555 {
556 return stream << value.toString();
557 }
558
559 private:
560 void setFromString(const std::string &value);
561
562 constexpr ValueType static verifyValue(const ValueType &value)
563 {
564 return validRange().isInRange(value)
565 ? value
566 : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
567 + std::to_string(validRange().min()) + ", "
568 + std::to_string(validRange().max()) + "]" };
569 }
570
571 Zivid::DataModel::Detail::Optional<double> m_opt;
572
573 friend struct DataModel::Detail::Befriend<Gain>;
574 };
575
576 using Descendants = std::tuple<
581
584
599#ifndef NO_DOC
600 template<
601 typename... Args,
602 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
603 typename std::enable_if<
604 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
605 value,
606 int>::type = 0>
607#else
608 template<typename... Args>
609#endif
610 explicit Acquisition(Args &&...args)
611 {
612 using namespace Zivid::Detail::TypeTraits;
613
614 static_assert(
615 AllArgsDecayedAreUnique<Args...>::value,
616 "Found duplicate types among the arguments passed to Acquisition(...). "
617 "Types should be listed at most once.");
618
619 set(std::forward<Args>(args)...);
620 }
621
635#ifndef NO_DOC
636 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
637#else
638 template<typename... Args>
639#endif
640 void set(Args &&...args)
641 {
642 using namespace Zivid::Detail::TypeTraits;
643
644 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
645 static_assert(
646 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
647
648 static_assert(
649 AllArgsDecayedAreUnique<Args...>::value,
650 "Found duplicate types among the arguments passed to set(...). "
651 "Types should be listed at most once.");
652
653 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
654 }
655
670#ifndef NO_DOC
671 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
672#else
673 template<typename... Args>
674#endif
675 Acquisition copyWith(Args &&...args) const
676 {
677 using namespace Zivid::Detail::TypeTraits;
678
679 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
680 static_assert(
681 AllArgsAreDescendantNodes::value,
682 "All arguments passed to copyWith(...) must be descendant nodes.");
683
684 static_assert(
685 AllArgsDecayedAreUnique<Args...>::value,
686 "Found duplicate types among the arguments passed to copyWith(...). "
687 "Types should be listed at most once.");
688
689 auto copy{ *this };
690 copy.set(std::forward<Args>(args)...);
691 return copy;
692 }
693
695 const Aperture &aperture() const
696 {
697 return m_aperture;
698 }
699
702 {
703 return m_aperture;
704 }
705
707 Acquisition &set(const Aperture &value)
708 {
709 m_aperture = value;
710 return *this;
711 }
712
714 const Brightness &brightness() const
715 {
716 return m_brightness;
717 }
718
721 {
722 return m_brightness;
723 }
724
727 {
728 m_brightness = value;
729 return *this;
730 }
731
734 {
735 return m_exposureTime;
736 }
737
740 {
741 return m_exposureTime;
742 }
743
746 {
747 m_exposureTime = value;
748 return *this;
749 }
750
752 const Gain &gain() const
753 {
754 return m_gain;
755 }
756
759 {
760 return m_gain;
761 }
762
764 Acquisition &set(const Gain &value)
765 {
766 m_gain = value;
767 return *this;
768 }
769
770 template<
771 typename T,
772 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
774 {
775 return m_aperture;
776 }
777
778 template<
779 typename T,
780 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
782 {
783 return m_brightness;
784 }
785
786 template<
787 typename T,
788 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
790 {
791 return m_exposureTime;
792 }
793
794 template<
795 typename T,
796 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
798 {
799 return m_gain;
800 }
801
802 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
804 {
805 return m_aperture;
806 }
807
808 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
810 {
811 return m_brightness;
812 }
813
814 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
816 {
817 return m_exposureTime;
818 }
819
820 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
822 {
823 return m_gain;
824 }
825
827 template<typename F>
828 void forEach(const F &f) const
829 {
830 f(m_aperture);
831 f(m_brightness);
832 f(m_exposureTime);
833 f(m_gain);
834 }
835
837 template<typename F>
838 void forEach(const F &f)
839 {
840 f(m_aperture);
841 f(m_brightness);
842 f(m_exposureTime);
843 f(m_gain);
844 }
845
847 bool operator==(const Acquisition &other) const;
848
850 bool operator!=(const Acquisition &other) const;
851
853 std::string toString() const;
854
856 friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
857 {
858 return stream << value.toString();
859 }
860
861 private:
862 void setFromString(const std::string &value);
863
864 void setFromString(const std::string &fullPath, const std::string &value);
865
866 std::string getString(const std::string &fullPath) const;
867
868 Aperture m_aperture;
869 Brightness m_brightness;
870 ExposureTime m_exposureTime;
871 Gain m_gain;
872
873 friend struct DataModel::Detail::Befriend<Acquisition>;
874 };
875
878 {
879 public:
882
884 static constexpr const char *path{ "Acquisitions" };
885
887 static constexpr const char *name{ "Acquisitions" };
888
890 static constexpr const char *description{
891 R"description(List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mode.)description"
892 };
893
895 using ValueType = std::vector<Settings2D::Acquisition>;
896
899 {
900 return { 0, std::numeric_limits<ValueType::size_type>::max() };
901 }
902
904 Acquisitions() = default;
905
907 explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
908 : m_value{ std::move(value) }
909 {}
910
912 explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
913 : Acquisitions{ ValueType{ value } }
914 {}
915
917 const std::vector<Settings2D::Acquisition> &value() const;
918
920 std::string toString() const;
921
923 std::size_t size() const noexcept;
924
926 bool isEmpty() const noexcept;
927
933 template<typename... Args>
934 void emplaceBack(Args &&...args)
935 {
936 m_value.emplace_back(std::forward<Args>(args)...);
937 }
938
944 Settings2D::Acquisition &at(std::size_t pos);
945
951 const Settings2D::Acquisition &at(std::size_t pos) const;
952
959
965 const Settings2D::Acquisition &operator[](std::size_t pos) const;
966
968 template<typename F>
969 void forEach(const F &f)
970 {
971 for(auto &child : m_value)
972 {
973 f(child);
974 }
975 }
976
978 template<typename F>
979 void forEach(const F &f) const
980 {
981 for(const auto &child : m_value)
982 {
983 f(child);
984 }
985 }
986
988 bool operator==(const Acquisitions &other) const
989 {
990 return m_value == other.m_value;
991 }
992
994 bool operator!=(const Acquisitions &other) const
995 {
996 return m_value != other.m_value;
997 }
998
1000 friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
1001 {
1002 return stream << value.toString();
1003 }
1004
1005 private:
1006 void setFromString(const std::string &value);
1007
1008 std::vector<Settings2D::Acquisition> m_value{};
1009
1010 friend struct DataModel::Detail::Befriend<Acquisitions>;
1011 };
1012
1015 {
1016 public:
1019
1021 static constexpr const char *path{ "Processing" };
1022
1024 static constexpr const char *name{ "Processing" };
1025
1027 static constexpr const char *description{ R"description(Processing related settings)description" };
1028
1031 {
1032 public:
1035
1037 static constexpr const char *path{ "Processing/Color" };
1038
1040 static constexpr const char *name{ "Color" };
1041
1043 static constexpr const char *description{ R"description(Color settings)description" };
1044
1047 {
1048 public:
1051
1053 static constexpr const char *path{ "Processing/Color/Balance" };
1054
1056 static constexpr const char *name{ "Balance" };
1057
1059 static constexpr const char *description{ R"description(Color balance settings)description" };
1060
1063 {
1064 public:
1067
1069 static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1070
1072 static constexpr const char *name{ "Blue" };
1073
1075 static constexpr const char *description{
1076 R"description(Digital gain applied to blue channel)description"
1077 };
1078
1080 using ValueType = double;
1081
1083 static constexpr Range<double> validRange()
1084 {
1085 return { 1.0, 8.0 };
1086 }
1087
1089 Blue() = default;
1090
1092 explicit constexpr Blue(double value)
1093 : m_opt{ verifyValue(value) }
1094 {}
1095
1100 double value() const;
1101
1103 bool hasValue() const;
1104
1106 void reset();
1107
1109 std::string toString() const;
1110
1112 bool operator==(const Blue &other) const
1113 {
1114 return m_opt == other.m_opt;
1115 }
1116
1118 bool operator!=(const Blue &other) const
1119 {
1120 return m_opt != other.m_opt;
1121 }
1122
1124 bool operator<(const Blue &other) const
1125 {
1126 return m_opt < other.m_opt;
1127 }
1128
1130 bool operator>(const Blue &other) const
1131 {
1132 return m_opt > other.m_opt;
1133 }
1134
1136 friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1137 {
1138 return stream << value.toString();
1139 }
1140
1141 private:
1142 void setFromString(const std::string &value);
1143
1144 constexpr ValueType static verifyValue(const ValueType &value)
1145 {
1146 return validRange().isInRange(value)
1147 ? value
1148 : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1149 + " } is not in range ["
1150 + std::to_string(validRange().min()) + ", "
1151 + std::to_string(validRange().max()) + "]" };
1152 }
1153
1154 Zivid::DataModel::Detail::Optional<double> m_opt;
1155
1156 friend struct DataModel::Detail::Befriend<Blue>;
1157 };
1158
1161 {
1162 public:
1165
1167 static constexpr const char *path{ "Processing/Color/Balance/Green" };
1168
1170 static constexpr const char *name{ "Green" };
1171
1173 static constexpr const char *description{
1174 R"description(Digital gain applied to green channel)description"
1175 };
1176
1178 using ValueType = double;
1179
1181 static constexpr Range<double> validRange()
1182 {
1183 return { 1.0, 8.0 };
1184 }
1185
1187 Green() = default;
1188
1190 explicit constexpr Green(double value)
1191 : m_opt{ verifyValue(value) }
1192 {}
1193
1198 double value() const;
1199
1201 bool hasValue() const;
1202
1204 void reset();
1205
1207 std::string toString() const;
1208
1210 bool operator==(const Green &other) const
1211 {
1212 return m_opt == other.m_opt;
1213 }
1214
1216 bool operator!=(const Green &other) const
1217 {
1218 return m_opt != other.m_opt;
1219 }
1220
1222 bool operator<(const Green &other) const
1223 {
1224 return m_opt < other.m_opt;
1225 }
1226
1228 bool operator>(const Green &other) const
1229 {
1230 return m_opt > other.m_opt;
1231 }
1232
1234 friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1235 {
1236 return stream << value.toString();
1237 }
1238
1239 private:
1240 void setFromString(const std::string &value);
1241
1242 constexpr ValueType static verifyValue(const ValueType &value)
1243 {
1244 return validRange().isInRange(value)
1245 ? value
1246 : throw std::out_of_range{ "Green{ " + std::to_string(value)
1247 + " } is not in range ["
1248 + std::to_string(validRange().min()) + ", "
1249 + std::to_string(validRange().max()) + "]" };
1250 }
1251
1252 Zivid::DataModel::Detail::Optional<double> m_opt;
1253
1254 friend struct DataModel::Detail::Befriend<Green>;
1255 };
1256
1259 {
1260 public:
1263
1265 static constexpr const char *path{ "Processing/Color/Balance/Red" };
1266
1268 static constexpr const char *name{ "Red" };
1269
1271 static constexpr const char *description{
1272 R"description(Digital gain applied to red channel)description"
1273 };
1274
1276 using ValueType = double;
1277
1279 static constexpr Range<double> validRange()
1280 {
1281 return { 1.0, 8.0 };
1282 }
1283
1285 Red() = default;
1286
1288 explicit constexpr Red(double value)
1289 : m_opt{ verifyValue(value) }
1290 {}
1291
1296 double value() const;
1297
1299 bool hasValue() const;
1300
1302 void reset();
1303
1305 std::string toString() const;
1306
1308 bool operator==(const Red &other) const
1309 {
1310 return m_opt == other.m_opt;
1311 }
1312
1314 bool operator!=(const Red &other) const
1315 {
1316 return m_opt != other.m_opt;
1317 }
1318
1320 bool operator<(const Red &other) const
1321 {
1322 return m_opt < other.m_opt;
1323 }
1324
1326 bool operator>(const Red &other) const
1327 {
1328 return m_opt > other.m_opt;
1329 }
1330
1332 friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1333 {
1334 return stream << value.toString();
1335 }
1336
1337 private:
1338 void setFromString(const std::string &value);
1339
1340 constexpr ValueType static verifyValue(const ValueType &value)
1341 {
1342 return validRange().isInRange(value)
1343 ? value
1344 : throw std::out_of_range{ "Red{ " + std::to_string(value)
1345 + " } is not in range ["
1346 + std::to_string(validRange().min()) + ", "
1347 + std::to_string(validRange().max()) + "]" };
1348 }
1349
1350 Zivid::DataModel::Detail::Optional<double> m_opt;
1351
1352 friend struct DataModel::Detail::Befriend<Red>;
1353 };
1354
1355 using Descendants = std::tuple<
1359
1362
1376#ifndef NO_DOC
1377 template<
1378 typename... Args,
1379 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1380 typename std::enable_if<
1381 Zivid::Detail::TypeTraits::
1382 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1383 int>::type = 0>
1384#else
1385 template<typename... Args>
1386#endif
1387 explicit Balance(Args &&...args)
1388 {
1389 using namespace Zivid::Detail::TypeTraits;
1390
1391 static_assert(
1392 AllArgsDecayedAreUnique<Args...>::value,
1393 "Found duplicate types among the arguments passed to Balance(...). "
1394 "Types should be listed at most once.");
1395
1396 set(std::forward<Args>(args)...);
1397 }
1398
1411#ifndef NO_DOC
1412 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1413#else
1414 template<typename... Args>
1415#endif
1416 void set(Args &&...args)
1417 {
1418 using namespace Zivid::Detail::TypeTraits;
1419
1420 using AllArgsAreDescendantNodes =
1421 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1422 static_assert(
1423 AllArgsAreDescendantNodes::value,
1424 "All arguments passed to set(...) must be descendant nodes.");
1425
1426 static_assert(
1427 AllArgsDecayedAreUnique<Args...>::value,
1428 "Found duplicate types among the arguments passed to set(...). "
1429 "Types should be listed at most once.");
1430
1431 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1432 }
1433
1447#ifndef NO_DOC
1448 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1449#else
1450 template<typename... Args>
1451#endif
1452 Balance copyWith(Args &&...args) const
1453 {
1454 using namespace Zivid::Detail::TypeTraits;
1455
1456 using AllArgsAreDescendantNodes =
1457 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1458 static_assert(
1459 AllArgsAreDescendantNodes::value,
1460 "All arguments passed to copyWith(...) must be descendant nodes.");
1461
1462 static_assert(
1463 AllArgsDecayedAreUnique<Args...>::value,
1464 "Found duplicate types among the arguments passed to copyWith(...). "
1465 "Types should be listed at most once.");
1466
1467 auto copy{ *this };
1468 copy.set(std::forward<Args>(args)...);
1469 return copy;
1470 }
1471
1473 const Blue &blue() const
1474 {
1475 return m_blue;
1476 }
1477
1480 {
1481 return m_blue;
1482 }
1483
1485 Balance &set(const Blue &value)
1486 {
1487 m_blue = value;
1488 return *this;
1489 }
1490
1492 const Green &green() const
1493 {
1494 return m_green;
1495 }
1496
1499 {
1500 return m_green;
1501 }
1502
1504 Balance &set(const Green &value)
1505 {
1506 m_green = value;
1507 return *this;
1508 }
1509
1511 const Red &red() const
1512 {
1513 return m_red;
1514 }
1515
1518 {
1519 return m_red;
1520 }
1521
1523 Balance &set(const Red &value)
1524 {
1525 m_red = value;
1526 return *this;
1527 }
1528
1529 template<
1530 typename T,
1531 typename std::enable_if<
1532 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1533 int>::type = 0>
1535 {
1536 return m_blue;
1537 }
1538
1539 template<
1540 typename T,
1541 typename std::enable_if<
1542 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1543 int>::type = 0>
1545 {
1546 return m_green;
1547 }
1548
1549 template<
1550 typename T,
1551 typename std::enable_if<
1552 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1553 int>::type = 0>
1555 {
1556 return m_red;
1557 }
1558
1559 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1561 {
1562 return m_blue;
1563 }
1564
1565 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1567 {
1568 return m_green;
1569 }
1570
1571 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1573 {
1574 return m_red;
1575 }
1576
1578 template<typename F>
1579 void forEach(const F &f) const
1580 {
1581 f(m_blue);
1582 f(m_green);
1583 f(m_red);
1584 }
1585
1587 template<typename F>
1588 void forEach(const F &f)
1589 {
1590 f(m_blue);
1591 f(m_green);
1592 f(m_red);
1593 }
1594
1596 bool operator==(const Balance &other) const;
1597
1599 bool operator!=(const Balance &other) const;
1600
1602 std::string toString() const;
1603
1605 friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1606 {
1607 return stream << value.toString();
1608 }
1609
1610 private:
1611 void setFromString(const std::string &value);
1612
1613 void setFromString(const std::string &fullPath, const std::string &value);
1614
1615 std::string getString(const std::string &fullPath) const;
1616
1617 Blue m_blue;
1618 Green m_green;
1619 Red m_red;
1620
1621 friend struct DataModel::Detail::Befriend<Balance>;
1622 };
1623
1628 {
1629 public:
1632
1634 static constexpr const char *path{ "Processing/Color/Gamma" };
1635
1637 static constexpr const char *name{ "Gamma" };
1638
1640 static constexpr const char *description{
1641 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
1642greater than 1 makes the colors darker.
1643)description"
1644 };
1645
1647 using ValueType = double;
1648
1650 static constexpr Range<double> validRange()
1651 {
1652 return { 0.25, 1.5 };
1653 }
1654
1656 Gamma() = default;
1657
1659 explicit constexpr Gamma(double value)
1660 : m_opt{ verifyValue(value) }
1661 {}
1662
1667 double value() const;
1668
1670 bool hasValue() const;
1671
1673 void reset();
1674
1676 std::string toString() const;
1677
1679 bool operator==(const Gamma &other) const
1680 {
1681 return m_opt == other.m_opt;
1682 }
1683
1685 bool operator!=(const Gamma &other) const
1686 {
1687 return m_opt != other.m_opt;
1688 }
1689
1691 bool operator<(const Gamma &other) const
1692 {
1693 return m_opt < other.m_opt;
1694 }
1695
1697 bool operator>(const Gamma &other) const
1698 {
1699 return m_opt > other.m_opt;
1700 }
1701
1703 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
1704 {
1705 return stream << value.toString();
1706 }
1707
1708 private:
1709 void setFromString(const std::string &value);
1710
1711 constexpr ValueType static verifyValue(const ValueType &value)
1712 {
1713 return validRange().isInRange(value)
1714 ? value
1715 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
1716 + std::to_string(validRange().min()) + ", "
1717 + std::to_string(validRange().max()) + "]" };
1718 }
1719
1720 Zivid::DataModel::Detail::Optional<double> m_opt;
1721
1722 friend struct DataModel::Detail::Befriend<Gamma>;
1723 };
1724
1725 using Descendants = std::tuple<
1731
1734
1750#ifndef NO_DOC
1751 template<
1752 typename... Args,
1753 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1754 typename std::enable_if<
1755 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1756 value,
1757 int>::type = 0>
1758#else
1759 template<typename... Args>
1760#endif
1761 explicit Color(Args &&...args)
1762 {
1763 using namespace Zivid::Detail::TypeTraits;
1764
1765 static_assert(
1766 AllArgsDecayedAreUnique<Args...>::value,
1767 "Found duplicate types among the arguments passed to Color(...). "
1768 "Types should be listed at most once.");
1769
1770 set(std::forward<Args>(args)...);
1771 }
1772
1787#ifndef NO_DOC
1788 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1789#else
1790 template<typename... Args>
1791#endif
1792 void set(Args &&...args)
1793 {
1794 using namespace Zivid::Detail::TypeTraits;
1795
1796 using AllArgsAreDescendantNodes =
1797 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1798 static_assert(
1799 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1800
1801 static_assert(
1802 AllArgsDecayedAreUnique<Args...>::value,
1803 "Found duplicate types among the arguments passed to set(...). "
1804 "Types should be listed at most once.");
1805
1806 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1807 }
1808
1824#ifndef NO_DOC
1825 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1826#else
1827 template<typename... Args>
1828#endif
1829 Color copyWith(Args &&...args) const
1830 {
1831 using namespace Zivid::Detail::TypeTraits;
1832
1833 using AllArgsAreDescendantNodes =
1834 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1835 static_assert(
1836 AllArgsAreDescendantNodes::value,
1837 "All arguments passed to copyWith(...) must be descendant nodes.");
1838
1839 static_assert(
1840 AllArgsDecayedAreUnique<Args...>::value,
1841 "Found duplicate types among the arguments passed to copyWith(...). "
1842 "Types should be listed at most once.");
1843
1844 auto copy{ *this };
1845 copy.set(std::forward<Args>(args)...);
1846 return copy;
1847 }
1848
1850 const Balance &balance() const
1851 {
1852 return m_balance;
1853 }
1854
1857 {
1858 return m_balance;
1859 }
1860
1862 Color &set(const Balance &value)
1863 {
1864 m_balance = value;
1865 return *this;
1866 }
1867
1869 Color &set(const Balance::Blue &value)
1870 {
1871 m_balance.set(value);
1872 return *this;
1873 }
1874
1876 Color &set(const Balance::Green &value)
1877 {
1878 m_balance.set(value);
1879 return *this;
1880 }
1881
1883 Color &set(const Balance::Red &value)
1884 {
1885 m_balance.set(value);
1886 return *this;
1887 }
1888
1890 const Gamma &gamma() const
1891 {
1892 return m_gamma;
1893 }
1894
1897 {
1898 return m_gamma;
1899 }
1900
1902 Color &set(const Gamma &value)
1903 {
1904 m_gamma = value;
1905 return *this;
1906 }
1907
1908 template<
1909 typename T,
1910 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
1911 0>
1913 {
1914 return m_balance;
1915 }
1916
1917 template<
1918 typename T,
1919 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
1920 type = 0>
1922 {
1923 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
1924 }
1925
1926 template<
1927 typename T,
1928 typename std::
1929 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
1931 {
1932 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
1933 }
1934
1935 template<
1936 typename T,
1937 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
1938 type = 0>
1940 {
1941 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
1942 }
1943
1944 template<
1945 typename T,
1946 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
1947 0>
1949 {
1950 return m_gamma;
1951 }
1952
1953 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1955 {
1956 return m_balance;
1957 }
1958
1959 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1961 {
1962 return m_gamma;
1963 }
1964
1966 template<typename F>
1967 void forEach(const F &f) const
1968 {
1969 f(m_balance);
1970 f(m_gamma);
1971 }
1972
1974 template<typename F>
1975 void forEach(const F &f)
1976 {
1977 f(m_balance);
1978 f(m_gamma);
1979 }
1980
1982 bool operator==(const Color &other) const;
1983
1985 bool operator!=(const Color &other) const;
1986
1988 std::string toString() const;
1989
1991 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
1992 {
1993 return stream << value.toString();
1994 }
1995
1996 private:
1997 void setFromString(const std::string &value);
1998
1999 void setFromString(const std::string &fullPath, const std::string &value);
2000
2001 std::string getString(const std::string &fullPath) const;
2002
2003 Balance m_balance;
2004 Gamma m_gamma;
2005
2006 friend struct DataModel::Detail::Befriend<Color>;
2007 };
2008
2009 using Descendants = std::tuple<
2016
2019
2036#ifndef NO_DOC
2037 template<
2038 typename... Args,
2039 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2040 typename std::enable_if<
2041 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2042 value,
2043 int>::type = 0>
2044#else
2045 template<typename... Args>
2046#endif
2047 explicit Processing(Args &&...args)
2048 {
2049 using namespace Zivid::Detail::TypeTraits;
2050
2051 static_assert(
2052 AllArgsDecayedAreUnique<Args...>::value,
2053 "Found duplicate types among the arguments passed to Processing(...). "
2054 "Types should be listed at most once.");
2055
2056 set(std::forward<Args>(args)...);
2057 }
2058
2074#ifndef NO_DOC
2075 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2076#else
2077 template<typename... Args>
2078#endif
2079 void set(Args &&...args)
2080 {
2081 using namespace Zivid::Detail::TypeTraits;
2082
2083 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2084 static_assert(
2085 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2086
2087 static_assert(
2088 AllArgsDecayedAreUnique<Args...>::value,
2089 "Found duplicate types among the arguments passed to set(...). "
2090 "Types should be listed at most once.");
2091
2092 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2093 }
2094
2111#ifndef NO_DOC
2112 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2113#else
2114 template<typename... Args>
2115#endif
2116 Processing copyWith(Args &&...args) const
2117 {
2118 using namespace Zivid::Detail::TypeTraits;
2119
2120 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2121 static_assert(
2122 AllArgsAreDescendantNodes::value,
2123 "All arguments passed to copyWith(...) must be descendant nodes.");
2124
2125 static_assert(
2126 AllArgsDecayedAreUnique<Args...>::value,
2127 "Found duplicate types among the arguments passed to copyWith(...). "
2128 "Types should be listed at most once.");
2129
2130 auto copy{ *this };
2131 copy.set(std::forward<Args>(args)...);
2132 return copy;
2133 }
2134
2136 const Color &color() const
2137 {
2138 return m_color;
2139 }
2140
2143 {
2144 return m_color;
2145 }
2146
2148 Processing &set(const Color &value)
2149 {
2150 m_color = value;
2151 return *this;
2152 }
2153
2156 {
2157 m_color.set(value);
2158 return *this;
2159 }
2160
2163 {
2164 m_color.set(value);
2165 return *this;
2166 }
2167
2170 {
2171 m_color.set(value);
2172 return *this;
2173 }
2174
2177 {
2178 m_color.set(value);
2179 return *this;
2180 }
2181
2184 {
2185 m_color.set(value);
2186 return *this;
2187 }
2188
2189 template<
2190 typename T,
2191 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2193 {
2194 return m_color;
2195 }
2196
2197 template<
2198 typename T,
2199 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2201 {
2203 }
2204
2205 template<
2206 typename T,
2207 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2208 type = 0>
2210 {
2212 }
2213
2214 template<
2215 typename T,
2216 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
2217 type = 0>
2219 {
2221 }
2222
2223 template<
2224 typename T,
2225 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2226 type = 0>
2228 {
2229 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2230 }
2231
2232 template<
2233 typename T,
2234 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2236 {
2237 return m_color.get<Settings2D::Processing::Color::Gamma>();
2238 }
2239
2240 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2242 {
2243 return m_color;
2244 }
2245
2247 template<typename F>
2248 void forEach(const F &f) const
2249 {
2250 f(m_color);
2251 }
2252
2254 template<typename F>
2255 void forEach(const F &f)
2256 {
2257 f(m_color);
2258 }
2259
2261 bool operator==(const Processing &other) const;
2262
2264 bool operator!=(const Processing &other) const;
2265
2267 std::string toString() const;
2268
2270 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2271 {
2272 return stream << value.toString();
2273 }
2274
2275 private:
2276 void setFromString(const std::string &value);
2277
2278 void setFromString(const std::string &fullPath, const std::string &value);
2279
2280 std::string getString(const std::string &fullPath) const;
2281
2282 Color m_color;
2283
2284 friend struct DataModel::Detail::Befriend<Processing>;
2285 };
2286
2287 using Descendants = std::tuple<
2296
2299
2301 explicit Settings2D(const std::string &fileName);
2302
2321#ifndef NO_DOC
2322 template<
2323 typename... Args,
2324 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2325 typename std::enable_if<
2326 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2327 int>::type = 0>
2328#else
2329 template<typename... Args>
2330#endif
2331 explicit Settings2D(Args &&...args)
2332 {
2333 using namespace Zivid::Detail::TypeTraits;
2334
2335 static_assert(
2336 AllArgsDecayedAreUnique<Args...>::value,
2337 "Found duplicate types among the arguments passed to Settings2D(...). "
2338 "Types should be listed at most once.");
2339
2340 set(std::forward<Args>(args)...);
2341 }
2342
2360#ifndef NO_DOC
2361 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2362#else
2363 template<typename... Args>
2364#endif
2365 void set(Args &&...args)
2366 {
2367 using namespace Zivid::Detail::TypeTraits;
2368
2369 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2370 static_assert(
2371 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2372
2373 static_assert(
2374 AllArgsDecayedAreUnique<Args...>::value,
2375 "Found duplicate types among the arguments passed to set(...). "
2376 "Types should be listed at most once.");
2377
2378 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2379 }
2380
2399#ifndef NO_DOC
2400 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2401#else
2402 template<typename... Args>
2403#endif
2404 Settings2D copyWith(Args &&...args) const
2405 {
2406 using namespace Zivid::Detail::TypeTraits;
2407
2408 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2409 static_assert(
2410 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
2411
2412 static_assert(
2413 AllArgsDecayedAreUnique<Args...>::value,
2414 "Found duplicate types among the arguments passed to copyWith(...). "
2415 "Types should be listed at most once.");
2416
2417 auto copy{ *this };
2418 copy.set(std::forward<Args>(args)...);
2419 return copy;
2420 }
2421
2424 {
2425 return m_acquisitions;
2426 }
2427
2430 {
2431 return m_acquisitions;
2432 }
2433
2436 {
2437 m_acquisitions = value;
2438 return *this;
2439 }
2440
2442 const Processing &processing() const
2443 {
2444 return m_processing;
2445 }
2446
2449 {
2450 return m_processing;
2451 }
2452
2455 {
2456 m_processing = value;
2457 return *this;
2458 }
2459
2462 {
2463 m_processing.set(value);
2464 return *this;
2465 }
2466
2469 {
2470 m_processing.set(value);
2471 return *this;
2472 }
2473
2476 {
2477 m_processing.set(value);
2478 return *this;
2479 }
2480
2483 {
2484 m_processing.set(value);
2485 return *this;
2486 }
2487
2490 {
2491 m_processing.set(value);
2492 return *this;
2493 }
2494
2497 {
2498 m_processing.set(value);
2499 return *this;
2500 }
2501
2502 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
2504 {
2505 return m_acquisitions;
2506 }
2507
2508 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
2510 {
2511 return m_processing;
2512 }
2513
2514 template<
2515 typename T,
2516 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2518 {
2519 return m_processing.get<Settings2D::Processing::Color>();
2520 }
2521
2522 template<
2523 typename T,
2524 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2526 {
2527 return m_processing.get<Settings2D::Processing::Color::Balance>();
2528 }
2529
2530 template<
2531 typename T,
2532 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
2533 0>
2535 {
2536 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
2537 }
2538
2539 template<
2540 typename T,
2541 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
2542 0>
2544 {
2545 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
2546 }
2547
2548 template<
2549 typename T,
2550 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
2552 {
2553 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
2554 }
2555
2556 template<
2557 typename T,
2558 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2560 {
2561 return m_processing.get<Settings2D::Processing::Color::Gamma>();
2562 }
2563
2564 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2566 {
2567 return m_acquisitions;
2568 }
2569
2570 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2572 {
2573 return m_processing;
2574 }
2575
2577 template<typename F>
2578 void forEach(const F &f) const
2579 {
2580 f(m_acquisitions);
2581 f(m_processing);
2582 }
2583
2585 template<typename F>
2586 void forEach(const F &f)
2587 {
2588 f(m_acquisitions);
2589 f(m_processing);
2590 }
2591
2593 bool operator==(const Settings2D &other) const;
2594
2596 bool operator!=(const Settings2D &other) const;
2597
2599 std::string toString() const;
2600
2602 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
2603 {
2604 return stream << value.toString();
2605 }
2606
2608 void save(const std::string &fileName) const;
2609
2611 void load(const std::string &fileName);
2612
2613 private:
2614 void setFromString(const std::string &value);
2615
2616 void setFromString(const std::string &fullPath, const std::string &value);
2617
2618 std::string getString(const std::string &fullPath) const;
2619
2620 Acquisitions m_acquisitions;
2621 Processing m_processing;
2622
2623 friend struct DataModel::Detail::Befriend<Settings2D>;
2624 };
2625
2626#ifndef NO_DOC
2627 template<>
2628 struct Settings2D::Version<3>
2629 {
2630 using Type = Settings2D;
2631 };
2632#endif
2633
2634} // namespace Zivid
2635
2636#ifdef _MSC_VER
2637# pragma warning(pop)
2638#endif
2639
2640#ifndef NO_DOC
2641# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2642namespace std // NOLINT
2643{
2644
2645 template<>
2646 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
2647 {};
2648
2649 template<size_t i>
2650 struct tuple_element<i, Zivid::Settings2D::Processing>
2651 {
2652 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
2653
2654 using type // NOLINT
2655 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
2656 };
2657
2658 template<>
2659 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
2660 {};
2661
2662 template<size_t i>
2663 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
2664 {
2665 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 2");
2666
2667 using type // NOLINT
2668 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
2669 };
2670
2671 template<>
2672 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
2673 {};
2674
2675 template<size_t i>
2676 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
2677 {
2678 static_assert(
2679 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
2680 "Index must be less than 3");
2681
2682 using type // NOLINT
2683 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
2684 };
2685
2686 template<>
2687 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 2>
2688 {};
2689
2690 template<size_t i>
2691 struct tuple_element<i, Zivid::Settings2D>
2692 {
2693 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 2");
2694
2695 using type // NOLINT
2696 = decltype(declval<Zivid::Settings2D>().get<i>());
2697 };
2698
2699} // namespace std
2700# endif
2701#endif
2702
2703// If we have access to the DataModel library, automatically include internal DataModel
2704// header. This header is necessary for serialization and deserialization.
2705#if defined(__has_include) && !defined(NO_DOC)
2706# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelSerializationMetaData.h")
2707# include "Zivid/Settings2DInternal.h"
2708# endif
2709#endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Class describing a range of values for a given type T
Definition: Range.h:102
Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to the effe...
Definition: Settings2D.h:171
void reset()
Reset the node to unset state
bool operator!=(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:228
friend std::ostream & operator<<(std::ostream &stream, const Aperture &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:246
bool operator<(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:234
constexpr Aperture(double value)
Constructor
Definition: Settings2D.h:202
static constexpr Range< double > validRange()
The range of valid values for Aperture
Definition: Settings2D.h:193
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:240
Aperture()=default
Default constructor
double ValueType
The type of the underlying value
Definition: Settings2D.h:190
bool operator==(const Aperture &other) const
Comparison operator
Definition: Settings2D.h:222
bool hasValue() const
Check if the value is set
Brightness controls the light output from the projector.
Definition: Settings2D.h:280
bool operator==(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:339
bool operator>(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:357
bool operator<(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:351
static constexpr Range< double > validRange()
The range of valid values for Brightness
Definition: Settings2D.h:310
constexpr Brightness(double value)
Constructor
Definition: Settings2D.h:319
std::string toString() const
Get the value as string
bool operator!=(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:345
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:363
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:307
Exposure time for the image
Definition: Settings2D.h:387
bool operator>(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:452
std::chrono::microseconds ValueType
The type of the underlying value
Definition: Settings2D.h:402
void reset()
Reset the node to unset state
constexpr ExposureTime(std::chrono::microseconds value)
Constructor
Definition: Settings2D.h:414
std::chrono::microseconds value() const
Get the value
bool operator<(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:446
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ExposureTime
Definition: Settings2D.h:405
bool operator!=(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:440
std::string toString() const
Get the value as string
ExposureTime()=default
Default constructor
bool operator==(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:434
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:458
bool hasValue() const
Check if the value is set
Analog gain in the camera
Definition: Settings2D.h:483
bool operator>(const Gain &other) const
Comparison operator
Definition: Settings2D.h:548
bool operator!=(const Gain &other) const
Comparison operator
Definition: Settings2D.h:536
bool operator==(const Gain &other) const
Comparison operator
Definition: Settings2D.h:530
friend std::ostream & operator<<(std::ostream &stream, const Gain &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:554
double ValueType
The type of the underlying value
Definition: Settings2D.h:498
Gain()=default
Default constructor
std::string toString() const
Get the value as string
void reset()
Reset the node to unset state
constexpr Gain(double value)
Constructor
Definition: Settings2D.h:510
double value() const
Get the value
bool hasValue() const
Check if the value is set
static constexpr Range< double > validRange()
The range of valid values for Gain
Definition: Settings2D.h:501
bool operator<(const Gain &other) const
Comparison operator
Definition: Settings2D.h:542
Settings for a single acquisition
Definition: Settings2D.h:153
const Settings2D::Acquisition::Gain & get() const
Definition: Settings2D.h:797
const ExposureTime & exposureTime() const
Get ExposureTime
Definition: Settings2D.h:733
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:828
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:838
const Settings2D::Acquisition::Aperture & get() const
Definition: Settings2D.h:773
ExposureTime & exposureTime()
Get ExposureTime
Definition: Settings2D.h:739
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:856
bool operator!=(const Acquisition &other) const
Inequality operator
Acquisition & set(const Gain &value)
Set Gain
Definition: Settings2D.h:764
std::string toString() const
Get the value as string
Acquisition & set(const Aperture &value)
Set Aperture
Definition: Settings2D.h:707
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition: Settings2D.h:580
Gain & gain()
Get Gain
Definition: Settings2D.h:758
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:675
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:640
const Settings2D::Acquisition::ExposureTime & get() const
Definition: Settings2D.h:789
Acquisition()
Default constructor
Aperture & aperture()
Get Aperture
Definition: Settings2D.h:701
Acquisition(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:610
const Aperture & aperture() const
Get Aperture
Definition: Settings2D.h:695
Acquisition & set(const Brightness &value)
Set Brightness
Definition: Settings2D.h:726
const Brightness & brightness() const
Get Brightness
Definition: Settings2D.h:714
Brightness & brightness()
Get Brightness
Definition: Settings2D.h:720
const Gain & gain() const
Get Gain
Definition: Settings2D.h:752
const Settings2D::Acquisition::Brightness & get() const
Definition: Settings2D.h:781
Acquisition & set(const ExposureTime &value)
Set ExposureTime
Definition: Settings2D.h:745
List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mo...
Definition: Settings2D.h:878
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:898
Acquisitions(std::initializer_list< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:912
Settings2D::Acquisition & operator[](std::size_t pos)
Returns a reference to the element at position pos in the list
const Settings2D::Acquisition & operator[](std::size_t pos) const
Returns a const reference to the element at position pos in the list
Acquisitions(std::vector< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:907
void forEach(const F &f)
Run the given function on each element in the list
Definition: Settings2D.h:969
bool operator==(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:988
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:979
std::vector< Settings2D::Acquisition > ValueType
The type of the underlying value
Definition: Settings2D.h:895
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:1000
std::size_t size() const noexcept
Get the size of the list
bool operator!=(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:994
Acquisitions()=default
Default constructor
const std::vector< Settings2D::Acquisition > & value() const
Get the value
Digital gain applied to blue channel
Definition: Settings2D.h:1063
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1136
bool operator==(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1112
void reset()
Reset the node to unset state
double ValueType
The type of the underlying value
Definition: Settings2D.h:1080
bool operator>(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1130
std::string toString() const
Get the value as string
constexpr Blue(double value)
Constructor
Definition: Settings2D.h:1092
bool operator!=(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1118
bool hasValue() const
Check if the value is set
static constexpr Range< double > validRange()
The range of valid values for Blue
Definition: Settings2D.h:1083
bool operator<(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1124
Digital gain applied to green channel
Definition: Settings2D.h:1161
double ValueType
The type of the underlying value
Definition: Settings2D.h:1178
static constexpr Range< double > validRange()
The range of valid values for Green
Definition: Settings2D.h:1181
bool operator==(const Green &other) const
Comparison operator
Definition: Settings2D.h:1210
std::string toString() const
Get the value as string
constexpr Green(double value)
Constructor
Definition: Settings2D.h:1190
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1234
bool operator<(const Green &other) const
Comparison operator
Definition: Settings2D.h:1222
bool hasValue() const
Check if the value is set
bool operator!=(const Green &other) const
Comparison operator
Definition: Settings2D.h:1216
bool operator>(const Green &other) const
Comparison operator
Definition: Settings2D.h:1228
void reset()
Reset the node to unset state
Digital gain applied to red channel
Definition: Settings2D.h:1259
double ValueType
The type of the underlying value
Definition: Settings2D.h:1276
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1332
bool operator<(const Red &other) const
Comparison operator
Definition: Settings2D.h:1320
std::string toString() const
Get the value as string
static constexpr Range< double > validRange()
The range of valid values for Red
Definition: Settings2D.h:1279
bool hasValue() const
Check if the value is set
bool operator!=(const Red &other) const
Comparison operator
Definition: Settings2D.h:1314
constexpr Red(double value)
Constructor
Definition: Settings2D.h:1288
bool operator==(const Red &other) const
Comparison operator
Definition: Settings2D.h:1308
void reset()
Reset the node to unset state
bool operator>(const Red &other) const
Comparison operator
Definition: Settings2D.h:1326
Color balance settings
Definition: Settings2D.h:1047
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1554
Balance(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1387
Blue & blue()
Get Blue
Definition: Settings2D.h:1479
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:1588
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:1579
const Blue & blue() const
Get Blue
Definition: Settings2D.h:1473
bool operator==(const Balance &other) const
Equality operator
Balance & set(const Blue &value)
Set Blue
Definition: Settings2D.h:1485
Red & red()
Get Red
Definition: Settings2D.h:1517
Green & green()
Get Green
Definition: Settings2D.h:1498
Balance & set(const Green &value)
Set Green
Definition: Settings2D.h:1504
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:1452
const Green & green() const
Get Green
Definition: Settings2D.h:1492
Balance & set(const Red &value)
Set Red
Definition: Settings2D.h:1523
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1544
const Red & red() const
Get Red
Definition: Settings2D.h:1511
std::string toString() const
Get the value as string
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1416
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1605
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1534
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition: Settings2D.h:1358
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition: Settings2D.h:1628
double ValueType
The type of the underlying value
Definition: Settings2D.h:1647
static constexpr Range< double > validRange()
The range of valid values for Gamma
Definition: Settings2D.h:1650
bool operator>(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1697
bool operator==(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1679
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1703
bool operator!=(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1685
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:1691
void reset()
Reset the node to unset state
constexpr Gamma(double value)
Constructor
Definition: Settings2D.h:1659
Gamma()=default
Default constructor
Color settings
Definition: Settings2D.h:1031
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1792
Color & set(const Balance::Green &value)
Set Balance::Green
Definition: Settings2D.h:1876
bool operator!=(const Color &other) const
Inequality operator
bool operator==(const Color &other) const
Equality operator
std::string toString() const
Get the value as string
const Balance & balance() const
Get Balance
Definition: Settings2D.h:1850
Color & set(const Balance::Blue &value)
Set Balance::Blue
Definition: Settings2D.h:1869
Balance & balance()
Get Balance
Definition: Settings2D.h:1856
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:1967
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1991
Color(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1761
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:1948
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1930
Gamma & gamma()
Get Gamma
Definition: Settings2D.h:1896
std::tuple< Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:1730
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1939
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:1829
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:1912
const Gamma & gamma() const
Get Gamma
Definition: Settings2D.h:1890
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1921
Color & set(const Balance &value)
Set Balance
Definition: Settings2D.h:1862
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1975
Color & set(const Gamma &value)
Set Gamma
Definition: Settings2D.h:1902
Color & set(const Balance::Red &value)
Set Balance::Red
Definition: Settings2D.h:1883
Processing related settings
Definition: Settings2D.h:1015
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2192
Processing & set(const Color::Gamma &value)
Set Color::Gamma
Definition: Settings2D.h:2183
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:2148
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2200
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2270
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:2248
Color & color()
Get Color
Definition: Settings2D.h:2142
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2079
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue
Definition: Settings2D.h:2162
Processing & set(const Color::Balance &value)
Set Color::Balance
Definition: Settings2D.h:2155
std::tuple< Settings2D::Processing::Color, Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:2015
const Color & color() const
Get Color
Definition: Settings2D.h:2136
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red
Definition: Settings2D.h:2176
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2235
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2227
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:2116
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2209
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2218
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:2255
Processing()
Default constructor
Processing(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2047
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green
Definition: Settings2D.h:2169
Settings used when capturing 2D images with a Zivid camera
Definition: Settings2D.h:121
Settings2D & set(const Processing &value)
Set Processing
Definition: Settings2D.h:2454
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2517
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2551
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2543
void save(const std::string &fileName) const
Save to the given file
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2534
const Acquisitions & acquisitions() const
Get Acquisitions
Definition: Settings2D.h:2423
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2586
Settings2D(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2331
const Settings2D::Acquisitions & get() const
Definition: Settings2D.h:2503
Settings2D()
Default constructor
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2559
Settings2D & set(const Acquisitions &value)
Set Acquisitions
Definition: Settings2D.h:2435
Settings2D(const std::string &fileName)
Construct Settings2D by loading from file
void load(const std::string &fileName)
Load from the given file
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2525
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green
Definition: Settings2D.h:2482
std::tuple< Settings2D::Acquisitions, Settings2D::Processing, Settings2D::Processing::Color, Settings2D::Processing::Color::Balance, Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red, Settings2D::Processing::Color::Gamma > Descendants
Definition: Settings2D.h:2295
bool operator!=(const Settings2D &other) const
Inequality operator
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance
Definition: Settings2D.h:2468
const Settings2D::Processing & get() const
Definition: Settings2D.h:2509
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red
Definition: Settings2D.h:2489
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2365
Processing & processing()
Get Processing
Definition: Settings2D.h:2448
const Processing & processing() const
Get Processing
Definition: Settings2D.h:2442
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:2404
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue
Definition: Settings2D.h:2475
Acquisitions & acquisitions()
Get Acquisitions
Definition: Settings2D.h:2429
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:2578
bool operator==(const Settings2D &other) const
Equality operator
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2602
Settings2D & set(const Processing::Color &value)
Set Processing::Color
Definition: Settings2D.h:2461
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma
Definition: Settings2D.h:2496
NodeType
Definition: NodeType.h:100
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:206
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99