Zivid C++ API 2.16.0+46cdaba6-1
SceneConditions.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2025 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <optional>
53#include <set>
54#include <sstream>
55#include <string>
56#include <tuple>
57#include <utility>
58#include <vector>
59
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74
77
78 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
80 {
81 public:
83 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
84
86 static constexpr const char *path{ "" };
87
89 static constexpr const char *name{ "SceneConditions" };
90
92 static constexpr const char *description{
93 R"description(A description of the ambient conditions detected by the camera.
94)description"
95 };
96
97 static constexpr size_t version{ 2 };
98
99#ifndef NO_DOC
100 template<size_t>
101 struct Version;
102
103 using LatestVersion = Zivid::SceneConditions;
104
105 // Short identifier. This value is not guaranteed to be universally unique
106 // Todo(ZIVID-2808): Move this to internal DataModelExt header
107 static constexpr std::array<uint8_t, 3> binaryId{ 'c', 's', 'c' };
108
109#endif
110
113
114 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
116 {
117 public:
119 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
120
122 static constexpr const char *path{ "AmbientLight" };
123
125 static constexpr const char *name{ "AmbientLight" };
126
128 static constexpr const char *description{ R"description(The ambient light detected by the camera.
129)description" };
130
142
143 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
145 {
146 public:
148 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
149
151 static constexpr const char *path{ "AmbientLight/FlickerClassification" };
152
154 static constexpr const char *name{ "FlickerClassification" };
155
157 static constexpr const char *description{
158 R"description(A classification of the detected ambient light flicker, if any.
159The values `grid50hz` and `grid60hz` indicate that ambient
160light matching a 50 Hz or 60 Hz power grid was detected in the
161scene. In those cases it is recommended to use Ambient Light
162Adaptation for better point cloud quality. The value
163`unknownFlicker` indicates that some significant time-varying
164ambient light was detected, but it was not possible to
165determine the frequency. `otherFlicker` indicates that ambient
166light of a particular frequency was detected but it did not
167match the characteristics of a standard power grid.
168)description"
169 };
170
172 enum class ValueType
173 {
174 noFlicker,
175 unknownFlicker,
176 grid50hz,
177 grid60hz,
178 otherFlicker
179 };
185
187 static std::set<ValueType> validValues()
188 {
189 return { ValueType::noFlicker,
190 ValueType::unknownFlicker,
191 ValueType::grid50hz,
192 ValueType::grid60hz,
193 ValueType::otherFlicker };
194 }
195
198
200 explicit constexpr FlickerClassification(ValueType value)
201 : m_value{ verifyValue(value) }
202 {}
203
206
208 std::string toString() const;
209
211 friend std::ostream &operator<<(std::ostream &stream, const FlickerClassification::ValueType &value)
212 {
213 return stream << FlickerClassification{ value }.toString();
214 }
215
217 bool operator==(const FlickerClassification &other) const
218 {
219 return m_value == other.m_value;
220 }
221
223 bool operator!=(const FlickerClassification &other) const
224 {
225 return m_value != other.m_value;
226 }
227
229 friend std::ostream &operator<<(std::ostream &stream, const FlickerClassification &value)
230 {
231 return stream << value.toString();
232 }
233
234 private:
235 void setFromString(const std::string &value);
236
237 constexpr ValueType static verifyValue(const ValueType &value)
238 {
239 return value == ValueType::noFlicker || value == ValueType::unknownFlicker
240 || value == ValueType::grid50hz || value == ValueType::grid60hz
241 || value == ValueType::otherFlicker
242 ? value
243 : throw std::invalid_argument{
244 "Invalid value: FlickerClassification{ "
245 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
246 };
247 }
248
249 ValueType m_value{ ValueType::unknownFlicker };
250
251 friend struct DataModel::Detail::Befriend<FlickerClassification>;
252 };
253
257
258 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
260 {
261 public:
263 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
264
266 static constexpr const char *path{ "AmbientLight/FlickerFrequency" };
267
269 static constexpr const char *name{ "FlickerFrequency" };
270
272 static constexpr const char *description{
273 R"description(This field contains the actual frequency unless the
274classification is `noFlicker` or `unknownFlicker`.
275)description"
276 };
277
279 using ValueType = double;
280
282 static constexpr Range<double> validRange()
283 {
284 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
285 }
286
288 FlickerFrequency() = default;
289
291 explicit constexpr FlickerFrequency(double value)
292 : m_opt{ value }
293 {}
294
299 double value() const;
300
302 bool hasValue() const;
303
305 void reset();
306
308 std::string toString() const;
309
311 bool operator==(const FlickerFrequency &other) const
312 {
313 return m_opt == other.m_opt;
314 }
315
317 bool operator!=(const FlickerFrequency &other) const
318 {
319 return m_opt != other.m_opt;
320 }
321
323 bool operator<(const FlickerFrequency &other) const
324 {
325 return m_opt < other.m_opt;
326 }
327
329 bool operator>(const FlickerFrequency &other) const
330 {
331 return m_opt > other.m_opt;
332 }
333
335 bool operator<=(const FlickerFrequency &other) const
336 {
337 return m_opt <= other.m_opt;
338 }
339
341 bool operator>=(const FlickerFrequency &other) const
342 {
343 return m_opt >= other.m_opt;
344 }
345
347 friend std::ostream &operator<<(std::ostream &stream, const FlickerFrequency &value)
348 {
349 return stream << value.toString();
350 }
351
352 private:
353 void setFromString(const std::string &value);
354
355 std::optional<double> m_opt;
356
357 friend struct DataModel::Detail::Befriend<FlickerFrequency>;
358 };
359
360 using Descendants = std::tuple<
363
366
379#ifndef NO_DOC
380 template<
381 typename... Args,
382 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
383 typename std::enable_if<
384 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
385 value,
386 int>::type = 0>
387#else
388 template<typename... Args>
389#endif
390 explicit AmbientLight(Args &&...args)
391 {
392 using namespace Zivid::Detail::TypeTraits;
393
394 static_assert(
395 AllArgsDecayedAreUnique<Args...>::value,
396 "Found duplicate types among the arguments passed to AmbientLight(...). "
397 "Types should be listed at most once.");
398
399 set(std::forward<Args>(args)...);
400 }
401
413#ifndef NO_DOC
414 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
415#else
416 template<typename... Args>
417#endif
418 void set(Args &&...args)
419 {
420 using namespace Zivid::Detail::TypeTraits;
421
422 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
423 static_assert(
424 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
425
426 static_assert(
427 AllArgsDecayedAreUnique<Args...>::value,
428 "Found duplicate types among the arguments passed to set(...). "
429 "Types should be listed at most once.");
430
431 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
432 }
433
446#ifndef NO_DOC
447 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
448#else
449 template<typename... Args>
450#endif
451 AmbientLight copyWith(Args &&...args) const
452 {
453 using namespace Zivid::Detail::TypeTraits;
454
455 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
456 static_assert(
457 AllArgsAreDescendantNodes::value,
458 "All arguments passed to copyWith(...) must be descendant nodes.");
459
460 static_assert(
461 AllArgsDecayedAreUnique<Args...>::value,
462 "Found duplicate types among the arguments passed to copyWith(...). "
463 "Types should be listed at most once.");
464
465 auto copy{ *this };
466 copy.set(std::forward<Args>(args)...);
467 return copy;
468 }
469
472 {
473 return m_flickerClassification;
474 }
475
478 {
479 return m_flickerClassification;
480 }
481
484 {
485 m_flickerClassification = value;
486 return *this;
487 }
488
491 {
492 return m_flickerFrequency;
493 }
494
497 {
498 return m_flickerFrequency;
499 }
500
503 {
504 m_flickerFrequency = value;
505 return *this;
506 }
507
508 template<
509 typename T,
510 typename std::enable_if<
511 std::is_same<T, SceneConditions::AmbientLight::FlickerClassification>::value,
512 int>::type = 0>
514 {
515 return m_flickerClassification;
516 }
517
518 template<
519 typename T,
520 typename std::enable_if<std::is_same<T, SceneConditions::AmbientLight::FlickerFrequency>::value, int>::
521 type = 0>
523 {
524 return m_flickerFrequency;
525 }
526
527 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
529 {
530 return m_flickerClassification;
531 }
532
533 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
535 {
536 return m_flickerFrequency;
537 }
538
540 template<typename F>
541 void forEach(const F &f) const
542 {
543 f(m_flickerClassification);
544 f(m_flickerFrequency);
545 }
546
548 template<typename F>
549 void forEach(const F &f)
550 {
551 f(m_flickerClassification);
552 f(m_flickerFrequency);
553 }
554
556 bool operator==(const AmbientLight &other) const;
557
559 bool operator!=(const AmbientLight &other) const;
560
562 std::string toString() const;
563
565 friend std::ostream &operator<<(std::ostream &stream, const AmbientLight &value)
566 {
567 return stream << value.toString();
568 }
569
570 private:
571 void setFromString(const std::string &value);
572
573 void setFromString(const std::string &fullPath, const std::string &value);
574
575 std::string getString(const std::string &fullPath) const;
576
577 FlickerClassification m_flickerClassification;
578 FlickerFrequency m_flickerFrequency;
579
580 friend struct DataModel::Detail::Befriend<AmbientLight>;
581 };
582
583 using Descendants = std::tuple<
587
590
592 explicit SceneConditions(const std::string &fileName);
593
599 [[nodiscard]] static SceneConditions fromSerialized(const std::string &value);
600
606 std::string serialize() const;
607
621#ifndef NO_DOC
622 template<
623 typename... Args,
624 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
625 typename std::enable_if<
626 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
627 int>::type = 0>
628#else
629 template<typename... Args>
630#endif
631 explicit SceneConditions(Args &&...args)
632 {
633 using namespace Zivid::Detail::TypeTraits;
634
635 static_assert(
636 AllArgsDecayedAreUnique<Args...>::value,
637 "Found duplicate types among the arguments passed to SceneConditions(...). "
638 "Types should be listed at most once.");
639
640 set(std::forward<Args>(args)...);
641 }
642
655#ifndef NO_DOC
656 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
657#else
658 template<typename... Args>
659#endif
660 void set(Args &&...args)
661 {
662 using namespace Zivid::Detail::TypeTraits;
663
664 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
665 static_assert(
666 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
667
668 static_assert(
669 AllArgsDecayedAreUnique<Args...>::value,
670 "Found duplicate types among the arguments passed to set(...). "
671 "Types should be listed at most once.");
672
673 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
674 }
675
689#ifndef NO_DOC
690 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
691#else
692 template<typename... Args>
693#endif
694 SceneConditions copyWith(Args &&...args) const
695 {
696 using namespace Zivid::Detail::TypeTraits;
697
698 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
699 static_assert(
700 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
701
702 static_assert(
703 AllArgsDecayedAreUnique<Args...>::value,
704 "Found duplicate types among the arguments passed to copyWith(...). "
705 "Types should be listed at most once.");
706
707 auto copy{ *this };
708 copy.set(std::forward<Args>(args)...);
709 return copy;
710 }
711
714 {
715 return m_ambientLight;
716 }
717
720 {
721 return m_ambientLight;
722 }
723
726 {
727 m_ambientLight = value;
728 return *this;
729 }
730
733 {
734 m_ambientLight.set(value);
735 return *this;
736 }
737
740 {
741 m_ambientLight.set(value);
742 return *this;
743 }
744
745 template<
746 typename T,
747 typename std::enable_if<std::is_same<T, SceneConditions::AmbientLight>::value, int>::type = 0>
749 {
750 return m_ambientLight;
751 }
752
753 template<
754 typename T,
755 typename std::enable_if<std::is_same<T, SceneConditions::AmbientLight::FlickerClassification>::value, int>::
756 type = 0>
758 {
759 return m_ambientLight.get<SceneConditions::AmbientLight::FlickerClassification>();
760 }
761
762 template<
763 typename T,
764 typename std::enable_if<std::is_same<T, SceneConditions::AmbientLight::FlickerFrequency>::value, int>::
765 type = 0>
767 {
768 return m_ambientLight.get<SceneConditions::AmbientLight::FlickerFrequency>();
769 }
770
771 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
773 {
774 return m_ambientLight;
775 }
776
778 template<typename F>
779 void forEach(const F &f) const
780 {
781 f(m_ambientLight);
782 }
783
785 template<typename F>
786 void forEach(const F &f)
787 {
788 f(m_ambientLight);
789 }
790
792 bool operator==(const SceneConditions &other) const;
793
795 bool operator!=(const SceneConditions &other) const;
796
798 std::string toString() const;
799
801 friend std::ostream &operator<<(std::ostream &stream, const SceneConditions &value)
802 {
803 return stream << value.toString();
804 }
805
807 void save(const std::string &fileName) const;
808
810 void load(const std::string &fileName);
811
812 private:
813 void setFromString(const std::string &value);
814
815 void setFromString(const std::string &fullPath, const std::string &value);
816
817 std::string getString(const std::string &fullPath) const;
818
819 AmbientLight m_ambientLight;
820
821 friend struct DataModel::Detail::Befriend<SceneConditions>;
822 };
823
824#ifndef NO_DOC
825 template<>
826 struct SceneConditions::Version<2>
827 {
828 using Type = SceneConditions;
829 };
830#endif
831
832} // namespace Zivid
833
834#ifndef NO_DOC
836namespace Zivid::Detail
837{
838
839 ZIVID_CORE_EXPORT void save(const Zivid::SceneConditions &dataModel, std::ostream &ostream);
840 ZIVID_CORE_EXPORT void load(Zivid::SceneConditions &dataModel, std::istream &istream);
841
842 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::SceneConditions &source);
843 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::SceneConditions &dest, const std::vector<uint8_t> &data);
844
845} // namespace Zivid::Detail
846#endif
847
848#ifdef _MSC_VER
849# pragma warning(pop)
850#endif
851
852#ifndef NO_DOC
853# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
854namespace std // NOLINT
855{
856
857 template<>
858 struct tuple_size<Zivid::SceneConditions::AmbientLight> : integral_constant<size_t, 2>
859 {};
860
861 template<size_t i>
862 struct tuple_element<i, Zivid::SceneConditions::AmbientLight>
863 {
864 static_assert(i < tuple_size<Zivid::SceneConditions::AmbientLight>::value, "Index must be less than 2");
865
866 using type // NOLINT
867 = decltype(declval<Zivid::SceneConditions::AmbientLight>().get<i>());
868 };
869
870 template<>
871 struct tuple_size<Zivid::SceneConditions> : integral_constant<size_t, 1>
872 {};
873
874 template<size_t i>
875 struct tuple_element<i, Zivid::SceneConditions>
876 {
877 static_assert(i < tuple_size<Zivid::SceneConditions>::value, "Index must be less than 1");
878
879 using type // NOLINT
880 = decltype(declval<Zivid::SceneConditions>().get<i>());
881 };
882
883} // namespace std
884# endif
885#endif
886
887// If we have access to the DataModel library, automatically include internal DataModel
888// header. This header is necessary for serialization and deserialization.
889#if defined(__has_include) && !defined(NO_DOC)
890# if __has_include("Zivid/SceneConditionsInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
891# include "Zivid/SceneConditionsInternal.h"
892# endif
893#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Class describing a range of values for a given type T.
Definition Range.h:75
A classification of the detected ambient light flicker, if any. The values grid50hz and grid60hz indi...
Definition SceneConditions.h:145
bool operator==(const FlickerClassification &other) const
Comparison operator.
Definition SceneConditions.h:217
static const FlickerClassification grid50hz
grid50hz
Definition SceneConditions.h:182
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const FlickerClassification &value)
Operator to serialize the value to a stream.
Definition SceneConditions.h:229
static std::set< ValueType > validValues()
All valid values of FlickerClassification.
Definition SceneConditions.h:187
bool operator!=(const FlickerClassification &other) const
Comparison operator.
Definition SceneConditions.h:223
ValueType
The type of the underlying value.
Definition SceneConditions.h:173
static const FlickerClassification noFlicker
noFlicker
Definition SceneConditions.h:180
static const FlickerClassification grid60hz
grid60hz
Definition SceneConditions.h:183
static const FlickerClassification otherFlicker
otherFlicker
Definition SceneConditions.h:184
friend std::ostream & operator<<(std::ostream &stream, const FlickerClassification::ValueType &value)
Operator to serialize ValueType to a stream.
Definition SceneConditions.h:211
static const FlickerClassification unknownFlicker
unknownFlicker
Definition SceneConditions.h:181
constexpr FlickerClassification(ValueType value)
Constructor.
Definition SceneConditions.h:200
This field contains the actual frequency unless the classification is noFlicker or unknownFlicker.
Definition SceneConditions.h:260
bool operator<(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:323
void reset()
Reset the node to unset state.
bool operator>=(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:341
std::string toString() const
Get the value as string.
bool operator>(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:329
static constexpr Range< double > validRange()
The range of valid values for FlickerFrequency.
Definition SceneConditions.h:282
bool operator!=(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:317
bool hasValue() const
Check if the value is set.
friend std::ostream & operator<<(std::ostream &stream, const FlickerFrequency &value)
Operator to serialize the value to a stream.
Definition SceneConditions.h:347
bool operator==(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:311
double ValueType
The type of the underlying value.
Definition SceneConditions.h:279
bool operator<=(const FlickerFrequency &other) const
Comparison operator.
Definition SceneConditions.h:335
constexpr FlickerFrequency(double value)
Constructor.
Definition SceneConditions.h:291
The ambient light detected by the camera.
Definition SceneConditions.h:116
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition SceneConditions.h:541
AmbientLight copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition SceneConditions.h:451
const SceneConditions::AmbientLight::FlickerClassification & get() const
Definition SceneConditions.h:513
std::string toString() const
Get the value as string.
AmbientLight & set(const FlickerClassification &value)
Set FlickerClassification.
Definition SceneConditions.h:483
AmbientLight & set(const FlickerFrequency &value)
Set FlickerFrequency.
Definition SceneConditions.h:502
FlickerClassification & flickerClassification()
Get FlickerClassification.
Definition SceneConditions.h:477
bool operator!=(const AmbientLight &other) const
Inequality operator.
const FlickerClassification & flickerClassification() const
Get FlickerClassification.
Definition SceneConditions.h:471
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition SceneConditions.h:549
AmbientLight()
Default constructor.
std::tuple< SceneConditions::AmbientLight::FlickerClassification, SceneConditions::AmbientLight::FlickerFrequency > Descendants
Definition SceneConditions.h:360
const SceneConditions::AmbientLight::FlickerFrequency & get() const
Definition SceneConditions.h:522
friend std::ostream & operator<<(std::ostream &stream, const AmbientLight &value)
Operator to send the value as string to a stream.
Definition SceneConditions.h:565
FlickerFrequency & flickerFrequency()
Get FlickerFrequency.
Definition SceneConditions.h:496
bool operator==(const AmbientLight &other) const
Equality operator.
const FlickerFrequency & flickerFrequency() const
Get FlickerFrequency.
Definition SceneConditions.h:490
void set(Args &&...args)
Set multiple arguments.
Definition SceneConditions.h:418
A description of the ambient conditions detected by the camera.
Definition SceneConditions.h:80
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition SceneConditions.h:786
SceneConditions & set(const AmbientLight::FlickerFrequency &value)
Set AmbientLight::FlickerFrequency.
Definition SceneConditions.h:739
std::tuple< SceneConditions::AmbientLight, SceneConditions::AmbientLight::FlickerClassification, SceneConditions::AmbientLight::FlickerFrequency > Descendants
Definition SceneConditions.h:583
const SceneConditions::AmbientLight::FlickerClassification & get() const
Definition SceneConditions.h:757
static SceneConditions fromSerialized(const std::string &value)
Construct a new SceneConditions instance from a previously serialized string.
void load(const std::string &fileName)
Load from the given file.
SceneConditions(const std::string &fileName)
Construct SceneConditions by loading from file.
bool operator==(const SceneConditions &other) const
Equality operator.
void set(Args &&...args)
Set multiple arguments.
Definition SceneConditions.h:660
friend std::ostream & operator<<(std::ostream &stream, const SceneConditions &value)
Operator to send the value as string to a stream.
Definition SceneConditions.h:801
const SceneConditions::AmbientLight & get() const
Definition SceneConditions.h:748
SceneConditions copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition SceneConditions.h:694
AmbientLight & ambientLight()
Get AmbientLight.
Definition SceneConditions.h:719
SceneConditions & set(const AmbientLight &value)
Set AmbientLight.
Definition SceneConditions.h:725
SceneConditions(Args &&...args)
Constructor taking variadic number of arguments.
Definition SceneConditions.h:631
SceneConditions()
Default constructor.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition SceneConditions.h:779
bool operator!=(const SceneConditions &other) const
Inequality operator.
SceneConditions & set(const AmbientLight::FlickerClassification &value)
Set AmbientLight::FlickerClassification.
Definition SceneConditions.h:732
std::string toString() const
Get the value as string.
void save(const std::string &fileName) const
Save to the given file.
const AmbientLight & ambientLight() const
Get AmbientLight.
Definition SceneConditions.h:713
std::string serialize() const
Serialize to a string.
const SceneConditions::AmbientLight::FlickerFrequency & get() const
Definition SceneConditions.h:766
NodeType
Definition NodeType.h:49
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84