Zivid C++ API 2.14.0+e4a0c4a9-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{ 6 };
95
96#ifndef NO_DOC
97 template<size_t>
98 struct Version;
99
100 using LatestVersion = Zivid::CameraInfo;
101
102 // Short identifier. This value is not guaranteed to be universally unique
103 // Todo(ZIVID-2808): Move this to internal DataModelExt header
104 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
105
106#endif
107
109
110 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
112 {
113 public:
115 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
116
118 static constexpr const char *path{ "FirmwareVersion" };
119
121 static constexpr const char *name{ "FirmwareVersion" };
122
124 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
125
127 using ValueType = std::string;
128
131 {
132 return { 0, 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 zivid2PlusMR130,
326 zivid2PlusMR60,
327 zivid2PlusLR110
328 };
332 static const Model zividTwo;
333 static const Model zividTwoL100;
334 static const Model zivid2PlusM130;
335 static const Model zivid2PlusM60;
336 static const Model zivid2PlusL110;
337 static const Model zivid2PlusMR130;
338 static const Model zivid2PlusMR60;
339 static const Model zivid2PlusLR110;
340
342 static std::set<ValueType> validValues()
343 {
344 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
345 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
346 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110, ValueType::zivid2PlusMR130,
347 ValueType::zivid2PlusMR60, ValueType::zivid2PlusLR110 };
348 }
349
351 Model() = default;
352
354 explicit constexpr Model(ValueType value)
355 : m_value{ verifyValue(value) }
356 {}
357
360
362 std::string toString() const;
363
365 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
366 {
367 return stream << Model{ value }.toString();
368 }
369
371 bool operator==(const Model &other) const
372 {
373 return m_value == other.m_value;
374 }
375
377 bool operator!=(const Model &other) const
378 {
379 return m_value != other.m_value;
380 }
381
383 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
384 {
385 return stream << value.toString();
386 }
387
388 private:
389 void setFromString(const std::string &value);
390
391 constexpr ValueType static verifyValue(const ValueType &value)
392 {
393 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
394 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
395 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
396 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
397 || value == ValueType::zivid2PlusMR130 || value == ValueType::zivid2PlusMR60
398 || value == ValueType::zivid2PlusLR110
399 ? value
400 : throw std::invalid_argument{
401 "Invalid value: Model{ "
402 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
403 };
404 }
405
406 ValueType m_value{ ValueType::zividOnePlusSmall };
407
408 friend struct DataModel::Detail::Befriend<Model>;
409 };
410
414
415 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
417 {
418 public:
420 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
421
423 static constexpr const char *path{ "ModelName" };
424
426 static constexpr const char *name{ "ModelName" };
427
429 static constexpr const char *description{
430 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
431characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
432)description"
433 };
434
436 using ValueType = std::string;
437
440 {
441 return { 0, std::numeric_limits<ValueType::size_type>::max() };
442 }
443
445 ModelName() = default;
446
448 explicit ModelName(std::string value)
449 : m_value{ std::move(value) }
450 {}
451
453 const std::string &value() const;
454
456 std::string toString() const;
457
459 bool operator==(const ModelName &other) const
460 {
461 return m_value == other.m_value;
462 }
463
465 bool operator!=(const ModelName &other) const
466 {
467 return m_value != other.m_value;
468 }
469
471 bool operator<(const ModelName &other) const
472 {
473 return m_value < other.m_value;
474 }
475
477 bool operator>(const ModelName &other) const
478 {
479 return m_value > other.m_value;
480 }
481
483 bool operator<=(const ModelName &other) const
484 {
485 return m_value <= other.m_value;
486 }
487
489 bool operator>=(const ModelName &other) const
490 {
491 return m_value >= other.m_value;
492 }
493
495 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
496 {
497 return stream << value.toString();
498 }
499
500 private:
501 void setFromString(const std::string &value);
502
503 std::string m_value{};
504
505 friend struct DataModel::Detail::Befriend<ModelName>;
506 };
507
511
512 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
514 {
515 public:
517 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
518
520 static constexpr const char *path{ "Revision" };
521
523 static constexpr const char *name{ "Revision" };
524
526 static constexpr const char *description{
527 R"description(Major/Minor hardware revision number. This field is deprecated and may be removed in a future version
528of the SDK. Please use HardwareRevision instead.
529)description"
530 };
531
535
536 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
538 {
539 public:
541 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
542
544 static constexpr const char *path{ "Revision/Major" };
545
547 static constexpr const char *name{ "Major" };
548
550 static constexpr const char *description{
551 R"description(Major hardware revision number. This field is deprecated and may be removed in a future version
552of the SDK. Please use HardwareRevision instead.
553)description"
554 };
555
557 using ValueType = uint32_t;
558
560 static constexpr Range<uint32_t> validRange()
561 {
562 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
563 }
564
566 Major() = default;
567
569 explicit constexpr Major(uint32_t value)
570 : m_value{ value }
571 {}
572
574 uint32_t value() const;
575
577 std::string toString() const;
578
580 bool operator==(const Major &other) const
581 {
582 return m_value == other.m_value;
583 }
584
586 bool operator!=(const Major &other) const
587 {
588 return m_value != other.m_value;
589 }
590
592 bool operator<(const Major &other) const
593 {
594 return m_value < other.m_value;
595 }
596
598 bool operator>(const Major &other) const
599 {
600 return m_value > other.m_value;
601 }
602
604 bool operator<=(const Major &other) const
605 {
606 return m_value <= other.m_value;
607 }
608
610 bool operator>=(const Major &other) const
611 {
612 return m_value >= other.m_value;
613 }
614
616 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
617 {
618 return stream << value.toString();
619 }
620
621 private:
622 void setFromString(const std::string &value);
623
624 uint32_t m_value{ 0 };
625
626 friend struct DataModel::Detail::Befriend<Major>;
627 };
628
632
633 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
635 {
636 public:
638 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
639
641 static constexpr const char *path{ "Revision/Minor" };
642
644 static constexpr const char *name{ "Minor" };
645
647 static constexpr const char *description{
648 R"description(Minor hardware revision number. This field is deprecated and may be removed in a future version
649of the SDK. Please use HardwareRevision instead.
650)description"
651 };
652
654 using ValueType = uint32_t;
655
657 static constexpr Range<uint32_t> validRange()
658 {
659 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
660 }
661
663 Minor() = default;
664
666 explicit constexpr Minor(uint32_t value)
667 : m_value{ value }
668 {}
669
671 uint32_t value() const;
672
674 std::string toString() const;
675
677 bool operator==(const Minor &other) const
678 {
679 return m_value == other.m_value;
680 }
681
683 bool operator!=(const Minor &other) const
684 {
685 return m_value != other.m_value;
686 }
687
689 bool operator<(const Minor &other) const
690 {
691 return m_value < other.m_value;
692 }
693
695 bool operator>(const Minor &other) const
696 {
697 return m_value > other.m_value;
698 }
699
701 bool operator<=(const Minor &other) const
702 {
703 return m_value <= other.m_value;
704 }
705
707 bool operator>=(const Minor &other) const
708 {
709 return m_value >= other.m_value;
710 }
711
713 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
714 {
715 return stream << value.toString();
716 }
717
718 private:
719 void setFromString(const std::string &value);
720
721 uint32_t m_value{ 0 };
722
723 friend struct DataModel::Detail::Befriend<Minor>;
724 };
725
726 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
727
730
743#ifndef NO_DOC
744 template<
745 typename... Args,
746 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
747 typename std::enable_if<
748 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
749 value,
750 int>::type = 0>
751#else
752 template<typename... Args>
753#endif
754 explicit Revision(Args &&...args)
755 {
756 using namespace Zivid::Detail::TypeTraits;
757
758 static_assert(
759 AllArgsDecayedAreUnique<Args...>::value,
760 "Found duplicate types among the arguments passed to Revision(...). "
761 "Types should be listed at most once.");
762
763 set(std::forward<Args>(args)...);
764 }
765
777#ifndef NO_DOC
778 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
779#else
780 template<typename... Args>
781#endif
782 void set(Args &&...args)
783 {
784 using namespace Zivid::Detail::TypeTraits;
785
786 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
787 static_assert(
788 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
789
790 static_assert(
791 AllArgsDecayedAreUnique<Args...>::value,
792 "Found duplicate types among the arguments passed to set(...). "
793 "Types should be listed at most once.");
794
795 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
796 }
797
810#ifndef NO_DOC
811 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
812#else
813 template<typename... Args>
814#endif
815 Revision copyWith(Args &&...args) const
816 {
817 using namespace Zivid::Detail::TypeTraits;
818
819 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
820 static_assert(
821 AllArgsAreDescendantNodes::value,
822 "All arguments passed to copyWith(...) must be descendant nodes.");
823
824 static_assert(
825 AllArgsDecayedAreUnique<Args...>::value,
826 "Found duplicate types among the arguments passed to copyWith(...). "
827 "Types should be listed at most once.");
828
829 auto copy{ *this };
830 copy.set(std::forward<Args>(args)...);
831 return copy;
832 }
833
835 const Major &major() const
836 {
837 return m_major;
838 }
839
842 {
843 return m_major;
844 }
845
847 Revision &set(const Major &value)
848 {
849 m_major = value;
850 return *this;
851 }
852
854 const Minor &minor() const
855 {
856 return m_minor;
857 }
858
861 {
862 return m_minor;
863 }
864
866 Revision &set(const Minor &value)
867 {
868 m_minor = value;
869 return *this;
870 }
871
872 template<
873 typename T,
874 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
876 {
877 return m_major;
878 }
879
880 template<
881 typename T,
882 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
884 {
885 return m_minor;
886 }
887
888 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
890 {
891 return m_major;
892 }
893
894 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
896 {
897 return m_minor;
898 }
899
901 template<typename F>
902 void forEach(const F &f) const
903 {
904 f(m_major);
905 f(m_minor);
906 }
907
909 template<typename F>
910 void forEach(const F &f)
911 {
912 f(m_major);
913 f(m_minor);
914 }
915
917 bool operator==(const Revision &other) const;
918
920 bool operator!=(const Revision &other) const;
921
923 std::string toString() const;
924
926 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
927 {
928 return stream << value.toString();
929 }
930
931 private:
932 void setFromString(const std::string &value);
933
934 void setFromString(const std::string &fullPath, const std::string &value);
935
936 std::string getString(const std::string &fullPath) const;
937
938 Major m_major;
939 Minor m_minor;
940
941 friend struct DataModel::Detail::Befriend<Revision>;
942 };
943
945
946 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
948 {
949 public:
951 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
952
954 static constexpr const char *path{ "SerialNumber" };
955
957 static constexpr const char *name{ "SerialNumber" };
958
960 static constexpr const char *description{ R"description(The serial number of the camera)description" };
961
963 using ValueType = std::string;
964
967 {
968 return { 0, std::numeric_limits<ValueType::size_type>::max() };
969 }
970
972 SerialNumber() = default;
973
975 explicit SerialNumber(std::string value)
976 : m_value{ std::move(value) }
977 {}
978
980 const std::string &value() const;
981
983 std::string toString() const;
984
986 bool operator==(const SerialNumber &other) const
987 {
988 return m_value == other.m_value;
989 }
990
992 bool operator!=(const SerialNumber &other) const
993 {
994 return m_value != other.m_value;
995 }
996
998 bool operator<(const SerialNumber &other) const
999 {
1000 return m_value < other.m_value;
1001 }
1002
1004 bool operator>(const SerialNumber &other) const
1005 {
1006 return m_value > other.m_value;
1007 }
1008
1010 bool operator<=(const SerialNumber &other) const
1011 {
1012 return m_value <= other.m_value;
1013 }
1014
1016 bool operator>=(const SerialNumber &other) const
1017 {
1018 return m_value >= other.m_value;
1019 }
1020
1022 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
1023 {
1024 return stream << value.toString();
1025 }
1026
1027 private:
1028 void setFromString(const std::string &value);
1029
1030 std::string m_value{};
1031
1032 friend struct DataModel::Detail::Befriend<SerialNumber>;
1033 };
1034
1036
1037 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1039 {
1040 public:
1042 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::group;
1043
1045 static constexpr const char *path{ "UserData" };
1046
1048 static constexpr const char *name{ "UserData" };
1049
1051 static constexpr const char *description{
1052 R"description(Information about user data capabilities of the camera)description"
1053 };
1054
1056
1057 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1059 {
1060 public:
1062 static constexpr DataModel::NodeType nodeType = DataModel::NodeType::leafValue;
1063
1065 static constexpr const char *path{ "UserData/MaxSizeBytes" };
1066
1068 static constexpr const char *name{ "MaxSizeBytes" };
1069
1071 static constexpr const char *description{
1072 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
1073 };
1074
1076 using ValueType = uint64_t;
1077
1079 static constexpr Range<uint64_t> validRange()
1080 {
1081 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1082 }
1083
1085 MaxSizeBytes() = default;
1086
1088 explicit constexpr MaxSizeBytes(uint64_t value)
1089 : m_value{ value }
1090 {}
1091
1093 uint64_t value() const;
1094
1096 std::string toString() const;
1097
1099 bool operator==(const MaxSizeBytes &other) const
1100 {
1101 return m_value == other.m_value;
1102 }
1103
1105 bool operator!=(const MaxSizeBytes &other) const
1106 {
1107 return m_value != other.m_value;
1108 }
1109
1111 bool operator<(const MaxSizeBytes &other) const
1112 {
1113 return m_value < other.m_value;
1114 }
1115
1117 bool operator>(const MaxSizeBytes &other) const
1118 {
1119 return m_value > other.m_value;
1120 }
1121
1123 bool operator<=(const MaxSizeBytes &other) const
1124 {
1125 return m_value <= other.m_value;
1126 }
1127
1129 bool operator>=(const MaxSizeBytes &other) const
1130 {
1131 return m_value >= other.m_value;
1132 }
1133
1135 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1136 {
1137 return stream << value.toString();
1138 }
1139
1140 private:
1141 void setFromString(const std::string &value);
1142
1143 uint64_t m_value{ 0 };
1144
1145 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1146 };
1147
1148 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1149
1152
1164#ifndef NO_DOC
1165 template<
1166 typename... Args,
1167 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1168 typename std::enable_if<
1169 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1170 value,
1171 int>::type = 0>
1172#else
1173 template<typename... Args>
1174#endif
1175 explicit UserData(Args &&...args)
1176 {
1177 using namespace Zivid::Detail::TypeTraits;
1178
1179 static_assert(
1180 AllArgsDecayedAreUnique<Args...>::value,
1181 "Found duplicate types among the arguments passed to UserData(...). "
1182 "Types should be listed at most once.");
1183
1184 set(std::forward<Args>(args)...);
1185 }
1186
1197#ifndef NO_DOC
1198 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1199#else
1200 template<typename... Args>
1201#endif
1202 void set(Args &&...args)
1203 {
1204 using namespace Zivid::Detail::TypeTraits;
1205
1206 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1207 static_assert(
1208 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1209
1210 static_assert(
1211 AllArgsDecayedAreUnique<Args...>::value,
1212 "Found duplicate types among the arguments passed to set(...). "
1213 "Types should be listed at most once.");
1214
1215 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1216 }
1217
1229#ifndef NO_DOC
1230 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1231#else
1232 template<typename... Args>
1233#endif
1234 UserData copyWith(Args &&...args) const
1235 {
1236 using namespace Zivid::Detail::TypeTraits;
1237
1238 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1239 static_assert(
1240 AllArgsAreDescendantNodes::value,
1241 "All arguments passed to copyWith(...) must be descendant nodes.");
1242
1243 static_assert(
1244 AllArgsDecayedAreUnique<Args...>::value,
1245 "Found duplicate types among the arguments passed to copyWith(...). "
1246 "Types should be listed at most once.");
1247
1248 auto copy{ *this };
1249 copy.set(std::forward<Args>(args)...);
1250 return copy;
1251 }
1252
1255 {
1256 return m_maxSizeBytes;
1257 }
1258
1261 {
1262 return m_maxSizeBytes;
1263 }
1264
1267 {
1268 m_maxSizeBytes = value;
1269 return *this;
1270 }
1271
1272 template<
1273 typename T,
1274 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1276 {
1277 return m_maxSizeBytes;
1278 }
1279
1280 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1282 {
1283 return m_maxSizeBytes;
1284 }
1285
1287 template<typename F>
1288 void forEach(const F &f) const
1289 {
1290 f(m_maxSizeBytes);
1291 }
1292
1294 template<typename F>
1295 void forEach(const F &f)
1296 {
1297 f(m_maxSizeBytes);
1298 }
1299
1301 bool operator==(const UserData &other) const;
1302
1304 bool operator!=(const UserData &other) const;
1305
1307 std::string toString() const;
1308
1310 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1311 {
1312 return stream << value.toString();
1313 }
1314
1315 private:
1316 void setFromString(const std::string &value);
1317
1318 void setFromString(const std::string &fullPath, const std::string &value);
1319
1320 std::string getString(const std::string &fullPath) const;
1321
1322 MaxSizeBytes m_maxSizeBytes;
1323
1324 friend struct DataModel::Detail::Befriend<UserData>;
1325 };
1326
1327 using Descendants = std::tuple<
1338
1341
1343 explicit CameraInfo(const std::string &fileName);
1344
1350 [[nodiscard]] static CameraInfo fromSerialized(const std::string &value);
1351
1357 std::string serialize() const;
1358
1379#ifndef NO_DOC
1380 template<
1381 typename... Args,
1382 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1383 typename std::enable_if<
1384 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1385 int>::type = 0>
1386#else
1387 template<typename... Args>
1388#endif
1389 explicit CameraInfo(Args &&...args)
1390 {
1391 using namespace Zivid::Detail::TypeTraits;
1392
1393 static_assert(
1394 AllArgsDecayedAreUnique<Args...>::value,
1395 "Found duplicate types among the arguments passed to CameraInfo(...). "
1396 "Types should be listed at most once.");
1397
1398 set(std::forward<Args>(args)...);
1399 }
1400
1420#ifndef NO_DOC
1421 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1422#else
1423 template<typename... Args>
1424#endif
1425 void set(Args &&...args)
1426 {
1427 using namespace Zivid::Detail::TypeTraits;
1428
1429 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1430 static_assert(
1431 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1432
1433 static_assert(
1434 AllArgsDecayedAreUnique<Args...>::value,
1435 "Found duplicate types among the arguments passed to set(...). "
1436 "Types should be listed at most once.");
1437
1438 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1439 }
1440
1461#ifndef NO_DOC
1462 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1463#else
1464 template<typename... Args>
1465#endif
1466 CameraInfo copyWith(Args &&...args) const
1467 {
1468 using namespace Zivid::Detail::TypeTraits;
1469
1470 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1471 static_assert(
1472 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1473
1474 static_assert(
1475 AllArgsDecayedAreUnique<Args...>::value,
1476 "Found duplicate types among the arguments passed to copyWith(...). "
1477 "Types should be listed at most once.");
1478
1479 auto copy{ *this };
1480 copy.set(std::forward<Args>(args)...);
1481 return copy;
1482 }
1483
1486 {
1487 return m_firmwareVersion;
1488 }
1489
1492 {
1493 return m_firmwareVersion;
1494 }
1495
1498 {
1499 m_firmwareVersion = value;
1500 return *this;
1501 }
1502
1505 {
1506 return m_hardwareRevision;
1507 }
1508
1511 {
1512 return m_hardwareRevision;
1513 }
1514
1517 {
1518 m_hardwareRevision = value;
1519 return *this;
1520 }
1521
1523 const Model &model() const
1524 {
1525 return m_model;
1526 }
1527
1530 {
1531 return m_model;
1532 }
1533
1535 CameraInfo &set(const Model &value)
1536 {
1537 m_model = value;
1538 return *this;
1539 }
1540
1542 const ModelName &modelName() const
1543 {
1544 return m_modelName;
1545 }
1546
1549 {
1550 return m_modelName;
1551 }
1552
1554 CameraInfo &set(const ModelName &value)
1555 {
1556 m_modelName = value;
1557 return *this;
1558 }
1559
1561 const Revision &revision() const
1562 {
1563 return m_revision;
1564 }
1565
1568 {
1569 return m_revision;
1570 }
1571
1573 CameraInfo &set(const Revision &value)
1574 {
1575 m_revision = value;
1576 return *this;
1577 }
1578
1581 {
1582 m_revision.set(value);
1583 return *this;
1584 }
1585
1588 {
1589 m_revision.set(value);
1590 return *this;
1591 }
1592
1595 {
1596 return m_serialNumber;
1597 }
1598
1601 {
1602 return m_serialNumber;
1603 }
1604
1607 {
1608 m_serialNumber = value;
1609 return *this;
1610 }
1611
1613 const UserData &userData() const
1614 {
1615 return m_userData;
1616 }
1617
1620 {
1621 return m_userData;
1622 }
1623
1625 CameraInfo &set(const UserData &value)
1626 {
1627 m_userData = value;
1628 return *this;
1629 }
1630
1633 {
1634 m_userData.set(value);
1635 return *this;
1636 }
1637
1638 template<
1639 typename T,
1640 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1642 {
1643 return m_firmwareVersion;
1644 }
1645
1646 template<
1647 typename T,
1648 typename std::enable_if<std::is_same<T, CameraInfo::HardwareRevision>::value, int>::type = 0>
1650 {
1651 return m_hardwareRevision;
1652 }
1653
1654 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1655 const CameraInfo::Model &get() const
1656 {
1657 return m_model;
1658 }
1659
1660 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1662 {
1663 return m_modelName;
1664 }
1665
1666 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1668 {
1669 return m_revision;
1670 }
1671
1672 template<
1673 typename T,
1674 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1676 {
1677 return m_revision.get<CameraInfo::Revision::Major>();
1678 }
1679
1680 template<
1681 typename T,
1682 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1684 {
1685 return m_revision.get<CameraInfo::Revision::Minor>();
1686 }
1687
1688 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1690 {
1691 return m_serialNumber;
1692 }
1693
1694 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1696 {
1697 return m_userData;
1698 }
1699
1700 template<
1701 typename T,
1702 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1704 {
1705 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1706 }
1707
1708 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1710 {
1711 return m_firmwareVersion;
1712 }
1713
1714 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1716 {
1717 return m_hardwareRevision;
1718 }
1719
1720 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1721 const CameraInfo::Model &get() const
1722 {
1723 return m_model;
1724 }
1725
1726 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1728 {
1729 return m_modelName;
1730 }
1731
1732 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1734 {
1735 return m_revision;
1736 }
1737
1738 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1740 {
1741 return m_serialNumber;
1742 }
1743
1744 template<size_t i, typename std::enable_if<i == 6, int>::type = 0>
1746 {
1747 return m_userData;
1748 }
1749
1751 template<typename F>
1752 void forEach(const F &f) const
1753 {
1754 f(m_firmwareVersion);
1755 f(m_hardwareRevision);
1756 f(m_model);
1757 f(m_modelName);
1758 f(m_revision);
1759 f(m_serialNumber);
1760 f(m_userData);
1761 }
1762
1764 template<typename F>
1765 void forEach(const F &f)
1766 {
1767 f(m_firmwareVersion);
1768 f(m_hardwareRevision);
1769 f(m_model);
1770 f(m_modelName);
1771 f(m_revision);
1772 f(m_serialNumber);
1773 f(m_userData);
1774 }
1775
1777 bool operator==(const CameraInfo &other) const;
1778
1780 bool operator!=(const CameraInfo &other) const;
1781
1783 std::string toString() const;
1784
1786 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1787 {
1788 return stream << value.toString();
1789 }
1790
1792 void save(const std::string &fileName) const;
1793
1795 void load(const std::string &fileName);
1796
1797 private:
1798 void setFromString(const std::string &value);
1799
1800 void setFromString(const std::string &fullPath, const std::string &value);
1801
1802 std::string getString(const std::string &fullPath) const;
1803
1804 FirmwareVersion m_firmwareVersion;
1805 HardwareRevision m_hardwareRevision;
1806 Model m_model;
1807 ModelName m_modelName;
1808 Revision m_revision;
1809 SerialNumber m_serialNumber;
1810 UserData m_userData;
1811
1812 friend struct DataModel::Detail::Befriend<CameraInfo>;
1813 };
1814
1815#ifndef NO_DOC
1816 template<>
1817 struct CameraInfo::Version<6>
1818 {
1819 using Type = CameraInfo;
1820 };
1821#endif
1822
1823} // namespace Zivid
1824
1825#ifndef NO_DOC
1827namespace Zivid::Detail
1828{
1829
1830 ZIVID_CORE_EXPORT void save(const Zivid::CameraInfo &dataModel, std::ostream &ostream);
1831 ZIVID_CORE_EXPORT void load(Zivid::CameraInfo &dataModel, std::istream &istream);
1832
1833 ZIVID_CORE_EXPORT std::vector<uint8_t> serializeToBinaryVector(const Zivid::CameraInfo &source);
1834 ZIVID_CORE_EXPORT void deserializeFromBinaryVector(Zivid::CameraInfo &dest, const std::vector<uint8_t> &data);
1835
1836} // namespace Zivid::Detail
1837#endif
1838
1839#ifdef _MSC_VER
1840# pragma warning(pop)
1841#endif
1842
1843#ifndef NO_DOC
1844# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1845namespace std // NOLINT
1846{
1847
1848 template<>
1849 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1850 {};
1851
1852 template<size_t i>
1853 struct tuple_element<i, Zivid::CameraInfo::Revision>
1854 {
1855 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1856
1857 using type // NOLINT
1858 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1859 };
1860
1861 template<>
1862 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1863 {};
1864
1865 template<size_t i>
1866 struct tuple_element<i, Zivid::CameraInfo::UserData>
1867 {
1868 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1869
1870 using type // NOLINT
1871 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1872 };
1873
1874 template<>
1875 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 7>
1876 {};
1877
1878 template<size_t i>
1879 struct tuple_element<i, Zivid::CameraInfo>
1880 {
1881 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 7");
1882
1883 using type // NOLINT
1884 = decltype(declval<Zivid::CameraInfo>().get<i>());
1885 };
1886
1887} // namespace std
1888# endif
1889#endif
1890
1891// If we have access to the DataModel library, automatically include internal DataModel
1892// header. This header is necessary for serialization and deserialization.
1893#if defined(__has_include) && !defined(NO_DOC)
1894# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1895# include "Zivid/CameraInfoInternal.h"
1896# endif
1897#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:417
bool operator==(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:459
ModelName()=default
Default constructor.
bool operator<=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:483
std::string toString() const
Get the value as string.
ModelName(std::string value)
Constructor.
Definition CameraInfo.h:448
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:436
bool operator<(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:471
bool operator>(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:477
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:495
const std::string & value() const
Get the value.
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName.
Definition CameraInfo.h:439
bool operator>=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:489
bool operator!=(const ModelName &other) const
Comparison operator.
Definition CameraInfo.h:465
The model of the camera.
Definition CameraInfo.h:300
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition CameraInfo.h:329
static const Model zivid2PlusMR60
zivid2PlusMR60
Definition CameraInfo.h:338
static const Model zivid2PlusM130
zivid2PlusM130
Definition CameraInfo.h:334
static const Model zividTwo
zividTwo
Definition CameraInfo.h:332
static const Model zivid2PlusL110
zivid2PlusL110
Definition CameraInfo.h:336
std::string toString() const
Get the value as string.
constexpr Model(ValueType value)
Constructor.
Definition CameraInfo.h:354
Model()=default
Default constructor.
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition CameraInfo.h:330
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:365
static const Model zivid2PlusM60
zivid2PlusM60
Definition CameraInfo.h:335
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:383
static const Model zivid2PlusLR110
zivid2PlusLR110
Definition CameraInfo.h:339
static std::set< ValueType > validValues()
All valid values of Model.
Definition CameraInfo.h:342
ValueType
The type of the underlying value.
Definition CameraInfo.h:316
static const Model zivid2PlusMR130
zivid2PlusMR130
Definition CameraInfo.h:337
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition CameraInfo.h:331
bool operator!=(const Model &other) const
Comparison operator.
Definition CameraInfo.h:377
static const Model zividTwoL100
zividTwoL100
Definition CameraInfo.h:333
bool operator==(const Model &other) const
Comparison operator.
Definition CameraInfo.h:371
Major hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:538
std::string toString() const
Get the value as string.
bool operator!=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:586
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:557
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:616
static constexpr Range< uint32_t > validRange()
The range of valid values for Major.
Definition CameraInfo.h:560
bool operator>=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:610
bool operator<=(const Major &other) const
Comparison operator.
Definition CameraInfo.h:604
bool operator>(const Major &other) const
Comparison operator.
Definition CameraInfo.h:598
uint32_t value() const
Get the value.
constexpr Major(uint32_t value)
Constructor.
Definition CameraInfo.h:569
bool operator<(const Major &other) const
Comparison operator.
Definition CameraInfo.h:592
Major()=default
Default constructor.
bool operator==(const Major &other) const
Comparison operator.
Definition CameraInfo.h:580
Minor hardware revision number. This field is deprecated and may be removed in a future version of th...
Definition CameraInfo.h:635
bool operator>(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:695
bool operator!=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:683
bool operator<=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:701
constexpr Minor(uint32_t value)
Constructor.
Definition CameraInfo.h:666
uint32_t ValueType
The type of the underlying value.
Definition CameraInfo.h:654
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream.
Definition CameraInfo.h:713
bool operator==(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:677
std::string toString() const
Get the value as string.
Minor()=default
Default constructor.
bool operator>=(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:707
bool operator<(const Minor &other) const
Comparison operator.
Definition CameraInfo.h:689
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor.
Definition CameraInfo.h:657
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:514
const Major & major() const
Get Major.
Definition CameraInfo.h:835
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:815
Minor & minor()
Get Minor.
Definition CameraInfo.h:860
Revision & set(const Minor &value)
Set Minor.
Definition CameraInfo.h:866
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition CameraInfo.h:726
Revision & set(const Major &value)
Set Major.
Definition CameraInfo.h:847
bool operator==(const Revision &other) const
Equality operator.
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:883
std::string toString() const
Get the value as string.
const Minor & minor() const
Get Minor.
Definition CameraInfo.h:854
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:910
Major & major()
Get Major.
Definition CameraInfo.h:841
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:875
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:902
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:926
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:782
bool operator!=(const Revision &other) const
Inequality operator.
The serial number of the camera.
Definition CameraInfo.h:948
SerialNumber(std::string value)
Constructor.
Definition CameraInfo.h:975
const std::string & value() const
Get the value.
bool operator==(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:986
std::string ValueType
The type of the underlying value.
Definition CameraInfo.h:963
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:1022
std::string toString() const
Get the value as string.
bool operator>(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1004
bool operator<(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:998
bool operator<=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1010
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber.
Definition CameraInfo.h:966
bool operator>=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:1016
bool operator!=(const SerialNumber &other) const
Comparison operator.
Definition CameraInfo.h:992
The maximum number of bytes of user data that can be stored in the camera.
Definition CameraInfo.h:1059
bool operator!=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1105
bool operator<=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1123
bool operator>(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1117
MaxSizeBytes()=default
Default constructor.
constexpr MaxSizeBytes(uint64_t value)
Constructor.
Definition CameraInfo.h:1088
uint64_t value() const
Get the value.
bool operator<(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1111
bool operator==(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1099
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:1135
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes.
Definition CameraInfo.h:1079
uint64_t ValueType
The type of the underlying value.
Definition CameraInfo.h:1076
bool operator>=(const MaxSizeBytes &other) const
Comparison operator.
Definition CameraInfo.h:1129
Information about user data capabilities of the camera.
Definition CameraInfo.h:1039
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:1295
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes.
Definition CameraInfo.h:1260
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:1234
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1310
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:1288
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1275
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition CameraInfo.h:1148
bool operator!=(const UserData &other) const
Inequality operator.
UserData()
Default constructor.
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes.
Definition CameraInfo.h:1254
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes.
Definition CameraInfo.h:1266
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1202
Information about camera model, serial number etc.
Definition CameraInfo.h:78
bool operator==(const CameraInfo &other) const
Equality operator.
static CameraInfo fromSerialized(const std::string &value)
Construct a new CameraInfo instance from a previously serialized string.
Revision & revision()
Get Revision.
Definition CameraInfo.h:1567
const ModelName & modelName() const
Get ModelName.
Definition CameraInfo.h:1542
FirmwareVersion & firmwareVersion()
Get FirmwareVersion.
Definition CameraInfo.h:1491
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraInfo.h:1765
const UserData & userData() const
Get UserData.
Definition CameraInfo.h:1613
ModelName & modelName()
Get ModelName.
Definition CameraInfo.h:1548
bool operator!=(const CameraInfo &other) const
Inequality operator.
CameraInfo & set(const Model &value)
Set Model.
Definition CameraInfo.h:1535
const CameraInfo::FirmwareVersion & get() const
Definition CameraInfo.h:1641
const CameraInfo::Model & get() const
Definition CameraInfo.h:1655
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file.
UserData & userData()
Get UserData.
Definition CameraInfo.h:1619
CameraInfo & set(const ModelName &value)
Set ModelName.
Definition CameraInfo.h:1554
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion.
Definition CameraInfo.h:1485
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition CameraInfo.h:1703
const Model & model() const
Get Model.
Definition CameraInfo.h:1523
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:1466
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:1752
Model & model()
Get Model.
Definition CameraInfo.h:1529
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream.
Definition CameraInfo.h:1786
const CameraInfo::ModelName & get() const
Definition CameraInfo.h:1661
CameraInfo & set(const UserData &value)
Set UserData.
Definition CameraInfo.h:1625
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes.
Definition CameraInfo.h:1632
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraInfo.h:1389
const CameraInfo::UserData & get() const
Definition CameraInfo.h:1695
const CameraInfo::Revision::Minor & get() const
Definition CameraInfo.h:1683
const SerialNumber & serialNumber() const
Get SerialNumber.
Definition CameraInfo.h:1594
SerialNumber & serialNumber()
Get SerialNumber.
Definition CameraInfo.h:1600
const Revision & revision() const
Get Revision.
Definition CameraInfo.h:1561
CameraInfo & set(const HardwareRevision &value)
Set HardwareRevision.
Definition CameraInfo.h:1516
const CameraInfo::HardwareRevision & get() const
Definition CameraInfo.h:1649
void load(const std::string &fileName)
Load from the given file.
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion.
Definition CameraInfo.h:1497
const CameraInfo::Revision::Major & get() const
Definition CameraInfo.h:1675
const HardwareRevision & hardwareRevision() const
Get HardwareRevision.
Definition CameraInfo.h:1504
void set(Args &&...args)
Set multiple arguments.
Definition CameraInfo.h:1425
CameraInfo & set(const Revision &value)
Set Revision.
Definition CameraInfo.h:1573
CameraInfo & set(const Revision::Major &value)
Set Revision::Major.
Definition CameraInfo.h:1580
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:1327
CameraInfo & set(const SerialNumber &value)
Set SerialNumber.
Definition CameraInfo.h:1606
std::string serialize() const
Serialize to a string.
HardwareRevision & hardwareRevision()
Get HardwareRevision.
Definition CameraInfo.h:1510
const CameraInfo::SerialNumber & get() const
Definition CameraInfo.h:1689
const CameraInfo::Revision & get() const
Definition CameraInfo.h:1667
std::string toString() const
Get the value as string.
CameraInfo()
Default constructor.
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor.
Definition CameraInfo.h:1587
void save(const std::string &fileName) const
Save to the given file.
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
Definition EnvironmentInfo.h:74
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:84