112# pragma warning(push)
113# pragma warning(disable : 4251)
118 namespace CaptureAssistant
129 static constexpr const char *path{
"" };
132 static constexpr const char *name{
"SuggestSettingsParameters" };
135 static constexpr const char *description{
136 R
"description(Used to specify a constraint on the total capture time for the settings suggested by the Capture Assistant, and optionally specify the ambient light frequency. The capture time constraint assumes a computer meeting Zivid's recommended minimum compute power.)description"
139 static constexpr size_t version{ 1 };
149 static constexpr std::array<uint8_t, 3> binaryId{
's',
's',
'p' };
161 static constexpr const char *path{
"AmbientLightFrequency" };
164 static constexpr const char *name{
"AmbientLightFrequency" };
167 static constexpr const char *description{ R
"description(Ambient light frequency)description" };
183 return { ValueType::none, ValueType::hz50, ValueType::hz60 };
191 : m_value{ verifyValue(value) }
209 return m_value == other.m_value;
215 return m_value != other.m_value;
225 void setFromString(
const std::string &value);
227 constexpr ValueType
static verifyValue(
const ValueType &value)
229 return value == ValueType::none || value == ValueType::hz50 || value == ValueType::hz60
231 :
throw std::invalid_argument{
232 "Invalid value: AmbientLightFrequency{ "
233 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
250 static constexpr const char *path{
"MaxCaptureTime" };
253 static constexpr const char *name{
"MaxCaptureTime" };
256 static constexpr const char *description{ R
"description(Capture time budget)description" };
264 return { std::chrono::milliseconds{ 200 }, std::chrono::milliseconds{ 10000 } };
272 : m_value{ verifyValue(value) }
276 std::chrono::milliseconds
value()
const;
284 return m_value == other.m_value;
290 return m_value != other.m_value;
296 return m_value < other.m_value;
302 return m_value > other.m_value;
312 void setFromString(
const std::string &value);
314 constexpr ValueType
static verifyValue(
const ValueType &value)
318 :
throw std::out_of_range{
"MaxCaptureTime{ " + std::to_string(value.count())
319 +
" } is not in range ["
320 + std::to_string(
validRange().min().count()) +
", "
321 + std::to_string(
validRange().max().count()) +
"]" };
324 std::chrono::milliseconds m_value{ 1200 };
330 std::tuple<SuggestSettingsParameters::AmbientLightFrequency, SuggestSettingsParameters::MaxCaptureTime>;
353 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
354 typename std::enable_if<
355 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
359 template<typename... Args>
363 using namespace Zivid::Detail::TypeTraits;
366 AllArgsDecayedAreUnique<Args...>::value,
367 "Found duplicate types among the arguments passed to SuggestSettingsParameters(...). "
368 "Types should be listed at most once.");
370 set(std::forward<Args>(args)...);
385 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
387 template<typename... Args>
391 using namespace Zivid::Detail::TypeTraits;
393 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
395 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
398 AllArgsDecayedAreUnique<Args...>::value,
399 "Found duplicate types among the arguments passed to set(...). "
400 "Types should be listed at most once.");
402 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
418 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
420 template<typename... Args>
424 using namespace Zivid::Detail::TypeTraits;
426 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
428 AllArgsAreDescendantNodes::value,
429 "All arguments passed to copyWith(...) must be descendant nodes.");
432 AllArgsDecayedAreUnique<Args...>::value,
433 "Found duplicate types among the arguments passed to copyWith(...). "
434 "Types should be listed at most once.");
437 copy.
set(std::forward<Args>(args)...);
444 return m_ambientLightFrequency;
450 return m_ambientLightFrequency;
456 m_ambientLightFrequency = value;
463 return m_maxCaptureTime;
469 return m_maxCaptureTime;
475 m_maxCaptureTime = value;
481 typename std::enable_if<std::is_same<T, SuggestSettingsParameters::AmbientLightFrequency>::value,
int>::
485 return m_ambientLightFrequency;
490 typename std::enable_if<std::is_same<T, SuggestSettingsParameters::MaxCaptureTime>::value,
int>::type =
494 return m_maxCaptureTime;
497 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
500 return m_ambientLightFrequency;
503 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
506 return m_maxCaptureTime;
513 f(m_ambientLightFrequency);
521 f(m_ambientLightFrequency);
541 void save(
const std::string &fileName)
const;
544 void load(
const std::string &fileName);
547 void setFromString(
const std::string &value);
549 void setFromString(
const std::string &fullPath,
const std::string &value);
551 std::string getString(
const std::string &fullPath)
const;
561 struct SuggestSettingsParameters::Version<1>
575# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
580 struct tuple_size<
Zivid::CaptureAssistant::SuggestSettingsParameters> : integral_constant<size_t, 2>
584 struct tuple_element<i,
Zivid::CaptureAssistant::SuggestSettingsParameters>
587 i < tuple_size<Zivid::CaptureAssistant::SuggestSettingsParameters>::value,
588 "Index must be less than 2");
591 =
decltype(declval<Zivid::CaptureAssistant::SuggestSettingsParameters>().get<i>());
600#if defined(__has_include) && !defined(NO_DOC)
602 "Zivid/CaptureAssistant/SuggestSettingsParametersInternal.h") \
603 && __has_include("Zivid/DataModelSerializationMetaData.h")
604# include "Zivid/CaptureAssistant/SuggestSettingsParametersInternal.h"
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Ambient light frequency
Definition: SuggestSettingsParameters.h:155
ValueType value() const
Get the value
constexpr AmbientLightFrequency(ValueType value)
Constructor
Definition: SuggestSettingsParameters.h:190
static std::set< ValueType > validValues()
All valid values of AmbientLightFrequency
Definition: SuggestSettingsParameters.h:181
AmbientLightFrequency()=default
Default constructor
static const AmbientLightFrequency none
none
Definition: SuggestSettingsParameters.h:176
bool operator==(const AmbientLightFrequency &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:207
static const AmbientLightFrequency hz60
hz60
Definition: SuggestSettingsParameters.h:178
friend std::ostream & operator<<(std::ostream &stream, const AmbientLightFrequency::ValueType &value)
Operator to serialize ValueType to a stream
Definition: SuggestSettingsParameters.h:201
bool operator!=(const AmbientLightFrequency &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:213
static const AmbientLightFrequency hz50
hz50
Definition: SuggestSettingsParameters.h:177
friend std::ostream & operator<<(std::ostream &stream, const AmbientLightFrequency &value)
Operator to serialize the value to a stream
Definition: SuggestSettingsParameters.h:219
std::string toString() const
Get the value as string
ValueType
The type of the underlying value
Definition: SuggestSettingsParameters.h:171
Capture time budget
Definition: SuggestSettingsParameters.h:244
bool operator>(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:300
bool operator==(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:282
bool operator<(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:294
static constexpr Range< std::chrono::milliseconds > validRange()
The range of valid values for MaxCaptureTime
Definition: SuggestSettingsParameters.h:262
constexpr MaxCaptureTime(std::chrono::milliseconds value)
Constructor
Definition: SuggestSettingsParameters.h:271
bool operator!=(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:288
std::chrono::milliseconds ValueType
The type of the underlying value
Definition: SuggestSettingsParameters.h:259
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const MaxCaptureTime &value)
Operator to serialize the value to a stream
Definition: SuggestSettingsParameters.h:306
MaxCaptureTime()=default
Default constructor
std::chrono::milliseconds value() const
Get the value
Used to specify a constraint on the total capture time for the settings suggested by the Capture Assi...
Definition: SuggestSettingsParameters.h:123
std::tuple< SuggestSettingsParameters::AmbientLightFrequency, SuggestSettingsParameters::MaxCaptureTime > Descendants
Definition: SuggestSettingsParameters.h:330
SuggestSettingsParameters & set(const MaxCaptureTime &value)
Set MaxCaptureTime
Definition: SuggestSettingsParameters.h:473
void save(const std::string &fileName) const
Save to the given file
void set(Args &&...args)
Set multiple arguments
Definition: SuggestSettingsParameters.h:389
const AmbientLightFrequency & ambientLightFrequency() const
Get AmbientLightFrequency
Definition: SuggestSettingsParameters.h:442
SuggestSettingsParameters copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: SuggestSettingsParameters.h:422
SuggestSettingsParameters(Args &&...args)
Constructor taking variadic number of arguments
Definition: SuggestSettingsParameters.h:361
AmbientLightFrequency & ambientLightFrequency()
Get AmbientLightFrequency
Definition: SuggestSettingsParameters.h:448
MaxCaptureTime & maxCaptureTime()
Get MaxCaptureTime
Definition: SuggestSettingsParameters.h:467
bool operator!=(const SuggestSettingsParameters &other) const
Inequality operator
const SuggestSettingsParameters::MaxCaptureTime & get() const
Definition: SuggestSettingsParameters.h:492
bool operator==(const SuggestSettingsParameters &other) const
Equality operator
SuggestSettingsParameters(const std::string &fileName)
Construct SuggestSettingsParameters by loading from file
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: SuggestSettingsParameters.h:511
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: SuggestSettingsParameters.h:519
SuggestSettingsParameters()
Default constructor
const MaxCaptureTime & maxCaptureTime() const
Get MaxCaptureTime
Definition: SuggestSettingsParameters.h:461
SuggestSettingsParameters & set(const AmbientLightFrequency &value)
Set AmbientLightFrequency
Definition: SuggestSettingsParameters.h:454
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const SuggestSettingsParameters &value)
Operator to send the value as string to a stream
Definition: SuggestSettingsParameters.h:535
void load(const std::string &fileName)
Load from the given file
const SuggestSettingsParameters::AmbientLightFrequency & get() const
Definition: SuggestSettingsParameters.h:483
Class describing a range of values for a given type T
Definition: Range.h:102
NodeType
Definition: NodeType.h:100
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:206
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99