Zivid C++ API 2.12.0+6afd4961-1
CameraInfo.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2024 (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{ 5 };
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, std::numeric_limits<ValueType::size_type>::max() };
133 }
134
136 FirmwareVersion() = default;
137
139 explicit FirmwareVersion(std::string value)
140 : m_value{ 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 std::string m_value{};
195
196 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
197 };
198
202
203 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
205 {
206 public:
208 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
209
211 static constexpr const char *path{ "HardwareRevision" };
212
214 static constexpr const char *name{ "HardwareRevision" };
215
217 static constexpr const char *description{
218 R"description(Hardware revision of this camera. This corresponds to the revision string that is printed on the product
219label.
220)description"
221 };
222
224 using ValueType = std::string;
225
228 {
229 return { 0, std::numeric_limits<ValueType::size_type>::max() };
230 }
231
233 HardwareRevision() = default;
234
236 explicit HardwareRevision(std::string value)
237 : m_value{ std::move(value) }
238 {}
239
241 const std::string &value() const;
242
244 std::string toString() const;
245
247 bool operator==(const HardwareRevision &other) const
248 {
249 return m_value == other.m_value;
250 }
251
253 bool operator!=(const HardwareRevision &other) const
254 {
255 return m_value != other.m_value;
256 }
257
259 bool operator<(const HardwareRevision &other) const
260 {
261 return m_value < other.m_value;
262 }
263
265 bool operator>(const HardwareRevision &other) const
266 {
267 return m_value > other.m_value;
268 }
269
271 bool operator<=(const HardwareRevision &other) const
272 {
273 return m_value <= other.m_value;
274 }
275
277 bool operator>=(const HardwareRevision &other) const
278 {
279 return m_value >= other.m_value;
280 }
281
283 friend std::ostream &operator<<(std::ostream &stream, const HardwareRevision &value)
284 {
285 return stream << value.toString();
286 }
287
288 private:
289 void setFromString(const std::string &value);
290
291 std::string m_value{};
292
293 friend struct DataModel::Detail::Befriend<HardwareRevision>;
294 };
295
297
298 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
300 {
301 public:
303 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
304
306 static constexpr const char *path{ "Model" };
307
309 static constexpr const char *name{ "Model" };
310
312 static constexpr const char *description{ R"description(The model of the camera)description" };
313
315 enum class ValueType
316 {
317 zividOnePlusSmall,
318 zividOnePlusMedium,
319 zividOnePlusLarge,
320 zividTwo,
321 zividTwoL100,
322 zivid2PlusM130,
323 zivid2PlusM60,
324 zivid2PlusL110
325 };
329 static const Model zividTwo;
330 static const Model zividTwoL100;
331 static const Model zivid2PlusM130;
332 static const Model zivid2PlusM60;
333 static const Model zivid2PlusL110;
334
336 static std::set<ValueType> validValues()
337 {
338 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
339 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
340 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110 };
341 }
342
344 Model() = default;
345
347 explicit constexpr Model(ValueType value)
348 : m_value{ verifyValue(value) }
349 {}
350
353
355 std::string toString() const;
356
358 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
359 {
360 return stream << Model{ value }.toString();
361 }
362
364 bool operator==(const Model &other) const
365 {
366 return m_value == other.m_value;
367 }
368
370 bool operator!=(const Model &other) const
371 {
372 return m_value != other.m_value;
373 }
374
376 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
377 {
378 return stream << value.toString();
379 }
380
381 private:
382 void setFromString(const std::string &value);
383
384 constexpr ValueType static verifyValue(const ValueType &value)
385 {
386 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
387 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
388 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
389 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
390 ? value
391 : throw std::invalid_argument{
392 "Invalid value: Model{ "
393 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
394 };
395 }
396
397 ValueType m_value{ ValueType::zividOnePlusSmall };
398
399 friend struct DataModel::Detail::Befriend<Model>;
400 };
401
405
406 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
408 {
409 public:
411 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
412
414 static constexpr const char *path{ "ModelName" };
415
417 static constexpr const char *name{ "ModelName" };
418
420 static constexpr const char *description{
421 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
422characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
423)description"
424 };
425
427 using ValueType = std::string;
428
431 {
432 return { 0, std::numeric_limits<ValueType::size_type>::max() };
433 }
434
436 ModelName() = default;
437
439 explicit ModelName(std::string value)
440 : m_value{ std::move(value) }
441 {}
442
444 const std::string &value() const;
445
447 std::string toString() const;
448
450 bool operator==(const ModelName &other) const
451 {
452 return m_value == other.m_value;
453 }
454
456 bool operator!=(const ModelName &other) const
457 {
458 return m_value != other.m_value;
459 }
460
462 bool operator<(const ModelName &other) const
463 {
464 return m_value < other.m_value;
465 }
466
468 bool operator>(const ModelName &other) const
469 {
470 return m_value > other.m_value;
471 }
472
474 bool operator<=(const ModelName &other) const
475 {
476 return m_value <= other.m_value;
477 }
478
480 bool operator>=(const ModelName &other) const
481 {
482 return m_value >= other.m_value;
483 }
484
486 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
487 {
488 return stream << value.toString();
489 }
490
491 private:
492 void setFromString(const std::string &value);
493
494 std::string m_value{};
495
496 friend struct DataModel::Detail::Befriend<ModelName>;
497 };
498
502
503 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
505 {
506 public:
508 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
509
511 static constexpr const char *path{ "Revision" };
512
514 static constexpr const char *name{ "Revision" };
515
517 static constexpr const char *description{
518 R"description(Major/Minor hardware revision number. This field is deprecated and may be removed in a future version
519of the SDK. Please use HardwareRevision instead.
520)description"
521 };
522
526
527 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
529 {
530 public:
532 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
533
535 static constexpr const char *path{ "Revision/Major" };
536
538 static constexpr const char *name{ "Major" };
539
541 static constexpr const char *description{
542 R"description(Major hardware revision number. This field is deprecated and may be removed in a future version
543of the SDK. Please use HardwareRevision instead.
544)description"
545 };
546
548 using ValueType = uint32_t;
549
551 static constexpr Range<uint32_t> validRange()
552 {
553 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
554 }
555
557 Major() = default;
558
560 explicit constexpr Major(uint32_t value)
561 : m_value{ value }
562 {}
563
565 uint32_t value() const;
566
568 std::string toString() const;
569
571 bool operator==(const Major &other) const
572 {
573 return m_value == other.m_value;
574 }
575
577 bool operator!=(const Major &other) const
578 {
579 return m_value != other.m_value;
580 }
581
583 bool operator<(const Major &other) const
584 {
585 return m_value < other.m_value;
586 }
587
589 bool operator>(const Major &other) const
590 {
591 return m_value > other.m_value;
592 }
593
595 bool operator<=(const Major &other) const
596 {
597 return m_value <= other.m_value;
598 }
599
601 bool operator>=(const Major &other) const
602 {
603 return m_value >= other.m_value;
604 }
605
607 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
608 {
609 return stream << value.toString();
610 }
611
612 private:
613 void setFromString(const std::string &value);
614
615 uint32_t m_value{ 0 };
616
617 friend struct DataModel::Detail::Befriend<Major>;
618 };
619
623
624 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
626 {
627 public:
629 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
630
632 static constexpr const char *path{ "Revision/Minor" };
633
635 static constexpr const char *name{ "Minor" };
636
638 static constexpr const char *description{
639 R"description(Minor hardware revision number. This field is deprecated and may be removed in a future version
640of the SDK. Please use HardwareRevision instead.
641)description"
642 };
643
645 using ValueType = uint32_t;
646
648 static constexpr Range<uint32_t> validRange()
649 {
650 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
651 }
652
654 Minor() = default;
655
657 explicit constexpr Minor(uint32_t value)
658 : m_value{ value }
659 {}
660
662 uint32_t value() const;
663
665 std::string toString() const;
666
668 bool operator==(const Minor &other) const
669 {
670 return m_value == other.m_value;
671 }
672
674 bool operator!=(const Minor &other) const
675 {
676 return m_value != other.m_value;
677 }
678
680 bool operator<(const Minor &other) const
681 {
682 return m_value < other.m_value;
683 }
684
686 bool operator>(const Minor &other) const
687 {
688 return m_value > other.m_value;
689 }
690
692 bool operator<=(const Minor &other) const
693 {
694 return m_value <= other.m_value;
695 }
696
698 bool operator>=(const Minor &other) const
699 {
700 return m_value >= other.m_value;
701 }
702
704 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
705 {
706 return stream << value.toString();
707 }
708
709 private:
710 void setFromString(const std::string &value);
711
712 uint32_t m_value{ 0 };
713
714 friend struct DataModel::Detail::Befriend<Minor>;
715 };
716
717 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
718
721
734#ifndef NO_DOC
735 template<
736 typename... Args,
737 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
738 typename std::enable_if<
739 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
740 value,
741 int>::type = 0>
742#else
743 template<typename... Args>
744#endif
745 explicit Revision(Args &&...args)
746 {
747 using namespace Zivid::Detail::TypeTraits;
748
749 static_assert(
750 AllArgsDecayedAreUnique<Args...>::value,
751 "Found duplicate types among the arguments passed to Revision(...). "
752 "Types should be listed at most once.");
753
754 set(std::forward<Args>(args)...);
755 }
756
768#ifndef NO_DOC
769 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
770#else
771 template<typename... Args>
772#endif
773 void set(Args &&...args)
774 {
775 using namespace Zivid::Detail::TypeTraits;
776
777 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
778 static_assert(
779 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
780
781 static_assert(
782 AllArgsDecayedAreUnique<Args...>::value,
783 "Found duplicate types among the arguments passed to set(...). "
784 "Types should be listed at most once.");
785
786 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
787 }
788
801#ifndef NO_DOC
802 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
803#else
804 template<typename... Args>
805#endif
806 Revision copyWith(Args &&...args) const
807 {
808 using namespace Zivid::Detail::TypeTraits;
809
810 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
811 static_assert(
812 AllArgsAreDescendantNodes::value,
813 "All arguments passed to copyWith(...) must be descendant nodes.");
814
815 static_assert(
816 AllArgsDecayedAreUnique<Args...>::value,
817 "Found duplicate types among the arguments passed to copyWith(...). "
818 "Types should be listed at most once.");
819
820 auto copy{ *this };
821 copy.set(std::forward<Args>(args)...);
822 return copy;
823 }
824
826 const Major &major() const
827 {
828 return m_major;
829 }
830
833 {
834 return m_major;
835 }
836
838 Revision &set(const Major &value)
839 {
840 m_major = value;
841 return *this;
842 }
843
845 const Minor &minor() const
846 {
847 return m_minor;
848 }
849
852 {
853 return m_minor;
854 }
855
857 Revision &set(const Minor &value)
858 {
859 m_minor = value;
860 return *this;
861 }
862
863 template<
864 typename T,
865 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
867 {
868 return m_major;
869 }
870
871 template<
872 typename T,
873 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
875 {
876 return m_minor;
877 }
878
879 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
881 {
882 return m_major;
883 }
884
885 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
887 {
888 return m_minor;
889 }
890
892 template<typename F>
893 void forEach(const F &f) const
894 {
895 f(m_major);
896 f(m_minor);
897 }
898
900 template<typename F>
901 void forEach(const F &f)
902 {
903 f(m_major);
904 f(m_minor);
905 }
906
908 bool operator==(const Revision &other) const;
909
911 bool operator!=(const Revision &other) const;
912
914 std::string toString() const;
915
917 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
918 {
919 return stream << value.toString();
920 }
921
922 private:
923 void setFromString(const std::string &value);
924
925 void setFromString(const std::string &fullPath, const std::string &value);
926
927 std::string getString(const std::string &fullPath) const;
928
929 Major m_major;
930 Minor m_minor;
931
932 friend struct DataModel::Detail::Befriend<Revision>;
933 };
934
936
937 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
939 {
940 public:
942 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
943
945 static constexpr const char *path{ "SerialNumber" };
946
948 static constexpr const char *name{ "SerialNumber" };
949
951 static constexpr const char *description{ R"description(The serial number of the camera)description" };
952
954 using ValueType = std::string;
955
958 {
959 return { 0, std::numeric_limits<ValueType::size_type>::max() };
960 }
961
963 SerialNumber() = default;
964
966 explicit SerialNumber(std::string value)
967 : m_value{ std::move(value) }
968 {}
969
971 const std::string &value() const;
972
974 std::string toString() const;
975
977 bool operator==(const SerialNumber &other) const
978 {
979 return m_value == other.m_value;
980 }
981
983 bool operator!=(const SerialNumber &other) const
984 {
985 return m_value != other.m_value;
986 }
987
989 bool operator<(const SerialNumber &other) const
990 {
991 return m_value < other.m_value;
992 }
993
995 bool operator>(const SerialNumber &other) const
996 {
997 return m_value > other.m_value;
998 }
999
1001 bool operator<=(const SerialNumber &other) const
1002 {
1003 return m_value <= other.m_value;
1004 }
1005
1007 bool operator>=(const SerialNumber &other) const
1008 {
1009 return m_value >= other.m_value;
1010 }
1011
1013 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
1014 {
1015 return stream << value.toString();
1016 }
1017
1018 private:
1019 void setFromString(const std::string &value);
1020
1021 std::string m_value{};
1022
1023 friend struct DataModel::Detail::Befriend<SerialNumber>;
1024 };
1025
1027
1028 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1030 {
1031 public:
1033 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1034
1036 static constexpr const char *path{ "UserData" };
1037
1039 static constexpr const char *name{ "UserData" };
1040
1042 static constexpr const char *description{
1043 R"description(Information about user data capabilities of the camera)description"
1044 };
1045
1047
1048 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1050 {
1051 public:
1053 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1054
1056 static constexpr const char *path{ "UserData/MaxSizeBytes" };
1057
1059 static constexpr const char *name{ "MaxSizeBytes" };
1060
1062 static constexpr const char *description{
1063 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
1064 };
1065
1067 using ValueType = uint64_t;
1068
1070 static constexpr Range<uint64_t> validRange()
1071 {
1072 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1073 }
1074
1076 MaxSizeBytes() = default;
1077
1079 explicit constexpr MaxSizeBytes(uint64_t value)
1080 : m_value{ value }
1081 {}
1082
1084 uint64_t value() const;
1085
1087 std::string toString() const;
1088
1090 bool operator==(const MaxSizeBytes &other) const
1091 {
1092 return m_value == other.m_value;
1093 }
1094
1096 bool operator!=(const MaxSizeBytes &other) const
1097 {
1098 return m_value != other.m_value;
1099 }
1100
1102 bool operator<(const MaxSizeBytes &other) const
1103 {
1104 return m_value < other.m_value;
1105 }
1106
1108 bool operator>(const MaxSizeBytes &other) const
1109 {
1110 return m_value > other.m_value;
1111 }
1112
1114 bool operator<=(const MaxSizeBytes &other) const
1115 {
1116 return m_value <= other.m_value;
1117 }
1118
1120 bool operator>=(const MaxSizeBytes &other) const
1121 {
1122 return m_value >= other.m_value;
1123 }
1124
1126 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1127 {
1128 return stream << value.toString();
1129 }
1130
1131 private:
1132 void setFromString(const std::string &value);
1133
1134 uint64_t m_value{ 0 };
1135
1136 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1137 };
1138
1139 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1140
1143
1155#ifndef NO_DOC
1156 template<
1157 typename... Args,
1158 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1159 typename std::enable_if<
1160 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1161 value,
1162 int>::type = 0>
1163#else
1164 template<typename... Args>
1165#endif
1166 explicit UserData(Args &&...args)
1167 {
1168 using namespace Zivid::Detail::TypeTraits;
1169
1170 static_assert(
1171 AllArgsDecayedAreUnique<Args...>::value,
1172 "Found duplicate types among the arguments passed to UserData(...). "
1173 "Types should be listed at most once.");
1174
1175 set(std::forward<Args>(args)...);
1176 }
1177
1188#ifndef NO_DOC
1189 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1190#else
1191 template<typename... Args>
1192#endif
1193 void set(Args &&...args)
1194 {
1195 using namespace Zivid::Detail::TypeTraits;
1196
1197 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1198 static_assert(
1199 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1200
1201 static_assert(
1202 AllArgsDecayedAreUnique<Args...>::value,
1203 "Found duplicate types among the arguments passed to set(...). "
1204 "Types should be listed at most once.");
1205
1206 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1207 }
1208
1220#ifndef NO_DOC
1221 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1222#else
1223 template<typename... Args>
1224#endif
1225 UserData copyWith(Args &&...args) const
1226 {
1227 using namespace Zivid::Detail::TypeTraits;
1228
1229 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1230 static_assert(
1231 AllArgsAreDescendantNodes::value,
1232 "All arguments passed to copyWith(...) must be descendant nodes.");
1233
1234 static_assert(
1235 AllArgsDecayedAreUnique<Args...>::value,
1236 "Found duplicate types among the arguments passed to copyWith(...). "
1237 "Types should be listed at most once.");
1238
1239 auto copy{ *this };
1240 copy.set(std::forward<Args>(args)...);
1241 return copy;
1242 }
1243
1246 {
1247 return m_maxSizeBytes;
1248 }
1249
1252 {
1253 return m_maxSizeBytes;
1254 }
1255
1258 {
1259 m_maxSizeBytes = value;
1260 return *this;
1261 }
1262
1263 template<
1264 typename T,
1265 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1267 {
1268 return m_maxSizeBytes;
1269 }
1270
1271 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1273 {
1274 return m_maxSizeBytes;
1275 }
1276
1278 template<typename F>
1279 void forEach(const F &f) const
1280 {
1281 f(m_maxSizeBytes);
1282 }
1283
1285 template<typename F>
1286 void forEach(const F &f)
1287 {
1288 f(m_maxSizeBytes);
1289 }
1290
1292 bool operator==(const UserData &other) const;
1293
1295 bool operator!=(const UserData &other) const;
1296
1298 std::string toString() const;
1299
1301 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1302 {
1303 return stream << value.toString();
1304 }
1305
1306 private:
1307 void setFromString(const std::string &value);
1308
1309 void setFromString(const std::string &fullPath, const std::string &value);
1310
1311 std::string getString(const std::string &fullPath) const;
1312
1313 MaxSizeBytes m_maxSizeBytes;
1314
1315 friend struct DataModel::Detail::Befriend<UserData>;
1316 };
1317
1318 using Descendants = std::tuple<
1329
1332
1334 explicit CameraInfo(const std::string &fileName);
1335
1356#ifndef NO_DOC
1357 template<
1358 typename... Args,
1359 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1360 typename std::enable_if<
1361 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1362 int>::type = 0>
1363#else
1364 template<typename... Args>
1365#endif
1366 explicit CameraInfo(Args &&...args)
1367 {
1368 using namespace Zivid::Detail::TypeTraits;
1369
1370 static_assert(
1371 AllArgsDecayedAreUnique<Args...>::value,
1372 "Found duplicate types among the arguments passed to CameraInfo(...). "
1373 "Types should be listed at most once.");
1374
1375 set(std::forward<Args>(args)...);
1376 }
1377
1397#ifndef NO_DOC
1398 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1399#else
1400 template<typename... Args>
1401#endif
1402 void set(Args &&...args)
1403 {
1404 using namespace Zivid::Detail::TypeTraits;
1405
1406 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1407 static_assert(
1408 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1409
1410 static_assert(
1411 AllArgsDecayedAreUnique<Args...>::value,
1412 "Found duplicate types among the arguments passed to set(...). "
1413 "Types should be listed at most once.");
1414
1415 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1416 }
1417
1438#ifndef NO_DOC
1439 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1440#else
1441 template<typename... Args>
1442#endif
1443 CameraInfo copyWith(Args &&...args) const
1444 {
1445 using namespace Zivid::Detail::TypeTraits;
1446
1447 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1448 static_assert(
1449 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1450
1451 static_assert(
1452 AllArgsDecayedAreUnique<Args...>::value,
1453 "Found duplicate types among the arguments passed to copyWith(...). "
1454 "Types should be listed at most once.");
1455
1456 auto copy{ *this };
1457 copy.set(std::forward<Args>(args)...);
1458 return copy;
1459 }
1460
1463 {
1464 return m_firmwareVersion;
1465 }
1466
1469 {
1470 return m_firmwareVersion;
1471 }
1472
1475 {
1476 m_firmwareVersion = value;
1477 return *this;
1478 }
1479
1482 {
1483 return m_hardwareRevision;
1484 }
1485
1488 {
1489 return m_hardwareRevision;
1490 }
1491
1494 {
1495 m_hardwareRevision = value;
1496 return *this;
1497 }
1498
1500 const Model &model() const
1501 {
1502 return m_model;
1503 }
1504
1507 {
1508 return m_model;
1509 }
1510
1512 CameraInfo &set(const Model &value)
1513 {
1514 m_model = value;
1515 return *this;
1516 }
1517
1519 const ModelName &modelName() const
1520 {
1521 return m_modelName;
1522 }
1523
1526 {
1527 return m_modelName;
1528 }
1529
1531 CameraInfo &set(const ModelName &value)
1532 {
1533 m_modelName = value;
1534 return *this;
1535 }
1536
1538 const Revision &revision() const
1539 {
1540 return m_revision;
1541 }
1542
1545 {
1546 return m_revision;
1547 }
1548
1550 CameraInfo &set(const Revision &value)
1551 {
1552 m_revision = value;
1553 return *this;
1554 }
1555
1558 {
1559 m_revision.set(value);
1560 return *this;
1561 }
1562
1565 {
1566 m_revision.set(value);
1567 return *this;
1568 }
1569
1572 {
1573 return m_serialNumber;
1574 }
1575
1578 {
1579 return m_serialNumber;
1580 }
1581
1584 {
1585 m_serialNumber = value;
1586 return *this;
1587 }
1588
1590 const UserData &userData() const
1591 {
1592 return m_userData;
1593 }
1594
1597 {
1598 return m_userData;
1599 }
1600
1602 CameraInfo &set(const UserData &value)
1603 {
1604 m_userData = value;
1605 return *this;
1606 }
1607
1610 {
1611 m_userData.set(value);
1612 return *this;
1613 }
1614
1615 template<
1616 typename T,
1617 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1619 {
1620 return m_firmwareVersion;
1621 }
1622
1623 template<
1624 typename T,
1625 typename std::enable_if<std::is_same<T, CameraInfo::HardwareRevision>::value, int>::type = 0>
1627 {
1628 return m_hardwareRevision;
1629 }
1630
1631 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1632 const CameraInfo::Model &get() const
1633 {
1634 return m_model;
1635 }
1636
1637 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1639 {
1640 return m_modelName;
1641 }
1642
1643 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1645 {
1646 return m_revision;
1647 }
1648
1649 template<
1650 typename T,
1651 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1653 {
1654 return m_revision.get<CameraInfo::Revision::Major>();
1655 }
1656
1657 template<
1658 typename T,
1659 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1661 {
1662 return m_revision.get<CameraInfo::Revision::Minor>();
1663 }
1664
1665 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1667 {
1668 return m_serialNumber;
1669 }
1670
1671 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1673 {
1674 return m_userData;
1675 }
1676
1677 template<
1678 typename T,
1679 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1681 {
1682 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1683 }
1684
1685 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1687 {
1688 return m_firmwareVersion;
1689 }
1690
1691 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1693 {
1694 return m_hardwareRevision;
1695 }
1696
1697 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1698 const CameraInfo::Model &get() const
1699 {
1700 return m_model;
1701 }
1702
1703 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1705 {
1706 return m_modelName;
1707 }
1708
1709 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1711 {
1712 return m_revision;
1713 }
1714
1715 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1717 {
1718 return m_serialNumber;
1719 }
1720
1721 template<size_t i, typename std::enable_if<i == 6, int>::type = 0>
1723 {
1724 return m_userData;
1725 }
1726
1728 template<typename F>
1729 void forEach(const F &f) const
1730 {
1731 f(m_firmwareVersion);
1732 f(m_hardwareRevision);
1733 f(m_model);
1734 f(m_modelName);
1735 f(m_revision);
1736 f(m_serialNumber);
1737 f(m_userData);
1738 }
1739
1741 template<typename F>
1742 void forEach(const F &f)
1743 {
1744 f(m_firmwareVersion);
1745 f(m_hardwareRevision);
1746 f(m_model);
1747 f(m_modelName);
1748 f(m_revision);
1749 f(m_serialNumber);
1750 f(m_userData);
1751 }
1752
1754 bool operator==(const CameraInfo &other) const;
1755
1757 bool operator!=(const CameraInfo &other) const;
1758
1760 std::string toString() const;
1761
1763 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1764 {
1765 return stream << value.toString();
1766 }
1767
1769 void save(const std::string &fileName) const;
1770
1772 void load(const std::string &fileName);
1773
1774 private:
1775 void setFromString(const std::string &value);
1776
1777 void setFromString(const std::string &fullPath, const std::string &value);
1778
1779 std::string getString(const std::string &fullPath) const;
1780
1781 FirmwareVersion m_firmwareVersion;
1782 HardwareRevision m_hardwareRevision;
1783 Model m_model;
1784 ModelName m_modelName;
1785 Revision m_revision;
1786 SerialNumber m_serialNumber;
1787 UserData m_userData;
1788
1789 friend struct DataModel::Detail::Befriend<CameraInfo>;
1790 };
1791
1792#ifndef NO_DOC
1794 namespace Detail
1795 {
1796 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1797 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1798 } // namespace Detail
1799#endif
1800
1801#ifndef NO_DOC
1802 template<>
1803 struct CameraInfo::Version<5>
1804 {
1805 using Type = CameraInfo;
1806 };
1807#endif
1808
1809} // namespace Zivid
1810
1811#ifdef _MSC_VER
1812# pragma warning(pop)
1813#endif
1814
1815#ifndef NO_DOC
1816# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1817namespace std // NOLINT
1818{
1819
1820 template<>
1821 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1822 {};
1823
1824 template<size_t i>
1825 struct tuple_element<i, Zivid::CameraInfo::Revision>
1826 {
1827 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1828
1829 using type // NOLINT
1830 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1831 };
1832
1833 template<>
1834 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1835 {};
1836
1837 template<size_t i>
1838 struct tuple_element<i, Zivid::CameraInfo::UserData>
1839 {
1840 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1841
1842 using type // NOLINT
1843 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1844 };
1845
1846 template<>
1847 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 7>
1848 {};
1849
1850 template<size_t i>
1851 struct tuple_element<i, Zivid::CameraInfo>
1852 {
1853 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 7");
1854
1855 using type // NOLINT
1856 = decltype(declval<Zivid::CameraInfo>().get<i>());
1857 };
1858
1859} // namespace std
1860# endif
1861#endif
1862
1863// If we have access to the DataModel library, automatically include internal DataModel
1864// header. This header is necessary for serialization and deserialization.
1865#if defined(__has_include) && !defined(NO_DOC)
1866# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1867# include "Zivid/CameraInfoInternal.h"
1868# endif
1869#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:205
HardwareRevision()=default
Default constructor.
bool operator!=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:253
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for HardwareRevision.
Definition CameraInfo.h:227
bool operator==(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:247
bool operator>(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:265
const std::string & value() const
Get the value.
bool operator<(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:259
friend std::ostream & operator<<(std::ostream &stream, const HardwareRevision &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:283
HardwareRevision(std::string value)
Constructor.
Definition CameraInfo.h:236
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:224
bool operator<=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:271
bool operator>=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:277
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:408
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:450
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:474
std::string toString() const
Get the value as string.
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:439
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:427
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:462
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:468
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:486
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:430
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:480
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:456
The model of the camera.
Definition CameraInfo.h:300
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:326
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:331
static const Model zividTwo
zividTwo
Definition CameraInfo.h:329
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:333
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:347
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:327
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:358
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:332
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:376
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:336
ValueType
The type of the underlying value.
Definition CameraInfo.h:316
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:328
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:370
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:330
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:364
Major hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:529
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:577
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:548
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:607
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:551
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:601
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:595
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:589
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:560
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:583
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:571
Minor hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:626
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:686
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:674
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:692
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:657
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:645
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:704
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:668
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:698
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:680
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:648
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:505
const Major & major() const
Get Major.
Definition CameraInfo.h:826
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:806
Minor & minor()
Get Minor.
Definition CameraInfo.h:851
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:857
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:717
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:838
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:874
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:845
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:901
Major & major()
Get Major.
Definition CameraInfo.h:832
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:866
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:893
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:917
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:773
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:939
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:966
const std::string & value() const
Get the value.
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:977
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:954
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:1013
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:995
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:989
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1001
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:957
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1007
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:983
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:1050
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1096
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1114
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1108
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:1079
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1102
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1090
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:1126
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:1070
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:1067
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1120
Information about user data capabilities of the camera.
Definition CameraInfo.h:1030
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:1286
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1251
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:1225
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1301
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:1279
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1266
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1139
bool operator!=(const UserData &other) const
Inequality operator.
UserData()
Default constructor.
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1245
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1257
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1193
Information about camera model, serial number etc.
Definition CameraInfo.h:78
bool operator==(const CameraInfo &other) const
Equality operator.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1544
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1519
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1468
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1742
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1590
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1525
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1512
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1618
const CameraInfo::Model & get() const
Definition CameraInfo.h:1632
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1596
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1531
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1462
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1680
const Model & model() const
Get Model.
Definition CameraInfo.h:1500
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:1443
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:1729
Model & model()
Get Model.
Definition CameraInfo.h:1506
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1763
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1638
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1602
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1609
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1366
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1672
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1660
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1571
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1577
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1538
CameraInfo & set(const HardwareRevision &value)
Set HardwareRevision.
Definition CameraInfo.h:1493
const CameraInfo::HardwareRevision & get() const
Definition CameraInfo.h:1626
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1474
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1652
const HardwareRevision & hardwareRevision() const
Get HardwareRevision.
Definition CameraInfo.h:1481
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1402
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1550
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1557
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:1318
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1583
HardwareRevision & hardwareRevision()
Get HardwareRevision.
Definition CameraInfo.h:1487
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1666
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1644
std::string toString() const
Get the value as string.
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1564
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:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:54