112# pragma warning(push)
113# pragma warning(disable : 4251)
118 namespace CaptureAssistant
133 static constexpr const char *path{
"" };
136 static constexpr const char *name{
"SuggestSettingsParameters" };
139 static constexpr const char *description{
140 R
"description(Used to specify a constraint on the total capture time for the settings suggested by the Capture Assistant, and
141optionally specify the ambient light frequency.
145 static constexpr size_t version{ 1 };
155 static constexpr std::array<uint8_t, 3> binaryId{
's',
's',
'p' };
175 static constexpr const char *path{
"AmbientLightFrequency" };
178 static constexpr const char *name{
"AmbientLightFrequency" };
181 static constexpr const char *description{
182 R
"description(Adapt suggested settings to the ambient light frequency. This can be used to avoid artifacts in the point
183cloud due to AC powered ambient light being mixed in with the camera's projector light.
185Select your power grid frequency. 60 Hz is typically used in Japan, Americas, Taiwan, South Korea, and the
186Philippines. 50 Hz is the normal in rest of the world. If ambient light is unproblematic, turn off for
205 return { ValueType::none, ValueType::hz50, ValueType::hz60 };
213 : m_value{ verifyValue(value) }
231 return m_value == other.m_value;
237 return m_value != other.m_value;
247 void setFromString(
const std::string &value);
249 constexpr ValueType
static verifyValue(
const ValueType &value)
251 return value == ValueType::none || value == ValueType::hz50 || value == ValueType::hz60
253 :
throw std::invalid_argument{
254 "Invalid value: AmbientLightFrequency{ "
255 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
277 static constexpr const char *path{
"MaxCaptureTime" };
280 static constexpr const char *name{
"MaxCaptureTime" };
283 static constexpr const char *description{
284 R
"description(Capture time budget. This budget assumes a high-end computer meeting Zivid's recommendations. The actual
285capture time may differ, based on your computer's performance and (for Zivid Two) your network connection
296 return { std::chrono::milliseconds{ 200 }, std::chrono::milliseconds{ 10000 } };
304 : m_value{ verifyValue(value) }
308 std::chrono::milliseconds
value()
const;
316 return m_value == other.m_value;
322 return m_value != other.m_value;
328 return m_value < other.m_value;
334 return m_value > other.m_value;
340 return m_value <= other.m_value;
346 return m_value >= other.m_value;
356 void setFromString(
const std::string &value);
358 constexpr ValueType
static verifyValue(
const ValueType &value)
362 :
throw std::out_of_range{
"MaxCaptureTime{ " + std::to_string(value.count())
363 +
" } is not in range ["
364 + std::to_string(
validRange().min().count()) +
", "
365 + std::to_string(
validRange().max().count()) +
"]" };
368 std::chrono::milliseconds m_value{ 1200 };
374 std::tuple<SuggestSettingsParameters::AmbientLightFrequency, SuggestSettingsParameters::MaxCaptureTime>;
397 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
398 typename std::enable_if<
399 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
403 template<typename... Args>
407 using namespace Zivid::Detail::TypeTraits;
410 AllArgsDecayedAreUnique<Args...>::value,
411 "Found duplicate types among the arguments passed to SuggestSettingsParameters(...). "
412 "Types should be listed at most once.");
414 set(std::forward<Args>(args)...);
429 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
431 template<typename... Args>
435 using namespace Zivid::Detail::TypeTraits;
437 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
439 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
442 AllArgsDecayedAreUnique<Args...>::value,
443 "Found duplicate types among the arguments passed to set(...). "
444 "Types should be listed at most once.");
446 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
462 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
464 template<typename... Args>
468 using namespace Zivid::Detail::TypeTraits;
470 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
472 AllArgsAreDescendantNodes::value,
473 "All arguments passed to copyWith(...) must be descendant nodes.");
476 AllArgsDecayedAreUnique<Args...>::value,
477 "Found duplicate types among the arguments passed to copyWith(...). "
478 "Types should be listed at most once.");
481 copy.
set(std::forward<Args>(args)...);
488 return m_ambientLightFrequency;
494 return m_ambientLightFrequency;
500 m_ambientLightFrequency = value;
507 return m_maxCaptureTime;
513 return m_maxCaptureTime;
519 m_maxCaptureTime = value;
525 typename std::enable_if<std::is_same<T, SuggestSettingsParameters::AmbientLightFrequency>::value,
int>::
529 return m_ambientLightFrequency;
534 typename std::enable_if<std::is_same<T, SuggestSettingsParameters::MaxCaptureTime>::value,
int>::type =
538 return m_maxCaptureTime;
541 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
544 return m_ambientLightFrequency;
547 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
550 return m_maxCaptureTime;
557 f(m_ambientLightFrequency);
565 f(m_ambientLightFrequency);
585 void save(
const std::string &fileName)
const;
588 void load(
const std::string &fileName);
591 void setFromString(
const std::string &value);
593 void setFromString(
const std::string &fullPath,
const std::string &value);
595 std::string getString(
const std::string &fullPath)
const;
614 struct SuggestSettingsParameters::Version<1>
628# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
633 struct tuple_size<
Zivid::CaptureAssistant::SuggestSettingsParameters> : integral_constant<size_t, 2>
637 struct tuple_element<i,
Zivid::CaptureAssistant::SuggestSettingsParameters>
640 i < tuple_size<Zivid::CaptureAssistant::SuggestSettingsParameters>::value,
641 "Index must be less than 2");
644 =
decltype(declval<Zivid::CaptureAssistant::SuggestSettingsParameters>().get<i>());
653#if defined(__has_include) && !defined(NO_DOC)
655 "Zivid/CaptureAssistant/SuggestSettingsParametersInternal.h") \
656 && __has_include("Zivid/DataModelNodeMetaData.h")
657# include "Zivid/CaptureAssistant/SuggestSettingsParametersInternal.h"
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Adapt suggested settings to the ambient light frequency. This can be used to avoid artifacts in the p...
Definition: SuggestSettingsParameters.h:169
ValueType value() const
Get the value
constexpr AmbientLightFrequency(ValueType value)
Constructor
Definition: SuggestSettingsParameters.h:212
static std::set< ValueType > validValues()
All valid values of AmbientLightFrequency
Definition: SuggestSettingsParameters.h:203
AmbientLightFrequency()=default
Default constructor
static const AmbientLightFrequency none
none
Definition: SuggestSettingsParameters.h:198
bool operator==(const AmbientLightFrequency &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:229
static const AmbientLightFrequency hz60
hz60
Definition: SuggestSettingsParameters.h:200
friend std::ostream & operator<<(std::ostream &stream, const AmbientLightFrequency::ValueType &value)
Operator to serialize ValueType to a stream
Definition: SuggestSettingsParameters.h:223
bool operator!=(const AmbientLightFrequency &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:235
static const AmbientLightFrequency hz50
hz50
Definition: SuggestSettingsParameters.h:199
friend std::ostream & operator<<(std::ostream &stream, const AmbientLightFrequency &value)
Operator to serialize the value to a stream
Definition: SuggestSettingsParameters.h:241
std::string toString() const
Get the value as string
ValueType
The type of the underlying value
Definition: SuggestSettingsParameters.h:193
Capture time budget. This budget assumes a high-end computer meeting Zivid's recommendations....
Definition: SuggestSettingsParameters.h:271
bool operator>(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:332
bool operator==(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:314
bool operator<(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:326
static constexpr Range< std::chrono::milliseconds > validRange()
The range of valid values for MaxCaptureTime
Definition: SuggestSettingsParameters.h:294
constexpr MaxCaptureTime(std::chrono::milliseconds value)
Constructor
Definition: SuggestSettingsParameters.h:303
bool operator>=(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:344
bool operator<=(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:338
bool operator!=(const MaxCaptureTime &other) const
Comparison operator
Definition: SuggestSettingsParameters.h:320
std::chrono::milliseconds ValueType
The type of the underlying value
Definition: SuggestSettingsParameters.h:291
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:350
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:127
std::tuple< SuggestSettingsParameters::AmbientLightFrequency, SuggestSettingsParameters::MaxCaptureTime > Descendants
Definition: SuggestSettingsParameters.h:374
SuggestSettingsParameters & set(const MaxCaptureTime &value)
Set MaxCaptureTime
Definition: SuggestSettingsParameters.h:517
void save(const std::string &fileName) const
Save to the given file
void set(Args &&...args)
Set multiple arguments
Definition: SuggestSettingsParameters.h:433
const AmbientLightFrequency & ambientLightFrequency() const
Get AmbientLightFrequency
Definition: SuggestSettingsParameters.h:486
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:466
SuggestSettingsParameters(Args &&...args)
Constructor taking variadic number of arguments
Definition: SuggestSettingsParameters.h:405
AmbientLightFrequency & ambientLightFrequency()
Get AmbientLightFrequency
Definition: SuggestSettingsParameters.h:492
MaxCaptureTime & maxCaptureTime()
Get MaxCaptureTime
Definition: SuggestSettingsParameters.h:511
bool operator!=(const SuggestSettingsParameters &other) const
Inequality operator
const SuggestSettingsParameters::MaxCaptureTime & get() const
Definition: SuggestSettingsParameters.h:536
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:555
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: SuggestSettingsParameters.h:563
SuggestSettingsParameters()
Default constructor
const MaxCaptureTime & maxCaptureTime() const
Get MaxCaptureTime
Definition: SuggestSettingsParameters.h:505
SuggestSettingsParameters & set(const AmbientLightFrequency &value)
Set AmbientLightFrequency
Definition: SuggestSettingsParameters.h:498
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:579
void load(const std::string &fileName)
Load from the given file
const SuggestSettingsParameters::AmbientLightFrequency & get() const
Definition: SuggestSettingsParameters.h:527
Class describing a range of values for a given type T
Definition: Range.h:118
NodeType
Definition: NodeType.h:100
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:225
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99