Zivid C++ API 2.15.0+5fcc365b-1
CameraInfo.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 <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73
75
76 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
78 {
79 public:
81 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
82
84 static constexpr const char *path{ "" };
85
87 static constexpr const char *name{ "CameraInfo" };
88
90 static constexpr const char *description{
91 R"description(Information about camera model, serial number etc.)description"
92 };
93
94 static constexpr size_t version{ 6 };
95
96#ifndef NO_DOC
97 template<size_t>
98 struct Version;
99
100 using LatestVersion = Zivid::CameraInfo;
101
102 // Short identifier. This value is not guaranteed to be universally unique
103 // Todo(ZIVID-2808): Move this to internal DataModelExt header
104 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
105
106#endif
107
109
110 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
112 {
113 public:
115 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
116
118 static constexpr const char *path{ "FirmwareVersion" };
119
121 static constexpr const char *name{ "FirmwareVersion" };
122
124 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
125
127 using ValueType = std::string;
128
131 {
132 return { 0, 256 };
133 }
134
136 FirmwareVersion() = default;
137
139 explicit FirmwareVersion(std::string value)
140 : m_value{ verifyValue(std::move(value)) }
141 {}
142
144 const std::string &value() const;
145
147 std::string toString() const;
148
150 bool operator==(const FirmwareVersion &other) const
151 {
152 return m_value == other.m_value;
153 }
154
156 bool operator!=(const FirmwareVersion &other) const
157 {
158 return m_value != other.m_value;
159 }
160
162 bool operator<(const FirmwareVersion &other) const
163 {
164 return m_value < other.m_value;
165 }
166
168 bool operator>(const FirmwareVersion &other) const
169 {
170 return m_value > other.m_value;
171 }
172
174 bool operator<=(const FirmwareVersion &other) const
175 {
176 return m_value <= other.m_value;
177 }
178
180 bool operator>=(const FirmwareVersion &other) const
181 {
182 return m_value >= other.m_value;
183 }
184
186 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
187 {
188 return stream << value.toString();
189 }
190
191 private:
192 void setFromString(const std::string &value);
193
194 ValueType static verifyValue(ValueType &&value)
195 {
196 return validSize().isInRange(value.size())
197 ? std::move(value)
198 : throw std::invalid_argument{ "Invalid FirmwareVersion size=" + std::to_string(value.size())
199 + ", valid size is {'max': 256}" };
200 }
201
202 std::string m_value{};
203
204 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
205 };
206
210
211 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
213 {
214 public:
216 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
217
219 static constexpr const char *path{ "HardwareRevision" };
220
222 static constexpr const char *name{ "HardwareRevision" };
223
225 static constexpr const char *description{
226 R"description(Hardware revision of this camera. This corresponds to the revision string that is printed on the product
227label.
228)description"
229 };
230
232 using ValueType = std::string;
233
236 {
237 return { 0, 256 };
238 }
239
241 HardwareRevision() = default;
242
244 explicit HardwareRevision(std::string value)
245 : m_value{ verifyValue(std::move(value)) }
246 {}
247
249 const std::string &value() const;
250
252 std::string toString() const;
253
255 bool operator==(const HardwareRevision &other) const
256 {
257 return m_value == other.m_value;
258 }
259
261 bool operator!=(const HardwareRevision &other) const
262 {
263 return m_value != other.m_value;
264 }
265
267 bool operator<(const HardwareRevision &other) const
268 {
269 return m_value < other.m_value;
270 }
271
273 bool operator>(const HardwareRevision &other) const
274 {
275 return m_value > other.m_value;
276 }
277
279 bool operator<=(const HardwareRevision &other) const
280 {
281 return m_value <= other.m_value;
282 }
283
285 bool operator>=(const HardwareRevision &other) const
286 {
287 return m_value >= other.m_value;
288 }
289
291 friend std::ostream &operator<<(std::ostream &stream, const HardwareRevision &value)
292 {
293 return stream << value.toString();
294 }
295
296 private:
297 void setFromString(const std::string &value);
298
299 ValueType static verifyValue(ValueType &&value)
300 {
301 return validSize().isInRange(value.size())
302 ? std::move(value)
303 : throw std::invalid_argument{ "Invalid HardwareRevision size="
304 + std::to_string(value.size())
305 + ", valid size is {'max': 256}" };
306 }
307
308 std::string m_value{};
309
310 friend struct DataModel::Detail::Befriend<HardwareRevision>;
311 };
312
314
315 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
317 {
318 public:
320 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
321
323 static constexpr const char *path{ "Model" };
324
326 static constexpr const char *name{ "Model" };
327
329 static constexpr const char *description{ R"description(The model of the camera)description" };
330
332 enum class ValueType
333 {
334 zividOnePlusSmall,
335 zividOnePlusMedium,
336 zividOnePlusLarge,
337 zividTwo,
338 zividTwoL100,
339 zivid2PlusM130,
340 zivid2PlusM60,
341 zivid2PlusL110,
342 zivid2PlusMR130,
343 zivid2PlusMR60,
344 zivid2PlusLR110
345 };
349 static const Model zividTwo;
350 static const Model zividTwoL100;
351 static const Model zivid2PlusM130;
352 static const Model zivid2PlusM60;
353 static const Model zivid2PlusL110;
354 static const Model zivid2PlusMR130;
355 static const Model zivid2PlusMR60;
356 static const Model zivid2PlusLR110;
357
359 static std::set<ValueType> validValues()
360 {
361 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
362 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
363 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110, ValueType::zivid2PlusMR130,
364 ValueType::zivid2PlusMR60, ValueType::zivid2PlusLR110 };
365 }
366
368 Model() = default;
369
371 explicit constexpr Model(ValueType value)
372 : m_value{ verifyValue(value) }
373 {}
374
377
379 std::string toString() const;
380
382 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
383 {
384 return stream << Model{ value }.toString();
385 }
386
388 bool operator==(const Model &other) const
389 {
390 return m_value == other.m_value;
391 }
392
394 bool operator!=(const Model &other) const
395 {
396 return m_value != other.m_value;
397 }
398
400 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
401 {
402 return stream << value.toString();
403 }
404
405 private:
406 void setFromString(const std::string &value);
407
408 constexpr ValueType static verifyValue(const ValueType &value)
409 {
410 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
411 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
412 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
413 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
414 || value == ValueType::zivid2PlusMR130 || value == ValueType::zivid2PlusMR60
415 || value == ValueType::zivid2PlusLR110
416 ? value
417 : throw std::invalid_argument{
418 "Invalid value: Model{ "
419 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
420 };
421 }
422
423 ValueType m_value{ ValueType::zividOnePlusSmall };
424
425 friend struct DataModel::Detail::Befriend<Model>;
426 };
427
431
432 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
434 {
435 public:
437 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
438
440 static constexpr const char *path{ "ModelName" };
441
443 static constexpr const char *name{ "ModelName" };
444
446 static constexpr const char *description{
447 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
448characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
449)description"
450 };
451
453 using ValueType = std::string;
454
457 {
458 return { 0, 256 };
459 }
460
462 ModelName() = default;
463
465 explicit ModelName(std::string value)
466 : m_value{ verifyValue(std::move(value)) }
467 {}
468
470 const std::string &value() const;
471
473 std::string toString() const;
474
476 bool operator==(const ModelName &other) const
477 {
478 return m_value == other.m_value;
479 }
480
482 bool operator!=(const ModelName &other) const
483 {
484 return m_value != other.m_value;
485 }
486
488 bool operator<(const ModelName &other) const
489 {
490 return m_value < other.m_value;
491 }
492
494 bool operator>(const ModelName &other) const
495 {
496 return m_value > other.m_value;
497 }
498
500 bool operator<=(const ModelName &other) const
501 {
502 return m_value <= other.m_value;
503 }
504
506 bool operator>=(const ModelName &other) const
507 {
508 return m_value >= other.m_value;
509 }
510
512 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
513 {
514 return stream << value.toString();
515 }
516
517 private:
518 void setFromString(const std::string &value);
519
520 ValueType static verifyValue(ValueType &&value)
521 {
522 return validSize().isInRange(value.size())
523 ? std::move(value)
524 : throw std::invalid_argument{ "Invalid ModelName size=" + std::to_string(value.size())
525 + ", valid size is {'max': 256}" };
526 }
527
528 std::string m_value{};
529
530 friend struct DataModel::Detail::Befriend<ModelName>;
531 };
532
536
537 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
539 {
540 public:
542 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
543
545 static constexpr const char *path{ "Revision" };
546
548 static constexpr const char *name{ "Revision" };
549
551 static constexpr const char *description{
552 R"description(Major/Minor hardware revision number. This field is deprecated and may be removed in a future version
553of the SDK. Please use HardwareRevision instead.
554)description"
555 };
556
560
561 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
563 {
564 public:
566 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
567
569 static constexpr const char *path{ "Revision/Major" };
570
572 static constexpr const char *name{ "Major" };
573
575 static constexpr const char *description{
576 R"description(Major hardware revision number. This field is deprecated and may be removed in a future version
577of the SDK. Please use HardwareRevision instead.
578)description"
579 };
580
582 using ValueType = uint32_t;
583
585 static constexpr Range<uint32_t> validRange()
586 {
587 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
588 }
589
591 Major() = default;
592
594 explicit constexpr Major(uint32_t value)
595 : m_value{ value }
596 {}
597
599 uint32_t value() const;
600
602 std::string toString() const;
603
605 bool operator==(const Major &other) const
606 {
607 return m_value == other.m_value;
608 }
609
611 bool operator!=(const Major &other) const
612 {
613 return m_value != other.m_value;
614 }
615
617 bool operator<(const Major &other) const
618 {
619 return m_value < other.m_value;
620 }
621
623 bool operator>(const Major &other) const
624 {
625 return m_value > other.m_value;
626 }
627
629 bool operator<=(const Major &other) const
630 {
631 return m_value <= other.m_value;
632 }
633
635 bool operator>=(const Major &other) const
636 {
637 return m_value >= other.m_value;
638 }
639
641 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
642 {
643 return stream << value.toString();
644 }
645
646 private:
647 void setFromString(const std::string &value);
648
649 uint32_t m_value{ 0 };
650
651 friend struct DataModel::Detail::Befriend<Major>;
652 };
653
657
658 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
660 {
661 public:
663 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
664
666 static constexpr const char *path{ "Revision/Minor" };
667
669 static constexpr const char *name{ "Minor" };
670
672 static constexpr const char *description{
673 R"description(Minor hardware revision number. This field is deprecated and may be removed in a future version
674of the SDK. Please use HardwareRevision instead.
675)description"
676 };
677
679 using ValueType = uint32_t;
680
682 static constexpr Range<uint32_t> validRange()
683 {
684 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
685 }
686
688 Minor() = default;
689
691 explicit constexpr Minor(uint32_t value)
692 : m_value{ value }
693 {}
694
696 uint32_t value() const;
697
699 std::string toString() const;
700
702 bool operator==(const Minor &other) const
703 {
704 return m_value == other.m_value;
705 }
706
708 bool operator!=(const Minor &other) const
709 {
710 return m_value != other.m_value;
711 }
712
714 bool operator<(const Minor &other) const
715 {
716 return m_value < other.m_value;
717 }
718
720 bool operator>(const Minor &other) const
721 {
722 return m_value > other.m_value;
723 }
724
726 bool operator<=(const Minor &other) const
727 {
728 return m_value <= other.m_value;
729 }
730
732 bool operator>=(const Minor &other) const
733 {
734 return m_value >= other.m_value;
735 }
736
738 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
739 {
740 return stream << value.toString();
741 }
742
743 private:
744 void setFromString(const std::string &value);
745
746 uint32_t m_value{ 0 };
747
748 friend struct DataModel::Detail::Befriend<Minor>;
749 };
750
751 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
752
755
768#ifndef NO_DOC
769 template<
770 typename... Args,
771 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
772 typename std::enable_if<
773 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
774 value,
775 int>::type = 0>
776#else
777 template<typename... Args>
778#endif
779 explicit Revision(Args &&...args)
780 {
781 using namespace Zivid::Detail::TypeTraits;
782
783 static_assert(
784 AllArgsDecayedAreUnique<Args...>::value,
785 "Found duplicate types among the arguments passed to Revision(...). "
786 "Types should be listed at most once.");
787
788 set(std::forward<Args>(args)...);
789 }
790
802#ifndef NO_DOC
803 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
804#else
805 template<typename... Args>
806#endif
807 void set(Args &&...args)
808 {
809 using namespace Zivid::Detail::TypeTraits;
810
811 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
812 static_assert(
813 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
814
815 static_assert(
816 AllArgsDecayedAreUnique<Args...>::value,
817 "Found duplicate types among the arguments passed to set(...). "
818 "Types should be listed at most once.");
819
820 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
821 }
822
835#ifndef NO_DOC
836 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
837#else
838 template<typename... Args>
839#endif
840 Revision copyWith(Args &&...args) const
841 {
842 using namespace Zivid::Detail::TypeTraits;
843
844 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
845 static_assert(
846 AllArgsAreDescendantNodes::value,
847 "All arguments passed to copyWith(...) must be descendant nodes.");
848
849 static_assert(
850 AllArgsDecayedAreUnique<Args...>::value,
851 "Found duplicate types among the arguments passed to copyWith(...). "
852 "Types should be listed at most once.");
853
854 auto copy{ *this };
855 copy.set(std::forward<Args>(args)...);
856 return copy;
857 }
858
860 const Major &major() const
861 {
862 return m_major;
863 }
864
867 {
868 return m_major;
869 }
870
872 Revision &set(const Major &value)
873 {
874 m_major = value;
875 return *this;
876 }
877
879 const Minor &minor() const
880 {
881 return m_minor;
882 }
883
886 {
887 return m_minor;
888 }
889
891 Revision &set(const Minor &value)
892 {
893 m_minor = value;
894 return *this;
895 }
896
897 template<
898 typename T,
899 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
901 {
902 return m_major;
903 }
904
905 template<
906 typename T,
907 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
909 {
910 return m_minor;
911 }
912
913 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
915 {
916 return m_major;
917 }
918
919 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
921 {
922 return m_minor;
923 }
924
926 template<typename F>
927 void forEach(const F &f) const
928 {
929 f(m_major);
930 f(m_minor);
931 }
932
934 template<typename F>
935 void forEach(const F &f)
936 {
937 f(m_major);
938 f(m_minor);
939 }
940
942 bool operator==(const Revision &other) const;
943
945 bool operator!=(const Revision &other) const;
946
948 std::string toString() const;
949
951 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
952 {
953 return stream << value.toString();
954 }
955
956 private:
957 void setFromString(const std::string &value);
958
959 void setFromString(const std::string &fullPath, const std::string &value);
960
961 std::string getString(const std::string &fullPath) const;
962
963 Major m_major;
964 Minor m_minor;
965
966 friend struct DataModel::Detail::Befriend<Revision>;
967 };
968
970
971 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
973 {
974 public:
976 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
977
979 static constexpr const char *path{ "SerialNumber" };
980
982 static constexpr const char *name{ "SerialNumber" };
983
985 static constexpr const char *description{ R"description(The serial number of the camera)description" };
986
988 using ValueType = std::string;
989
992 {
993 return { 0, 256 };
994 }
995
997 SerialNumber() = default;
998
1000 explicit SerialNumber(std::string value)
1001 : m_value{ verifyValue(std::move(value)) }
1002 {}
1003
1005 const std::string &value() const;
1006
1008 std::string toString() const;
1009
1011 bool operator==(const SerialNumber &other) const
1012 {
1013 return m_value == other.m_value;
1014 }
1015
1017 bool operator!=(const SerialNumber &other) const
1018 {
1019 return m_value != other.m_value;
1020 }
1021
1023 bool operator<(const SerialNumber &other) const
1024 {
1025 return m_value < other.m_value;
1026 }
1027
1029 bool operator>(const SerialNumber &other) const
1030 {
1031 return m_value > other.m_value;
1032 }
1033
1035 bool operator<=(const SerialNumber &other) const
1036 {
1037 return m_value <= other.m_value;
1038 }
1039
1041 bool operator>=(const SerialNumber &other) const
1042 {
1043 return m_value >= other.m_value;
1044 }
1045
1047 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
1048 {
1049 return stream << value.toString();
1050 }
1051
1052 private:
1053 void setFromString(const std::string &value);
1054
1055 ValueType static verifyValue(ValueType &&value)
1056 {
1057 return validSize().isInRange(value.size())
1058 ? std::move(value)
1059 : throw std::invalid_argument{ "Invalid SerialNumber size=" + std::to_string(value.size())
1060 + ", valid size is {'max': 256}" };
1061 }
1062
1063 std::string m_value{};
1064
1065 friend struct DataModel::Detail::Befriend<SerialNumber>;
1066 };
1067
1069
1070 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1072 {
1073 public:
1075 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1076
1078 static constexpr const char *path{ "UserData" };
1079
1081 static constexpr const char *name{ "UserData" };
1082
1084 static constexpr const char *description{
1085 R"description(Information about user data capabilities of the camera)description"
1086 };
1087
1089
1090 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1092 {
1093 public:
1095 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1096
1098 static constexpr const char *path{ "UserData/MaxSizeBytes" };
1099
1101 static constexpr const char *name{ "MaxSizeBytes" };
1102
1104 static constexpr const char *description{
1105 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
1106 };
1107
1109 using ValueType = uint64_t;
1110
1112 static constexpr Range<uint64_t> validRange()
1113 {
1114 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1115 }
1116
1118 MaxSizeBytes() = default;
1119
1121 explicit constexpr MaxSizeBytes(uint64_t value)
1122 : m_value{ value }
1123 {}
1124
1126 uint64_t value() const;
1127
1129 std::string toString() const;
1130
1132 bool operator==(const MaxSizeBytes &other) const
1133 {
1134 return m_value == other.m_value;
1135 }
1136
1138 bool operator!=(const MaxSizeBytes &other) const
1139 {
1140 return m_value != other.m_value;
1141 }
1142
1144 bool operator<(const MaxSizeBytes &other) const
1145 {
1146 return m_value < other.m_value;
1147 }
1148
1150 bool operator>(const MaxSizeBytes &other) const
1151 {
1152 return m_value > other.m_value;
1153 }
1154
1156 bool operator<=(const MaxSizeBytes &other) const
1157 {
1158 return m_value <= other.m_value;
1159 }
1160
1162 bool operator>=(const MaxSizeBytes &other) const
1163 {
1164 return m_value >= other.m_value;
1165 }
1166
1168 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1169 {
1170 return stream << value.toString();
1171 }
1172
1173 private:
1174 void setFromString(const std::string &value);
1175
1176 uint64_t m_value{ 0 };
1177
1178 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1179 };
1180
1181 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1182
1185
1197#ifndef NO_DOC
1198 template<
1199 typename... Args,
1200 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1201 typename std::enable_if<
1202 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1203 value,
1204 int>::type = 0>
1205#else
1206 template<typename... Args>
1207#endif
1208 explicit UserData(Args &&...args)
1209 {
1210 using namespace Zivid::Detail::TypeTraits;
1211
1212 static_assert(
1213 AllArgsDecayedAreUnique<Args...>::value,
1214 "Found duplicate types among the arguments passed to UserData(...). "
1215 "Types should be listed at most once.");
1216
1217 set(std::forward<Args>(args)...);
1218 }
1219
1230#ifndef NO_DOC
1231 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1232#else
1233 template<typename... Args>
1234#endif
1235 void set(Args &&...args)
1236 {
1237 using namespace Zivid::Detail::TypeTraits;
1238
1239 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1240 static_assert(
1241 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1242
1243 static_assert(
1244 AllArgsDecayedAreUnique<Args...>::value,
1245 "Found duplicate types among the arguments passed to set(...). "
1246 "Types should be listed at most once.");
1247
1248 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1249 }
1250
1262#ifndef NO_DOC
1263 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1264#else
1265 template<typename... Args>
1266#endif
1267 UserData copyWith(Args &&...args) const
1268 {
1269 using namespace Zivid::Detail::TypeTraits;
1270
1271 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1272 static_assert(
1273 AllArgsAreDescendantNodes::value,
1274 "All arguments passed to copyWith(...) must be descendant nodes.");
1275
1276 static_assert(
1277 AllArgsDecayedAreUnique<Args...>::value,
1278 "Found duplicate types among the arguments passed to copyWith(...). "
1279 "Types should be listed at most once.");
1280
1281 auto copy{ *this };
1282 copy.set(std::forward<Args>(args)...);
1283 return copy;
1284 }
1285
1288 {
1289 return m_maxSizeBytes;
1290 }
1291
1294 {
1295 return m_maxSizeBytes;
1296 }
1297
1300 {
1301 m_maxSizeBytes = value;
1302 return *this;
1303 }
1304
1305 template<
1306 typename T,
1307 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1309 {
1310 return m_maxSizeBytes;
1311 }
1312
1313 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1315 {
1316 return m_maxSizeBytes;
1317 }
1318
1320 template<typename F>
1321 void forEach(const F &f) const
1322 {
1323 f(m_maxSizeBytes);
1324 }
1325
1327 template<typename F>
1328 void forEach(const F &f)
1329 {
1330 f(m_maxSizeBytes);
1331 }
1332
1334 bool operator==(const UserData &other) const;
1335
1337 bool operator!=(const UserData &other) const;
1338
1340 std::string toString() const;
1341
1343 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1344 {
1345 return stream << value.toString();
1346 }
1347
1348 private:
1349 void setFromString(const std::string &value);
1350
1351 void setFromString(const std::string &fullPath, const std::string &value);
1352
1353 std::string getString(const std::string &fullPath) const;
1354
1355 MaxSizeBytes m_maxSizeBytes;
1356
1357 friend struct DataModel::Detail::Befriend<UserData>;
1358 };
1359
1360 using Descendants = std::tuple<
1371
1374
1376 explicit CameraInfo(const std::string &fileName);
1377
1383 [[nodiscard]] static CameraInfo fromSerialized(const std::string &value);
1384
1390 std::string serialize() const;
1391
1412#ifndef NO_DOC
1413 template<
1414 typename... Args,
1415 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1416 typename std::enable_if<
1417 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1418 int>::type = 0>
1419#else
1420 template<typename... Args>
1421#endif
1422 explicit CameraInfo(Args &&...args)
1423 {
1424 using namespace Zivid::Detail::TypeTraits;
1425
1426 static_assert(
1427 AllArgsDecayedAreUnique<Args...>::value,
1428 "Found duplicate types among the arguments passed to CameraInfo(...). "
1429 "Types should be listed at most once.");
1430
1431 set(std::forward<Args>(args)...);
1432 }
1433
1453#ifndef NO_DOC
1454 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1455#else
1456 template<typename... Args>
1457#endif
1458 void set(Args &&...args)
1459 {
1460 using namespace Zivid::Detail::TypeTraits;
1461
1462 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1463 static_assert(
1464 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1465
1466 static_assert(
1467 AllArgsDecayedAreUnique<Args...>::value,
1468 "Found duplicate types among the arguments passed to set(...). "
1469 "Types should be listed at most once.");
1470
1471 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1472 }
1473
1494#ifndef NO_DOC
1495 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1496#else
1497 template<typename... Args>
1498#endif
1499 CameraInfo copyWith(Args &&...args) const
1500 {
1501 using namespace Zivid::Detail::TypeTraits;
1502
1503 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1504 static_assert(
1505 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1506
1507 static_assert(
1508 AllArgsDecayedAreUnique<Args...>::value,
1509 "Found duplicate types among the arguments passed to copyWith(...). "
1510 "Types should be listed at most once.");
1511
1512 auto copy{ *this };
1513 copy.set(std::forward<Args>(args)...);
1514 return copy;
1515 }
1516
1519 {
1520 return m_firmwareVersion;
1521 }
1522
1525 {
1526 return m_firmwareVersion;
1527 }
1528
1531 {
1532 m_firmwareVersion = value;
1533 return *this;
1534 }
1535
1538 {
1539 return m_hardwareRevision;
1540 }
1541
1544 {
1545 return m_hardwareRevision;
1546 }
1547
1550 {
1551 m_hardwareRevision = value;
1552 return *this;
1553 }
1554
1556 const Model &model() const
1557 {
1558 return m_model;
1559 }
1560
1563 {
1564 return m_model;
1565 }
1566
1568 CameraInfo &set(const Model &value)
1569 {
1570 m_model = value;
1571 return *this;
1572 }
1573
1575 const ModelName &modelName() const
1576 {
1577 return m_modelName;
1578 }
1579
1582 {
1583 return m_modelName;
1584 }
1585
1587 CameraInfo &set(const ModelName &value)
1588 {
1589 m_modelName = value;
1590 return *this;
1591 }
1592
1594 const Revision &revision() const
1595 {
1596 return m_revision;
1597 }
1598
1601 {
1602 return m_revision;
1603 }
1604
1606 CameraInfo &set(const Revision &value)
1607 {
1608 m_revision = value;
1609 return *this;
1610 }
1611
1614 {
1615 m_revision.set(value);
1616 return *this;
1617 }
1618
1621 {
1622 m_revision.set(value);
1623 return *this;
1624 }
1625
1628 {
1629 return m_serialNumber;
1630 }
1631
1634 {
1635 return m_serialNumber;
1636 }
1637
1640 {
1641 m_serialNumber = value;
1642 return *this;
1643 }
1644
1646 const UserData &userData() const
1647 {
1648 return m_userData;
1649 }
1650
1653 {
1654 return m_userData;
1655 }
1656
1658 CameraInfo &set(const UserData &value)
1659 {
1660 m_userData = value;
1661 return *this;
1662 }
1663
1666 {
1667 m_userData.set(value);
1668 return *this;
1669 }
1670
1671 template<
1672 typename T,
1673 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1675 {
1676 return m_firmwareVersion;
1677 }
1678
1679 template<
1680 typename T,
1681 typename std::enable_if<std::is_same<T, CameraInfo::HardwareRevision>::value, int>::type = 0>
1683 {
1684 return m_hardwareRevision;
1685 }
1686
1687 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1688 const CameraInfo::Model &get() const
1689 {
1690 return m_model;
1691 }
1692
1693 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1695 {
1696 return m_modelName;
1697 }
1698
1699 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1701 {
1702 return m_revision;
1703 }
1704
1705 template<
1706 typename T,
1707 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1709 {
1710 return m_revision.get<CameraInfo::Revision::Major>();
1711 }
1712
1713 template<
1714 typename T,
1715 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1717 {
1718 return m_revision.get<CameraInfo::Revision::Minor>();
1719 }
1720
1721 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1723 {
1724 return m_serialNumber;
1725 }
1726
1727 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1729 {
1730 return m_userData;
1731 }
1732
1733 template<
1734 typename T,
1735 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1737 {
1738 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1739 }
1740
1741 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1743 {
1744 return m_firmwareVersion;
1745 }
1746
1747 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1749 {
1750 return m_hardwareRevision;
1751 }
1752
1753 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1754 const CameraInfo::Model &get() const
1755 {
1756 return m_model;
1757 }
1758
1759 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1761 {
1762 return m_modelName;
1763 }
1764
1765 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1767 {
1768 return m_revision;
1769 }
1770
1771 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1773 {
1774 return m_serialNumber;
1775 }
1776
1777 template<size_t i, typename std::enable_if<i == 6, int>::type = 0>
1779 {
1780 return m_userData;
1781 }
1782
1784 template<typename F>
1785 void forEach(const F &f) const
1786 {
1787 f(m_firmwareVersion);
1788 f(m_hardwareRevision);
1789 f(m_model);
1790 f(m_modelName);
1791 f(m_revision);
1792 f(m_serialNumber);
1793 f(m_userData);
1794 }
1795
1797 template<typename F>
1798 void forEach(const F &f)
1799 {
1800 f(m_firmwareVersion);
1801 f(m_hardwareRevision);
1802 f(m_model);
1803 f(m_modelName);
1804 f(m_revision);
1805 f(m_serialNumber);
1806 f(m_userData);
1807 }
1808
1810 bool operator==(const CameraInfo &other) const;
1811
1813 bool operator!=(const CameraInfo &other) const;
1814
1816 std::string toString() const;
1817
1819 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1820 {
1821 return stream << value.toString();
1822 }
1823
1825 void save(const std::string &fileName) const;
1826
1828 void load(const std::string &fileName);
1829
1830 private:
1831 void setFromString(const std::string &value);
1832
1833 void setFromString(const std::string &fullPath, const std::string &value);
1834
1835 std::string getString(const std::string &fullPath) const;
1836
1837 FirmwareVersion m_firmwareVersion;
1838 HardwareRevision m_hardwareRevision;
1839 Model m_model;
1840 ModelName m_modelName;
1841 Revision m_revision;
1842 SerialNumber m_serialNumber;
1843 UserData m_userData;
1844
1845 friend struct DataModel::Detail::Befriend<CameraInfo>;
1846 };
1847
1848#ifndef NO_DOC
1849 template<>
1850 struct CameraInfo::Version<6>
1851 {
1852 using Type = CameraInfo;
1853 };
1854#endif
1855
1856} // namespace Zivid
1857
1858#ifndef NO_DOC
1860namespace Zivid::Detail
1861{
1862
1863 ZIVID_CORE_EXPORT void save(const Zivid::CameraInfo &dataModel, std::ostream &ostream);
1864 ZIVID_CORE_EXPORT void load(Zivid::CameraInfo &dataModel, std::istream &istream);
1865
1866 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::CameraInfo &source);
1867 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::CameraInfo &dest, const std::vector<uint8_t> &data);
1868
1869} // namespace Zivid::Detail
1870#endif
1871
1872#ifdef _MSC_VER
1873# pragma warning(pop)
1874#endif
1875
1876#ifndef NO_DOC
1877# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1878namespace std // NOLINT
1879{
1880
1881 template<>
1882 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1883 {};
1884
1885 template<size_t i>
1886 struct tuple_element<i, Zivid::CameraInfo::Revision>
1887 {
1888 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1889
1890 using type // NOLINT
1891 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1892 };
1893
1894 template<>
1895 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1896 {};
1897
1898 template<size_t i>
1899 struct tuple_element<i, Zivid::CameraInfo::UserData>
1900 {
1901 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1902
1903 using type // NOLINT
1904 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1905 };
1906
1907 template<>
1908 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 7>
1909 {};
1910
1911 template<size_t i>
1912 struct tuple_element<i, Zivid::CameraInfo>
1913 {
1914 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 7");
1915
1916 using type // NOLINT
1917 = decltype(declval<Zivid::CameraInfo>().get<i>());
1918 };
1919
1920} // namespace std
1921# endif
1922#endif
1923
1924// If we have access to the DataModel library, automatically include internal DataModel
1925// header. This header is necessary for serialization and deserialization.
1926#if defined(__has_include) && !defined(NO_DOC)
1927# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1928# include "Zivid/CameraInfoInternal.h"
1929# endif
1930#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The firmware version on the camera.
Definition CameraInfo.h:112
std::string toString() const
Get the value as string.
bool operator==(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:150
FirmwareVersion(std::string value)
Constructor.
Definition CameraInfo.h:139
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion.
Definition CameraInfo.h:130
bool operator<(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:162
bool operator<=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:174
bool operator>=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:180
const std::string & value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const FirmwareVersion &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:186
bool operator>(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:168
bool operator!=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:156
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:127
FirmwareVersion()=default
Default constructor.
Hardware revision of this camera. This corresponds to the revision string that is printed on the prod...
Definition CameraInfo.h:213
HardwareRevision()=default
Default constructor.
bool operator!=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:261
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for HardwareRevision.
Definition CameraInfo.h:235
bool operator==(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:255
bool operator>(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:273
const std::string & value() const
Get the value.
bool operator<(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:267
friend std::ostream & operator<<(std::ostream &stream, const HardwareRevision &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:291
HardwareRevision(std::string value)
Constructor.
Definition CameraInfo.h:244
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:232
bool operator<=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:279
bool operator>=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:285
std::string toString() const
Get the value as string.
The model name of the camera. This is a user-friendly display name that may contain spaces and specia...
Definition CameraInfo.h:434
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:476
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:500
std::string toString() const
Get the value as string.
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:465
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:453
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:488
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:494
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:512
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:456
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:506
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:482
The model of the camera.
Definition CameraInfo.h:317
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:346
static const Model zivid2PlusMR60
zivid2PlusMR60
Definition CameraInfo.h:355
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:351
static const Model zividTwo
zividTwo
Definition CameraInfo.h:349
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:353
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:371
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:347
ValueType value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const Model::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraInfo.h:382
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:352
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:400
static const Model zivid2PlusLR110
zivid2PlusLR110
Definition CameraInfo.h:356
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:359
ValueType
The type of the underlying value.
Definition CameraInfo.h:333
static const Model zivid2PlusMR130
zivid2PlusMR130
Definition CameraInfo.h:354
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:348
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:394
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:350
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:388
Major hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:563
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:611
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:582
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:641
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:585
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:635
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:629
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:623
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:594
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:617
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:605
Minor hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:660
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:720
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:708
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:726
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:691
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:679
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:738
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:702
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:732
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:714
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:682
uint32_t value() const
Get the value.
Major/Minor hardware revision number. This field is deprecated and may be removed in a future version...
Definition CameraInfo.h:539
const Major & major() const
Get Major.
Definition CameraInfo.h:860
Revision copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:840
Minor & minor()
Get Minor.
Definition CameraInfo.h:885
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:891
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:751
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:872
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:908
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:879
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:935
Major & major()
Get Major.
Definition CameraInfo.h:866
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:900
Revision()
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 CameraInfo.h:927
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:951
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:807
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:973
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:1000
const std::string & value() const
Get the value.
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1011
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:988
SerialNumber()=default
Default constructor.
friend std::ostream & operator<<(std::ostream &stream, const SerialNumber &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:1047
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1029
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1023
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1035
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:991
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1041
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1017
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:1092
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1138
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1156
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1150
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:1121
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1144
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1132
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const MaxSizeBytes &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:1168
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:1112
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:1109
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1162
Information about user data capabilities of the camera.
Definition CameraInfo.h:1072
bool operator==(const UserData &other) const
Equality operator.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1328
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1293
UserData copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:1267
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1343
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 CameraInfo.h:1321
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1308
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1181
bool operator!=(const UserData &other) const
Inequality operator.
UserData()
Default constructor.
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1287
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1299
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1235
Information about camera model, serial number etc.
Definition CameraInfo.h:78
bool operator==(const CameraInfo &other) const
Equality operator.
static CameraInfo fromSerialized(const std::string &value)
Construct a new CameraInfo instance from a previously serialized string.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1600
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1575
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1524
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1798
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1646
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1581
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1568
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1674
const CameraInfo::Model & get() const
Definition CameraInfo.h:1688
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1652
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1587
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1518
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1736
const Model & model() const
Get Model.
Definition CameraInfo.h:1556
CameraInfo copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraInfo.h:1499
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1785
Model & model()
Get Model.
Definition CameraInfo.h:1562
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1819
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1694
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1658
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1665
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1422
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1728
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1716
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1627
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1633
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1594
CameraInfo & set(const HardwareRevision &value)
Set HardwareRevision.
Definition CameraInfo.h:1549
const CameraInfo::HardwareRevision & get() const
Definition CameraInfo.h:1682
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1530
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1708
const HardwareRevision & hardwareRevision() const
Get HardwareRevision.
Definition CameraInfo.h:1537
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1458
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1606
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1613
std::tuple< CameraInfo::FirmwareVersion, CameraInfo::HardwareRevision, CameraInfo::Model, CameraInfo::ModelName, CameraInfo::Revision, CameraInfo::Revision::Major, CameraInfo::Revision::Minor, CameraInfo::SerialNumber, CameraInfo::UserData, CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1360
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1639
std::string serialize() const
Serialize to a string.
HardwareRevision & hardwareRevision()
Get HardwareRevision.
Definition CameraInfo.h:1543
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1722
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1700
std::string toString() const
Get the value as string.
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1620
void save(const std::string &fileName) const
Save to the given file.
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84