Zivid C++ API 2.13.1+18e79e79-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
65#include "Zivid/Range.h"
66
67#ifdef _MSC_VER
68# pragma warning(push)
69# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
70#endif
71
72namespace Zivid
73{
74
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
82 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "CameraInfo" };
89
91 static constexpr const char *description{
92 R"description(Information about camera model, serial number etc.)description"
93 };
94
95 static constexpr size_t version{ 5 };
96
97#ifndef NO_DOC
98 template<size_t>
99 struct Version;
100
101 using LatestVersion = Zivid::CameraInfo;
102
103 // Short identifier. This value is not guaranteed to be universally unique
104 // Todo(ZIVID-2808): Move this to internal DataModelExt header
105 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
106
107#endif
108
110
111 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
113 {
114 public:
116 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
117
119 static constexpr const char *path{ "FirmwareVersion" };
120
122 static constexpr const char *name{ "FirmwareVersion" };
123
125 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
126
128 using ValueType = std::string;
129
132 {
133 return { 0, std::numeric_limits<ValueType::size_type>::max() };
134 }
135
137 FirmwareVersion() = default;
138
140 explicit FirmwareVersion(std::string value)
141 : m_value{ std::move(value) }
142 {}
143
145 const std::string &value() const;
146
148 std::string toString() const;
149
151 bool operator==(const FirmwareVersion &other) const
152 {
153 return m_value == other.m_value;
154 }
155
157 bool operator!=(const FirmwareVersion &other) const
158 {
159 return m_value != other.m_value;
160 }
161
163 bool operator<(const FirmwareVersion &other) const
164 {
165 return m_value < other.m_value;
166 }
167
169 bool operator>(const FirmwareVersion &other) const
170 {
171 return m_value > other.m_value;
172 }
173
175 bool operator<=(const FirmwareVersion &other) const
176 {
177 return m_value <= other.m_value;
178 }
179
181 bool operator>=(const FirmwareVersion &other) const
182 {
183 return m_value >= other.m_value;
184 }
185
187 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
188 {
189 return stream << value.toString();
190 }
191
192 private:
193 void setFromString(const std::string &value);
194
195 std::string m_value{};
196
197 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
198 };
199
203
204 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
206 {
207 public:
209 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
210
212 static constexpr const char *path{ "HardwareRevision" };
213
215 static constexpr const char *name{ "HardwareRevision" };
216
218 static constexpr const char *description{
219 R"description(Hardware revision of this camera. This corresponds to the revision string that is printed on the product
220label.
221)description"
222 };
223
225 using ValueType = std::string;
226
229 {
230 return { 0, std::numeric_limits<ValueType::size_type>::max() };
231 }
232
234 HardwareRevision() = default;
235
237 explicit HardwareRevision(std::string value)
238 : m_value{ std::move(value) }
239 {}
240
242 const std::string &value() const;
243
245 std::string toString() const;
246
248 bool operator==(const HardwareRevision &other) const
249 {
250 return m_value == other.m_value;
251 }
252
254 bool operator!=(const HardwareRevision &other) const
255 {
256 return m_value != other.m_value;
257 }
258
260 bool operator<(const HardwareRevision &other) const
261 {
262 return m_value < other.m_value;
263 }
264
266 bool operator>(const HardwareRevision &other) const
267 {
268 return m_value > other.m_value;
269 }
270
272 bool operator<=(const HardwareRevision &other) const
273 {
274 return m_value <= other.m_value;
275 }
276
278 bool operator>=(const HardwareRevision &other) const
279 {
280 return m_value >= other.m_value;
281 }
282
284 friend std::ostream &operator<<(std::ostream &stream, const HardwareRevision &value)
285 {
286 return stream << value.toString();
287 }
288
289 private:
290 void setFromString(const std::string &value);
291
292 std::string m_value{};
293
294 friend struct DataModel::Detail::Befriend<HardwareRevision>;
295 };
296
298
299 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
301 {
302 public:
304 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
305
307 static constexpr const char *path{ "Model" };
308
310 static constexpr const char *name{ "Model" };
311
313 static constexpr const char *description{ R"description(The model of the camera)description" };
314
316 enum class ValueType
317 {
318 zividOnePlusSmall,
319 zividOnePlusMedium,
320 zividOnePlusLarge,
321 zividTwo,
322 zividTwoL100,
323 zivid2PlusM130,
324 zivid2PlusM60,
325 zivid2PlusL110
326 };
330 static const Model zividTwo;
331 static const Model zividTwoL100;
332 static const Model zivid2PlusM130;
333 static const Model zivid2PlusM60;
334 static const Model zivid2PlusL110;
335
337 static std::set<ValueType> validValues()
338 {
339 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
340 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
341 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110 };
342 }
343
345 Model() = default;
346
348 explicit constexpr Model(ValueType value)
349 : m_value{ verifyValue(value) }
350 {}
351
354
356 std::string toString() const;
357
359 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
360 {
361 return stream << Model{ value }.toString();
362 }
363
365 bool operator==(const Model &other) const
366 {
367 return m_value == other.m_value;
368 }
369
371 bool operator!=(const Model &other) const
372 {
373 return m_value != other.m_value;
374 }
375
377 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
378 {
379 return stream << value.toString();
380 }
381
382 private:
383 void setFromString(const std::string &value);
384
385 constexpr ValueType static verifyValue(const ValueType &value)
386 {
387 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
388 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
389 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
390 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
391 ? value
392 : throw std::invalid_argument{
393 "Invalid value: Model{ "
394 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
395 };
396 }
397
398 ValueType m_value{ ValueType::zividOnePlusSmall };
399
400 friend struct DataModel::Detail::Befriend<Model>;
401 };
402
406
407 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
409 {
410 public:
412 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
413
415 static constexpr const char *path{ "ModelName" };
416
418 static constexpr const char *name{ "ModelName" };
419
421 static constexpr const char *description{
422 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
423characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
424)description"
425 };
426
428 using ValueType = std::string;
429
432 {
433 return { 0, std::numeric_limits<ValueType::size_type>::max() };
434 }
435
437 ModelName() = default;
438
440 explicit ModelName(std::string value)
441 : m_value{ std::move(value) }
442 {}
443
445 const std::string &value() const;
446
448 std::string toString() const;
449
451 bool operator==(const ModelName &other) const
452 {
453 return m_value == other.m_value;
454 }
455
457 bool operator!=(const ModelName &other) const
458 {
459 return m_value != other.m_value;
460 }
461
463 bool operator<(const ModelName &other) const
464 {
465 return m_value < other.m_value;
466 }
467
469 bool operator>(const ModelName &other) const
470 {
471 return m_value > other.m_value;
472 }
473
475 bool operator<=(const ModelName &other) const
476 {
477 return m_value <= other.m_value;
478 }
479
481 bool operator>=(const ModelName &other) const
482 {
483 return m_value >= other.m_value;
484 }
485
487 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
488 {
489 return stream << value.toString();
490 }
491
492 private:
493 void setFromString(const std::string &value);
494
495 std::string m_value{};
496
497 friend struct DataModel::Detail::Befriend<ModelName>;
498 };
499
503
504 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
506 {
507 public:
509 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
510
512 static constexpr const char *path{ "Revision" };
513
515 static constexpr const char *name{ "Revision" };
516
518 static constexpr const char *description{
519 R"description(Major/Minor hardware revision number. This field is deprecated and may be removed in a future version
520of the SDK. Please use HardwareRevision instead.
521)description"
522 };
523
527
528 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
530 {
531 public:
533 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
534
536 static constexpr const char *path{ "Revision/Major" };
537
539 static constexpr const char *name{ "Major" };
540
542 static constexpr const char *description{
543 R"description(Major hardware revision number. This field is deprecated and may be removed in a future version
544of the SDK. Please use HardwareRevision instead.
545)description"
546 };
547
549 using ValueType = uint32_t;
550
552 static constexpr Range<uint32_t> validRange()
553 {
554 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
555 }
556
558 Major() = default;
559
561 explicit constexpr Major(uint32_t value)
562 : m_value{ value }
563 {}
564
566 uint32_t value() const;
567
569 std::string toString() const;
570
572 bool operator==(const Major &other) const
573 {
574 return m_value == other.m_value;
575 }
576
578 bool operator!=(const Major &other) const
579 {
580 return m_value != other.m_value;
581 }
582
584 bool operator<(const Major &other) const
585 {
586 return m_value < other.m_value;
587 }
588
590 bool operator>(const Major &other) const
591 {
592 return m_value > other.m_value;
593 }
594
596 bool operator<=(const Major &other) const
597 {
598 return m_value <= other.m_value;
599 }
600
602 bool operator>=(const Major &other) const
603 {
604 return m_value >= other.m_value;
605 }
606
608 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
609 {
610 return stream << value.toString();
611 }
612
613 private:
614 void setFromString(const std::string &value);
615
616 uint32_t m_value{ 0 };
617
618 friend struct DataModel::Detail::Befriend<Major>;
619 };
620
624
625 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
627 {
628 public:
630 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
631
633 static constexpr const char *path{ "Revision/Minor" };
634
636 static constexpr const char *name{ "Minor" };
637
639 static constexpr const char *description{
640 R"description(Minor hardware revision number. This field is deprecated and may be removed in a future version
641of the SDK. Please use HardwareRevision instead.
642)description"
643 };
644
646 using ValueType = uint32_t;
647
649 static constexpr Range<uint32_t> validRange()
650 {
651 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
652 }
653
655 Minor() = default;
656
658 explicit constexpr Minor(uint32_t value)
659 : m_value{ value }
660 {}
661
663 uint32_t value() const;
664
666 std::string toString() const;
667
669 bool operator==(const Minor &other) const
670 {
671 return m_value == other.m_value;
672 }
673
675 bool operator!=(const Minor &other) const
676 {
677 return m_value != other.m_value;
678 }
679
681 bool operator<(const Minor &other) const
682 {
683 return m_value < other.m_value;
684 }
685
687 bool operator>(const Minor &other) const
688 {
689 return m_value > other.m_value;
690 }
691
693 bool operator<=(const Minor &other) const
694 {
695 return m_value <= other.m_value;
696 }
697
699 bool operator>=(const Minor &other) const
700 {
701 return m_value >= other.m_value;
702 }
703
705 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
706 {
707 return stream << value.toString();
708 }
709
710 private:
711 void setFromString(const std::string &value);
712
713 uint32_t m_value{ 0 };
714
715 friend struct DataModel::Detail::Befriend<Minor>;
716 };
717
718 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
719
722
735#ifndef NO_DOC
736 template<
737 typename... Args,
738 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
739 typename std::enable_if<
740 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
741 value,
742 int>::type = 0>
743#else
744 template<typename... Args>
745#endif
746 explicit Revision(Args &&...args)
747 {
748 using namespace Zivid::Detail::TypeTraits;
749
750 static_assert(
751 AllArgsDecayedAreUnique<Args...>::value,
752 "Found duplicate types among the arguments passed to Revision(...). "
753 "Types should be listed at most once.");
754
755 set(std::forward<Args>(args)...);
756 }
757
769#ifndef NO_DOC
770 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
771#else
772 template<typename... Args>
773#endif
774 void set(Args &&...args)
775 {
776 using namespace Zivid::Detail::TypeTraits;
777
778 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
779 static_assert(
780 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
781
782 static_assert(
783 AllArgsDecayedAreUnique<Args...>::value,
784 "Found duplicate types among the arguments passed to set(...). "
785 "Types should be listed at most once.");
786
787 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
788 }
789
802#ifndef NO_DOC
803 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
804#else
805 template<typename... Args>
806#endif
807 Revision copyWith(Args &&...args) const
808 {
809 using namespace Zivid::Detail::TypeTraits;
810
811 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
812 static_assert(
813 AllArgsAreDescendantNodes::value,
814 "All arguments passed to copyWith(...) must be descendant nodes.");
815
816 static_assert(
817 AllArgsDecayedAreUnique<Args...>::value,
818 "Found duplicate types among the arguments passed to copyWith(...). "
819 "Types should be listed at most once.");
820
821 auto copy{ *this };
822 copy.set(std::forward<Args>(args)...);
823 return copy;
824 }
825
827 const Major &major() const
828 {
829 return m_major;
830 }
831
834 {
835 return m_major;
836 }
837
839 Revision &set(const Major &value)
840 {
841 m_major = value;
842 return *this;
843 }
844
846 const Minor &minor() const
847 {
848 return m_minor;
849 }
850
853 {
854 return m_minor;
855 }
856
858 Revision &set(const Minor &value)
859 {
860 m_minor = value;
861 return *this;
862 }
863
864 template<
865 typename T,
866 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
868 {
869 return m_major;
870 }
871
872 template<
873 typename T,
874 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
876 {
877 return m_minor;
878 }
879
880 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
882 {
883 return m_major;
884 }
885
886 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
888 {
889 return m_minor;
890 }
891
893 template<typename F>
894 void forEach(const F &f) const
895 {
896 f(m_major);
897 f(m_minor);
898 }
899
901 template<typename F>
902 void forEach(const F &f)
903 {
904 f(m_major);
905 f(m_minor);
906 }
907
909 bool operator==(const Revision &other) const;
910
912 bool operator!=(const Revision &other) const;
913
915 std::string toString() const;
916
918 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
919 {
920 return stream << value.toString();
921 }
922
923 private:
924 void setFromString(const std::string &value);
925
926 void setFromString(const std::string &fullPath, const std::string &value);
927
928 std::string getString(const std::string &fullPath) const;
929
930 Major m_major;
931 Minor m_minor;
932
933 friend struct DataModel::Detail::Befriend<Revision>;
934 };
935
937
938 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
940 {
941 public:
943 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
944
946 static constexpr const char *path{ "SerialNumber" };
947
949 static constexpr const char *name{ "SerialNumber" };
950
952 static constexpr const char *description{ R"description(The serial number of the camera)description" };
953
955 using ValueType = std::string;
956
959 {
960 return { 0, std::numeric_limits<ValueType::size_type>::max() };
961 }
962
964 SerialNumber() = default;
965
967 explicit SerialNumber(std::string value)
968 : m_value{ std::move(value) }
969 {}
970
972 const std::string &value() const;
973
975 std::string toString() const;
976
978 bool operator==(const SerialNumber &other) const
979 {
980 return m_value == other.m_value;
981 }
982
984 bool operator!=(const SerialNumber &other) const
985 {
986 return m_value != other.m_value;
987 }
988
990 bool operator<(const SerialNumber &other) const
991 {
992 return m_value < other.m_value;
993 }
994
996 bool operator>(const SerialNumber &other) const
997 {
998 return m_value > other.m_value;
999 }
1000
1002 bool operator<=(const SerialNumber &other) const
1003 {
1004 return m_value <= other.m_value;
1005 }
1006
1008 bool operator>=(const SerialNumber &other) const
1009 {
1010 return m_value >= other.m_value;
1011 }
1012
1014 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
1015 {
1016 return stream << value.toString();
1017 }
1018
1019 private:
1020 void setFromString(const std::string &value);
1021
1022 std::string m_value{};
1023
1024 friend struct DataModel::Detail::Befriend<SerialNumber>;
1025 };
1026
1028
1029 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1031 {
1032 public:
1034 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1035
1037 static constexpr const char *path{ "UserData" };
1038
1040 static constexpr const char *name{ "UserData" };
1041
1043 static constexpr const char *description{
1044 R"description(Information about user data capabilities of the camera)description"
1045 };
1046
1048
1049 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1051 {
1052 public:
1054 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1055
1057 static constexpr const char *path{ "UserData/MaxSizeBytes" };
1058
1060 static constexpr const char *name{ "MaxSizeBytes" };
1061
1063 static constexpr const char *description{
1064 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
1065 };
1066
1068 using ValueType = uint64_t;
1069
1071 static constexpr Range<uint64_t> validRange()
1072 {
1073 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1074 }
1075
1077 MaxSizeBytes() = default;
1078
1080 explicit constexpr MaxSizeBytes(uint64_t value)
1081 : m_value{ value }
1082 {}
1083
1085 uint64_t value() const;
1086
1088 std::string toString() const;
1089
1091 bool operator==(const MaxSizeBytes &other) const
1092 {
1093 return m_value == other.m_value;
1094 }
1095
1097 bool operator!=(const MaxSizeBytes &other) const
1098 {
1099 return m_value != other.m_value;
1100 }
1101
1103 bool operator<(const MaxSizeBytes &other) const
1104 {
1105 return m_value < other.m_value;
1106 }
1107
1109 bool operator>(const MaxSizeBytes &other) const
1110 {
1111 return m_value > other.m_value;
1112 }
1113
1115 bool operator<=(const MaxSizeBytes &other) const
1116 {
1117 return m_value <= other.m_value;
1118 }
1119
1121 bool operator>=(const MaxSizeBytes &other) const
1122 {
1123 return m_value >= other.m_value;
1124 }
1125
1127 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1128 {
1129 return stream << value.toString();
1130 }
1131
1132 private:
1133 void setFromString(const std::string &value);
1134
1135 uint64_t m_value{ 0 };
1136
1137 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1138 };
1139
1140 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1141
1144
1156#ifndef NO_DOC
1157 template<
1158 typename... Args,
1159 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1160 typename std::enable_if<
1161 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1162 value,
1163 int>::type = 0>
1164#else
1165 template<typename... Args>
1166#endif
1167 explicit UserData(Args &&...args)
1168 {
1169 using namespace Zivid::Detail::TypeTraits;
1170
1171 static_assert(
1172 AllArgsDecayedAreUnique<Args...>::value,
1173 "Found duplicate types among the arguments passed to UserData(...). "
1174 "Types should be listed at most once.");
1175
1176 set(std::forward<Args>(args)...);
1177 }
1178
1189#ifndef NO_DOC
1190 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1191#else
1192 template<typename... Args>
1193#endif
1194 void set(Args &&...args)
1195 {
1196 using namespace Zivid::Detail::TypeTraits;
1197
1198 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1199 static_assert(
1200 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1201
1202 static_assert(
1203 AllArgsDecayedAreUnique<Args...>::value,
1204 "Found duplicate types among the arguments passed to set(...). "
1205 "Types should be listed at most once.");
1206
1207 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1208 }
1209
1221#ifndef NO_DOC
1222 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1223#else
1224 template<typename... Args>
1225#endif
1226 UserData copyWith(Args &&...args) const
1227 {
1228 using namespace Zivid::Detail::TypeTraits;
1229
1230 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1231 static_assert(
1232 AllArgsAreDescendantNodes::value,
1233 "All arguments passed to copyWith(...) must be descendant nodes.");
1234
1235 static_assert(
1236 AllArgsDecayedAreUnique<Args...>::value,
1237 "Found duplicate types among the arguments passed to copyWith(...). "
1238 "Types should be listed at most once.");
1239
1240 auto copy{ *this };
1241 copy.set(std::forward<Args>(args)...);
1242 return copy;
1243 }
1244
1247 {
1248 return m_maxSizeBytes;
1249 }
1250
1253 {
1254 return m_maxSizeBytes;
1255 }
1256
1259 {
1260 m_maxSizeBytes = value;
1261 return *this;
1262 }
1263
1264 template<
1265 typename T,
1266 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1268 {
1269 return m_maxSizeBytes;
1270 }
1271
1272 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1274 {
1275 return m_maxSizeBytes;
1276 }
1277
1279 template<typename F>
1280 void forEach(const F &f) const
1281 {
1282 f(m_maxSizeBytes);
1283 }
1284
1286 template<typename F>
1287 void forEach(const F &f)
1288 {
1289 f(m_maxSizeBytes);
1290 }
1291
1293 bool operator==(const UserData &other) const;
1294
1296 bool operator!=(const UserData &other) const;
1297
1299 std::string toString() const;
1300
1302 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1303 {
1304 return stream << value.toString();
1305 }
1306
1307 private:
1308 void setFromString(const std::string &value);
1309
1310 void setFromString(const std::string &fullPath, const std::string &value);
1311
1312 std::string getString(const std::string &fullPath) const;
1313
1314 MaxSizeBytes m_maxSizeBytes;
1315
1316 friend struct DataModel::Detail::Befriend<UserData>;
1317 };
1318
1319 using Descendants = std::tuple<
1330
1333
1335 explicit CameraInfo(const std::string &fileName);
1336
1342 ZIVID_NODISCARD static CameraInfo fromSerialized(const std::string &value);
1343
1349 std::string serialize() const;
1350
1371#ifndef NO_DOC
1372 template<
1373 typename... Args,
1374 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1375 typename std::enable_if<
1376 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1377 int>::type = 0>
1378#else
1379 template<typename... Args>
1380#endif
1381 explicit CameraInfo(Args &&...args)
1382 {
1383 using namespace Zivid::Detail::TypeTraits;
1384
1385 static_assert(
1386 AllArgsDecayedAreUnique<Args...>::value,
1387 "Found duplicate types among the arguments passed to CameraInfo(...). "
1388 "Types should be listed at most once.");
1389
1390 set(std::forward<Args>(args)...);
1391 }
1392
1412#ifndef NO_DOC
1413 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1414#else
1415 template<typename... Args>
1416#endif
1417 void set(Args &&...args)
1418 {
1419 using namespace Zivid::Detail::TypeTraits;
1420
1421 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1422 static_assert(
1423 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1424
1425 static_assert(
1426 AllArgsDecayedAreUnique<Args...>::value,
1427 "Found duplicate types among the arguments passed to set(...). "
1428 "Types should be listed at most once.");
1429
1430 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1431 }
1432
1453#ifndef NO_DOC
1454 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1455#else
1456 template<typename... Args>
1457#endif
1458 CameraInfo copyWith(Args &&...args) const
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 copyWith(...) must be descendant nodes.");
1465
1466 static_assert(
1467 AllArgsDecayedAreUnique<Args...>::value,
1468 "Found duplicate types among the arguments passed to copyWith(...). "
1469 "Types should be listed at most once.");
1470
1471 auto copy{ *this };
1472 copy.set(std::forward<Args>(args)...);
1473 return copy;
1474 }
1475
1478 {
1479 return m_firmwareVersion;
1480 }
1481
1484 {
1485 return m_firmwareVersion;
1486 }
1487
1490 {
1491 m_firmwareVersion = value;
1492 return *this;
1493 }
1494
1497 {
1498 return m_hardwareRevision;
1499 }
1500
1503 {
1504 return m_hardwareRevision;
1505 }
1506
1509 {
1510 m_hardwareRevision = value;
1511 return *this;
1512 }
1513
1515 const Model &model() const
1516 {
1517 return m_model;
1518 }
1519
1522 {
1523 return m_model;
1524 }
1525
1527 CameraInfo &set(const Model &value)
1528 {
1529 m_model = value;
1530 return *this;
1531 }
1532
1534 const ModelName &modelName() const
1535 {
1536 return m_modelName;
1537 }
1538
1541 {
1542 return m_modelName;
1543 }
1544
1546 CameraInfo &set(const ModelName &value)
1547 {
1548 m_modelName = value;
1549 return *this;
1550 }
1551
1553 const Revision &revision() const
1554 {
1555 return m_revision;
1556 }
1557
1560 {
1561 return m_revision;
1562 }
1563
1565 CameraInfo &set(const Revision &value)
1566 {
1567 m_revision = value;
1568 return *this;
1569 }
1570
1573 {
1574 m_revision.set(value);
1575 return *this;
1576 }
1577
1580 {
1581 m_revision.set(value);
1582 return *this;
1583 }
1584
1587 {
1588 return m_serialNumber;
1589 }
1590
1593 {
1594 return m_serialNumber;
1595 }
1596
1599 {
1600 m_serialNumber = value;
1601 return *this;
1602 }
1603
1605 const UserData &userData() const
1606 {
1607 return m_userData;
1608 }
1609
1612 {
1613 return m_userData;
1614 }
1615
1617 CameraInfo &set(const UserData &value)
1618 {
1619 m_userData = value;
1620 return *this;
1621 }
1622
1625 {
1626 m_userData.set(value);
1627 return *this;
1628 }
1629
1630 template<
1631 typename T,
1632 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1634 {
1635 return m_firmwareVersion;
1636 }
1637
1638 template<
1639 typename T,
1640 typename std::enable_if<std::is_same<T, CameraInfo::HardwareRevision>::value, int>::type = 0>
1642 {
1643 return m_hardwareRevision;
1644 }
1645
1646 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1647 const CameraInfo::Model &get() const
1648 {
1649 return m_model;
1650 }
1651
1652 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1654 {
1655 return m_modelName;
1656 }
1657
1658 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1660 {
1661 return m_revision;
1662 }
1663
1664 template<
1665 typename T,
1666 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1668 {
1669 return m_revision.get<CameraInfo::Revision::Major>();
1670 }
1671
1672 template<
1673 typename T,
1674 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1676 {
1677 return m_revision.get<CameraInfo::Revision::Minor>();
1678 }
1679
1680 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1682 {
1683 return m_serialNumber;
1684 }
1685
1686 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1688 {
1689 return m_userData;
1690 }
1691
1692 template<
1693 typename T,
1694 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1696 {
1697 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1698 }
1699
1700 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1702 {
1703 return m_firmwareVersion;
1704 }
1705
1706 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1708 {
1709 return m_hardwareRevision;
1710 }
1711
1712 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1713 const CameraInfo::Model &get() const
1714 {
1715 return m_model;
1716 }
1717
1718 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1720 {
1721 return m_modelName;
1722 }
1723
1724 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1726 {
1727 return m_revision;
1728 }
1729
1730 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1732 {
1733 return m_serialNumber;
1734 }
1735
1736 template<size_t i, typename std::enable_if<i == 6, int>::type = 0>
1738 {
1739 return m_userData;
1740 }
1741
1743 template<typename F>
1744 void forEach(const F &f) const
1745 {
1746 f(m_firmwareVersion);
1747 f(m_hardwareRevision);
1748 f(m_model);
1749 f(m_modelName);
1750 f(m_revision);
1751 f(m_serialNumber);
1752 f(m_userData);
1753 }
1754
1756 template<typename F>
1757 void forEach(const F &f)
1758 {
1759 f(m_firmwareVersion);
1760 f(m_hardwareRevision);
1761 f(m_model);
1762 f(m_modelName);
1763 f(m_revision);
1764 f(m_serialNumber);
1765 f(m_userData);
1766 }
1767
1769 bool operator==(const CameraInfo &other) const;
1770
1772 bool operator!=(const CameraInfo &other) const;
1773
1775 std::string toString() const;
1776
1778 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1779 {
1780 return stream << value.toString();
1781 }
1782
1784 void save(const std::string &fileName) const;
1785
1787 void load(const std::string &fileName);
1788
1789 private:
1790 void setFromString(const std::string &value);
1791
1792 void setFromString(const std::string &fullPath, const std::string &value);
1793
1794 std::string getString(const std::string &fullPath) const;
1795
1796 FirmwareVersion m_firmwareVersion;
1797 HardwareRevision m_hardwareRevision;
1798 Model m_model;
1799 ModelName m_modelName;
1800 Revision m_revision;
1801 SerialNumber m_serialNumber;
1802 UserData m_userData;
1803
1804 friend struct DataModel::Detail::Befriend<CameraInfo>;
1805 };
1806
1807#ifndef NO_DOC
1809 namespace Detail
1810 {
1811 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1812 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1813 } // namespace Detail
1814#endif
1815
1816#ifndef NO_DOC
1817 template<>
1818 struct CameraInfo::Version<5>
1819 {
1820 using Type = CameraInfo;
1821 };
1822#endif
1823
1824} // namespace Zivid
1825
1826#ifdef _MSC_VER
1827# pragma warning(pop)
1828#endif
1829
1830#ifndef NO_DOC
1831# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1832namespace std // NOLINT
1833{
1834
1835 template<>
1836 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1837 {};
1838
1839 template<size_t i>
1840 struct tuple_element<i, Zivid::CameraInfo::Revision>
1841 {
1842 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1843
1844 using type // NOLINT
1845 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1846 };
1847
1848 template<>
1849 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1850 {};
1851
1852 template<size_t i>
1853 struct tuple_element<i, Zivid::CameraInfo::UserData>
1854 {
1855 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1856
1857 using type // NOLINT
1858 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1859 };
1860
1861 template<>
1862 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 7>
1863 {};
1864
1865 template<size_t i>
1866 struct tuple_element<i, Zivid::CameraInfo>
1867 {
1868 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 7");
1869
1870 using type // NOLINT
1871 = decltype(declval<Zivid::CameraInfo>().get<i>());
1872 };
1873
1874} // namespace std
1875# endif
1876#endif
1877
1878// If we have access to the DataModel library, automatically include internal DataModel
1879// header. This header is necessary for serialization and deserialization.
1880#if defined(__has_include) && !defined(NO_DOC)
1881# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1882# include "Zivid/CameraInfoInternal.h"
1883# endif
1884#endif
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
The firmware version on the camera.
Definition CameraInfo.h:113
std::string toString() const
Get the value as string.
bool operator==(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:151
FirmwareVersion(std::string value)
Constructor.
Definition CameraInfo.h:140
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion.
Definition CameraInfo.h:131
bool operator<(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:163
bool operator<=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:175
bool operator>=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:181
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:187
bool operator>(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:169
bool operator!=(const FirmwareVersion &other) const
Comparison operator.
Definition CameraInfo.h:157
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:128
FirmwareVersion()=default
Default constructor.
Hardware revision of this camera. This corresponds to the revision string that is printed on the prod...
Definition CameraInfo.h:206
HardwareRevision()=default
Default constructor.
bool operator!=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:254
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for HardwareRevision.
Definition CameraInfo.h:228
bool operator==(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:248
bool operator>(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:266
const std::string & value() const
Get the value.
bool operator<(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:260
friend std::ostream & operator<<(std::ostream &stream, const HardwareRevision &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:284
HardwareRevision(std::string value)
Constructor.
Definition CameraInfo.h:237
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:225
bool operator<=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:272
bool operator>=(const HardwareRevision &other) const
Comparison operator.
Definition CameraInfo.h:278
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:409
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:451
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:475
std::string toString() const
Get the value as string.
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:440
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:428
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:463
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:469
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:487
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:431
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:481
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:457
The model of the camera.
Definition CameraInfo.h:301
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:327
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:332
static const Model zividTwo
zividTwo
Definition CameraInfo.h:330
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:334
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:348
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:328
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:359
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:333
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:377
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:337
ValueType
The type of the underlying value.
Definition CameraInfo.h:317
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:329
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:371
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:331
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:365
Major hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:530
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:578
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:549
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:608
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:552
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:602
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:596
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:590
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:561
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:584
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:572
Minor hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:627
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:687
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:675
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:693
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:658
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:646
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:705
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:669
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:699
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:681
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:649
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:506
const Major & major() const
Get Major.
Definition CameraInfo.h:827
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:807
Minor & minor()
Get Minor.
Definition CameraInfo.h:852
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:858
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:718
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:839
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:875
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:846
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:902
Major & major()
Get Major.
Definition CameraInfo.h:833
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:867
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:894
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:918
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:774
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:940
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:967
const std::string & value() const
Get the value.
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:978
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:955
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:1014
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:996
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:990
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1002
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:958
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1008
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:984
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:1051
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1097
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1115
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1109
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:1080
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1103
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1091
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:1127
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:1071
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:1068
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1121
Information about user data capabilities of the camera.
Definition CameraInfo.h:1031
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:1287
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1252
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:1226
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1302
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:1280
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1267
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1140
bool operator!=(const UserData &other) const
Inequality operator.
UserData()
Default constructor.
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1246
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1258
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1194
Information about camera model, serial number etc.
Definition CameraInfo.h:79
bool operator==(const CameraInfo &other) const
Equality operator.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1559
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1534
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1483
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1757
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1605
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1540
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1527
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1633
const CameraInfo::Model & get() const
Definition CameraInfo.h:1647
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1611
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1546
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1477
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1695
const Model & model() const
Get Model.
Definition CameraInfo.h:1515
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:1458
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:1744
Model & model()
Get Model.
Definition CameraInfo.h:1521
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1778
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1653
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1617
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1624
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1381
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1687
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1675
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1586
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1592
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1553
CameraInfo & set(const HardwareRevision &value)
Set HardwareRevision.
Definition CameraInfo.h:1508
const CameraInfo::HardwareRevision & get() const
Definition CameraInfo.h:1641
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1489
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1667
const HardwareRevision & hardwareRevision() const
Get HardwareRevision.
Definition CameraInfo.h:1496
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1417
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1565
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1572
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:1319
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1598
std::string serialize() const
Serialize to a string.
HardwareRevision & hardwareRevision()
Get HardwareRevision.
Definition CameraInfo.h:1502
static ZIVID_NODISCARD CameraInfo fromSerialized(const std::string &value)
Construct a new CameraInfo instance from a previously serialized string.
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1681
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1659
std::string toString() const
Get the value as string.
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1579
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:56