69# pragma warning(disable : 4251)
85 static constexpr const char *path{
"" };
88 static constexpr const char *name{
"Settings2D" };
91 static constexpr const char *description{
92 R
"description(Settings used when capturing 2D images with a Zivid camera.)description"
95 static constexpr size_t version{ 5 };
105 static constexpr std::array<uint8_t, 3> binaryId{
's',
't',
'2' };
119 static constexpr const char *path{
"Acquisition" };
122 static constexpr const char *name{
"Acquisition" };
125 static constexpr const char *description{ R
"description(Settings for a single acquisition.)description" };
139 static constexpr const char *path{
"Acquisition/Aperture" };
142 static constexpr const char *name{
"Aperture" };
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).
157 return { 1.4, 32.0 };
165 : m_opt{ verifyValue(value) }
186 return m_opt == other.m_opt;
192 return m_opt != other.m_opt;
198 return m_opt < other.m_opt;
204 return m_opt > other.m_opt;
210 return m_opt <= other.m_opt;
216 return m_opt >= other.m_opt;
226 void setFromString(
const std::string &value);
228 constexpr ValueType
static verifyValue(
const ValueType &value)
230 return validRange().isInRange(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()) +
"]" };
237 Zivid::DataModel::Detail::Optional<double> m_opt;
239 friend struct DataModel::Detail::Befriend<
Aperture>;
262 static constexpr const char *path{
"Acquisition/Brightness" };
265 static constexpr const char *name{
"Brightness" };
268 static constexpr const char *description{
269 R
"description(Brightness controls the light output from the projector.
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.
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.
296 : m_opt{ verifyValue(value) }
317 return m_opt == other.m_opt;
323 return m_opt != other.m_opt;
329 return m_opt < other.m_opt;
335 return m_opt > other.m_opt;
341 return m_opt <= other.m_opt;
347 return m_opt >= other.m_opt;
357 void setFromString(
const std::string &value);
359 constexpr ValueType
static verifyValue(
const ValueType &value)
361 return validRange().isInRange(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()) +
"]" };
368 Zivid::DataModel::Detail::Optional<double> m_opt;
370 friend struct DataModel::Detail::Befriend<
Brightness>;
383 static constexpr const char *path{
"Acquisition/ExposureTime" };
386 static constexpr const char *name{
"ExposureTime" };
389 static constexpr const char *description{ R
"description(Exposure time for the image.)description" };
397 return { std::chrono::microseconds{ 1677 }, std::chrono::microseconds{ 100000 } };
405 : m_opt{ verifyValue(value) }
412 std::chrono::microseconds
value()
const;
426 return m_opt == other.m_opt;
432 return m_opt != other.m_opt;
438 return m_opt < other.m_opt;
444 return m_opt > other.m_opt;
450 return m_opt <= other.m_opt;
456 return m_opt >= other.m_opt;
466 void setFromString(
const std::string &value);
468 constexpr ValueType
static verifyValue(
const ValueType &value)
470 return validRange().isInRange(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()) +
"]" };
478 Zivid::DataModel::Detail::Optional<std::chrono::microseconds> m_opt;
480 friend struct DataModel::Detail::Befriend<
ExposureTime>;
493 static constexpr const char *path{
"Acquisition/Gain" };
496 static constexpr const char *name{
"Gain" };
499 static constexpr const char *description{ R
"description(Analog gain in the camera.)description" };
514 explicit constexpr Gain(
double value)
515 : m_opt{ verifyValue(value) }
536 return m_opt == other.m_opt;
542 return m_opt != other.m_opt;
548 return m_opt < other.m_opt;
554 return m_opt > other.m_opt;
560 return m_opt <= other.m_opt;
566 return m_opt >= other.m_opt;
576 void setFromString(
const std::string &value);
578 constexpr ValueType
static verifyValue(
const ValueType &value)
580 return validRange().isInRange(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()) +
"]" };
587 Zivid::DataModel::Detail::Optional<double> m_opt;
589 friend struct DataModel::Detail::Befriend<
Gain>;
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...>::
624 template<typename... Args>
628 using namespace Zivid::Detail::TypeTraits;
631 AllArgsDecayedAreUnique<Args...>::value,
632 "Found duplicate types among the arguments passed to Acquisition(...). "
633 "Types should be listed at most once.");
635 set(std::forward<Args>(args)...);
652 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
654 template<typename... Args>
658 using namespace Zivid::Detail::TypeTraits;
660 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
662 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
665 AllArgsDecayedAreUnique<Args...>::value,
666 "Found duplicate types among the arguments passed to set(...). "
667 "Types should be listed at most once.");
669 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
687 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
689 template<typename... Args>
693 using namespace Zivid::Detail::TypeTraits;
695 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
697 AllArgsAreDescendantNodes::value,
698 "All arguments passed to copyWith(...) must be descendant nodes.");
701 AllArgsDecayedAreUnique<Args...>::value,
702 "Found duplicate types among the arguments passed to copyWith(...). "
703 "Types should be listed at most once.");
706 copy.
set(std::forward<Args>(args)...);
744 m_brightness = value;
751 return m_exposureTime;
757 return m_exposureTime;
763 m_exposureTime = value;
788 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Aperture>::value,
int>::type = 0>
796 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Brightness>::value,
int>::type = 0>
804 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::ExposureTime>::value,
int>::type = 0>
807 return m_exposureTime;
812 typename std::enable_if<std::is_same<T, Settings2D::Acquisition::Gain>::value,
int>::type = 0>
818 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
824 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
830 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
833 return m_exposureTime;
836 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
878 void setFromString(
const std::string &value);
880 void setFromString(
const std::string &fullPath,
const std::string &value);
882 std::string getString(
const std::string &fullPath)
const;
885 Brightness m_brightness;
886 ExposureTime m_exposureTime;
889 friend struct DataModel::Detail::Befriend<
Acquisition>;
902 static constexpr const char *path{
"Acquisitions" };
905 static constexpr const char *name{
"Acquisitions" };
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"
918 return { 0, std::numeric_limits<ValueType::size_type>::max() };
926 : m_value{ std::move(value) }
930 explicit Acquisitions(std::initializer_list<Settings2D::Acquisition> value)
935 const std::vector<Settings2D::Acquisition> &
value()
const;
941 std::size_t
size() const noexcept;
944 bool isEmpty() const noexcept;
951 template<typename... Args>
952 void emplaceBack(Args &&...args)
954 m_value.emplace_back(std::forward<Args>(args)...);
989 for(
auto &child : m_value)
999 for(
const auto &child : m_value)
1006 using Iterator = std::vector<Settings2D::Acquisition>::iterator;
1032 return m_value == other.m_value;
1038 return m_value != other.m_value;
1048 void setFromString(
const std::string &value);
1050 std::vector<Settings2D::Acquisition> m_value{};
1052 friend struct DataModel::Detail::Befriend<
Acquisitions>;
1065 static constexpr const char *path{
"Processing" };
1068 static constexpr const char *name{
"Processing" };
1071 static constexpr const char *description{ R
"description(Processing related settings.)description" };
1083 static constexpr const char *path{
"Processing/Color" };
1086 static constexpr const char *name{
"Color" };
1089 static constexpr const char *description{ R
"description(Color settings.)description" };
1101 static constexpr const char *path{
"Processing/Color/Balance" };
1104 static constexpr const char *name{
"Balance" };
1107 static constexpr const char *description{ R
"description(Color balance settings.)description" };
1119 static constexpr const char *path{
"Processing/Color/Balance/Blue" };
1122 static constexpr const char *name{
"Blue" };
1125 static constexpr const char *description{
1126 R
"description(Digital gain applied to blue channel.)description"
1135 return { 1.0, 8.0 };
1142 explicit constexpr Blue(
double value)
1143 : m_opt{ verifyValue(value) }
1164 return m_opt == other.m_opt;
1170 return m_opt != other.m_opt;
1176 return m_opt < other.m_opt;
1182 return m_opt > other.m_opt;
1188 return m_opt <= other.m_opt;
1194 return m_opt >= other.m_opt;
1204 void setFromString(
const std::string &value);
1206 constexpr ValueType
static verifyValue(
const ValueType &value)
1208 return validRange().isInRange(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()) +
"]" };
1216 Zivid::DataModel::Detail::Optional<double> m_opt;
1218 friend struct DataModel::Detail::Befriend<
Blue>;
1231 static constexpr const char *path{
"Processing/Color/Balance/Green" };
1234 static constexpr const char *name{
"Green" };
1237 static constexpr const char *description{
1238 R
"description(Digital gain applied to green channel.)description"
1247 return { 1.0, 8.0 };
1255 : m_opt{ verifyValue(value) }
1276 return m_opt == other.m_opt;
1282 return m_opt != other.m_opt;
1288 return m_opt < other.m_opt;
1294 return m_opt > other.m_opt;
1300 return m_opt <= other.m_opt;
1306 return m_opt >= other.m_opt;
1316 void setFromString(
const std::string &value);
1318 constexpr ValueType
static verifyValue(
const ValueType &value)
1320 return validRange().isInRange(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()) +
"]" };
1328 Zivid::DataModel::Detail::Optional<double> m_opt;
1330 friend struct DataModel::Detail::Befriend<
Green>;
1343 static constexpr const char *path{
"Processing/Color/Balance/Red" };
1346 static constexpr const char *name{
"Red" };
1349 static constexpr const char *description{
1350 R
"description(Digital gain applied to red channel.)description"
1359 return { 1.0, 8.0 };
1366 explicit constexpr Red(
double value)
1367 : m_opt{ verifyValue(value) }
1388 return m_opt == other.m_opt;
1394 return m_opt != other.m_opt;
1400 return m_opt < other.m_opt;
1406 return m_opt > other.m_opt;
1412 return m_opt <= other.m_opt;
1418 return m_opt >= other.m_opt;
1428 void setFromString(
const std::string &value);
1430 constexpr ValueType
static verifyValue(
const ValueType &value)
1432 return validRange().isInRange(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()) +
"]" };
1440 Zivid::DataModel::Detail::Optional<double> m_opt;
1442 friend struct DataModel::Detail::Befriend<
Red>;
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,
1475 template<typename... Args>
1479 using namespace Zivid::Detail::TypeTraits;
1482 AllArgsDecayedAreUnique<Args...>::value,
1483 "Found duplicate types among the arguments passed to Balance(...). "
1484 "Types should be listed at most once.");
1486 set(std::forward<Args>(args)...);
1502 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1504 template<typename... Args>
1508 using namespace Zivid::Detail::TypeTraits;
1510 using AllArgsAreDescendantNodes =
1511 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1513 AllArgsAreDescendantNodes::value,
1514 "All arguments passed to set(...) must be descendant nodes.");
1517 AllArgsDecayedAreUnique<Args...>::value,
1518 "Found duplicate types among the arguments passed to set(...). "
1519 "Types should be listed at most once.");
1521 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1538 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1540 template<typename... Args>
1544 using namespace Zivid::Detail::TypeTraits;
1546 using AllArgsAreDescendantNodes =
1547 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1549 AllArgsAreDescendantNodes::value,
1550 "All arguments passed to copyWith(...) must be descendant nodes.");
1553 AllArgsDecayedAreUnique<Args...>::value,
1554 "Found duplicate types among the arguments passed to copyWith(...). "
1555 "Types should be listed at most once.");
1558 copy.
set(std::forward<Args>(args)...);
1621 typename std::enable_if<
1622 std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
1631 typename std::enable_if<
1632 std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
1641 typename std::enable_if<
1642 std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
1649 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1655 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1661 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1668 template<
typename F>
1677 template<
typename F>
1701 void setFromString(
const std::string &value);
1703 void setFromString(
const std::string &fullPath,
const std::string &value);
1705 std::string getString(
const std::string &fullPath)
const;
1711 friend struct DataModel::Detail::Befriend<
Balance>;
1726 static constexpr const char *path{
"Processing/Color/Gamma" };
1729 static constexpr const char *name{
"Gamma" };
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.
1744 return { 0.25, 1.5 };
1752 : m_opt{ verifyValue(value) }
1773 return m_opt == other.m_opt;
1779 return m_opt != other.m_opt;
1785 return m_opt < other.m_opt;
1791 return m_opt > other.m_opt;
1797 return m_opt <= other.m_opt;
1803 return m_opt >= other.m_opt;
1813 void setFromString(
const std::string &value);
1815 constexpr ValueType
static verifyValue(
const ValueType &value)
1817 return validRange().isInRange(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()) +
"]" };
1824 Zivid::DataModel::Detail::Optional<double> m_opt;
1826 friend struct DataModel::Detail::Befriend<
Gamma>;
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...>::
1863 template<typename... Args>
1867 using namespace Zivid::Detail::TypeTraits;
1870 AllArgsDecayedAreUnique<Args...>::value,
1871 "Found duplicate types among the arguments passed to Color(...). "
1872 "Types should be listed at most once.");
1874 set(std::forward<Args>(args)...);
1892 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1894 template<typename... Args>
1898 using namespace Zivid::Detail::TypeTraits;
1900 using AllArgsAreDescendantNodes =
1901 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1903 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1906 AllArgsDecayedAreUnique<Args...>::value,
1907 "Found duplicate types among the arguments passed to set(...). "
1908 "Types should be listed at most once.");
1910 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1929 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1931 template<typename... Args>
1935 using namespace Zivid::Detail::TypeTraits;
1937 using AllArgsAreDescendantNodes =
1938 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1940 AllArgsAreDescendantNodes::value,
1941 "All arguments passed to copyWith(...) must be descendant nodes.");
1944 AllArgsDecayedAreUnique<Args...>::value,
1945 "Found duplicate types among the arguments passed to copyWith(...). "
1946 "Types should be listed at most once.");
1949 copy.
set(std::forward<Args>(args)...);
1975 m_balance.
set(value);
1982 m_balance.
set(value);
1989 m_balance.
set(value);
2014 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value,
int>::type =
2023 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
int>::
2033 enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
int>::type = 0>
2041 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
int>::
2050 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value,
int>::type =
2057 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2063 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2070 template<
typename F>
2078 template<
typename F>
2101 void setFromString(
const std::string &value);
2103 void setFromString(
const std::string &fullPath,
const std::string &value);
2105 std::string getString(
const std::string &fullPath)
const;
2110 friend struct DataModel::Detail::Befriend<
Color>;
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...>::
2149 template<typename... Args>
2153 using namespace Zivid::Detail::TypeTraits;
2156 AllArgsDecayedAreUnique<Args...>::value,
2157 "Found duplicate types among the arguments passed to Processing(...). "
2158 "Types should be listed at most once.");
2160 set(std::forward<Args>(args)...);
2179 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2181 template<typename... Args>
2185 using namespace Zivid::Detail::TypeTraits;
2187 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2189 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2192 AllArgsDecayedAreUnique<Args...>::value,
2193 "Found duplicate types among the arguments passed to set(...). "
2194 "Types should be listed at most once.");
2196 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2216 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2218 template<typename... Args>
2222 using namespace Zivid::Detail::TypeTraits;
2224 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2226 AllArgsAreDescendantNodes::value,
2227 "All arguments passed to copyWith(...) must be descendant nodes.");
2230 AllArgsDecayedAreUnique<Args...>::value,
2231 "Found duplicate types among the arguments passed to copyWith(...). "
2232 "Types should be listed at most once.");
2235 copy.
set(std::forward<Args>(args)...);
2295 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value,
int>::type = 0>
2303 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value,
int>::type = 0>
2311 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
int>::
2320 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
int>::
2329 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
int>::
2338 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value,
int>::type = 0>
2344 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2351 template<
typename F>
2358 template<
typename F>
2380 void setFromString(
const std::string &value);
2382 void setFromString(
const std::string &fullPath,
const std::string &value);
2384 std::string getString(
const std::string &fullPath)
const;
2388 friend struct DataModel::Detail::Befriend<
Processing>;
2402 static constexpr const char *path{
"Sampling" };
2405 static constexpr const char *name{
"Sampling" };
2408 static constexpr const char *description{ R
"description(Sampling settings.
2426 static constexpr const char *path{
"Sampling/Color" };
2429 static constexpr const char *name{
"Color" };
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.
2437The `grayscale` option is not available on all camera models.
2453 return { ValueType::rgb, ValueType::grayscale };
2461 : m_opt{ verifyValue(value) }
2488 return m_opt == other.m_opt;
2494 return m_opt != other.m_opt;
2504 void setFromString(
const std::string &value);
2506 constexpr ValueType
static verifyValue(
const ValueType &value)
2508 return value == ValueType::rgb || value == ValueType::grayscale
2510 :
throw std::invalid_argument{
2511 "Invalid value: Color{ "
2512 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
2516 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
2518 friend struct DataModel::Detail::Befriend<
Color>;
2532 static constexpr const char *path{
"Sampling/Pixel" };
2535 static constexpr const char *name{
"Pixel" };
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.
2561 return { ValueType::all,
2562 ValueType::blueSubsample2x2,
2563 ValueType::redSubsample2x2,
2564 ValueType::blueSubsample4x4,
2565 ValueType::redSubsample4x4 };
2573 : m_opt{ verifyValue(value) }
2600 return m_opt == other.m_opt;
2606 return m_opt != other.m_opt;
2616 void setFromString(
const std::string &value);
2618 constexpr ValueType
static verifyValue(
const ValueType &value)
2620 return value == ValueType::all || value == ValueType::blueSubsample2x2
2621 || value == ValueType::redSubsample2x2 || value == ValueType::blueSubsample4x4
2622 || value == ValueType::redSubsample4x4
2624 :
throw std::invalid_argument{
2625 "Invalid value: Pixel{ "
2626 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
2630 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
2632 friend struct DataModel::Detail::Befriend<
Pixel>;
2635 using Descendants = std::tuple<Settings2D::Sampling::Color, Settings2D::Sampling::Pixel>;
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...>::
2661 template<typename... Args>
2665 using namespace Zivid::Detail::TypeTraits;
2668 AllArgsDecayedAreUnique<Args...>::value,
2669 "Found duplicate types among the arguments passed to Sampling(...). "
2670 "Types should be listed at most once.");
2672 set(std::forward<Args>(args)...);
2687 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2689 template<typename... Args>
2693 using namespace Zivid::Detail::TypeTraits;
2695 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2697 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2700 AllArgsDecayedAreUnique<Args...>::value,
2701 "Found duplicate types among the arguments passed to set(...). "
2702 "Types should be listed at most once.");
2704 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2720 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2722 template<typename... Args>
2726 using namespace Zivid::Detail::TypeTraits;
2728 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2730 AllArgsAreDescendantNodes::value,
2731 "All arguments passed to copyWith(...) must be descendant nodes.");
2734 AllArgsDecayedAreUnique<Args...>::value,
2735 "Found duplicate types among the arguments passed to copyWith(...). "
2736 "Types should be listed at most once.");
2739 copy.
set(std::forward<Args>(args)...);
2783 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value,
int>::type = 0>
2791 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value,
int>::type = 0>
2797 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2803 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2810 template<
typename F>
2818 template<
typename F>
2841 void setFromString(
const std::string &value);
2843 void setFromString(
const std::string &fullPath,
const std::string &value);
2845 std::string getString(
const std::string &fullPath)
const;
2850 friend struct DataModel::Detail::Befriend<
Sampling>;
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,
2915 template<typename... Args>
2919 using namespace Zivid::Detail::TypeTraits;
2922 AllArgsDecayedAreUnique<Args...>::value,
2923 "Found duplicate types among the arguments passed to Settings2D(...). "
2924 "Types should be listed at most once.");
2926 set(std::forward<Args>(args)...);
2950 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
2952 template<typename... Args>
2956 using namespace Zivid::Detail::TypeTraits;
2958 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2960 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2963 AllArgsDecayedAreUnique<Args...>::value,
2964 "Found duplicate types among the arguments passed to set(...). "
2965 "Types should be listed at most once.");
2967 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2992 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2994 template<typename... Args>
2998 using namespace Zivid::Detail::TypeTraits;
3000 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
3002 AllArgsAreDescendantNodes::value,
"All arguments passed to copyWith(...) must be descendant nodes.");
3005 AllArgsDecayedAreUnique<Args...>::value,
3006 "Found duplicate types among the arguments passed to copyWith(...). "
3007 "Types should be listed at most once.");
3010 copy.
set(std::forward<Args>(args)...);
3017 return m_acquisitions;
3023 return m_acquisitions;
3029 m_acquisitions = value;
3036 return m_processing;
3042 return m_processing;
3048 m_processing = value;
3055 m_processing.
set(value);
3062 m_processing.
set(value);
3069 m_processing.
set(value);
3076 m_processing.
set(value);
3083 m_processing.
set(value);
3090 m_processing.
set(value);
3116 m_sampling.
set(value);
3123 m_sampling.
set(value);
3127 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Acquisitions>::value,
int>::type = 0>
3130 return m_acquisitions;
3133 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Processing>::value,
int>::type = 0>
3136 return m_processing;
3141 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color>::value,
int>::type = 0>
3149 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance>::value,
int>::type = 0>
3157 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Blue>::value,
int>::type =
3166 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Green>::value,
int>::type =
3175 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Balance::Red>::value,
int>::type = 0>
3183 typename std::enable_if<std::is_same<T, Settings2D::Processing::Color::Gamma>::value,
int>::type = 0>
3189 template<typename T, typename std::enable_if<std::is_same<T, Settings2D::Sampling>::value,
int>::type = 0>
3197 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Color>::value,
int>::type = 0>
3205 typename std::enable_if<std::is_same<T, Settings2D::Sampling::Pixel>::value,
int>::type = 0>
3211 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
3214 return m_acquisitions;
3217 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
3220 return m_processing;
3223 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
3230 template<
typename F>
3239 template<
typename F>
3263 void save(
const std::string &fileName)
const;
3266 void load(
const std::string &fileName);
3269 void setFromString(
const std::string &value);
3271 void setFromString(
const std::string &fullPath,
const std::string &value);
3273 std::string getString(
const std::string &fullPath)
const;
3279 friend struct DataModel::Detail::Befriend<
Settings2D>;
3293 struct Settings2D::Version<5>
3295 using Type = Settings2D;
3302# pragma warning(pop)
3306# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
3311 struct tuple_size<
Zivid::Settings2D::Processing> : integral_constant<size_t, 1>
3315 struct tuple_element<i,
Zivid::Settings2D::Processing>
3317 static_assert(i < tuple_size<Zivid::Settings2D::Processing>::value,
"Index must be less than 1");
3320 =
decltype(declval<Zivid::Settings2D::Processing>().get<i>());
3324 struct tuple_size<
Zivid::Settings2D::Processing::Color> : integral_constant<size_t, 2>
3328 struct tuple_element<i,
Zivid::Settings2D::Processing::Color>
3330 static_assert(i < tuple_size<Zivid::Settings2D::Processing::Color>::value,
"Index must be less than 2");
3333 =
decltype(declval<Zivid::Settings2D::Processing::Color>().get<i>());
3337 struct tuple_size<
Zivid::Settings2D::Processing::Color::Balance> : integral_constant<size_t, 3>
3341 struct tuple_element<i,
Zivid::Settings2D::Processing::Color::Balance>
3344 i < tuple_size<Zivid::Settings2D::Processing::Color::Balance>::value,
3345 "Index must be less than 3");
3348 =
decltype(declval<Zivid::Settings2D::Processing::Color::Balance>().get<i>());
3352 struct tuple_size<
Zivid::Settings2D::Sampling> : integral_constant<size_t, 2>
3356 struct tuple_element<i,
Zivid::Settings2D::Sampling>
3358 static_assert(i < tuple_size<Zivid::Settings2D::Sampling>::value,
"Index must be less than 2");
3361 =
decltype(declval<Zivid::Settings2D::Sampling>().get<i>());
3365 struct tuple_size<
Zivid::Settings2D> : integral_constant<size_t, 3>
3369 struct tuple_element<i,
Zivid::Settings2D>
3371 static_assert(i < tuple_size<Zivid::Settings2D>::value,
"Index must be less than 3");
3374 =
decltype(declval<Zivid::Settings2D>().get<i>());
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"
#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
double value() const
Get the value.
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
Blue()=default
Default constructor.
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
Green()=default
Default constructor.
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
double value() const
Get the value.
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
Red()=default
Default constructor.
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
double value() const
Get the value.
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()
Default constructor.
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
Color()
Default constructor.
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