Zivid C++ API 2.13.1+18e79e79-1
Settings2D.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
82 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "Settings2D" };
89
91 static constexpr const char *description{
92 R"description(Settings used when capturing 2D images with a Zivid camera.)description"
93 };
94
95 static constexpr size_t version{ 5 };
96
97#ifndef NO_DOC
98 template<size_t>
99 struct Version;
100
101 using LatestVersion = Zivid::Settings2D;
102
103 // Short identifier. This value is not guaranteed to be universally unique
104 // Todo(ZIVID-2808): Move this to internal DataModelExt header
105 static constexpr std::array<uint8_t, 3> binaryId{ 's', 't', '2' };
106
107#endif
108
110
111 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
113 {
114 public:
116 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
117
119 static constexpr const char *path{ "Acquisition" };
120
122 static constexpr const char *name{ "Acquisition" };
123
125 static constexpr const char *description{ R"description(Settings for a single acquisition.)description" };
126
130
131 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
133 {
134 public:
136 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
137
139 static constexpr const char *path{ "Acquisition/Aperture" };
140
142 static constexpr const char *name{ "Aperture" };
143
145 static constexpr const char *description{
146 R"description(Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to
147the effective aperture diameter).
148)description"
149 };
150
152 using ValueType = double;
153
155 static constexpr Range<double> validRange()
156 {
157 return { 1.4, 32.0 };
158 }
159
161 Aperture() = default;
162
164 explicit constexpr Aperture(double value)
165 : m_opt{ verifyValue(value) }
166 {}
167
172 double value() const;
173
175 bool hasValue() const;
176
178 void reset();
179
181 std::string toString() const;
182
184 bool operator==(const Aperture &other) const
185 {
186 return m_opt == other.m_opt;
187 }
188
190 bool operator!=(const Aperture &other) const
191 {
192 return m_opt != other.m_opt;
193 }
194
196 bool operator<(const Aperture &other) const
197 {
198 return m_opt < other.m_opt;
199 }
200
202 bool operator>(const Aperture &other) const
203 {
204 return m_opt > other.m_opt;
205 }
206
208 bool operator<=(const Aperture &other) const
209 {
210 return m_opt <= other.m_opt;
211 }
212
214 bool operator>=(const Aperture &other) const
215 {
216 return m_opt >= other.m_opt;
217 }
218
220 friend std::ostream &operator<<(std::ostream &stream, const Aperture &value)
221 {
222 return stream << value.toString();
223 }
224
225 private:
226 void setFromString(const std::string &value);
227
228 constexpr ValueType static verifyValue(const ValueType &value)
229 {
230 return validRange().isInRange(value)
231 ? value
232 : throw std::out_of_range{ "Aperture{ " + std::to_string(value) + " } is not in range ["
233 + std::to_string(validRange().min()) + ", "
234 + std::to_string(validRange().max()) + "]" };
235 }
236
237 Zivid::DataModel::Detail::Optional<double> m_opt;
238
239 friend struct DataModel::Detail::Befriend<Aperture>;
240 };
241
253
254 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
256 {
257 public:
259 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
260
262 static constexpr const char *path{ "Acquisition/Brightness" };
263
265 static constexpr const char *name{ "Brightness" };
266
268 static constexpr const char *description{
269 R"description(Brightness controls the light output from the projector.
270
271Brightness above 1.0 may be needed when the distance between the camera and the scene is large,
272or in case of high levels of ambient lighting.
273
274When brightness is above 1.0 the duty cycle of the camera (the percentage of time the camera
275can capture) will be reduced. The duty cycle in boost mode is 50%. The duty cycle is calculated
276over a 10 second period. This limitation is enforced automatically by the camera. Calling capture
277when the duty cycle limit has been reached will cause the camera to first wait (sleep) for a
278duration of time to cool down, before capture will start.
279)description"
280 };
281
283 using ValueType = double;
284
286 static constexpr Range<double> validRange()
287 {
288 return { 0, 2.5 };
289 }
290
292 Brightness() = default;
293
295 explicit constexpr Brightness(double value)
296 : m_opt{ verifyValue(value) }
297 {}
298
303 double value() const;
304
306 bool hasValue() const;
307
309 void reset();
310
312 std::string toString() const;
313
315 bool operator==(const Brightness &other) const
316 {
317 return m_opt == other.m_opt;
318 }
319
321 bool operator!=(const Brightness &other) const
322 {
323 return m_opt != other.m_opt;
324 }
325
327 bool operator<(const Brightness &other) const
328 {
329 return m_opt < other.m_opt;
330 }
331
333 bool operator>(const Brightness &other) const
334 {
335 return m_opt > other.m_opt;
336 }
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 friend std::ostream &operator<<(std::ostream &stream, const Brightness &value)
352 {
353 return stream << value.toString();
354 }
355
356 private:
357 void setFromString(const std::string &value);
358
359 constexpr ValueType static verifyValue(const ValueType &value)
360 {
361 return validRange().isInRange(value)
362 ? value
363 : throw std::out_of_range{ "Brightness{ " + std::to_string(value)
364 + " } is not in range [" + std::to_string(validRange().min())
365 + ", " + std::to_string(validRange().max()) + "]" };
366 }
367
368 Zivid::DataModel::Detail::Optional<double> m_opt;
369
370 friend struct DataModel::Detail::Befriend<Brightness>;
371 };
372
374
375 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
377 {
378 public:
380 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
381
383 static constexpr const char *path{ "Acquisition/ExposureTime" };
384
386 static constexpr const char *name{ "ExposureTime" };
387
389 static constexpr const char *description{ R"description(Exposure time for the image.)description" };
390
392 using ValueType = std::chrono::microseconds;
393
396 {
397 return { std::chrono::microseconds{ 1677 }, std::chrono::microseconds{ 100000 } };
398 }
399
401 ExposureTime() = default;
402
404 explicit constexpr ExposureTime(std::chrono::microseconds value)
405 : m_opt{ verifyValue(value) }
406 {}
407
412 std::chrono::microseconds value() const;
413
415 bool hasValue() const;
416
418 void reset();
419
421 std::string toString() const;
422
424 bool operator==(const ExposureTime &other) const
425 {
426 return m_opt == other.m_opt;
427 }
428
430 bool operator!=(const ExposureTime &other) const
431 {
432 return m_opt != other.m_opt;
433 }
434
436 bool operator<(const ExposureTime &other) const
437 {
438 return m_opt < other.m_opt;
439 }
440
442 bool operator>(const ExposureTime &other) const
443 {
444 return m_opt > other.m_opt;
445 }
446
448 bool operator<=(const ExposureTime &other) const
449 {
450 return m_opt <= other.m_opt;
451 }
452
454 bool operator>=(const ExposureTime &other) const
455 {
456 return m_opt >= other.m_opt;
457 }
458
460 friend std::ostream &operator<<(std::ostream &stream, const ExposureTime &value)
461 {
462 return stream << value.toString();
463 }
464
465 private:
466 void setFromString(const std::string &value);
467
468 constexpr ValueType static verifyValue(const ValueType &value)
469 {
470 return validRange().isInRange(value)
471 ? value
472 : throw std::out_of_range{ "ExposureTime{ " + std::to_string(value.count())
473 + " } is not in range ["
474 + std::to_string(validRange().min().count()) + ", "
475 + std::to_string(validRange().max().count()) + "]" };
476 }
477
478 Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
479
480 friend struct DataModel::Detail::Befriend<ExposureTime>;
481 };
482
484
485 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
487 {
488 public:
490 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
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 bool operator<=(const Gain &other) const
559 {
560 return m_opt <= other.m_opt;
561 }
562
564 bool operator>=(const Gain &other) const
565 {
566 return m_opt >= other.m_opt;
567 }
568
570 friend std::ostream &operator<<(std::ostream &stream, const Gain &value)
571 {
572 return stream << value.toString();
573 }
574
575 private:
576 void setFromString(const std::string &value);
577
578 constexpr ValueType static verifyValue(const ValueType &value)
579 {
580 return validRange().isInRange(value)
581 ? value
582 : throw std::out_of_range{ "Gain{ " + std::to_string(value) + " } is not in range ["
583 + std::to_string(validRange().min()) + ", "
584 + std::to_string(validRange().max()) + "]" };
585 }
586
587 Zivid::DataModel::Detail::Optional<double> m_opt;
588
589 friend struct DataModel::Detail::Befriend<Gain>;
590 };
591
592 using Descendants = std::tuple<
597
600
615#ifndef NO_DOC
616 template<
617 typename... Args,
618 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
619 typename std::enable_if<
620 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
621 value,
622 int>::type = 0>
623#else
624 template<typename... Args>
625#endif
626 explicit Acquisition(Args &&...args)
627 {
628 using namespace Zivid::Detail::TypeTraits;
629
630 static_assert(
631 AllArgsDecayedAreUnique<Args...>::value,
632 "Found duplicate types among the arguments passed to Acquisition(...). "
633 "Types should be listed at most once.");
634
635 set(std::forward<Args>(args)...);
636 }
637
651#ifndef NO_DOC
652 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
653#else
654 template<typename... Args>
655#endif
656 void set(Args &&...args)
657 {
658 using namespace Zivid::Detail::TypeTraits;
659
660 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
661 static_assert(
662 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
663
664 static_assert(
665 AllArgsDecayedAreUnique<Args...>::value,
666 "Found duplicate types among the arguments passed to set(...). "
667 "Types should be listed at most once.");
668
669 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
670 }
671
686#ifndef NO_DOC
687 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
688#else
689 template<typename... Args>
690#endif
691 Acquisition copyWith(Args &&...args) const
692 {
693 using namespace Zivid::Detail::TypeTraits;
694
695 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
696 static_assert(
697 AllArgsAreDescendantNodes::value,
698 "All arguments passed to copyWith(...) must be descendant nodes.");
699
700 static_assert(
701 AllArgsDecayedAreUnique<Args...>::value,
702 "Found duplicate types among the arguments passed to copyWith(...). "
703 "Types should be listed at most once.");
704
705 auto copy{ *this };
706 copy.set(std::forward<Args>(args)...);
707 return copy;
708 }
709
711 const Aperture &aperture() const
712 {
713 return m_aperture;
714 }
715
718 {
719 return m_aperture;
720 }
721
723 Acquisition &set(const Aperture &value)
724 {
725 m_aperture = value;
726 return *this;
727 }
728
730 const Brightness &brightness() const
731 {
732 return m_brightness;
733 }
734
737 {
738 return m_brightness;
739 }
740
743 {
744 m_brightness = value;
745 return *this;
746 }
747
750 {
751 return m_exposureTime;
752 }
753
756 {
757 return m_exposureTime;
758 }
759
762 {
763 m_exposureTime = value;
764 return *this;
765 }
766
768 const Gain &gain() const
769 {
770 return m_gain;
771 }
772
775 {
776 return m_gain;
777 }
778
780 Acquisition &set(const Gain &value)
781 {
782 m_gain = value;
783 return *this;
784 }
785
786 template<
787 typename T,
788 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value, int>::type = 0>
790 {
791 return m_aperture;
792 }
793
794 template<
795 typename T,
796 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value, int>::type = 0>
798 {
799 return m_brightness;
800 }
801
802 template<
803 typename T,
804 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value, int>::type = 0>
806 {
807 return m_exposureTime;
808 }
809
810 template<
811 typename T,
812 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value, int>::type = 0>
814 {
815 return m_gain;
816 }
817
818 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
820 {
821 return m_aperture;
822 }
823
824 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
826 {
827 return m_brightness;
828 }
829
830 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
832 {
833 return m_exposureTime;
834 }
835
836 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
838 {
839 return m_gain;
840 }
841
843 template<typename F>
844 void forEach(const F &f) const
845 {
846 f(m_aperture);
847 f(m_brightness);
848 f(m_exposureTime);
849 f(m_gain);
850 }
851
853 template<typename F>
854 void forEach(const F &f)
855 {
856 f(m_aperture);
857 f(m_brightness);
858 f(m_exposureTime);
859 f(m_gain);
860 }
861
863 bool operator==(const Acquisition &other) const;
864
866 bool operator!=(const Acquisition &other) const;
867
869 std::string toString() const;
870
872 friend std::ostream &operator<<(std::ostream &stream, const Acquisition &value)
873 {
874 return stream << value.toString();
875 }
876
877 private:
878 void setFromString(const std::string &value);
879
880 void setFromString(const std::string &fullPath, const std::string &value);
881
882 std::string getString(const std::string &fullPath) const;
883
884 Aperture m_aperture;
885 Brightness m_brightness;
886 ExposureTime m_exposureTime;
887 Gain m_gain;
888
889 friend struct DataModel::Detail::Befriend<Acquisition>;
890 };
891
893
894 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
896 {
897 public:
899 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafDataModelList;
900
902 static constexpr const char *path{ "Acquisitions" };
903
905 static constexpr const char *name{ "Acquisitions" };
906
908 static constexpr const char *description{
909 R"description(List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mode.)description"
910 };
911
913 using ValueType = std::vector<Settings2D::Acquisition>;
914
917 {
918 return { 0, std::numeric_limits<ValueType::size_type>::max() };
919 }
920
922 Acquisitions() = default;
923
925 explicit Acquisitions(std::vector<Settings2D::Acquisition> value)
926 : m_value{ std::move(value) }
927 {}
928
930 explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
931 : Acquisitions{ ValueType{ value } }
932 {}
933
935 const std::vector<Settings2D::Acquisition> &value() const;
936
938 std::string toString() const;
939
941 std::size_t size() const noexcept;
942
944 bool isEmpty() const noexcept;
945
951 template<typename... Args>
952 void emplaceBack(Args &&...args)
953 {
954 m_value.emplace_back(std::forward<Args>(args)...);
955 }
956
962 Settings2D::Acquisition &at(std::size_t pos);
963
969 const Settings2D::Acquisition &at(std::size_t pos) const;
970
977
983 const Settings2D::Acquisition &operator[](std::size_t pos) const;
984
986 template<typename F>
987 void forEach(const F &f)
988 {
989 for(auto &child : m_value)
990 {
991 f(child);
992 }
993 }
994
996 template<typename F>
997 void forEach(const F &f) const
998 {
999 for(const auto &child : m_value)
1000 {
1001 f(child);
1002 }
1003 }
1004
1006 using Iterator = std::vector<Settings2D::Acquisition>::iterator;
1007
1009 Iterator begin() noexcept;
1010
1012 Iterator end() noexcept;
1013
1015 using ConstIterator = std::vector<Settings2D::Acquisition>::const_iterator;
1016
1018 ConstIterator begin() const noexcept;
1019
1021 ConstIterator end() const noexcept;
1022
1024 ConstIterator cbegin() const noexcept;
1025
1027 ConstIterator cend() const noexcept;
1028
1030 bool operator==(const Acquisitions &other) const
1031 {
1032 return m_value == other.m_value;
1033 }
1034
1036 bool operator!=(const Acquisitions &other) const
1037 {
1038 return m_value != other.m_value;
1039 }
1040
1042 friend std::ostream &operator<<(std::ostream &stream, const Acquisitions &value)
1043 {
1044 return stream << value.toString();
1045 }
1046
1047 private:
1048 void setFromString(const std::string &value);
1049
1050 std::vector<Settings2D::Acquisition> m_value{};
1051
1052 friend struct DataModel::Detail::Befriend<Acquisitions>;
1053 };
1054
1056
1057 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1059 {
1060 public:
1062 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1063
1065 static constexpr const char *path{ "Processing" };
1066
1068 static constexpr const char *name{ "Processing" };
1069
1071 static constexpr const char *description{ R"description(Processing related settings.)description" };
1072
1074
1075 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1077 {
1078 public:
1080 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1081
1083 static constexpr const char *path{ "Processing/Color" };
1084
1086 static constexpr const char *name{ "Color" };
1087
1089 static constexpr const char *description{ R"description(Color settings.)description" };
1090
1092
1093 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1095 {
1096 public:
1098 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1099
1101 static constexpr const char *path{ "Processing/Color/Balance" };
1102
1104 static constexpr const char *name{ "Balance" };
1105
1107 static constexpr const char *description{ R"description(Color balance settings.)description" };
1108
1110
1111 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1113 {
1114 public:
1116 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1117
1119 static constexpr const char *path{ "Processing/Color/Balance/Blue" };
1120
1122 static constexpr const char *name{ "Blue" };
1123
1125 static constexpr const char *description{
1126 R"description(Digital gain applied to blue channel.)description"
1127 };
1128
1130 using ValueType = double;
1131
1133 static constexpr Range<double> validRange()
1134 {
1135 return { 1.0, 8.0 };
1136 }
1137
1139 Blue() = default;
1140
1142 explicit constexpr Blue(double value)
1143 : m_opt{ verifyValue(value) }
1144 {}
1145
1150 double value() const;
1151
1153 bool hasValue() const;
1154
1156 void reset();
1157
1159 std::string toString() const;
1160
1162 bool operator==(const Blue &other) const
1163 {
1164 return m_opt == other.m_opt;
1165 }
1166
1168 bool operator!=(const Blue &other) const
1169 {
1170 return m_opt != other.m_opt;
1171 }
1172
1174 bool operator<(const Blue &other) const
1175 {
1176 return m_opt < other.m_opt;
1177 }
1178
1180 bool operator>(const Blue &other) const
1181 {
1182 return m_opt > other.m_opt;
1183 }
1184
1186 bool operator<=(const Blue &other) const
1187 {
1188 return m_opt <= other.m_opt;
1189 }
1190
1192 bool operator>=(const Blue &other) const
1193 {
1194 return m_opt >= other.m_opt;
1195 }
1196
1198 friend std::ostream &operator<<(std::ostream &stream, const Blue &value)
1199 {
1200 return stream << value.toString();
1201 }
1202
1203 private:
1204 void setFromString(const std::string &value);
1205
1206 constexpr ValueType static verifyValue(const ValueType &value)
1207 {
1208 return validRange().isInRange(value)
1209 ? value
1210 : throw std::out_of_range{ "Blue{ " + std::to_string(value)
1211 + " } is not in range ["
1212 + std::to_string(validRange().min()) + ", "
1213 + std::to_string(validRange().max()) + "]" };
1214 }
1215
1216 Zivid::DataModel::Detail::Optional<double> m_opt;
1217
1218 friend struct DataModel::Detail::Befriend<Blue>;
1219 };
1220
1222
1223 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1225 {
1226 public:
1228 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1229
1231 static constexpr const char *path{ "Processing/Color/Balance/Green" };
1232
1234 static constexpr const char *name{ "Green" };
1235
1237 static constexpr const char *description{
1238 R"description(Digital gain applied to green channel.)description"
1239 };
1240
1242 using ValueType = double;
1243
1245 static constexpr Range<double> validRange()
1246 {
1247 return { 1.0, 8.0 };
1248 }
1249
1251 Green() = default;
1252
1254 explicit constexpr Green(double value)
1255 : m_opt{ verifyValue(value) }
1256 {}
1257
1262 double value() const;
1263
1265 bool hasValue() const;
1266
1268 void reset();
1269
1271 std::string toString() const;
1272
1274 bool operator==(const Green &other) const
1275 {
1276 return m_opt == other.m_opt;
1277 }
1278
1280 bool operator!=(const Green &other) const
1281 {
1282 return m_opt != other.m_opt;
1283 }
1284
1286 bool operator<(const Green &other) const
1287 {
1288 return m_opt < other.m_opt;
1289 }
1290
1292 bool operator>(const Green &other) const
1293 {
1294 return m_opt > other.m_opt;
1295 }
1296
1298 bool operator<=(const Green &other) const
1299 {
1300 return m_opt <= other.m_opt;
1301 }
1302
1304 bool operator>=(const Green &other) const
1305 {
1306 return m_opt >= other.m_opt;
1307 }
1308
1310 friend std::ostream &operator<<(std::ostream &stream, const Green &value)
1311 {
1312 return stream << value.toString();
1313 }
1314
1315 private:
1316 void setFromString(const std::string &value);
1317
1318 constexpr ValueType static verifyValue(const ValueType &value)
1319 {
1320 return validRange().isInRange(value)
1321 ? value
1322 : throw std::out_of_range{ "Green{ " + std::to_string(value)
1323 + " } is not in range ["
1324 + std::to_string(validRange().min()) + ", "
1325 + std::to_string(validRange().max()) + "]" };
1326 }
1327
1328 Zivid::DataModel::Detail::Optional<double> m_opt;
1329
1330 friend struct DataModel::Detail::Befriend<Green>;
1331 };
1332
1334
1335 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1337 {
1338 public:
1340 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1341
1343 static constexpr const char *path{ "Processing/Color/Balance/Red" };
1344
1346 static constexpr const char *name{ "Red" };
1347
1349 static constexpr const char *description{
1350 R"description(Digital gain applied to red channel.)description"
1351 };
1352
1354 using ValueType = double;
1355
1357 static constexpr Range<double> validRange()
1358 {
1359 return { 1.0, 8.0 };
1360 }
1361
1363 Red() = default;
1364
1366 explicit constexpr Red(double value)
1367 : m_opt{ verifyValue(value) }
1368 {}
1369
1374 double value() const;
1375
1377 bool hasValue() const;
1378
1380 void reset();
1381
1383 std::string toString() const;
1384
1386 bool operator==(const Red &other) const
1387 {
1388 return m_opt == other.m_opt;
1389 }
1390
1392 bool operator!=(const Red &other) const
1393 {
1394 return m_opt != other.m_opt;
1395 }
1396
1398 bool operator<(const Red &other) const
1399 {
1400 return m_opt < other.m_opt;
1401 }
1402
1404 bool operator>(const Red &other) const
1405 {
1406 return m_opt > other.m_opt;
1407 }
1408
1410 bool operator<=(const Red &other) const
1411 {
1412 return m_opt <= other.m_opt;
1413 }
1414
1416 bool operator>=(const Red &other) const
1417 {
1418 return m_opt >= other.m_opt;
1419 }
1420
1422 friend std::ostream &operator<<(std::ostream &stream, const Red &value)
1423 {
1424 return stream << value.toString();
1425 }
1426
1427 private:
1428 void setFromString(const std::string &value);
1429
1430 constexpr ValueType static verifyValue(const ValueType &value)
1431 {
1432 return validRange().isInRange(value)
1433 ? value
1434 : throw std::out_of_range{ "Red{ " + std::to_string(value)
1435 + " } is not in range ["
1436 + std::to_string(validRange().min()) + ", "
1437 + std::to_string(validRange().max()) + "]" };
1438 }
1439
1440 Zivid::DataModel::Detail::Optional<double> m_opt;
1441
1442 friend struct DataModel::Detail::Befriend<Red>;
1443 };
1444
1445 using Descendants = std::tuple<
1449
1452
1466#ifndef NO_DOC
1467 template<
1468 typename... Args,
1469 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1470 typename std::enable_if<
1471 Zivid::Detail::TypeTraits::
1472 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1473 int>::type = 0>
1474#else
1475 template<typename... Args>
1476#endif
1477 explicit Balance(Args &&...args)
1478 {
1479 using namespace Zivid::Detail::TypeTraits;
1480
1481 static_assert(
1482 AllArgsDecayedAreUnique<Args...>::value,
1483 "Found duplicate types among the arguments passed to Balance(...). "
1484 "Types should be listed at most once.");
1485
1486 set(std::forward<Args>(args)...);
1487 }
1488
1501#ifndef NO_DOC
1502 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1503#else
1504 template<typename... Args>
1505#endif
1506 void set(Args &&...args)
1507 {
1508 using namespace Zivid::Detail::TypeTraits;
1509
1510 using AllArgsAreDescendantNodes =
1511 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1512 static_assert(
1513 AllArgsAreDescendantNodes::value,
1514 "All arguments passed to set(...) must be descendant nodes.");
1515
1516 static_assert(
1517 AllArgsDecayedAreUnique<Args...>::value,
1518 "Found duplicate types among the arguments passed to set(...). "
1519 "Types should be listed at most once.");
1520
1521 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1522 }
1523
1537#ifndef NO_DOC
1538 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1539#else
1540 template<typename... Args>
1541#endif
1542 Balance copyWith(Args &&...args) const
1543 {
1544 using namespace Zivid::Detail::TypeTraits;
1545
1546 using AllArgsAreDescendantNodes =
1547 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1548 static_assert(
1549 AllArgsAreDescendantNodes::value,
1550 "All arguments passed to copyWith(...) must be descendant nodes.");
1551
1552 static_assert(
1553 AllArgsDecayedAreUnique<Args...>::value,
1554 "Found duplicate types among the arguments passed to copyWith(...). "
1555 "Types should be listed at most once.");
1556
1557 auto copy{ *this };
1558 copy.set(std::forward<Args>(args)...);
1559 return copy;
1560 }
1561
1563 const Blue &blue() const
1564 {
1565 return m_blue;
1566 }
1567
1570 {
1571 return m_blue;
1572 }
1573
1575 Balance &set(const Blue &value)
1576 {
1577 m_blue = value;
1578 return *this;
1579 }
1580
1582 const Green &green() const
1583 {
1584 return m_green;
1585 }
1586
1589 {
1590 return m_green;
1591 }
1592
1594 Balance &set(const Green &value)
1595 {
1596 m_green = value;
1597 return *this;
1598 }
1599
1601 const Red &red() const
1602 {
1603 return m_red;
1604 }
1605
1608 {
1609 return m_red;
1610 }
1611
1613 Balance &set(const Red &value)
1614 {
1615 m_red = value;
1616 return *this;
1617 }
1618
1619 template<
1620 typename T,
1621 typename std::enable_if<
1622 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1623 int>::type = 0>
1625 {
1626 return m_blue;
1627 }
1628
1629 template<
1630 typename T,
1631 typename std::enable_if<
1632 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1633 int>::type = 0>
1635 {
1636 return m_green;
1637 }
1638
1639 template<
1640 typename T,
1641 typename std::enable_if<
1642 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1643 int>::type = 0>
1645 {
1646 return m_red;
1647 }
1648
1649 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1651 {
1652 return m_blue;
1653 }
1654
1655 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1657 {
1658 return m_green;
1659 }
1660
1661 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1663 {
1664 return m_red;
1665 }
1666
1668 template<typename F>
1669 void forEach(const F &f) const
1670 {
1671 f(m_blue);
1672 f(m_green);
1673 f(m_red);
1674 }
1675
1677 template<typename F>
1678 void forEach(const F &f)
1679 {
1680 f(m_blue);
1681 f(m_green);
1682 f(m_red);
1683 }
1684
1686 bool operator==(const Balance &other) const;
1687
1689 bool operator!=(const Balance &other) const;
1690
1692 std::string toString() const;
1693
1695 friend std::ostream &operator<<(std::ostream &stream, const Balance &value)
1696 {
1697 return stream << value.toString();
1698 }
1699
1700 private:
1701 void setFromString(const std::string &value);
1702
1703 void setFromString(const std::string &fullPath, const std::string &value);
1704
1705 std::string getString(const std::string &fullPath) const;
1706
1707 Blue m_blue;
1708 Green m_green;
1709 Red m_red;
1710
1711 friend struct DataModel::Detail::Befriend<Balance>;
1712 };
1713
1717
1718 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1720 {
1721 public:
1723 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1724
1726 static constexpr const char *path{ "Processing/Color/Gamma" };
1727
1729 static constexpr const char *name{ "Gamma" };
1730
1732 static constexpr const char *description{
1733 R"description(Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma
1734greater than 1 makes the colors darker.
1735)description"
1736 };
1737
1739 using ValueType = double;
1740
1742 static constexpr Range<double> validRange()
1743 {
1744 return { 0.25, 1.5 };
1745 }
1746
1748 Gamma() = default;
1749
1751 explicit constexpr Gamma(double value)
1752 : m_opt{ verifyValue(value) }
1753 {}
1754
1759 double value() const;
1760
1762 bool hasValue() const;
1763
1765 void reset();
1766
1768 std::string toString() const;
1769
1771 bool operator==(const Gamma &other) const
1772 {
1773 return m_opt == other.m_opt;
1774 }
1775
1777 bool operator!=(const Gamma &other) const
1778 {
1779 return m_opt != other.m_opt;
1780 }
1781
1783 bool operator<(const Gamma &other) const
1784 {
1785 return m_opt < other.m_opt;
1786 }
1787
1789 bool operator>(const Gamma &other) const
1790 {
1791 return m_opt > other.m_opt;
1792 }
1793
1795 bool operator<=(const Gamma &other) const
1796 {
1797 return m_opt <= other.m_opt;
1798 }
1799
1801 bool operator>=(const Gamma &other) const
1802 {
1803 return m_opt >= other.m_opt;
1804 }
1805
1807 friend std::ostream &operator<<(std::ostream &stream, const Gamma &value)
1808 {
1809 return stream << value.toString();
1810 }
1811
1812 private:
1813 void setFromString(const std::string &value);
1814
1815 constexpr ValueType static verifyValue(const ValueType &value)
1816 {
1817 return validRange().isInRange(value)
1818 ? value
1819 : throw std::out_of_range{ "Gamma{ " + std::to_string(value) + " } is not in range ["
1820 + std::to_string(validRange().min()) + ", "
1821 + std::to_string(validRange().max()) + "]" };
1822 }
1823
1824 Zivid::DataModel::Detail::Optional<double> m_opt;
1825
1826 friend struct DataModel::Detail::Befriend<Gamma>;
1827 };
1828
1829 using Descendants = std::tuple<
1835
1838
1854#ifndef NO_DOC
1855 template<
1856 typename... Args,
1857 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1858 typename std::enable_if<
1859 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1860 value,
1861 int>::type = 0>
1862#else
1863 template<typename... Args>
1864#endif
1865 explicit Color(Args &&...args)
1866 {
1867 using namespace Zivid::Detail::TypeTraits;
1868
1869 static_assert(
1870 AllArgsDecayedAreUnique<Args...>::value,
1871 "Found duplicate types among the arguments passed to Color(...). "
1872 "Types should be listed at most once.");
1873
1874 set(std::forward<Args>(args)...);
1875 }
1876
1891#ifndef NO_DOC
1892 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1893#else
1894 template<typename... Args>
1895#endif
1896 void set(Args &&...args)
1897 {
1898 using namespace Zivid::Detail::TypeTraits;
1899
1900 using AllArgsAreDescendantNodes =
1901 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1902 static_assert(
1903 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1904
1905 static_assert(
1906 AllArgsDecayedAreUnique<Args...>::value,
1907 "Found duplicate types among the arguments passed to set(...). "
1908 "Types should be listed at most once.");
1909
1910 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1911 }
1912
1928#ifndef NO_DOC
1929 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1930#else
1931 template<typename... Args>
1932#endif
1933 Color copyWith(Args &&...args) const
1934 {
1935 using namespace Zivid::Detail::TypeTraits;
1936
1937 using AllArgsAreDescendantNodes =
1938 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1939 static_assert(
1940 AllArgsAreDescendantNodes::value,
1941 "All arguments passed to copyWith(...) must be descendant nodes.");
1942
1943 static_assert(
1944 AllArgsDecayedAreUnique<Args...>::value,
1945 "Found duplicate types among the arguments passed to copyWith(...). "
1946 "Types should be listed at most once.");
1947
1948 auto copy{ *this };
1949 copy.set(std::forward<Args>(args)...);
1950 return copy;
1951 }
1952
1954 const Balance &balance() const
1955 {
1956 return m_balance;
1957 }
1958
1961 {
1962 return m_balance;
1963 }
1964
1966 Color &set(const Balance &value)
1967 {
1968 m_balance = value;
1969 return *this;
1970 }
1971
1973 Color &set(const Balance::Blue &value)
1974 {
1975 m_balance.set(value);
1976 return *this;
1977 }
1978
1980 Color &set(const Balance::Green &value)
1981 {
1982 m_balance.set(value);
1983 return *this;
1984 }
1985
1987 Color &set(const Balance::Red &value)
1988 {
1989 m_balance.set(value);
1990 return *this;
1991 }
1992
1994 const Gamma &gamma() const
1995 {
1996 return m_gamma;
1997 }
1998
2001 {
2002 return m_gamma;
2003 }
2004
2006 Color &set(const Gamma &value)
2007 {
2008 m_gamma = value;
2009 return *this;
2010 }
2011
2012 template<
2013 typename T,
2014 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type =
2015 0>
2017 {
2018 return m_balance;
2019 }
2020
2021 template<
2022 typename T,
2023 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2024 type = 0>
2026 {
2027 return m_balance.get<Settings2D::Processing::Color::Balance::Blue>();
2028 }
2029
2030 template<
2031 typename T,
2032 typename std::
2033 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type = 0>
2035 {
2036 return m_balance.get<Settings2D::Processing::Color::Balance::Green>();
2037 }
2038
2039 template<
2040 typename T,
2041 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2042 type = 0>
2044 {
2045 return m_balance.get<Settings2D::Processing::Color::Balance::Red>();
2046 }
2047
2048 template<
2049 typename T,
2050 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type =
2051 0>
2053 {
2054 return m_gamma;
2055 }
2056
2057 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2059 {
2060 return m_balance;
2061 }
2062
2063 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2065 {
2066 return m_gamma;
2067 }
2068
2070 template<typename F>
2071 void forEach(const F &f) const
2072 {
2073 f(m_balance);
2074 f(m_gamma);
2075 }
2076
2078 template<typename F>
2079 void forEach(const F &f)
2080 {
2081 f(m_balance);
2082 f(m_gamma);
2083 }
2084
2086 bool operator==(const Color &other) const;
2087
2089 bool operator!=(const Color &other) const;
2090
2092 std::string toString() const;
2093
2095 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
2096 {
2097 return stream << value.toString();
2098 }
2099
2100 private:
2101 void setFromString(const std::string &value);
2102
2103 void setFromString(const std::string &fullPath, const std::string &value);
2104
2105 std::string getString(const std::string &fullPath) const;
2106
2107 Balance m_balance;
2108 Gamma m_gamma;
2109
2110 friend struct DataModel::Detail::Befriend<Color>;
2111 };
2112
2113 using Descendants = std::tuple<
2120
2123
2140#ifndef NO_DOC
2141 template<
2142 typename... Args,
2143 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2144 typename std::enable_if<
2145 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2146 value,
2147 int>::type = 0>
2148#else
2149 template<typename... Args>
2150#endif
2151 explicit Processing(Args &&...args)
2152 {
2153 using namespace Zivid::Detail::TypeTraits;
2154
2155 static_assert(
2156 AllArgsDecayedAreUnique<Args...>::value,
2157 "Found duplicate types among the arguments passed to Processing(...). "
2158 "Types should be listed at most once.");
2159
2160 set(std::forward<Args>(args)...);
2161 }
2162
2178#ifndef NO_DOC
2179 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2180#else
2181 template<typename... Args>
2182#endif
2183 void set(Args &&...args)
2184 {
2185 using namespace Zivid::Detail::TypeTraits;
2186
2187 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2188 static_assert(
2189 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2190
2191 static_assert(
2192 AllArgsDecayedAreUnique<Args...>::value,
2193 "Found duplicate types among the arguments passed to set(...). "
2194 "Types should be listed at most once.");
2195
2196 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2197 }
2198
2215#ifndef NO_DOC
2216 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2217#else
2218 template<typename... Args>
2219#endif
2220 Processing copyWith(Args &&...args) const
2221 {
2222 using namespace Zivid::Detail::TypeTraits;
2223
2224 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2225 static_assert(
2226 AllArgsAreDescendantNodes::value,
2227 "All arguments passed to copyWith(...) must be descendant nodes.");
2228
2229 static_assert(
2230 AllArgsDecayedAreUnique<Args...>::value,
2231 "Found duplicate types among the arguments passed to copyWith(...). "
2232 "Types should be listed at most once.");
2233
2234 auto copy{ *this };
2235 copy.set(std::forward<Args>(args)...);
2236 return copy;
2237 }
2238
2240 const Color &color() const
2241 {
2242 return m_color;
2243 }
2244
2247 {
2248 return m_color;
2249 }
2250
2252 Processing &set(const Color &value)
2253 {
2254 m_color = value;
2255 return *this;
2256 }
2257
2260 {
2261 m_color.set(value);
2262 return *this;
2263 }
2264
2267 {
2268 m_color.set(value);
2269 return *this;
2270 }
2271
2274 {
2275 m_color.set(value);
2276 return *this;
2277 }
2278
2281 {
2282 m_color.set(value);
2283 return *this;
2284 }
2285
2288 {
2289 m_color.set(value);
2290 return *this;
2291 }
2292
2293 template<
2294 typename T,
2295 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
2297 {
2298 return m_color;
2299 }
2300
2301 template<
2302 typename T,
2303 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
2305 {
2307 }
2308
2309 template<
2310 typename T,
2311 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::
2312 type = 0>
2314 {
2316 }
2317
2318 template<
2319 typename T,
2320 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::
2321 type = 0>
2323 {
2325 }
2326
2327 template<
2328 typename T,
2329 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::
2330 type = 0>
2332 {
2333 return m_color.get<Settings2D::Processing::Color::Balance::Red>();
2334 }
2335
2336 template<
2337 typename T,
2338 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
2340 {
2341 return m_color.get<Settings2D::Processing::Color::Gamma>();
2342 }
2343
2344 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2346 {
2347 return m_color;
2348 }
2349
2351 template<typename F>
2352 void forEach(const F &f) const
2353 {
2354 f(m_color);
2355 }
2356
2358 template<typename F>
2359 void forEach(const F &f)
2360 {
2361 f(m_color);
2362 }
2363
2365 bool operator==(const Processing &other) const;
2366
2368 bool operator!=(const Processing &other) const;
2369
2371 std::string toString() const;
2372
2374 friend std::ostream &operator<<(std::ostream &stream, const Processing &value)
2375 {
2376 return stream << value.toString();
2377 }
2378
2379 private:
2380 void setFromString(const std::string &value);
2381
2382 void setFromString(const std::string &fullPath, const std::string &value);
2383
2384 std::string getString(const std::string &fullPath) const;
2385
2386 Color m_color;
2387
2388 friend struct DataModel::Detail::Befriend<Processing>;
2389 };
2390
2393
2394 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2396 {
2397 public:
2399 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
2400
2402 static constexpr const char *path{ "Sampling" };
2403
2405 static constexpr const char *name{ "Sampling" };
2406
2408 static constexpr const char *description{ R"description(Sampling settings.
2409)description" };
2410
2417
2418 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2420 {
2421 public:
2423 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
2424
2426 static constexpr const char *path{ "Sampling/Color" };
2427
2429 static constexpr const char *name{ "Color" };
2430
2432 static constexpr const char *description{
2433 R"description(Choose how to sample colors for the 2D image. The `rgb` option gives an image
2434with full colors. The `grayscale` option gives a grayscale (r=g=b) image, which
2435can be acquired faster than full colors.
2436
2437The `grayscale` option is not available on all camera models.
2438)description"
2439 };
2440
2442 enum class ValueType
2443 {
2444 rgb,
2445 grayscale
2446 };
2447 static const Color rgb;
2448 static const Color grayscale;
2449
2451 static std::set<ValueType> validValues()
2452 {
2453 return { ValueType::rgb, ValueType::grayscale };
2454 }
2455
2457 Color() = default;
2458
2460 explicit constexpr Color(ValueType value)
2461 : m_opt{ verifyValue(value) }
2462 {}
2463
2469
2471 bool hasValue() const;
2472
2474 void reset();
2475
2477 std::string toString() const;
2478
2480 friend std::ostream &operator<<(std::ostream &stream, const Color::ValueType &value)
2481 {
2482 return stream << Color{ value }.toString();
2483 }
2484
2486 bool operator==(const Color &other) const
2487 {
2488 return m_opt == other.m_opt;
2489 }
2490
2492 bool operator!=(const Color &other) const
2493 {
2494 return m_opt != other.m_opt;
2495 }
2496
2498 friend std::ostream &operator<<(std::ostream &stream, const Color &value)
2499 {
2500 return stream << value.toString();
2501 }
2502
2503 private:
2504 void setFromString(const std::string &value);
2505
2506 constexpr ValueType static verifyValue(const ValueType &value)
2507 {
2508 return value == ValueType::rgb || value == ValueType::grayscale
2509 ? value
2510 : throw std::invalid_argument{
2511 "Invalid value: Color{ "
2512 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2513 };
2514 }
2515
2516 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
2517
2518 friend struct DataModel::Detail::Befriend<Color>;
2519 };
2520
2523
2524 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
2526 {
2527 public:
2529 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
2530
2532 static constexpr const char *path{ "Sampling/Pixel" };
2533
2535 static constexpr const char *name{ "Pixel" };
2536
2538 static constexpr const char *description{
2539 R"description(Use this setting to obtain an image that matches a point cloud captured with the equivalent sampling setting.
2540)description"
2541 };
2542
2544 enum class ValueType
2545 {
2546 all,
2547 blueSubsample2x2,
2548 redSubsample2x2,
2549 blueSubsample4x4,
2550 redSubsample4x4
2551 };
2552 static const Pixel all;
2554 static const Pixel redSubsample2x2;
2556 static const Pixel redSubsample4x4;
2557
2559 static std::set<ValueType> validValues()
2560 {
2561 return { ValueType::all,
2562 ValueType::blueSubsample2x2,
2563 ValueType::redSubsample2x2,
2564 ValueType::blueSubsample4x4,
2565 ValueType::redSubsample4x4 };
2566 }
2567
2569 Pixel() = default;
2570
2572 explicit constexpr Pixel(ValueType value)
2573 : m_opt{ verifyValue(value) }
2574 {}
2575
2581
2583 bool hasValue() const;
2584
2586 void reset();
2587
2589 std::string toString() const;
2590
2592 friend std::ostream &operator<<(std::ostream &stream, const Pixel::ValueType &value)
2593 {
2594 return stream << Pixel{ value }.toString();
2595 }
2596
2598 bool operator==(const Pixel &other) const
2599 {
2600 return m_opt == other.m_opt;
2601 }
2602
2604 bool operator!=(const Pixel &other) const
2605 {
2606 return m_opt != other.m_opt;
2607 }
2608
2610 friend std::ostream &operator<<(std::ostream &stream, const Pixel &value)
2611 {
2612 return stream << value.toString();
2613 }
2614
2615 private:
2616 void setFromString(const std::string &value);
2617
2618 constexpr ValueType static verifyValue(const ValueType &value)
2619 {
2620 return value == ValueType::all || value == ValueType::blueSubsample2x2
2621 || value == ValueType::redSubsample2x2 || value == ValueType::blueSubsample4x4
2622 || value == ValueType::redSubsample4x4
2623 ? value
2624 : throw std::invalid_argument{
2625 "Invalid value: Pixel{ "
2626 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
2627 };
2628 }
2629
2630 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
2631
2632 friend struct DataModel::Detail::Befriend<Pixel>;
2633 };
2634
2635 using Descendants = std::tuple<Settings2D::Sampling::Color, Settings2D::Sampling::Pixel>;
2636
2639
2652#ifndef NO_DOC
2653 template<
2654 typename... Args,
2655 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2656 typename std::enable_if<
2657 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
2658 value,
2659 int>::type = 0>
2660#else
2661 template<typename... Args>
2662#endif
2663 explicit Sampling(Args &&...args)
2664 {
2665 using namespace Zivid::Detail::TypeTraits;
2666
2667 static_assert(
2668 AllArgsDecayedAreUnique<Args...>::value,
2669 "Found duplicate types among the arguments passed to Sampling(...). "
2670 "Types should be listed at most once.");
2671
2672 set(std::forward<Args>(args)...);
2673 }
2674
2686#ifndef NO_DOC
2687 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2688#else
2689 template<typename... Args>
2690#endif
2691 void set(Args &&...args)
2692 {
2693 using namespace Zivid::Detail::TypeTraits;
2694
2695 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2696 static_assert(
2697 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2698
2699 static_assert(
2700 AllArgsDecayedAreUnique<Args...>::value,
2701 "Found duplicate types among the arguments passed to set(...). "
2702 "Types should be listed at most once.");
2703
2704 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2705 }
2706
2719#ifndef NO_DOC
2720 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2721#else
2722 template<typename... Args>
2723#endif
2724 Sampling copyWith(Args &&...args) const
2725 {
2726 using namespace Zivid::Detail::TypeTraits;
2727
2728 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2729 static_assert(
2730 AllArgsAreDescendantNodes::value,
2731 "All arguments passed to copyWith(...) must be descendant nodes.");
2732
2733 static_assert(
2734 AllArgsDecayedAreUnique<Args...>::value,
2735 "Found duplicate types among the arguments passed to copyWith(...). "
2736 "Types should be listed at most once.");
2737
2738 auto copy{ *this };
2739 copy.set(std::forward<Args>(args)...);
2740 return copy;
2741 }
2742
2744 const Color &color() const
2745 {
2746 return m_color;
2747 }
2748
2751 {
2752 return m_color;
2753 }
2754
2756 Sampling &set(const Color &value)
2757 {
2758 m_color = value;
2759 return *this;
2760 }
2761
2763 const Pixel &pixel() const
2764 {
2765 return m_pixel;
2766 }
2767
2770 {
2771 return m_pixel;
2772 }
2773
2775 Sampling &set(const Pixel &value)
2776 {
2777 m_pixel = value;
2778 return *this;
2779 }
2780
2781 template<
2782 typename T,
2783 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
2785 {
2786 return m_color;
2787 }
2788
2789 template<
2790 typename T,
2791 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
2793 {
2794 return m_pixel;
2795 }
2796
2797 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2799 {
2800 return m_color;
2801 }
2802
2803 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2805 {
2806 return m_pixel;
2807 }
2808
2810 template<typename F>
2811 void forEach(const F &f) const
2812 {
2813 f(m_color);
2814 f(m_pixel);
2815 }
2816
2818 template<typename F>
2819 void forEach(const F &f)
2820 {
2821 f(m_color);
2822 f(m_pixel);
2823 }
2824
2826 bool operator==(const Sampling &other) const;
2827
2829 bool operator!=(const Sampling &other) const;
2830
2832 std::string toString() const;
2833
2835 friend std::ostream &operator<<(std::ostream &stream, const Sampling &value)
2836 {
2837 return stream << value.toString();
2838 }
2839
2840 private:
2841 void setFromString(const std::string &value);
2842
2843 void setFromString(const std::string &fullPath, const std::string &value);
2844
2845 std::string getString(const std::string &fullPath) const;
2846
2847 Color m_color;
2848 Pixel m_pixel;
2849
2850 friend struct DataModel::Detail::Befriend<Sampling>;
2851 };
2852
2853 using Descendants = std::tuple<
2865
2868
2870 explicit Settings2D(const std::string &fileName);
2871
2877 ZIVID_NODISCARD static Settings2D fromSerialized(const std::string &value);
2878
2884 std::string serialize() const;
2885
2907#ifndef NO_DOC
2908 template<
2909 typename... Args,
2910 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
2911 typename std::enable_if<
2912 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
2913 int>::type = 0>
2914#else
2915 template<typename... Args>
2916#endif
2917 explicit Settings2D(Args &&...args)
2918 {
2919 using namespace Zivid::Detail::TypeTraits;
2920
2921 static_assert(
2922 AllArgsDecayedAreUnique<Args...>::value,
2923 "Found duplicate types among the arguments passed to Settings2D(...). "
2924 "Types should be listed at most once.");
2925
2926 set(std::forward<Args>(args)...);
2927 }
2928
2949#ifndef NO_DOC
2950 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
2951#else
2952 template<typename... Args>
2953#endif
2954 void set(Args &&...args)
2955 {
2956 using namespace Zivid::Detail::TypeTraits;
2957
2958 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2959 static_assert(
2960 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
2961
2962 static_assert(
2963 AllArgsDecayedAreUnique<Args...>::value,
2964 "Found duplicate types among the arguments passed to set(...). "
2965 "Types should be listed at most once.");
2966
2967 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
2968 }
2969
2991#ifndef NO_DOC
2992 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
2993#else
2994 template<typename... Args>
2995#endif
2996 Settings2D copyWith(Args &&...args) const
2997 {
2998 using namespace Zivid::Detail::TypeTraits;
2999
3000 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3001 static_assert(
3002 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
3003
3004 static_assert(
3005 AllArgsDecayedAreUnique<Args...>::value,
3006 "Found duplicate types among the arguments passed to copyWith(...). "
3007 "Types should be listed at most once.");
3008
3009 auto copy{ *this };
3010 copy.set(std::forward<Args>(args)...);
3011 return copy;
3012 }
3013
3016 {
3017 return m_acquisitions;
3018 }
3019
3022 {
3023 return m_acquisitions;
3024 }
3025
3028 {
3029 m_acquisitions = value;
3030 return *this;
3031 }
3032
3034 const Processing &processing() const
3035 {
3036 return m_processing;
3037 }
3038
3041 {
3042 return m_processing;
3043 }
3044
3047 {
3048 m_processing = value;
3049 return *this;
3050 }
3051
3054 {
3055 m_processing.set(value);
3056 return *this;
3057 }
3058
3061 {
3062 m_processing.set(value);
3063 return *this;
3064 }
3065
3068 {
3069 m_processing.set(value);
3070 return *this;
3071 }
3072
3075 {
3076 m_processing.set(value);
3077 return *this;
3078 }
3079
3082 {
3083 m_processing.set(value);
3084 return *this;
3085 }
3086
3089 {
3090 m_processing.set(value);
3091 return *this;
3092 }
3093
3095 const Sampling &sampling() const
3096 {
3097 return m_sampling;
3098 }
3099
3102 {
3103 return m_sampling;
3104 }
3105
3107 Settings2D &set(const Sampling &value)
3108 {
3109 m_sampling = value;
3110 return *this;
3111 }
3112
3115 {
3116 m_sampling.set(value);
3117 return *this;
3118 }
3119
3122 {
3123 m_sampling.set(value);
3124 return *this;
3125 }
3126
3127 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value, int>::type = 0>
3129 {
3130 return m_acquisitions;
3131 }
3132
3133 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value, int>::type = 0>
3135 {
3136 return m_processing;
3137 }
3138
3139 template<
3140 typename T,
3141 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value, int>::type = 0>
3143 {
3144 return m_processing.get<Settings2D::Processing::Color>();
3145 }
3146
3147 template<
3148 typename T,
3149 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value, int>::type = 0>
3151 {
3152 return m_processing.get<Settings2D::Processing::Color::Balance>();
3153 }
3154
3155 template<
3156 typename T,
3157 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value, int>::type =
3158 0>
3160 {
3161 return m_processing.get<Settings2D::Processing::Color::Balance::Blue>();
3162 }
3163
3164 template<
3165 typename T,
3166 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value, int>::type =
3167 0>
3169 {
3170 return m_processing.get<Settings2D::Processing::Color::Balance::Green>();
3171 }
3172
3173 template<
3174 typename T,
3175 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value, int>::type = 0>
3177 {
3178 return m_processing.get<Settings2D::Processing::Color::Balance::Red>();
3179 }
3180
3181 template<
3182 typename T,
3183 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value, int>::type = 0>
3185 {
3186 return m_processing.get<Settings2D::Processing::Color::Gamma>();
3187 }
3188
3189 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Sampling>::value, int>::type = 0>
3191 {
3192 return m_sampling;
3193 }
3194
3195 template<
3196 typename T,
3197 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value, int>::type = 0>
3199 {
3200 return m_sampling.get<Settings2D::Sampling::Color>();
3201 }
3202
3203 template<
3204 typename T,
3205 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value, int>::type = 0>
3207 {
3208 return m_sampling.get<Settings2D::Sampling::Pixel>();
3209 }
3210
3211 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3213 {
3214 return m_acquisitions;
3215 }
3216
3217 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3219 {
3220 return m_processing;
3221 }
3222
3223 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3225 {
3226 return m_sampling;
3227 }
3228
3230 template<typename F>
3231 void forEach(const F &f) const
3232 {
3233 f(m_acquisitions);
3234 f(m_processing);
3235 f(m_sampling);
3236 }
3237
3239 template<typename F>
3240 void forEach(const F &f)
3241 {
3242 f(m_acquisitions);
3243 f(m_processing);
3244 f(m_sampling);
3245 }
3246
3248 bool operator==(const Settings2D &other) const;
3249
3251 bool operator!=(const Settings2D &other) const;
3252
3254 std::string toString() const;
3255
3257 friend std::ostream &operator<<(std::ostream &stream, const Settings2D &value)
3258 {
3259 return stream << value.toString();
3260 }
3261
3263 void save(const std::string &fileName) const;
3264
3266 void load(const std::string &fileName);
3267
3268 private:
3269 void setFromString(const std::string &value);
3270
3271 void setFromString(const std::string &fullPath, const std::string &value);
3272
3273 std::string getString(const std::string &fullPath) const;
3274
3275 Acquisitions m_acquisitions;
3276 Processing m_processing;
3277 Sampling m_sampling;
3278
3279 friend struct DataModel::Detail::Befriend<Settings2D>;
3280 };
3281
3282#ifndef NO_DOC
3284 namespace Detail
3285 {
3286 ZIVID_CORE_EXPORT void save(const Settings2D &dataModel, std::ostream &ostream);
3287 ZIVID_CORE_EXPORT void load(Settings2D &dataModel, std::istream &istream);
3288 } // namespace Detail
3289#endif
3290
3291#ifndef NO_DOC
3292 template<>
3293 struct Settings2D::Version<5>
3294 {
3295 using Type = Settings2D;
3296 };
3297#endif
3298
3299} // namespace Zivid
3300
3301#ifdef _MSC_VER
3302# pragma warning(pop)
3303#endif
3304
3305#ifndef NO_DOC
3306# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3307namespace std // NOLINT
3308{
3309
3310 template<>
3311 struct tuple_size<Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
3312 {};
3313
3314 template<size_t i>
3315 struct tuple_element<i, Zivid::Settings2D::Processing>
3316 {
3317 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value, "Index must be less than 1");
3318
3319 using type // NOLINT
3320 = decltype(declval<Zivid::Settings2D::Processing>().get<i>());
3321 };
3322
3323 template<>
3324 struct tuple_size<Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
3325 {};
3326
3327 template<size_t i>
3328 struct tuple_element<i, Zivid::Settings2D::Processing::Color>
3329 {
3330 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value, "Index must be less than 2");
3331
3332 using type // NOLINT
3333 = decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
3334 };
3335
3336 template<>
3337 struct tuple_size<Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
3338 {};
3339
3340 template<size_t i>
3341 struct tuple_element<i, Zivid::Settings2D::Processing::Color::Balance>
3342 {
3343 static_assert(
3344 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
3345 "Index must be less than 3");
3346
3347 using type // NOLINT
3348 = decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
3349 };
3350
3351 template<>
3352 struct tuple_size<Zivid::Settings2D::Sampling> : integral_constant<size_t, 2>
3353 {};
3354
3355 template<size_t i>
3356 struct tuple_element<i, Zivid::Settings2D::Sampling>
3357 {
3358 static_assert(i < tuple_size<Zivid::Settings2D::Sampling>::value, "Index must be less than 2");
3359
3360 using type // NOLINT
3361 = decltype(declval<Zivid::Settings2D::Sampling>().get<i>());
3362 };
3363
3364 template<>
3365 struct tuple_size<Zivid::Settings2D> : integral_constant<size_t, 3>
3366 {};
3367
3368 template<size_t i>
3369 struct tuple_element<i, Zivid::Settings2D>
3370 {
3371 static_assert(i < tuple_size<Zivid::Settings2D>::value, "Index must be less than 3");
3372
3373 using type // NOLINT
3374 = decltype(declval<Zivid::Settings2D>().get<i>());
3375 };
3376
3377} // namespace std
3378# endif
3379#endif
3380
3381// If we have access to the DataModel library, automatically include internal DataModel
3382// header. This header is necessary for serialization and deserialization.
3383#if defined(__has_include) && !defined(NO_DOC)
3384# if __has_include("Zivid/Settings2DInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
3385# include "Zivid/Settings2DInternal.h"
3386# endif
3387#endif
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Class describing a range of values for a given type T.
Definition Range.h:73
Aperture setting for the camera. Specified as an f-number (the ratio of lens focal length to the effe...
Definition Settings2D.h:133
void reset()
Reset the node to unset state.
bool operator!=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:190
friend std::ostream & operator<<(std::ostream &stream, const Aperture &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:220
bool operator<(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:196
constexpr Aperture(double value)
Constructor.
Definition Settings2D.h:164
static constexpr Range< double > validRange()
The range of valid values for Aperture.
Definition Settings2D.h:155
bool operator>=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:214
bool operator<=(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:208
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:202
Aperture()=default
Default constructor.
double ValueType
The type of the underlying value.
Definition Settings2D.h:152
bool operator==(const Aperture &other) const
Comparison operator.
Definition Settings2D.h:184
bool hasValue() const
Check if the value is set.
Brightness controls the light output from the projector.
Definition Settings2D.h:256
bool operator==(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:315
bool operator<=(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:339
bool operator>(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:333
bool operator<(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:327
static constexpr Range< double > validRange()
The range of valid values for Brightness.
Definition Settings2D.h:286
constexpr Brightness(double value)
Constructor.
Definition Settings2D.h:295
std::string toString() const
Get the value as string.
bool operator!=(const Brightness &other) const
Comparison operator.
Definition Settings2D.h:321
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:351
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:283
Exposure time for the image.
Definition Settings2D.h:377
bool operator>(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:442
std::chrono::microseconds ValueType
The type of the underlying value.
Definition Settings2D.h:392
bool operator>=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:454
void reset()
Reset the node to unset state.
constexpr ExposureTime(std::chrono::microseconds value)
Constructor.
Definition Settings2D.h:404
std::chrono::microseconds value() const
Get the value.
bool operator<(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:436
bool operator<=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:448
static constexpr Range< std::chrono::microseconds > validRange()
The range of valid values for ExposureTime.
Definition Settings2D.h:395
bool operator!=(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:430
std::string toString() const
Get the value as string.
ExposureTime()=default
Default constructor.
bool operator==(const ExposureTime &other) const
Comparison operator.
Definition Settings2D.h:424
friend std::ostream & operator<<(std::ostream &stream, const ExposureTime &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:460
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:570
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.
bool operator>=(const Gain &other) const
Comparison operator.
Definition Settings2D.h:564
bool operator<=(const Gain &other) const
Comparison operator.
Definition Settings2D.h:558
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:113
const Settings2D::Acquisition::Gain & get() const
Definition Settings2D.h:813
const ExposureTime & exposureTime() const
Get ExposureTime.
Definition Settings2D.h:749
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:844
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:854
const Settings2D::Acquisition::Aperture & get() const
Definition Settings2D.h:789
ExposureTime & exposureTime()
Get ExposureTime.
Definition Settings2D.h:755
friend std::ostream & operator<<(std::ostream &stream, const Acquisition &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:872
bool operator!=(const Acquisition &other) const
Inequality operator.
Acquisition & set(const Gain &value)
Set Gain.
Definition Settings2D.h:780
std::string toString() const
Get the value as string.
Acquisition & set(const Aperture &value)
Set Aperture.
Definition Settings2D.h:723
Gain & gain()
Get Gain.
Definition Settings2D.h:774
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:691
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:656
const Settings2D::Acquisition::ExposureTime & get() const
Definition Settings2D.h:805
Acquisition()
Default constructor.
Aperture & aperture()
Get Aperture.
Definition Settings2D.h:717
const Aperture & aperture() const
Get Aperture.
Definition Settings2D.h:711
Acquisition & set(const Brightness &value)
Set Brightness.
Definition Settings2D.h:742
const Brightness & brightness() const
Get Brightness.
Definition Settings2D.h:730
Brightness & brightness()
Get Brightness.
Definition Settings2D.h:736
std::tuple< Settings2D::Acquisition::Aperture, Settings2D::Acquisition::Brightness, Settings2D::Acquisition::ExposureTime, Settings2D::Acquisition::Gain > Descendants
Definition Settings2D.h:592
const Gain & gain() const
Get Gain.
Definition Settings2D.h:768
const Settings2D::Acquisition::Brightness & get() const
Definition Settings2D.h:797
Acquisition & set(const ExposureTime &value)
Set ExposureTime.
Definition Settings2D.h:761
List of acquisitions. Note that the Zivid SDK only supports a single acquisition per capture in 2D mo...
Definition Settings2D.h:896
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:916
Acquisitions(std::initializer_list< Settings2D::Acquisition > value)
Constructor.
Definition Settings2D.h:930
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:925
void forEach(const F &f)
Run the given function on each element in the list.
Definition Settings2D.h:987
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:997
std::vector< Settings2D::Acquisition > ValueType
The type of the underlying value.
Definition Settings2D.h:913
Iterator begin() noexcept
Returns an iterator to the first element of the list.
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Acquisitions &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1042
std::vector< Settings2D::Acquisition >::iterator Iterator
Iterator type for Acquisitions.
Definition Settings2D.h:1006
std::vector< Settings2D::Acquisition >::const_iterator ConstIterator
Constant iterator type for Acquisitions.
Definition Settings2D.h:1015
std::size_t size() const noexcept
Get the size of the list.
bool operator!=(const Acquisitions &other) const
Comparison operator.
Definition Settings2D.h:1036
Acquisitions()=default
Default constructor.
const std::vector< Settings2D::Acquisition > & value() const
Get the value.
Digital gain applied to blue channel.
Definition Settings2D.h:1113
friend std::ostream & operator<<(std::ostream &stream, const Blue &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1198
bool operator<=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1186
bool operator==(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1162
void reset()
Reset the node to unset state.
double ValueType
The type of the underlying value.
Definition Settings2D.h:1130
bool operator>(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1180
std::string toString() const
Get the value as string.
constexpr Blue(double value)
Constructor.
Definition Settings2D.h:1142
bool operator!=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1168
bool hasValue() const
Check if the value is set.
static constexpr Range< double > validRange()
The range of valid values for Blue.
Definition Settings2D.h:1133
bool operator<(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1174
bool operator>=(const Blue &other) const
Comparison operator.
Definition Settings2D.h:1192
Digital gain applied to green channel.
Definition Settings2D.h:1225
double ValueType
The type of the underlying value.
Definition Settings2D.h:1242
static constexpr Range< double > validRange()
The range of valid values for Green.
Definition Settings2D.h:1245
bool operator==(const Green &other) const
Comparison operator.
Definition Settings2D.h:1274
std::string toString() const
Get the value as string.
constexpr Green(double value)
Constructor.
Definition Settings2D.h:1254
friend std::ostream & operator<<(std::ostream &stream, const Green &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1310
bool operator<(const Green &other) const
Comparison operator.
Definition Settings2D.h:1286
bool hasValue() const
Check if the value is set.
bool operator<=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1298
bool operator>=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1304
bool operator!=(const Green &other) const
Comparison operator.
Definition Settings2D.h:1280
bool operator>(const Green &other) const
Comparison operator.
Definition Settings2D.h:1292
void reset()
Reset the node to unset state.
Digital gain applied to red channel.
Definition Settings2D.h:1337
double ValueType
The type of the underlying value.
Definition Settings2D.h:1354
friend std::ostream & operator<<(std::ostream &stream, const Red &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1422
bool operator>=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1416
bool operator<(const Red &other) const
Comparison operator.
Definition Settings2D.h:1398
bool operator<=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1410
std::string toString() const
Get the value as string.
static constexpr Range< double > validRange()
The range of valid values for Red.
Definition Settings2D.h:1357
bool hasValue() const
Check if the value is set.
bool operator!=(const Red &other) const
Comparison operator.
Definition Settings2D.h:1392
constexpr Red(double value)
Constructor.
Definition Settings2D.h:1366
bool operator==(const Red &other) const
Comparison operator.
Definition Settings2D.h:1386
void reset()
Reset the node to unset state.
bool operator>(const Red &other) const
Comparison operator.
Definition Settings2D.h:1404
Color balance settings.
Definition Settings2D.h:1095
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:1644
Blue & blue()
Get Blue.
Definition Settings2D.h:1569
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:1678
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:1669
std::tuple< Settings2D::Processing::Color::Balance::Blue, Settings2D::Processing::Color::Balance::Green, Settings2D::Processing::Color::Balance::Red > Descendants
Definition Settings2D.h:1445
const Blue & blue() const
Get Blue.
Definition Settings2D.h:1563
bool operator==(const Balance &other) const
Equality operator.
Balance & set(const Blue &value)
Set Blue.
Definition Settings2D.h:1575
Red & red()
Get Red.
Definition Settings2D.h:1607
Green & green()
Get Green.
Definition Settings2D.h:1588
Balance & set(const Green &value)
Set Green.
Definition Settings2D.h:1594
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:1542
const Green & green() const
Get Green.
Definition Settings2D.h:1582
Balance & set(const Red &value)
Set Red.
Definition Settings2D.h:1613
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:1634
const Red & red() const
Get Red.
Definition Settings2D.h:1601
std::string toString() const
Get the value as string.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1506
friend std::ostream & operator<<(std::ostream &stream, const Balance &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:1695
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:1624
Gamma applied to the color values. Gamma less than 1 makes the colors brighter, while gamma greater t...
Definition Settings2D.h:1720
double ValueType
The type of the underlying value.
Definition Settings2D.h:1739
static constexpr Range< double > validRange()
The range of valid values for Gamma.
Definition Settings2D.h:1742
bool operator>(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:1789
bool operator==(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:1771
friend std::ostream & operator<<(std::ostream &stream, const Gamma &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:1807
bool operator!=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:1777
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:1783
void reset()
Reset the node to unset state.
bool operator>=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:1801
constexpr Gamma(double value)
Constructor.
Definition Settings2D.h:1751
Gamma()=default
Default constructor.
bool operator<=(const Gamma &other) const
Comparison operator.
Definition Settings2D.h:1795
double value() const
Get the value.
Color settings.
Definition Settings2D.h:1077
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:1896
Color & set(const Balance::Green &value)
Set Balance::Green.
Definition Settings2D.h:1980
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:1954
Color & set(const Balance::Blue &value)
Set Balance::Blue.
Definition Settings2D.h:1973
Balance & balance()
Get Balance.
Definition Settings2D.h:1960
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:2071
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2095
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:2052
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:1829
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:2034
Gamma & gamma()
Get Gamma.
Definition Settings2D.h:2000
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:2043
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:1933
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:2016
const Gamma & gamma() const
Get Gamma.
Definition Settings2D.h:1994
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:2025
Color & set(const Balance &value)
Set Balance.
Definition Settings2D.h:1966
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2079
Color & set(const Gamma &value)
Set Gamma.
Definition Settings2D.h:2006
Color & set(const Balance::Red &value)
Set Balance::Red.
Definition Settings2D.h:1987
Processing related settings.
Definition Settings2D.h:1059
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:2296
Processing & set(const Color::Gamma &value)
Set Color::Gamma.
Definition Settings2D.h:2287
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:2252
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:2304
friend std::ostream & operator<<(std::ostream &stream, const Processing &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2374
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:2352
Color & color()
Get Color.
Definition Settings2D.h:2246
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2183
Processing & set(const Color::Balance::Blue &value)
Set Color::Balance::Blue.
Definition Settings2D.h:2266
Processing & set(const Color::Balance &value)
Set Color::Balance.
Definition Settings2D.h:2259
const Color & color() const
Get Color.
Definition Settings2D.h:2240
Processing & set(const Color::Balance::Red &value)
Set Color::Balance::Red.
Definition Settings2D.h:2280
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:2339
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:2331
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:2220
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:2313
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:2322
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:2359
Processing()
Default constructor.
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:2113
Processing & set(const Color::Balance::Green &value)
Set Color::Balance::Green.
Definition Settings2D.h:2273
Choose how to sample colors for the 2D image. The rgb option gives an image with full colors....
Definition Settings2D.h:2420
ValueType
The type of the underlying value.
Definition Settings2D.h:2443
Color()=default
Default constructor.
void reset()
Reset the node to unset state.
static const Color grayscale
grayscale
Definition Settings2D.h:2448
static std::set< ValueType > validValues()
All valid values of Color.
Definition Settings2D.h:2451
ValueType value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const Color &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2498
constexpr Color(ValueType value)
Constructor.
Definition Settings2D.h:2460
bool hasValue() const
Check if the value is set.
static const Color rgb
rgb
Definition Settings2D.h:2447
bool operator==(const Color &other) const
Comparison operator.
Definition Settings2D.h:2486
bool operator!=(const Color &other) const
Comparison operator.
Definition Settings2D.h:2492
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Color::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:2480
Use this setting to obtain an image that matches a point cloud captured with the equivalent sampling ...
Definition Settings2D.h:2526
static const Pixel redSubsample4x4
redSubsample4x4
Definition Settings2D.h:2556
Pixel()=default
Default constructor.
constexpr Pixel(ValueType value)
Constructor.
Definition Settings2D.h:2572
ValueType
The type of the underlying value.
Definition Settings2D.h:2545
bool operator!=(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:2604
ValueType value() const
Get the value.
bool operator==(const Pixel &other) const
Comparison operator.
Definition Settings2D.h:2598
static const Pixel redSubsample2x2
redSubsample2x2
Definition Settings2D.h:2554
static const Pixel all
all
Definition Settings2D.h:2552
static std::set< ValueType > validValues()
All valid values of Pixel.
Definition Settings2D.h:2559
std::string toString() const
Get the value as string.
static const Pixel blueSubsample2x2
blueSubsample2x2
Definition Settings2D.h:2553
friend std::ostream & operator<<(std::ostream &stream, const Pixel::ValueType &value)
Operator to serialize ValueType to a stream.
Definition Settings2D.h:2592
friend std::ostream & operator<<(std::ostream &stream, const Pixel &value)
Operator to serialize the value to a stream.
Definition Settings2D.h:2610
void reset()
Reset the node to unset state.
static const Pixel blueSubsample4x4
blueSubsample4x4
Definition Settings2D.h:2555
bool hasValue() const
Check if the value is set.
Sampling settings.
Definition Settings2D.h:2396
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:2819
bool operator==(const Sampling &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2691
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:2792
Sampling & set(const Pixel &value)
Set Pixel.
Definition Settings2D.h:2775
const Pixel & pixel() const
Get Pixel.
Definition Settings2D.h:2763
Pixel & pixel()
Get Pixel.
Definition Settings2D.h:2769
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:2811
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:2784
friend std::ostream & operator<<(std::ostream &stream, const Sampling &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:2835
bool operator!=(const Sampling &other) const
Inequality operator.
const Color & color() const
Get Color.
Definition Settings2D.h:2744
Sampling & set(const Color &value)
Set Color.
Definition Settings2D.h:2756
Sampling copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition Settings2D.h:2724
Color & color()
Get Color.
Definition Settings2D.h:2750
Sampling()
Default constructor.
std::tuple< Settings2D::Sampling::Color, Settings2D::Sampling::Pixel > Descendants
Definition Settings2D.h:2635
Settings used when capturing 2D images with a Zivid camera.
Definition Settings2D.h:79
Settings2D & set(const Processing &value)
Set Processing.
Definition Settings2D.h:3046
const Settings2D::Sampling::Pixel & get() const
Definition Settings2D.h:3206
const Settings2D::Processing::Color & get() const
Definition Settings2D.h:3142
Sampling & sampling()
Get Sampling.
Definition Settings2D.h:3101
const Settings2D::Sampling::Color & get() const
Definition Settings2D.h:3198
const Settings2D::Processing::Color::Balance::Red & get() const
Definition Settings2D.h:3176
const Settings2D::Processing::Color::Balance::Green & get() const
Definition Settings2D.h:3168
Settings2D & set(const Sampling::Color &value)
Set Sampling::Color.
Definition Settings2D.h:3114
void save(const std::string &fileName) const
Save to the given file.
std::string serialize() const
Serialize to a string.
const Settings2D::Processing::Color::Balance::Blue & get() const
Definition Settings2D.h:3159
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, Settings2D::Sampling, Settings2D::Sampling::Color, Settings2D::Sampling::Pixel > Descendants
Definition Settings2D.h:2853
const Acquisitions & acquisitions() const
Get Acquisitions.
Definition Settings2D.h:3015
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition Settings2D.h:3240
Settings2D & set(const Sampling &value)
Set Sampling.
Definition Settings2D.h:3107
Settings2D(Args &&...args)
Constructor taking variadic number of arguments.
Definition Settings2D.h:2917
const Settings2D::Acquisitions & get() const
Definition Settings2D.h:3128
Settings2D()
Default constructor.
const Settings2D::Processing::Color::Gamma & get() const
Definition Settings2D.h:3184
Settings2D & set(const Acquisitions &value)
Set Acquisitions.
Definition Settings2D.h:3027
Settings2D(const std::string &fileName)
Construct Settings2D by loading from file.
const Settings2D::Sampling & get() const
Definition Settings2D.h:3190
void load(const std::string &fileName)
Load from the given file.
const Settings2D::Processing::Color::Balance & get() const
Definition Settings2D.h:3150
Settings2D & set(const Processing::Color::Balance::Green &value)
Set Processing::Color::Balance::Green.
Definition Settings2D.h:3074
bool operator!=(const Settings2D &other) const
Inequality operator.
Settings2D & set(const Processing::Color::Balance &value)
Set Processing::Color::Balance.
Definition Settings2D.h:3060
const Settings2D::Processing & get() const
Definition Settings2D.h:3134
Settings2D & set(const Processing::Color::Balance::Red &value)
Set Processing::Color::Balance::Red.
Definition Settings2D.h:3081
void set(Args &&...args)
Set multiple arguments.
Definition Settings2D.h:2954
Processing & processing()
Get Processing.
Definition Settings2D.h:3040
const Processing & processing() const
Get Processing.
Definition Settings2D.h:3034
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:2996
Settings2D & set(const Processing::Color::Balance::Blue &value)
Set Processing::Color::Balance::Blue.
Definition Settings2D.h:3067
Acquisitions & acquisitions()
Get Acquisitions.
Definition Settings2D.h:3021
std::string toString() const
Get the value as string.
Settings2D & set(const Sampling::Pixel &value)
Set Sampling::Pixel.
Definition Settings2D.h:3121
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:3231
bool operator==(const Settings2D &other) const
Equality operator.
const Sampling & sampling() const
Get Sampling.
Definition Settings2D.h:3095
friend std::ostream & operator<<(std::ostream &stream, const Settings2D &value)
Operator to send the value as string to a stream.
Definition Settings2D.h:3257
static ZIVID_NODISCARD Settings2D fromSerialized(const std::string &value)
Construct a new Settings2D instance from a previously serialized string.
Settings2D & set(const Processing::Color &value)
Set Processing::Color.
Definition Settings2D.h:3053
Settings2D & set(const Processing::Color::Gamma &value)
Set Processing::Color::Gamma.
Definition Settings2D.h:3088
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56