Zivid C++ API 2.6.1+6cec8609-3
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
282 {
283 public:
286
288 static constexpr const char *path{ "Acquisition/Brightness" };
289
291 static constexpr const char *name{ "Brightness" };
292
294 static constexpr const char *description{
295 R"description(Brightness controls the light output from the projector.
296
297Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
298or in case of high levels of ambient lighting. Brightness above 1.0 is supported on Zivid One
299Plus and Zivid Two.
300
301When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
302can capture) will be reduced. For Zivid One Plus the duty cycle in boost mode is 50%. For Zivid
303Two the duty cycle is reduced linearly from 100% at brightness 1.0, to 50% at brightness 1.8.
304The duty cycle is calculated over a 10 second period. This limitation is enforced automatically
305by the camera. Calling capture when the duty cycle limit has been reached will cause the camera
306to first wait (sleep) for a duration of time to cool down, before capture will start.
307)description"
308 };
309
311 using ValueType = double;
312
314 static constexpr Range<double> validRange()
315 {
316 return { 0, 1.8 };
317 }
318
320 Brightness() = default;
321
323 explicit constexpr Brightness(double value)
324 : m_opt{ verifyValue(value) }
325 {}
326
331 double value() const;
332
334 bool hasValue() const;
335
337 void reset();
338
340 std::string toString() const;
341
343 bool operator==(const Brightness &other) const
344 {
345 return m_opt == other.m_opt;
346 }
347
349 bool operator!=(const Brightness &other) const
350 {
351 return m_opt != other.m_opt;
352 }
353
355 bool operator<(const Brightness &other) const
356 {
357 return m_opt < other.m_opt;
358 }
359
361 bool operator>(const Brightness &other) const
362 {
363 return m_opt > other.m_opt;
364 }
365
367 friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
368 {
369 return stream << value.toString();
370 }
371
372 private:
373 void setFromString(const std::string &value);
374
375 constexpr ValueType static verifyValue(const ValueType &value)
376 {
377 return validRange().isInRange(value)
378 ? value
379 : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
380 + " } is not in range [" + std::to_string(validRange().min())
381 + ", " + std::to_string(validRange().max()) + "]" };
382 }
383
384 Zivid::DataModel::Detail::Optional<double> m_opt;
385
386 friend struct DataModel::Detail::Befriend<Brightness>;
387 };
388
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{ 1677 }, 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 friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
463 {
464 return stream << value.toString();
465 }
466
467 private:
468 void setFromString(const std::string &value);
469
470 constexpr ValueType static verifyValue(const ValueType &value)
471 {
472 return validRange().isInRange(value)
473 ? value
474 : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
475 + " } is not in range ["
476 + std::to_string(validRange().min().count()) + ", "
477 + std::to_string(validRange().max().count()) + "]" };
478 }
479
480 Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
481
482 friend struct DataModel::Detail::Befriend<ExposureTime>;
483 };
484
487 {
488 public:
491
493 static constexpr const char *path{ "Acquisition/Gain" };
494
496 static constexpr const char *name{ "Gain" };
497
499 static constexpr const char *description{ R"description(Analog gain in the camera)description" };
500
502 using ValueType = double;
503
505 static constexpr Range<double> validRange()
506 {
507 return { 1, 16 };
508 }
509
511 Gain() = default;
512
514 explicit constexpr Gain(double value)
515 : m_opt{ verifyValue(value) }
516 {}
517
522 double value() const;
523
525 bool hasValue() const;
526
528 void reset();
529
531 std::string toString() const;
532
534 bool operator==(const Gain &other) const
535 {
536 return m_opt == other.m_opt;
537 }
538
540 bool operator!=(const Gain &other) const
541 {
542 return m_opt != other.m_opt;
543 }
544
546 bool operator<(const Gain &other) const
547 {
548 return m_opt < other.m_opt;
549 }
550
552 bool operator>(const Gain &other) const
553 {
554 return m_opt > other.m_opt;
555 }
556
558 friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
559 {
560 return stream << value.toString();
561 }
562
563 private:
564 void setFromString(const std::string &value);
565
566 constexpr ValueType static verifyValue(const ValueType &value)
567 {
568 return validRange().isInRange(value)
569 ? value
570 : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
571 + std::to_string(validRange().min()) + ", "
572 + std::to_string(validRange().max()) + "]" };
573 }
574
575 Zivid::DataModel::Detail::Optional<double> m_opt;
576
577 friend struct DataModel::Detail::Befriend<Gain>;
578 };
579
580 using Descendants = std::tuple<
585
588
603#ifndef NO_DOC
604 template<
605 typename... Args,
606 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
607 typename std::enable_if<
608 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
609 value,
610 int>::type = 0>
611#else
612 template<typename... Args>
613#endif
614 explicit Acquisition(Args &&...args)
615 {
616 using namespace Zivid::Detail::TypeTraits;
617
618 static_assert(
619 AllArgsDecayedAreUnique<Args...>::value,
620 "Found duplicate types among the arguments passed to Acquisition(...). "
621 "Types should be listed at most once.");
622
623 set(std::forward<Args>(args)...);
624 }
625
639#ifndef NO_DOC
640 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
641#else
642 template<typename... Args>
643#endif
644 void set(Args &&...args)
645 {
646 using namespace Zivid::Detail::TypeTraits;
647
648 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
649 static_assert(
650 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
651
652 static_assert(
653 AllArgsDecayedAreUnique<Args...>::value,
654 "Found duplicate types among the arguments passed to set(...). "
655 "Types should be listed at most once.");
656
657 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
658 }
659
674#ifndef NO_DOC
675 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
676#else
677 template<typename... Args>
678#endif
679 Acquisition copyWith(Args &&...args) const
680 {
681 using namespace Zivid::Detail::TypeTraits;
682
683 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
684 static_assert(
685 AllArgsAreDescendantNodes::value,
686 "All arguments passed to copyWith(...) must be descendant nodes.");
687
688 static_assert(
689 AllArgsDecayedAreUnique<Args...>::value,
690 "Found duplicate types among the arguments passed to copyWith(...). "
691 "Types should be listed at most once.");
692
693 auto copy{ *this };
694 copy.set(std::forward<Args>(args)...);
695 return copy;
696 }
697
699 const Aperture &aperture() const
700 {
701 return m_aperture;
702 }
703
706 {
707 return m_aperture;
708 }
709
711 Acquisition &set(const Aperture &value)
712 {
713 m_aperture = value;
714 return *this;
715 }
716
718 const Brightness &brightness() const
719 {
720 return m_brightness;
721 }
722
725 {
726 return m_brightness;
727 }
728
731 {
732 m_brightness = value;
733 return *this;
734 }
735
738 {
739 return m_exposureTime;
740 }
741
744 {
745 return m_exposureTime;
746 }
747
750 {
751 m_exposureTime = value;
752 return *this;
753 }
754
756 const Gain &gain() const
757 {
758 return m_gain;
759 }
760
763 {
764 return m_gain;
765 }
766
768 Acquisition &set(const Gain &value)
769 {
770 m_gain = value;
771 return *this;
772 }
773
774 template<
775 typename T,
776 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
778 {
779 return m_aperture;
780 }
781
782 template<
783 typename T,
784 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
786 {
787 return m_brightness;
788 }
789
790 template<
791 typename T,
792 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
794 {
795 return m_exposureTime;
796 }
797
798 template<
799 typename T,
800 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
802 {
803 return m_gain;
804 }
805
806 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
808 {
809 return m_aperture;
810 }
811
812 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
814 {
815 return m_brightness;
816 }
817
818 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
820 {
821 return m_exposureTime;
822 }
823
824 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
826 {
827 return m_gain;
828 }
829
831 template<typename F>
832 void forEach(const F &f) const
833 {
834 f(m_aperture);
835 f(m_brightness);
836 f(m_exposureTime);
837 f(m_gain);
838 }
839
841 template<typename F>
842 void forEach(const F &f)
843 {
844 f(m_aperture);
845 f(m_brightness);
846 f(m_exposureTime);
847 f(m_gain);
848 }
849
851 bool operator==(const Acquisition &other) const;
852
854 bool operator!=(const Acquisition &other) const;
855
857 std::string toString() const;
858
860 friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
861 {
862 return stream << value.toString();
863 }
864
865 private:
866 void setFromString(const std::string &value);
867
868 void setFromString(const std::string &fullPath, const std::string &value);
869
870 std::string getString(const std::string &fullPath) const;
871
872 Aperture m_aperture;
873 Brightness m_brightness;
874 ExposureTime m_exposureTime;
875 Gain m_gain;
876
877 friend struct DataModel::Detail::Befriend<Acquisition>;
878 };
879
882 {
883 public:
886
888 static constexpr const char *path{ "Acquisitions" };
889
891 static constexpr const char *name{ "Acquisitions" };
892
894 static constexpr const char *description{
895 R"description(List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mode.)description"
896 };
897
899 using ValueType = std::vector<Settings2D::Acquisition>;
900
903 {
904 return { 0, std::numeric_limits<ValueType::size_type>::max() };
905 }
906
908 Acquisitions() = default;
909
911 explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
912 : m_value{ std::move(value) }
913 {}
914
916 explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
917 : Acquisitions{ ValueType{ value } }
918 {}
919
921 const std::vector<Settings2D::Acquisition> &value() const;
922
924 std::string toString() const;
925
927 std::size_t size() const noexcept;
928
930 bool isEmpty() const noexcept;
931
937 template<typename... Args>
938 void emplaceBack(Args &&...args)
939 {
940 m_value.emplace_back(std::forward<Args>(args)...);
941 }
942
948 Settings2D::Acquisition &at(std::size_t pos);
949
955 const Settings2D::Acquisition &at(std::size_t pos) const;
956
963
969 const Settings2D::Acquisition &operator[](std::size_t pos) const;
970
972 template<typename F>
973 void forEach(const F &f)
974 {
975 for(auto &child : m_value)
976 {
977 f(child);
978 }
979 }
980
982 template<typename F>
983 void forEach(const F &f) const
984 {
985 for(const auto &child : m_value)
986 {
987 f(child);
988 }
989 }
990
992 bool operator==(const Acquisitions &other) const
993 {
994 return m_value == other.m_value;
995 }
996
998 bool operator!=(const Acquisitions &other) const
999 {
1000 return m_value != other.m_value;
1001 }
1002
1004 friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
1005 {
1006 return stream << value.toString();
1007 }
1008
1009 private:
1010 void setFromString(const std::string &value);
1011
1012 std::vector<Settings2D::Acquisition> m_value{};
1013
1014 friend struct DataModel::Detail::Befriend<Acquisitions>;
1015 };
1016
1019 {
1020 public:
1023
1025 static constexpr const char *path{ "Processing" };
1026
1028 static constexpr const char *name{ "Processing" };
1029
1031 static constexpr const char *description{ R"description(Processing related settings)description" };
1032
1035 {
1036 public:
1039
1041 static constexpr const char *path{ "Processing/Color" };
1042
1044 static constexpr const char *name{ "Color" };
1045
1047 static constexpr const char *description{ R"description(Color settings)description" };
1048
1051 {
1052 public:
1055
1057 static constexpr const char *path{ "Processing/Color/Balance" };
1058
1060 static constexpr const char *name{ "Balance" };
1061
1063 static constexpr const char *description{ R"description(Color balance settings)description" };
1064
1067 {
1068 public:
1071
1073 static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1074
1076 static constexpr const char *name{ "Blue" };
1077
1079 static constexpr const char *description{
1080 R"description(Digital gain applied to blue channel)description"
1081 };
1082
1084 using ValueType = double;
1085
1087 static constexpr Range<double> validRange()
1088 {
1089 return { 1.0, 8.0 };
1090 }
1091
1093 Blue() = default;
1094
1096 explicit constexpr Blue(double value)
1097 : m_opt{ verifyValue(value) }
1098 {}
1099
1104 double value() const;
1105
1107 bool hasValue() const;
1108
1110 void reset();
1111
1113 std::string toString() const;
1114
1116 bool operator==(const Blue &other) const
1117 {
1118 return m_opt == other.m_opt;
1119 }
1120
1122 bool operator!=(const Blue &other) const
1123 {
1124 return m_opt != other.m_opt;
1125 }
1126
1128 bool operator<(const Blue &other) const
1129 {
1130 return m_opt < other.m_opt;
1131 }
1132
1134 bool operator>(const Blue &other) const
1135 {
1136 return m_opt > other.m_opt;
1137 }
1138
1140 friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1141 {
1142 return stream << value.toString();
1143 }
1144
1145 private:
1146 void setFromString(const std::string &value);
1147
1148 constexpr ValueType static verifyValue(const ValueType &value)
1149 {
1150 return validRange().isInRange(value)
1151 ? value
1152 : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1153 + " } is not in range ["
1154 + std::to_string(validRange().min()) + ", "
1155 + std::to_string(validRange().max()) + "]" };
1156 }
1157
1158 Zivid::DataModel::Detail::Optional<double> m_opt;
1159
1160 friend struct DataModel::Detail::Befriend<Blue>;
1161 };
1162
1165 {
1166 public:
1169
1171 static constexpr const char *path{ "Processing/Color/Balance/Green" };
1172
1174 static constexpr const char *name{ "Green" };
1175
1177 static constexpr const char *description{
1178 R"description(Digital gain applied to green channel)description"
1179 };
1180
1182 using ValueType = double;
1183
1185 static constexpr Range<double> validRange()
1186 {
1187 return { 1.0, 8.0 };
1188 }
1189
1191 Green() = default;
1192
1194 explicit constexpr Green(double value)
1195 : m_opt{ verifyValue(value) }
1196 {}
1197
1202 double value() const;
1203
1205 bool hasValue() const;
1206
1208 void reset();
1209
1211 std::string toString() const;
1212
1214 bool operator==(const Green &other) const
1215 {
1216 return m_opt == other.m_opt;
1217 }
1218
1220 bool operator!=(const Green &other) const
1221 {
1222 return m_opt != other.m_opt;
1223 }
1224
1226 bool operator<(const Green &other) const
1227 {
1228 return m_opt < other.m_opt;
1229 }
1230
1232 bool operator>(const Green &other) const
1233 {
1234 return m_opt > other.m_opt;
1235 }
1236
1238 friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1239 {
1240 return stream << value.toString();
1241 }
1242
1243 private:
1244 void setFromString(const std::string &value);
1245
1246 constexpr ValueType static verifyValue(const ValueType &value)
1247 {
1248 return validRange().isInRange(value)
1249 ? value
1250 : throw std::out_of_range{ "Green{ " + std::to_string(value)
1251 + " } is not in range ["
1252 + std::to_string(validRange().min()) + ", "
1253 + std::to_string(validRange().max()) + "]" };
1254 }
1255
1256 Zivid::DataModel::Detail::Optional<double> m_opt;
1257
1258 friend struct DataModel::Detail::Befriend<Green>;
1259 };
1260
1263 {
1264 public:
1267
1269 static constexpr const char *path{ "Processing/Color/Balance/Red" };
1270
1272 static constexpr const char *name{ "Red" };
1273
1275 static constexpr const char *description{
1276 R"description(Digital gain applied to red channel)description"
1277 };
1278
1280 using ValueType = double;
1281
1283 static constexpr Range<double> validRange()
1284 {
1285 return { 1.0, 8.0 };
1286 }
1287
1289 Red() = default;
1290
1292 explicit constexpr Red(double value)
1293 : m_opt{ verifyValue(value) }
1294 {}
1295
1300 double value() const;
1301
1303 bool hasValue() const;
1304
1306 void reset();
1307
1309 std::string toString() const;
1310
1312 bool operator==(const Red &other) const
1313 {
1314 return m_opt == other.m_opt;
1315 }
1316
1318 bool operator!=(const Red &other) const
1319 {
1320 return m_opt != other.m_opt;
1321 }
1322
1324 bool operator<(const Red &other) const
1325 {
1326 return m_opt < other.m_opt;
1327 }
1328
1330 bool operator>(const Red &other) const
1331 {
1332 return m_opt > other.m_opt;
1333 }
1334
1336 friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1337 {
1338 return stream << value.toString();
1339 }
1340
1341 private:
1342 void setFromString(const std::string &value);
1343
1344 constexpr ValueType static verifyValue(const ValueType &value)
1345 {
1346 return validRange().isInRange(value)
1347 ? value
1348 : throw std::out_of_range{ "Red{ " + std::to_string(value)
1349 + " } is not in range ["
1350 + std::to_string(validRange().min()) + ", "
1351 + std::to_string(validRange().max()) + "]" };
1352 }
1353
1354 Zivid::DataModel::Detail::Optional<double> m_opt;
1355
1356 friend struct DataModel::Detail::Befriend<Red>;
1357 };
1358
1359 using Descendants = std::tuple<
1363
1366
1380#ifndef NO_DOC
1381 template<
1382 typename... Args,
1383 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1384 typename std::enable_if<
1385 Zivid::Detail::TypeTraits::
1386 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1387 int>::type = 0>
1388#else
1389 template<typename... Args>
1390#endif
1391 explicit Balance(Args &&...args)
1392 {
1393 using namespace Zivid::Detail::TypeTraits;
1394
1395 static_assert(
1396 AllArgsDecayedAreUnique<Args...>::value,
1397 "Found duplicate types among the arguments passed to Balance(...). "
1398 "Types should be listed at most once.");
1399
1400 set(std::forward<Args>(args)...);
1401 }
1402
1415#ifndef NO_DOC
1416 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1417#else
1418 template<typename... Args>
1419#endif
1420 void set(Args &&...args)
1421 {
1422 using namespace Zivid::Detail::TypeTraits;
1423
1424 using AllArgsAreDescendantNodes =
1425 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1426 static_assert(
1427 AllArgsAreDescendantNodes::value,
1428 "All arguments passed to set(...) must be descendant nodes.");
1429
1430 static_assert(
1431 AllArgsDecayedAreUnique<Args...>::value,
1432 "Found duplicate types among the arguments passed to set(...). "
1433 "Types should be listed at most once.");
1434
1435 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1436 }
1437
1451#ifndef NO_DOC
1452 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1453#else
1454 template<typename... Args>
1455#endif
1456 Balance copyWith(Args &&...args) const
1457 {
1458 using namespace Zivid::Detail::TypeTraits;
1459
1460 using AllArgsAreDescendantNodes =
1461 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1462 static_assert(
1463 AllArgsAreDescendantNodes::value,
1464 "All arguments passed to copyWith(...) must be descendant nodes.");
1465
1466 static_assert(
1467 AllArgsDecayedAreUnique<Args...>::value,
1468 "Found duplicate types among the arguments passed to copyWith(...). "
1469 "Types should be listed at most once.");
1470
1471 auto copy{ *this };
1472 copy.set(std::forward<Args>(args)...);
1473 return copy;
1474 }
1475
1477 const Blue &blue() const
1478 {
1479 return m_blue;
1480 }
1481
1484 {
1485 return m_blue;
1486 }
1487
1489 Balance &set(const Blue &value)
1490 {
1491 m_blue = value;
1492 return *this;
1493 }
1494
1496 const Green &green() const
1497 {
1498 return m_green;
1499 }
1500
1503 {
1504 return m_green;
1505 }
1506
1508 Balance &set(const Green &value)
1509 {
1510 m_green = value;
1511 return *this;
1512 }
1513
1515 const Red &red() const
1516 {
1517 return m_red;
1518 }
1519
1522 {
1523 return m_red;
1524 }
1525
1527 Balance &set(const Red &value)
1528 {
1529 m_red = value;
1530 return *this;
1531 }
1532
1533 template<
1534 typename T,
1535 typename std::enable_if<
1536 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1537 int>::type = 0>
1539 {
1540 return m_blue;
1541 }
1542
1543 template<
1544 typename T,
1545 typename std::enable_if<
1546 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1547 int>::type = 0>
1549 {
1550 return m_green;
1551 }
1552
1553 template<
1554 typename T,
1555 typename std::enable_if<
1556 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1557 int>::type = 0>
1559 {
1560 return m_red;
1561 }
1562
1563 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1565 {
1566 return m_blue;
1567 }
1568
1569 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1571 {
1572 return m_green;
1573 }
1574
1575 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1577 {
1578 return m_red;
1579 }
1580
1582 template<typename F>
1583 void forEach(const F &f) const
1584 {
1585 f(m_blue);
1586 f(m_green);
1587 f(m_red);
1588 }
1589
1591 template<typename F>
1592 void forEach(const F &f)
1593 {
1594 f(m_blue);
1595 f(m_green);
1596 f(m_red);
1597 }
1598
1600 bool operator==(const Balance &other) const;
1601
1603 bool operator!=(const Balance &other) const;
1604
1606 std::string toString() const;
1607
1609 friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1610 {
1611 return stream << value.toString();
1612 }
1613
1614 private:
1615 void setFromString(const std::string &value);
1616
1617 void setFromString(const std::string &fullPath, const std::string &value);
1618
1619 std::string getString(const std::string &fullPath) const;
1620
1621 Blue m_blue;
1622 Green m_green;
1623 Red m_red;
1624
1625 friend struct DataModel::Detail::Befriend<Balance>;
1626 };
1627
1632 {
1633 public:
1636
1638 static constexpr const char *path{ "Processing/Color/Gamma" };
1639
1641 static constexpr const char *name{ "Gamma" };
1642
1644 static constexpr const char *description{
1645 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
1646greater than 1 makes the colors darker.
1647)description"
1648 };
1649
1651 using ValueType = double;
1652
1654 static constexpr Range<double> validRange()
1655 {
1656 return { 0.25, 1.5 };
1657 }
1658
1660 Gamma() = default;
1661
1663 explicit constexpr Gamma(double value)
1664 : m_opt{ verifyValue(value) }
1665 {}
1666
1671 double value() const;
1672
1674 bool hasValue() const;
1675
1677 void reset();
1678
1680 std::string toString() const;
1681
1683 bool operator==(const Gamma &other) const
1684 {
1685 return m_opt == other.m_opt;
1686 }
1687
1689 bool operator!=(const Gamma &other) const
1690 {
1691 return m_opt != other.m_opt;
1692 }
1693
1695 bool operator<(const Gamma &other) const
1696 {
1697 return m_opt < other.m_opt;
1698 }
1699
1701 bool operator>(const Gamma &other) const
1702 {
1703 return m_opt > other.m_opt;
1704 }
1705
1707 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
1708 {
1709 return stream << value.toString();
1710 }
1711
1712 private:
1713 void setFromString(const std::string &value);
1714
1715 constexpr ValueType static verifyValue(const ValueType &value)
1716 {
1717 return validRange().isInRange(value)
1718 ? value
1719 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
1720 + std::to_string(validRange().min()) + ", "
1721 + std::to_string(validRange().max()) + "]" };
1722 }
1723
1724 Zivid::DataModel::Detail::Optional<double> m_opt;
1725
1726 friend struct DataModel::Detail::Befriend<Gamma>;
1727 };
1728
1729 using Descendants = std::tuple<
1735
1738
1754#ifndef NO_DOC
1755 template<
1756 typename... Args,
1757 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1758 typename std::enable_if<
1759 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1760 value,
1761 int>::type = 0>
1762#else
1763 template<typename... Args>
1764#endif
1765 explicit Color(Args &&...args)
1766 {
1767 using namespace Zivid::Detail::TypeTraits;
1768
1769 static_assert(
1770 AllArgsDecayedAreUnique<Args...>::value,
1771 "Found duplicate types among the arguments passed to Color(...). "
1772 "Types should be listed at most once.");
1773
1774 set(std::forward<Args>(args)...);
1775 }
1776
1791#ifndef NO_DOC
1792 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1793#else
1794 template<typename... Args>
1795#endif
1796 void set(Args &&...args)
1797 {
1798 using namespace Zivid::Detail::TypeTraits;
1799
1800 using AllArgsAreDescendantNodes =
1801 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1802 static_assert(
1803 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1804
1805 static_assert(
1806 AllArgsDecayedAreUnique<Args...>::value,
1807 "Found duplicate types among the arguments passed to set(...). "
1808 "Types should be listed at most once.");
1809
1810 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1811 }
1812
1828#ifndef NO_DOC
1829 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1830#else
1831 template<typename... Args>
1832#endif
1833 Color copyWith(Args &&...args) const
1834 {
1835 using namespace Zivid::Detail::TypeTraits;
1836
1837 using AllArgsAreDescendantNodes =
1838 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1839 static_assert(
1840 AllArgsAreDescendantNodes::value,
1841 "All arguments passed to copyWith(...) must be descendant nodes.");
1842
1843 static_assert(
1844 AllArgsDecayedAreUnique<Args...>::value,
1845 "Found duplicate types among the arguments passed to copyWith(...). "
1846 "Types should be listed at most once.");
1847
1848 auto copy{ *this };
1849 copy.set(std::forward<Args>(args)...);
1850 return copy;
1851 }
1852
1854 const Balance &balance() const
1855 {
1856 return m_balance;
1857 }
1858
1861 {
1862 return m_balance;
1863 }
1864
1866 Color &set(const Balance &value)
1867 {
1868 m_balance = value;
1869 return *this;
1870 }
1871
1873 Color &set(const Balance::Blue &value)
1874 {
1875 m_balance.set(value);
1876 return *this;
1877 }
1878
1880 Color &set(const Balance::Green &value)
1881 {
1882 m_balance.set(value);
1883 return *this;
1884 }
1885
1887 Color &set(const Balance::Red &value)
1888 {
1889 m_balance.set(value);
1890 return *this;
1891 }
1892
1894 const Gamma &gamma() const
1895 {
1896 return m_gamma;
1897 }
1898
1901 {
1902 return m_gamma;
1903 }
1904
1906 Color &set(const Gamma &value)
1907 {
1908 m_gamma = value;
1909 return *this;
1910 }
1911
1912 template<
1913 typename T,
1914 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
1915 0>
1917 {
1918 return m_balance;
1919 }
1920
1921 template<
1922 typename T,
1923 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
1924 type = 0>
1926 {
1927 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
1928 }
1929
1930 template<
1931 typename T,
1932 typename std::
1933 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
1935 {
1936 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
1937 }
1938
1939 template<
1940 typename T,
1941 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
1942 type = 0>
1944 {
1945 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
1946 }
1947
1948 template<
1949 typename T,
1950 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
1951 0>
1953 {
1954 return m_gamma;
1955 }
1956
1957 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1959 {
1960 return m_balance;
1961 }
1962
1963 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1965 {
1966 return m_gamma;
1967 }
1968
1970 template<typename F>
1971 void forEach(const F &f) const
1972 {
1973 f(m_balance);
1974 f(m_gamma);
1975 }
1976
1978 template<typename F>
1979 void forEach(const F &f)
1980 {
1981 f(m_balance);
1982 f(m_gamma);
1983 }
1984
1986 bool operator==(const Color &other) const;
1987
1989 bool operator!=(const Color &other) const;
1990
1992 std::string toString() const;
1993
1995 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
1996 {
1997 return stream << value.toString();
1998 }
1999
2000 private:
2001 void setFromString(const std::string &value);
2002
2003 void setFromString(const std::string &fullPath, const std::string &value);
2004
2005 std::string getString(const std::string &fullPath) const;
2006
2007 Balance m_balance;
2008 Gamma m_gamma;
2009
2010 friend struct DataModel::Detail::Befriend<Color>;
2011 };
2012
2013 using Descendants = std::tuple<
2020
2023
2040#ifndef NO_DOC
2041 template<
2042 typename... Args,
2043 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2044 typename std::enable_if<
2045 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2046 value,
2047 int>::type = 0>
2048#else
2049 template<typename... Args>
2050#endif
2051 explicit Processing(Args &&...args)
2052 {
2053 using namespace Zivid::Detail::TypeTraits;
2054
2055 static_assert(
2056 AllArgsDecayedAreUnique<Args...>::value,
2057 "Found duplicate types among the arguments passed to Processing(...). "
2058 "Types should be listed at most once.");
2059
2060 set(std::forward<Args>(args)...);
2061 }
2062
2078#ifndef NO_DOC
2079 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2080#else
2081 template<typename... Args>
2082#endif
2083 void set(Args &&...args)
2084 {
2085 using namespace Zivid::Detail::TypeTraits;
2086
2087 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2088 static_assert(
2089 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2090
2091 static_assert(
2092 AllArgsDecayedAreUnique<Args...>::value,
2093 "Found duplicate types among the arguments passed to set(...). "
2094 "Types should be listed at most once.");
2095
2096 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2097 }
2098
2115#ifndef NO_DOC
2116 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2117#else
2118 template<typename... Args>
2119#endif
2120 Processing copyWith(Args &&...args) const
2121 {
2122 using namespace Zivid::Detail::TypeTraits;
2123
2124 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2125 static_assert(
2126 AllArgsAreDescendantNodes::value,
2127 "All arguments passed to copyWith(...) must be descendant nodes.");
2128
2129 static_assert(
2130 AllArgsDecayedAreUnique<Args...>::value,
2131 "Found duplicate types among the arguments passed to copyWith(...). "
2132 "Types should be listed at most once.");
2133
2134 auto copy{ *this };
2135 copy.set(std::forward<Args>(args)...);
2136 return copy;
2137 }
2138
2140 const Color &color() const
2141 {
2142 return m_color;
2143 }
2144
2147 {
2148 return m_color;
2149 }
2150
2152 Processing &set(const Color &value)
2153 {
2154 m_color = value;
2155 return *this;
2156 }
2157
2160 {
2161 m_color.set(value);
2162 return *this;
2163 }
2164
2167 {
2168 m_color.set(value);
2169 return *this;
2170 }
2171
2174 {
2175 m_color.set(value);
2176 return *this;
2177 }
2178
2181 {
2182 m_color.set(value);
2183 return *this;
2184 }
2185
2188 {
2189 m_color.set(value);
2190 return *this;
2191 }
2192
2193 template<
2194 typename T,
2195 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2197 {
2198 return m_color;
2199 }
2200
2201 template<
2202 typename T,
2203 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2205 {
2207 }
2208
2209 template<
2210 typename T,
2211 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2212 type = 0>
2214 {
2216 }
2217
2218 template<
2219 typename T,
2220 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
2221 type = 0>
2223 {
2225 }
2226
2227 template<
2228 typename T,
2229 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2230 type = 0>
2232 {
2233 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2234 }
2235
2236 template<
2237 typename T,
2238 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2240 {
2241 return m_color.get<Settings2D::Processing::Color::Gamma>();
2242 }
2243
2244 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2246 {
2247 return m_color;
2248 }
2249
2251 template<typename F>
2252 void forEach(const F &f) const
2253 {
2254 f(m_color);
2255 }
2256
2258 template<typename F>
2259 void forEach(const F &f)
2260 {
2261 f(m_color);
2262 }
2263
2265 bool operator==(const Processing &other) const;
2266
2268 bool operator!=(const Processing &other) const;
2269
2271 std::string toString() const;
2272
2274 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2275 {
2276 return stream << value.toString();
2277 }
2278
2279 private:
2280 void setFromString(const std::string &value);
2281
2282 void setFromString(const std::string &fullPath, const std::string &value);
2283
2284 std::string getString(const std::string &fullPath) const;
2285
2286 Color m_color;
2287
2288 friend struct DataModel::Detail::Befriend<Processing>;
2289 };
2290
2291 using Descendants = std::tuple<
2300
2303
2305 explicit Settings2D(const std::string &fileName);
2306
2325#ifndef NO_DOC
2326 template<
2327 typename... Args,
2328 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2329 typename std::enable_if<
2330 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2331 int>::type = 0>
2332#else
2333 template<typename... Args>
2334#endif
2335 explicit Settings2D(Args &&...args)
2336 {
2337 using namespace Zivid::Detail::TypeTraits;
2338
2339 static_assert(
2340 AllArgsDecayedAreUnique<Args...>::value,
2341 "Found duplicate types among the arguments passed to Settings2D(...). "
2342 "Types should be listed at most once.");
2343
2344 set(std::forward<Args>(args)...);
2345 }
2346
2364#ifndef NO_DOC
2365 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2366#else
2367 template<typename... Args>
2368#endif
2369 void set(Args &&...args)
2370 {
2371 using namespace Zivid::Detail::TypeTraits;
2372
2373 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2374 static_assert(
2375 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2376
2377 static_assert(
2378 AllArgsDecayedAreUnique<Args...>::value,
2379 "Found duplicate types among the arguments passed to set(...). "
2380 "Types should be listed at most once.");
2381
2382 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2383 }
2384
2403#ifndef NO_DOC
2404 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2405#else
2406 template<typename... Args>
2407#endif
2408 Settings2D copyWith(Args &&...args) const
2409 {
2410 using namespace Zivid::Detail::TypeTraits;
2411
2412 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2413 static_assert(
2414 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
2415
2416 static_assert(
2417 AllArgsDecayedAreUnique<Args...>::value,
2418 "Found duplicate types among the arguments passed to copyWith(...). "
2419 "Types should be listed at most once.");
2420
2421 auto copy{ *this };
2422 copy.set(std::forward<Args>(args)...);
2423 return copy;
2424 }
2425
2428 {
2429 return m_acquisitions;
2430 }
2431
2434 {
2435 return m_acquisitions;
2436 }
2437
2440 {
2441 m_acquisitions = value;
2442 return *this;
2443 }
2444
2446 const Processing &processing() const
2447 {
2448 return m_processing;
2449 }
2450
2453 {
2454 return m_processing;
2455 }
2456
2459 {
2460 m_processing = value;
2461 return *this;
2462 }
2463
2466 {
2467 m_processing.set(value);
2468 return *this;
2469 }
2470
2473 {
2474 m_processing.set(value);
2475 return *this;
2476 }
2477
2480 {
2481 m_processing.set(value);
2482 return *this;
2483 }
2484
2487 {
2488 m_processing.set(value);
2489 return *this;
2490 }
2491
2494 {
2495 m_processing.set(value);
2496 return *this;
2497 }
2498
2501 {
2502 m_processing.set(value);
2503 return *this;
2504 }
2505
2506 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
2508 {
2509 return m_acquisitions;
2510 }
2511
2512 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
2514 {
2515 return m_processing;
2516 }
2517
2518 template<
2519 typename T,
2520 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2522 {
2523 return m_processing.get<Settings2D::Processing::Color>();
2524 }
2525
2526 template<
2527 typename T,
2528 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2530 {
2531 return m_processing.get<Settings2D::Processing::Color::Balance>();
2532 }
2533
2534 template<
2535 typename T,
2536 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
2537 0>
2539 {
2540 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
2541 }
2542
2543 template<
2544 typename T,
2545 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
2546 0>
2548 {
2549 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
2550 }
2551
2552 template<
2553 typename T,
2554 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
2556 {
2557 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
2558 }
2559
2560 template<
2561 typename T,
2562 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2564 {
2565 return m_processing.get<Settings2D::Processing::Color::Gamma>();
2566 }
2567
2568 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2570 {
2571 return m_acquisitions;
2572 }
2573
2574 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2576 {
2577 return m_processing;
2578 }
2579
2581 template<typename F>
2582 void forEach(const F &f) const
2583 {
2584 f(m_acquisitions);
2585 f(m_processing);
2586 }
2587
2589 template<typename F>
2590 void forEach(const F &f)
2591 {
2592 f(m_acquisitions);
2593 f(m_processing);
2594 }
2595
2597 bool operator==(const Settings2D &other) const;
2598
2600 bool operator!=(const Settings2D &other) const;
2601
2603 std::string toString() const;
2604
2606 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
2607 {
2608 return stream << value.toString();
2609 }
2610
2612 void save(const std::string &fileName) const;
2613
2615 void load(const std::string &fileName);
2616
2617 private:
2618 void setFromString(const std::string &value);
2619
2620 void setFromString(const std::string &fullPath, const std::string &value);
2621
2622 std::string getString(const std::string &fullPath) const;
2623
2624 Acquisitions m_acquisitions;
2625 Processing m_processing;
2626
2627 friend struct DataModel::Detail::Befriend<Settings2D>;
2628 };
2629
2630#ifndef NO_DOC
2631 template<>
2632 struct Settings2D::Version<3>
2633 {
2634 using Type = Settings2D;
2635 };
2636#endif
2637
2638} // namespace Zivid
2639
2640#ifdef _MSC_VER
2641# pragma warning(pop)
2642#endif
2643
2644#ifndef NO_DOC
2645# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2646namespace std // NOLINT
2647{
2648
2649 template<>
2650 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
2651 {};
2652
2653 template<size_t i>
2654 struct tuple_element<i, Zivid::Settings2D::Processing>
2655 {
2656 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
2657
2658 using type // NOLINT
2659 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
2660 };
2661
2662 template<>
2663 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
2664 {};
2665
2666 template<size_t i>
2667 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
2668 {
2669 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 2");
2670
2671 using type // NOLINT
2672 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
2673 };
2674
2675 template<>
2676 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
2677 {};
2678
2679 template<size_t i>
2680 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
2681 {
2682 static_assert(
2683 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
2684 "Index must be less than 3");
2685
2686 using type // NOLINT
2687 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
2688 };
2689
2690 template<>
2691 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 2>
2692 {};
2693
2694 template<size_t i>
2695 struct tuple_element<i, Zivid::Settings2D>
2696 {
2697 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 2");
2698
2699 using type // NOLINT
2700 = decltype(declval<Zivid::Settings2D>().get<i>());
2701 };
2702
2703} // namespace std
2704# endif
2705#endif
2706
2707// If we have access to the DataModel library, automatically include internal DataModel
2708// header. This header is necessary for serialization and deserialization.
2709#if defined(__has_include) && !defined(NO_DOC)
2710# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelSerializationMetaData.h")
2711# include "Zivid/Settings2DInternal.h"
2712# endif
2713#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:282
bool operator==(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:343
bool operator>(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:361
bool operator<(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:355
static constexpr Range< double > validRange()
The range of valid values for Brightness
Definition: Settings2D.h:314
constexpr Brightness(double value)
Constructor
Definition: Settings2D.h:323
std::string toString() const
Get the value as string
bool operator!=(const Brightness &other) const
Comparison operator
Definition: Settings2D.h:349
friend std::ostream & operator<<(std::ostream &stream, const Brightness &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:367
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:311
Exposure time for the image
Definition: Settings2D.h:391
bool operator>(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:456
std::chrono::microseconds ValueType
The type of the underlying value
Definition: Settings2D.h:406
void reset()
Reset the node to unset state
constexpr ExposureTime(std::chrono::microseconds value)
Constructor
Definition: Settings2D.h:418
std::chrono::microseconds value() const
Get the value
bool operator<(const ExposureTime &other) const
Comparison operator
Definition: Settings2D.h:450
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:462
bool hasValue() const
Check if the value is set
Analog gain in the camera
Definition: Settings2D.h:487
bool operator>(const Gain &other) const
Comparison operator
Definition: Settings2D.h:552
bool operator!=(const Gain &other) const
Comparison operator
Definition: Settings2D.h:540
bool operator==(const Gain &other) const
Comparison operator
Definition: Settings2D.h:534
friend std::ostream & operator<<(std::ostream &stream, const Gain &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:558
double ValueType
The type of the underlying value
Definition: Settings2D.h:502
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:514
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:505
bool operator<(const Gain &other) const
Comparison operator
Definition: Settings2D.h:546
Settings for a single acquisition
Definition: Settings2D.h:153
const Settings2D::Acquisition::Gain & get() const
Definition: Settings2D.h:801
const ExposureTime & exposureTime() const
Get ExposureTime
Definition: Settings2D.h:737
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:832
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:842
const Settings2D::Acquisition::Aperture & get() const
Definition: Settings2D.h:777
ExposureTime & exposureTime()
Get ExposureTime
Definition: Settings2D.h:743
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:860
bool operator!=(const Acquisition &other) const
Inequality operator
Acquisition & set(const Gain &value)
Set Gain
Definition: Settings2D.h:768
std::string toString() const
Get the value as string
Acquisition & set(const Aperture &value)
Set Aperture
Definition: Settings2D.h:711
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition: Settings2D.h:584
Gain & gain()
Get Gain
Definition: Settings2D.h:762
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:679
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:644
const Settings2D::Acquisition::ExposureTime & get() const
Definition: Settings2D.h:793
Acquisition()
Default constructor
Aperture & aperture()
Get Aperture
Definition: Settings2D.h:705
Acquisition(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:614
const Aperture & aperture() const
Get Aperture
Definition: Settings2D.h:699
Acquisition & set(const Brightness &value)
Set Brightness
Definition: Settings2D.h:730
const Brightness & brightness() const
Get Brightness
Definition: Settings2D.h:718
Brightness & brightness()
Get Brightness
Definition: Settings2D.h:724
const Gain & gain() const
Get Gain
Definition: Settings2D.h:756
const Settings2D::Acquisition::Brightness & get() const
Definition: Settings2D.h:785
Acquisition & set(const ExposureTime &value)
Set ExposureTime
Definition: Settings2D.h:749
List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mo...
Definition: Settings2D.h:882
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:902
Acquisitions(std::initializer_list< Settings2D::Acquisition > value)
Constructor
Definition: Settings2D.h:916
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:911
void forEach(const F &f)
Run the given function on each element in the list
Definition: Settings2D.h:973
bool operator==(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:992
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:983
std::vector< Settings2D::Acquisition > ValueType
The type of the underlying value
Definition: Settings2D.h:899
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:1004
std::size_t size() const noexcept
Get the size of the list
bool operator!=(const Acquisitions &other) const
Comparison operator
Definition: Settings2D.h:998
Acquisitions()=default
Default constructor
const std::vector< Settings2D::Acquisition > & value() const
Get the value
Digital gain applied to blue channel
Definition: Settings2D.h:1067
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1140
bool operator==(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1116
void reset()
Reset the node to unset state
double ValueType
The type of the underlying value
Definition: Settings2D.h:1084
bool operator>(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1134
std::string toString() const
Get the value as string
constexpr Blue(double value)
Constructor
Definition: Settings2D.h:1096
bool operator!=(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1122
bool hasValue() const
Check if the value is set
static constexpr Range< double > validRange()
The range of valid values for Blue
Definition: Settings2D.h:1087
bool operator<(const Blue &other) const
Comparison operator
Definition: Settings2D.h:1128
Digital gain applied to green channel
Definition: Settings2D.h:1165
double ValueType
The type of the underlying value
Definition: Settings2D.h:1182
static constexpr Range< double > validRange()
The range of valid values for Green
Definition: Settings2D.h:1185
bool operator==(const Green &other) const
Comparison operator
Definition: Settings2D.h:1214
std::string toString() const
Get the value as string
constexpr Green(double value)
Constructor
Definition: Settings2D.h:1194
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1238
bool operator<(const Green &other) const
Comparison operator
Definition: Settings2D.h:1226
bool hasValue() const
Check if the value is set
bool operator!=(const Green &other) const
Comparison operator
Definition: Settings2D.h:1220
bool operator>(const Green &other) const
Comparison operator
Definition: Settings2D.h:1232
void reset()
Reset the node to unset state
Digital gain applied to red channel
Definition: Settings2D.h:1263
double ValueType
The type of the underlying value
Definition: Settings2D.h:1280
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1336
bool operator<(const Red &other) const
Comparison operator
Definition: Settings2D.h:1324
std::string toString() const
Get the value as string
static constexpr Range< double > validRange()
The range of valid values for Red
Definition: Settings2D.h:1283
bool hasValue() const
Check if the value is set
bool operator!=(const Red &other) const
Comparison operator
Definition: Settings2D.h:1318
constexpr Red(double value)
Constructor
Definition: Settings2D.h:1292
bool operator==(const Red &other) const
Comparison operator
Definition: Settings2D.h:1312
void reset()
Reset the node to unset state
bool operator>(const Red &other) const
Comparison operator
Definition: Settings2D.h:1330
Color balance settings
Definition: Settings2D.h:1051
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1558
Balance(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1391
Blue & blue()
Get Blue
Definition: Settings2D.h:1483
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:1592
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:1583
const Blue & blue() const
Get Blue
Definition: Settings2D.h:1477
bool operator==(const Balance &other) const
Equality operator
Balance & set(const Blue &value)
Set Blue
Definition: Settings2D.h:1489
Red & red()
Get Red
Definition: Settings2D.h:1521
Green & green()
Get Green
Definition: Settings2D.h:1502
Balance & set(const Green &value)
Set Green
Definition: Settings2D.h:1508
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:1456
const Green & green() const
Get Green
Definition: Settings2D.h:1496
Balance & set(const Red &value)
Set Red
Definition: Settings2D.h:1527
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1548
const Red & red() const
Get Red
Definition: Settings2D.h:1515
std::string toString() const
Get the value as string
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1420
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1609
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1538
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition: Settings2D.h:1362
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition: Settings2D.h:1632
double ValueType
The type of the underlying value
Definition: Settings2D.h:1651
static constexpr Range< double > validRange()
The range of valid values for Gamma
Definition: Settings2D.h:1654
bool operator>(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1701
bool operator==(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1683
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream
Definition: Settings2D.h:1707
bool operator!=(const Gamma &other) const
Comparison operator
Definition: Settings2D.h:1689
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:1695
void reset()
Reset the node to unset state
constexpr Gamma(double value)
Constructor
Definition: Settings2D.h:1663
Gamma()=default
Default constructor
Color settings
Definition: Settings2D.h:1035
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:1796
Color & set(const Balance::Green &value)
Set Balance::Green
Definition: Settings2D.h:1880
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:1854
Color & set(const Balance::Blue &value)
Set Balance::Blue
Definition: Settings2D.h:1873
Balance & balance()
Get Balance
Definition: Settings2D.h:1860
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:1971
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:1995
Color(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:1765
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:1952
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:1934
Gamma & gamma()
Get Gamma
Definition: Settings2D.h:1900
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:1734
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:1943
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:1833
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:1916
const Gamma & gamma() const
Get Gamma
Definition: Settings2D.h:1894
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:1925
Color & set(const Balance &value)
Set Balance
Definition: Settings2D.h:1866
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:1979
Color & set(const Gamma &value)
Set Gamma
Definition: Settings2D.h:1906
Color & set(const Balance::Red &value)
Set Balance::Red
Definition: Settings2D.h:1887
Processing related settings
Definition: Settings2D.h:1019
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2196
Processing & set(const Color::Gamma &value)
Set Color::Gamma
Definition: Settings2D.h:2187
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:2152
const Settings2D::Processing::Color::Balance & get() const
Definition: Settings2D.h:2204
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream
Definition: Settings2D.h:2274
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:2252
Color & color()
Get Color
Definition: Settings2D.h:2146
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2083
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue
Definition: Settings2D.h:2166
Processing & set(const Color::Balance &value)
Set Color::Balance
Definition: Settings2D.h:2159
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:2019
const Color & color() const
Get Color
Definition: Settings2D.h:2140
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red
Definition: Settings2D.h:2180
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2239
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2231
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:2120
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2213
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2222
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:2259
Processing()
Default constructor
Processing(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2051
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green
Definition: Settings2D.h:2173
Settings used when capturing 2D images with a Zivid camera
Definition: Settings2D.h:121
Settings2D & set(const Processing &value)
Set Processing
Definition: Settings2D.h:2458
const Settings2D::Processing::Color & get() const
Definition: Settings2D.h:2521
const Settings2D::Processing::Color::Balance::Red & get() const
Definition: Settings2D.h:2555
const Settings2D::Processing::Color::Balance::Green & get() const
Definition: Settings2D.h:2547
void save(const std::string &fileName) const
Save to the given file
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition: Settings2D.h:2538
const Acquisitions & acquisitions() const
Get Acquisitions
Definition: Settings2D.h:2427
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: Settings2D.h:2590
Settings2D(Args &&...args)
Constructor taking variadic number of arguments
Definition: Settings2D.h:2335
const Settings2D::Acquisitions & get() const
Definition: Settings2D.h:2507
Settings2D()
Default constructor
const Settings2D::Processing::Color::Gamma & get() const
Definition: Settings2D.h:2563
Settings2D & set(const Acquisitions &value)
Set Acquisitions
Definition: Settings2D.h:2439
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:2529
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green
Definition: Settings2D.h:2486
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:2299
bool operator!=(const Settings2D &other) const
Inequality operator
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance
Definition: Settings2D.h:2472
const Settings2D::Processing & get() const
Definition: Settings2D.h:2513
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red
Definition: Settings2D.h:2493
void set(Args &&...args)
Set multiple arguments
Definition: Settings2D.h:2369
Processing & processing()
Get Processing
Definition: Settings2D.h:2452
const Processing & processing() const
Get Processing
Definition: Settings2D.h:2446
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:2408
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue
Definition: Settings2D.h:2479
Acquisitions & acquisitions()
Get Acquisitions
Definition: Settings2D.h:2433
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:2582
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:2606
Settings2D & set(const Processing::Color &value)
Set Processing::Color
Definition: Settings2D.h:2465
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma
Definition: Settings2D.h:2500
NodeType
Definition: NodeType.h:100
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:203
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99