Zivid C++ API 2.10.1+50b274e8-7
Defining the Future of 3D Machine Vision
CameraInfo.h
Go to the documentation of this file.
1
2
3/*******************************************************************************
4
5 * This file is part of the Zivid 3D Camera API
6
7 *
8
9 * Copyright 2015-2023 (C) Zivid AS
10
11 * All rights reserved.
12
13 *
14
15 * Zivid Software License, v1.0
16
17 *
18
19 * Redistribution and use in source and binary forms, with or without
20
21 * modification, are permitted provided that the following conditions are met:
22
23 *
24
25 * 1. Redistributions of source code must retain the above copyright notice,
26
27 * this list of conditions and the following disclaimer.
28
29 *
30
31 * 2. Redistributions in binary form must reproduce the above copyright notice,
32
33 * this list of conditions and the following disclaimer in the documentation
34
35 * and/or other materials provided with the distribution.
36
37 *
38
39 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
40
41 * to endorse or promote products derived from this software without specific
42
43 * prior written permission.
44
45 *
46
47 * 4. This software, with or without modification, must not be used with any
48
49 * other 3D camera than from Zivid AS.
50
51 *
52
53 * 5. Any software provided in binary form under this license must not be
54
55 * reverse engineered, decompiled, modified and/or disassembled.
56
57 *
58
59 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
60
61 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
62
63 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
64
65 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
66
67 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68
69 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
70
71 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
72
73 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74
75 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
76
77 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
78
79 *
80
81 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
82
83 * Info: http://www.zivid.com
84
85 ******************************************************************************/
86
87
88
89#pragma once
90
91#include <array>
92#include <chrono>
93#include <cmath>
94#include <ctime>
95#include <iomanip>
96#include <memory>
97#include <set>
98#include <sstream>
99#include <string>
100#include <tuple>
101#include <utility>
102#include <vector>
103
109#include "Zivid/Range.h"
110
111#ifdef _MSC_VER
112# pragma warning(push)
113# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
114#endif
115
116namespace Zivid
117{
118
120
121 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
123 {
124 public:
127
129 static constexpr const char *path{ "" };
130
132 static constexpr const char *name{ "CameraInfo" };
133
135 static constexpr const char *description{
136 R"description(Information about camera model, serial number etc.)description"
137 };
138
139 static constexpr size_t version{ 4 };
140
141#ifndef NO_DOC
142 template<size_t>
143 struct Version;
144
145 using LatestVersion = Zivid::CameraInfo;
146
147 // Short identifier. This value is not guaranteed to be universally unique
148 // Todo(ZIVID-2808): Move this to internal DataModelExt header
149 static constexpr std::array<uint8_t, 3> binaryId{ 'n', 'f', 'o' };
150
151#endif
152
154
155 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
157 {
158 public:
161
163 static constexpr const char *path{ "FirmwareVersion" };
164
166 static constexpr const char *name{ "FirmwareVersion" };
167
169 static constexpr const char *description{ R"description(The firmware version on the camera)description" };
170
172 using ValueType = std::string;
173
176 {
177 return { 0, std::numeric_limits<ValueType::size_type>::max() };
178 }
179
181 FirmwareVersion() = default;
182
184 explicit FirmwareVersion(std::string value)
185 : m_value{ std::move(value) }
186 {}
187
189 const std::string &value() const;
190
192 std::string toString() const;
193
195 bool operator==(const FirmwareVersion &other) const
196 {
197 return m_value == other.m_value;
198 }
199
201 bool operator!=(const FirmwareVersion &other) const
202 {
203 return m_value != other.m_value;
204 }
205
207 bool operator<(const FirmwareVersion &other) const
208 {
209 return m_value < other.m_value;
210 }
211
213 bool operator>(const FirmwareVersion &other) const
214 {
215 return m_value > other.m_value;
216 }
217
219 bool operator<=(const FirmwareVersion &other) const
220 {
221 return m_value <= other.m_value;
222 }
223
225 bool operator>=(const FirmwareVersion &other) const
226 {
227 return m_value >= other.m_value;
228 }
229
231 friend std::ostream &operator<<(std::ostream &stream, const FirmwareVersion &value)
232 {
233 return stream << value.toString();
234 }
235
236 private:
237 void setFromString(const std::string &value);
238
239 std::string m_value{};
240
241 friend struct DataModel::Detail::Befriend<FirmwareVersion>;
242 };
243
245
246 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
248 {
249 public:
252
254 static constexpr const char *path{ "Model" };
255
257 static constexpr const char *name{ "Model" };
258
260 static constexpr const char *description{ R"description(The model of the camera)description" };
261
263 enum class ValueType
264 {
265 zividOnePlusSmall,
266 zividOnePlusMedium,
267 zividOnePlusLarge,
268 zividTwo,
269 zividTwoL100,
270 zivid2PlusM130,
271 zivid2PlusM60,
272 zivid2PlusL110
273 };
277 static const Model zividTwo;
278 static const Model zividTwoL100;
279 static const Model zivid2PlusM130;
280 static const Model zivid2PlusM60;
281 static const Model zivid2PlusL110;
282
284 static std::set<ValueType> validValues()
285 {
286 return { ValueType::zividOnePlusSmall, ValueType::zividOnePlusMedium, ValueType::zividOnePlusLarge,
287 ValueType::zividTwo, ValueType::zividTwoL100, ValueType::zivid2PlusM130,
288 ValueType::zivid2PlusM60, ValueType::zivid2PlusL110 };
289 }
290
292 Model() = default;
293
295 explicit constexpr Model(ValueType value)
296 : m_value{ verifyValue(value) }
297 {}
298
301
303 std::string toString() const;
304
306 friend std::ostream &operator<<(std::ostream &stream, const Model::ValueType &value)
307 {
308 return stream << Model{ value }.toString();
309 }
310
312 bool operator==(const Model &other) const
313 {
314 return m_value == other.m_value;
315 }
316
318 bool operator!=(const Model &other) const
319 {
320 return m_value != other.m_value;
321 }
322
324 friend std::ostream &operator<<(std::ostream &stream, const Model &value)
325 {
326 return stream << value.toString();
327 }
328
329 private:
330 void setFromString(const std::string &value);
331
332 constexpr ValueType static verifyValue(const ValueType &value)
333 {
334 return value == ValueType::zividOnePlusSmall || value == ValueType::zividOnePlusMedium
335 || value == ValueType::zividOnePlusLarge || value == ValueType::zividTwo
336 || value == ValueType::zividTwoL100 || value == ValueType::zivid2PlusM130
337 || value == ValueType::zivid2PlusM60 || value == ValueType::zivid2PlusL110
338 ? value
339 : throw std::invalid_argument{
340 "Invalid value: Model{ "
341 + std::to_string(static_cast<std::underlying_type<ValueType>::type>(value)) + " }"
342 };
343 }
344
345 ValueType m_value{ ValueType::zividOnePlusSmall };
346
347 friend struct DataModel::Detail::Befriend<Model>;
348 };
349
353
354 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
356 {
357 public:
360
362 static constexpr const char *path{ "ModelName" };
363
365 static constexpr const char *name{ "ModelName" };
366
368 static constexpr const char *description{
369 R"description(The model name of the camera. This is a user-friendly display name that may contain spaces and special
370characters. We recommend to use `Model` instead if you want to programmatically check for camera model.
371)description"
372 };
373
375 using ValueType = std::string;
376
379 {
380 return { 0, std::numeric_limits<ValueType::size_type>::max() };
381 }
382
384 ModelName() = default;
385
387 explicit ModelName(std::string value)
388 : m_value{ std::move(value) }
389 {}
390
392 const std::string &value() const;
393
395 std::string toString() const;
396
398 bool operator==(const ModelName &other) const
399 {
400 return m_value == other.m_value;
401 }
402
404 bool operator!=(const ModelName &other) const
405 {
406 return m_value != other.m_value;
407 }
408
410 bool operator<(const ModelName &other) const
411 {
412 return m_value < other.m_value;
413 }
414
416 bool operator>(const ModelName &other) const
417 {
418 return m_value > other.m_value;
419 }
420
422 bool operator<=(const ModelName &other) const
423 {
424 return m_value <= other.m_value;
425 }
426
428 bool operator>=(const ModelName &other) const
429 {
430 return m_value >= other.m_value;
431 }
432
434 friend std::ostream &operator<<(std::ostream &stream, const ModelName &value)
435 {
436 return stream << value.toString();
437 }
438
439 private:
440 void setFromString(const std::string &value);
441
442 std::string m_value{};
443
444 friend struct DataModel::Detail::Befriend<ModelName>;
445 };
446
448
449 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
451 {
452 public:
455
457 static constexpr const char *path{ "Revision" };
458
460 static constexpr const char *name{ "Revision" };
461
463 static constexpr const char *description{ R"description(The hardware revision of the camera)description" };
464
466
467 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
469 {
470 public:
473
475 static constexpr const char *path{ "Revision/Major" };
476
478 static constexpr const char *name{ "Major" };
479
481 static constexpr const char *description{ R"description(Major hardware revision number)description" };
482
484 using ValueType = uint32_t;
485
487 static constexpr Range<uint32_t> validRange()
488 {
489 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
490 }
491
493 Major() = default;
494
496 explicit constexpr Major(uint32_t value)
497 : m_value{ value }
498 {}
499
501 uint32_t value() const;
502
504 std::string toString() const;
505
507 bool operator==(const Major &other) const
508 {
509 return m_value == other.m_value;
510 }
511
513 bool operator!=(const Major &other) const
514 {
515 return m_value != other.m_value;
516 }
517
519 bool operator<(const Major &other) const
520 {
521 return m_value < other.m_value;
522 }
523
525 bool operator>(const Major &other) const
526 {
527 return m_value > other.m_value;
528 }
529
531 bool operator<=(const Major &other) const
532 {
533 return m_value <= other.m_value;
534 }
535
537 bool operator>=(const Major &other) const
538 {
539 return m_value >= other.m_value;
540 }
541
543 friend std::ostream &operator<<(std::ostream &stream, const Major &value)
544 {
545 return stream << value.toString();
546 }
547
548 private:
549 void setFromString(const std::string &value);
550
551 uint32_t m_value{ 0 };
552
553 friend struct DataModel::Detail::Befriend<Major>;
554 };
555
557
558 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
560 {
561 public:
564
566 static constexpr const char *path{ "Revision/Minor" };
567
569 static constexpr const char *name{ "Minor" };
570
572 static constexpr const char *description{ R"description(Minor hardware revision number)description" };
573
575 using ValueType = uint32_t;
576
578 static constexpr Range<uint32_t> validRange()
579 {
580 return { std::numeric_limits<uint32_t>::lowest(), std::numeric_limits<uint32_t>::max() };
581 }
582
584 Minor() = default;
585
587 explicit constexpr Minor(uint32_t value)
588 : m_value{ value }
589 {}
590
592 uint32_t value() const;
593
595 std::string toString() const;
596
598 bool operator==(const Minor &other) const
599 {
600 return m_value == other.m_value;
601 }
602
604 bool operator!=(const Minor &other) const
605 {
606 return m_value != other.m_value;
607 }
608
610 bool operator<(const Minor &other) const
611 {
612 return m_value < other.m_value;
613 }
614
616 bool operator>(const Minor &other) const
617 {
618 return m_value > other.m_value;
619 }
620
622 bool operator<=(const Minor &other) const
623 {
624 return m_value <= other.m_value;
625 }
626
628 bool operator>=(const Minor &other) const
629 {
630 return m_value >= other.m_value;
631 }
632
634 friend std::ostream &operator<<(std::ostream &stream, const Minor &value)
635 {
636 return stream << value.toString();
637 }
638
639 private:
640 void setFromString(const std::string &value);
641
642 uint32_t m_value{ 0 };
643
644 friend struct DataModel::Detail::Befriend<Minor>;
645 };
646
647 using Descendants = std::tuple<CameraInfo::Revision::Major, CameraInfo::Revision::Minor>;
648
651
664#ifndef NO_DOC
665 template<
666 typename... Args,
667 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
668 typename std::enable_if<
669 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
670 value,
671 int>::type = 0>
672#else
673 template<typename... Args>
674#endif
675 explicit Revision(Args &&...args)
676 {
677 using namespace Zivid::Detail::TypeTraits;
678
679 static_assert(
680 AllArgsDecayedAreUnique<Args...>::value,
681 "Found duplicate types among the arguments passed to Revision(...). "
682 "Types should be listed at most once.");
683
684 set(std::forward<Args>(args)...);
685 }
686
698#ifndef NO_DOC
699 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
700#else
701 template<typename... Args>
702#endif
703 void set(Args &&...args)
704 {
705 using namespace Zivid::Detail::TypeTraits;
706
707 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
708 static_assert(
709 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
710
711 static_assert(
712 AllArgsDecayedAreUnique<Args...>::value,
713 "Found duplicate types among the arguments passed to set(...). "
714 "Types should be listed at most once.");
715
716 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
717 }
718
731#ifndef NO_DOC
732 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
733#else
734 template<typename... Args>
735#endif
736 Revision copyWith(Args &&...args) const
737 {
738 using namespace Zivid::Detail::TypeTraits;
739
740 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
741 static_assert(
742 AllArgsAreDescendantNodes::value,
743 "All arguments passed to copyWith(...) must be descendant nodes.");
744
745 static_assert(
746 AllArgsDecayedAreUnique<Args...>::value,
747 "Found duplicate types among the arguments passed to copyWith(...). "
748 "Types should be listed at most once.");
749
750 auto copy{ *this };
751 copy.set(std::forward<Args>(args)...);
752 return copy;
753 }
754
756 const Major &major() const
757 {
758 return m_major;
759 }
760
763 {
764 return m_major;
765 }
766
768 Revision &set(const Major &value)
769 {
770 m_major = value;
771 return *this;
772 }
773
775 const Minor &minor() const
776 {
777 return m_minor;
778 }
779
782 {
783 return m_minor;
784 }
785
787 Revision &set(const Minor &value)
788 {
789 m_minor = value;
790 return *this;
791 }
792
793 template<
794 typename T,
795 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
797 {
798 return m_major;
799 }
800
801 template<
802 typename T,
803 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
805 {
806 return m_minor;
807 }
808
809 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
811 {
812 return m_major;
813 }
814
815 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
817 {
818 return m_minor;
819 }
820
822 template<typename F>
823 void forEach(const F &f) const
824 {
825 f(m_major);
826 f(m_minor);
827 }
828
830 template<typename F>
831 void forEach(const F &f)
832 {
833 f(m_major);
834 f(m_minor);
835 }
836
838 bool operator==(const Revision &other) const;
839
841 bool operator!=(const Revision &other) const;
842
844 std::string toString() const;
845
847 friend std::ostream &operator<<(std::ostream &stream, const Revision &value)
848 {
849 return stream << value.toString();
850 }
851
852 private:
853 void setFromString(const std::string &value);
854
855 void setFromString(const std::string &fullPath, const std::string &value);
856
857 std::string getString(const std::string &fullPath) const;
858
859 Major m_major;
860 Minor m_minor;
861
862 friend struct DataModel::Detail::Befriend<Revision>;
863 };
864
866
867 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
869 {
870 public:
873
875 static constexpr const char *path{ "SerialNumber" };
876
878 static constexpr const char *name{ "SerialNumber" };
879
881 static constexpr const char *description{ R"description(The serial number of the camera)description" };
882
884 using ValueType = std::string;
885
888 {
889 return { 0, std::numeric_limits<ValueType::size_type>::max() };
890 }
891
893 SerialNumber() = default;
894
896 explicit SerialNumber(std::string value)
897 : m_value{ std::move(value) }
898 {}
899
901 const std::string &value() const;
902
904 std::string toString() const;
905
907 bool operator==(const SerialNumber &other) const
908 {
909 return m_value == other.m_value;
910 }
911
913 bool operator!=(const SerialNumber &other) const
914 {
915 return m_value != other.m_value;
916 }
917
919 bool operator<(const SerialNumber &other) const
920 {
921 return m_value < other.m_value;
922 }
923
925 bool operator>(const SerialNumber &other) const
926 {
927 return m_value > other.m_value;
928 }
929
931 bool operator<=(const SerialNumber &other) const
932 {
933 return m_value <= other.m_value;
934 }
935
937 bool operator>=(const SerialNumber &other) const
938 {
939 return m_value >= other.m_value;
940 }
941
943 friend std::ostream &operator<<(std::ostream &stream, const SerialNumber &value)
944 {
945 return stream << value.toString();
946 }
947
948 private:
949 void setFromString(const std::string &value);
950
951 std::string m_value{};
952
953 friend struct DataModel::Detail::Befriend<SerialNumber>;
954 };
955
957
958 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
960 {
961 public:
964
966 static constexpr const char *path{ "UserData" };
967
969 static constexpr const char *name{ "UserData" };
970
972 static constexpr const char *description{
973 R"description(Information about user data capabilities of the camera)description"
974 };
975
977
978 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
980 {
981 public:
984
986 static constexpr const char *path{ "UserData/MaxSizeBytes" };
987
989 static constexpr const char *name{ "MaxSizeBytes" };
990
992 static constexpr const char *description{
993 R"description(The maximum number of bytes of user data that can be stored in the camera)description"
994 };
995
997 using ValueType = uint64_t;
998
1000 static constexpr Range<uint64_t> validRange()
1001 {
1002 return { std::numeric_limits<uint64_t>::lowest(), std::numeric_limits<uint64_t>::max() };
1003 }
1004
1006 MaxSizeBytes() = default;
1007
1009 explicit constexpr MaxSizeBytes(uint64_t value)
1010 : m_value{ value }
1011 {}
1012
1014 uint64_t value() const;
1015
1017 std::string toString() const;
1018
1020 bool operator==(const MaxSizeBytes &other) const
1021 {
1022 return m_value == other.m_value;
1023 }
1024
1026 bool operator!=(const MaxSizeBytes &other) const
1027 {
1028 return m_value != other.m_value;
1029 }
1030
1032 bool operator<(const MaxSizeBytes &other) const
1033 {
1034 return m_value < other.m_value;
1035 }
1036
1038 bool operator>(const MaxSizeBytes &other) const
1039 {
1040 return m_value > other.m_value;
1041 }
1042
1044 bool operator<=(const MaxSizeBytes &other) const
1045 {
1046 return m_value <= other.m_value;
1047 }
1048
1050 bool operator>=(const MaxSizeBytes &other) const
1051 {
1052 return m_value >= other.m_value;
1053 }
1054
1056 friend std::ostream &operator<<(std::ostream &stream, const MaxSizeBytes &value)
1057 {
1058 return stream << value.toString();
1059 }
1060
1061 private:
1062 void setFromString(const std::string &value);
1063
1064 uint64_t m_value{ 0 };
1065
1066 friend struct DataModel::Detail::Befriend<MaxSizeBytes>;
1067 };
1068
1069 using Descendants = std::tuple<CameraInfo::UserData::MaxSizeBytes>;
1070
1073
1085#ifndef NO_DOC
1086 template<
1087 typename... Args,
1088 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1089 typename std::enable_if<
1090 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1091 value,
1092 int>::type = 0>
1093#else
1094 template<typename... Args>
1095#endif
1096 explicit UserData(Args &&...args)
1097 {
1098 using namespace Zivid::Detail::TypeTraits;
1099
1100 static_assert(
1101 AllArgsDecayedAreUnique<Args...>::value,
1102 "Found duplicate types among the arguments passed to UserData(...). "
1103 "Types should be listed at most once.");
1104
1105 set(std::forward<Args>(args)...);
1106 }
1107
1118#ifndef NO_DOC
1119 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1120#else
1121 template<typename... Args>
1122#endif
1123 void set(Args &&...args)
1124 {
1125 using namespace Zivid::Detail::TypeTraits;
1126
1127 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1128 static_assert(
1129 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1130
1131 static_assert(
1132 AllArgsDecayedAreUnique<Args...>::value,
1133 "Found duplicate types among the arguments passed to set(...). "
1134 "Types should be listed at most once.");
1135
1136 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1137 }
1138
1150#ifndef NO_DOC
1151 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1152#else
1153 template<typename... Args>
1154#endif
1155 UserData copyWith(Args &&...args) const
1156 {
1157 using namespace Zivid::Detail::TypeTraits;
1158
1159 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1160 static_assert(
1161 AllArgsAreDescendantNodes::value,
1162 "All arguments passed to copyWith(...) must be descendant nodes.");
1163
1164 static_assert(
1165 AllArgsDecayedAreUnique<Args...>::value,
1166 "Found duplicate types among the arguments passed to copyWith(...). "
1167 "Types should be listed at most once.");
1168
1169 auto copy{ *this };
1170 copy.set(std::forward<Args>(args)...);
1171 return copy;
1172 }
1173
1176 {
1177 return m_maxSizeBytes;
1178 }
1179
1182 {
1183 return m_maxSizeBytes;
1184 }
1185
1188 {
1189 m_maxSizeBytes = value;
1190 return *this;
1191 }
1192
1193 template<
1194 typename T,
1195 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1197 {
1198 return m_maxSizeBytes;
1199 }
1200
1201 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1203 {
1204 return m_maxSizeBytes;
1205 }
1206
1208 template<typename F>
1209 void forEach(const F &f) const
1210 {
1211 f(m_maxSizeBytes);
1212 }
1213
1215 template<typename F>
1216 void forEach(const F &f)
1217 {
1218 f(m_maxSizeBytes);
1219 }
1220
1222 bool operator==(const UserData &other) const;
1223
1225 bool operator!=(const UserData &other) const;
1226
1228 std::string toString() const;
1229
1231 friend std::ostream &operator<<(std::ostream &stream, const UserData &value)
1232 {
1233 return stream << value.toString();
1234 }
1235
1236 private:
1237 void setFromString(const std::string &value);
1238
1239 void setFromString(const std::string &fullPath, const std::string &value);
1240
1241 std::string getString(const std::string &fullPath) const;
1242
1243 MaxSizeBytes m_maxSizeBytes;
1244
1245 friend struct DataModel::Detail::Befriend<UserData>;
1246 };
1247
1248 using Descendants = std::tuple<
1258
1261
1263 explicit CameraInfo(const std::string &fileName);
1264
1284#ifndef NO_DOC
1285 template<
1286 typename... Args,
1287 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1288 typename std::enable_if<
1289 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1290 int>::type = 0>
1291#else
1292 template<typename... Args>
1293#endif
1294 explicit CameraInfo(Args &&...args)
1295 {
1296 using namespace Zivid::Detail::TypeTraits;
1297
1298 static_assert(
1299 AllArgsDecayedAreUnique<Args...>::value,
1300 "Found duplicate types among the arguments passed to CameraInfo(...). "
1301 "Types should be listed at most once.");
1302
1303 set(std::forward<Args>(args)...);
1304 }
1305
1324#ifndef NO_DOC
1325 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1326#else
1327 template<typename... Args>
1328#endif
1329 void set(Args &&...args)
1330 {
1331 using namespace Zivid::Detail::TypeTraits;
1332
1333 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1334 static_assert(
1335 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1336
1337 static_assert(
1338 AllArgsDecayedAreUnique<Args...>::value,
1339 "Found duplicate types among the arguments passed to set(...). "
1340 "Types should be listed at most once.");
1341
1342 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1343 }
1344
1364#ifndef NO_DOC
1365 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1366#else
1367 template<typename... Args>
1368#endif
1369 CameraInfo copyWith(Args &&...args) const
1370 {
1371 using namespace Zivid::Detail::TypeTraits;
1372
1373 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1374 static_assert(
1375 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1376
1377 static_assert(
1378 AllArgsDecayedAreUnique<Args...>::value,
1379 "Found duplicate types among the arguments passed to copyWith(...). "
1380 "Types should be listed at most once.");
1381
1382 auto copy{ *this };
1383 copy.set(std::forward<Args>(args)...);
1384 return copy;
1385 }
1386
1389 {
1390 return m_firmwareVersion;
1391 }
1392
1395 {
1396 return m_firmwareVersion;
1397 }
1398
1401 {
1402 m_firmwareVersion = value;
1403 return *this;
1404 }
1405
1407 const Model &model() const
1408 {
1409 return m_model;
1410 }
1411
1414 {
1415 return m_model;
1416 }
1417
1419 CameraInfo &set(const Model &value)
1420 {
1421 m_model = value;
1422 return *this;
1423 }
1424
1426 const ModelName &modelName() const
1427 {
1428 return m_modelName;
1429 }
1430
1433 {
1434 return m_modelName;
1435 }
1436
1438 CameraInfo &set(const ModelName &value)
1439 {
1440 m_modelName = value;
1441 return *this;
1442 }
1443
1445 const Revision &revision() const
1446 {
1447 return m_revision;
1448 }
1449
1452 {
1453 return m_revision;
1454 }
1455
1457 CameraInfo &set(const Revision &value)
1458 {
1459 m_revision = value;
1460 return *this;
1461 }
1462
1465 {
1466 m_revision.set(value);
1467 return *this;
1468 }
1469
1472 {
1473 m_revision.set(value);
1474 return *this;
1475 }
1476
1479 {
1480 return m_serialNumber;
1481 }
1482
1485 {
1486 return m_serialNumber;
1487 }
1488
1491 {
1492 m_serialNumber = value;
1493 return *this;
1494 }
1495
1497 const UserData &userData() const
1498 {
1499 return m_userData;
1500 }
1501
1504 {
1505 return m_userData;
1506 }
1507
1509 CameraInfo &set(const UserData &value)
1510 {
1511 m_userData = value;
1512 return *this;
1513 }
1514
1517 {
1518 m_userData.set(value);
1519 return *this;
1520 }
1521
1522 template<
1523 typename T,
1524 typename std::enable_if<std::is_same<T, CameraInfo::FirmwareVersion>::value, int>::type = 0>
1526 {
1527 return m_firmwareVersion;
1528 }
1529
1530 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Model>::value, int>::type = 0>
1531 const CameraInfo::Model &get() const
1532 {
1533 return m_model;
1534 }
1535
1536 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::ModelName>::value, int>::type = 0>
1538 {
1539 return m_modelName;
1540 }
1541
1542 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::Revision>::value, int>::type = 0>
1544 {
1545 return m_revision;
1546 }
1547
1548 template<
1549 typename T,
1550 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Major>::value, int>::type = 0>
1552 {
1553 return m_revision.get<CameraInfo::Revision::Major>();
1554 }
1555
1556 template<
1557 typename T,
1558 typename std::enable_if<std::is_same<T, CameraInfo::Revision::Minor>::value, int>::type = 0>
1560 {
1561 return m_revision.get<CameraInfo::Revision::Minor>();
1562 }
1563
1564 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::SerialNumber>::value, int>::type = 0>
1566 {
1567 return m_serialNumber;
1568 }
1569
1570 template<typename T, typename std::enable_if<std::is_same<T, CameraInfo::UserData>::value, int>::type = 0>
1572 {
1573 return m_userData;
1574 }
1575
1576 template<
1577 typename T,
1578 typename std::enable_if<std::is_same<T, CameraInfo::UserData::MaxSizeBytes>::value, int>::type = 0>
1580 {
1581 return m_userData.get<CameraInfo::UserData::MaxSizeBytes>();
1582 }
1583
1584 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1586 {
1587 return m_firmwareVersion;
1588 }
1589
1590 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1591 const CameraInfo::Model &get() const
1592 {
1593 return m_model;
1594 }
1595
1596 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1598 {
1599 return m_modelName;
1600 }
1601
1602 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1604 {
1605 return m_revision;
1606 }
1607
1608 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1610 {
1611 return m_serialNumber;
1612 }
1613
1614 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
1616 {
1617 return m_userData;
1618 }
1619
1621 template<typename F>
1622 void forEach(const F &f) const
1623 {
1624 f(m_firmwareVersion);
1625 f(m_model);
1626 f(m_modelName);
1627 f(m_revision);
1628 f(m_serialNumber);
1629 f(m_userData);
1630 }
1631
1633 template<typename F>
1634 void forEach(const F &f)
1635 {
1636 f(m_firmwareVersion);
1637 f(m_model);
1638 f(m_modelName);
1639 f(m_revision);
1640 f(m_serialNumber);
1641 f(m_userData);
1642 }
1643
1645 bool operator==(const CameraInfo &other) const;
1646
1648 bool operator!=(const CameraInfo &other) const;
1649
1651 std::string toString() const;
1652
1654 friend std::ostream &operator<<(std::ostream &stream, const CameraInfo &value)
1655 {
1656 return stream << value.toString();
1657 }
1658
1660 void save(const std::string &fileName) const;
1661
1663 void load(const std::string &fileName);
1664
1665 private:
1666 void setFromString(const std::string &value);
1667
1668 void setFromString(const std::string &fullPath, const std::string &value);
1669
1670 std::string getString(const std::string &fullPath) const;
1671
1672 FirmwareVersion m_firmwareVersion;
1673 Model m_model;
1674 ModelName m_modelName;
1675 Revision m_revision;
1676 SerialNumber m_serialNumber;
1677 UserData m_userData;
1678
1679 friend struct DataModel::Detail::Befriend<CameraInfo>;
1680 };
1681
1682#ifndef NO_DOC
1684 namespace Detail
1685 {
1686 ZIVID_CORE_EXPORT void save(const CameraInfo &dataModel, std::ostream &ostream);
1687 ZIVID_CORE_EXPORT void load(CameraInfo &dataModel, std::istream &istream);
1688 } // namespace Detail
1689#endif
1690
1691#ifndef NO_DOC
1692 template<>
1693 struct CameraInfo::Version<4>
1694 {
1695 using Type = CameraInfo;
1696 };
1697#endif
1698
1699} // namespace Zivid
1700
1701#ifdef _MSC_VER
1702# pragma warning(pop)
1703#endif
1704
1705#ifndef NO_DOC
1706# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1707namespace std // NOLINT
1708{
1709
1710 template<>
1711 struct tuple_size<Zivid::CameraInfo::Revision> : integral_constant<size_t, 2>
1712 {};
1713
1714 template<size_t i>
1715 struct tuple_element<i, Zivid::CameraInfo::Revision>
1716 {
1717 static_assert(i < tuple_size<Zivid::CameraInfo::Revision>::value, "Index must be less than 2");
1718
1719 using type // NOLINT
1720 = decltype(declval<Zivid::CameraInfo::Revision>().get<i>());
1721 };
1722
1723 template<>
1724 struct tuple_size<Zivid::CameraInfo::UserData> : integral_constant<size_t, 1>
1725 {};
1726
1727 template<size_t i>
1728 struct tuple_element<i, Zivid::CameraInfo::UserData>
1729 {
1730 static_assert(i < tuple_size<Zivid::CameraInfo::UserData>::value, "Index must be less than 1");
1731
1732 using type // NOLINT
1733 = decltype(declval<Zivid::CameraInfo::UserData>().get<i>());
1734 };
1735
1736 template<>
1737 struct tuple_size<Zivid::CameraInfo> : integral_constant<size_t, 6>
1738 {};
1739
1740 template<size_t i>
1741 struct tuple_element<i, Zivid::CameraInfo>
1742 {
1743 static_assert(i < tuple_size<Zivid::CameraInfo>::value, "Index must be less than 6");
1744
1745 using type // NOLINT
1746 = decltype(declval<Zivid::CameraInfo>().get<i>());
1747 };
1748
1749} // namespace std
1750# endif
1751#endif
1752
1753// If we have access to the DataModel library, automatically include internal DataModel
1754// header. This header is necessary for serialization and deserialization.
1755#if defined(__has_include) && !defined(NO_DOC)
1756# if __has_include("Zivid/CameraInfoInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1757# include "Zivid/CameraInfoInternal.h"
1758# endif
1759#endif
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
The firmware version on the camera
Definition: CameraInfo.h:157
std::string toString() const
Get the value as string
bool operator==(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:195
FirmwareVersion(std::string value)
Constructor
Definition: CameraInfo.h:184
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for FirmwareVersion
Definition: CameraInfo.h:175
bool operator<(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:207
bool operator<=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:219
bool operator>=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:225
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:231
bool operator>(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:213
bool operator!=(const FirmwareVersion &other) const
Comparison operator
Definition: CameraInfo.h:201
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:172
FirmwareVersion()=default
Default constructor
The model name of the camera. This is a user-friendly display name that may contain spaces and specia...
Definition: CameraInfo.h:356
bool operator==(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:398
ModelName()=default
Default constructor
bool operator<=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:422
std::string toString() const
Get the value as string
ModelName(std::string value)
Constructor
Definition: CameraInfo.h:387
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:375
bool operator<(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:410
bool operator>(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:416
friend std::ostream & operator<<(std::ostream &stream, const ModelName &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:434
const std::string & value() const
Get the value
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for ModelName
Definition: CameraInfo.h:378
bool operator>=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:428
bool operator!=(const ModelName &other) const
Comparison operator
Definition: CameraInfo.h:404
The model of the camera
Definition: CameraInfo.h:248
static const Model zividOnePlusSmall
zividOnePlusSmall
Definition: CameraInfo.h:274
static const Model zivid2PlusM130
zivid2PlusM130
Definition: CameraInfo.h:279
static const Model zividTwo
zividTwo
Definition: CameraInfo.h:277
static const Model zivid2PlusL110
zivid2PlusL110
Definition: CameraInfo.h:281
std::string toString() const
Get the value as string
constexpr Model(ValueType value)
Constructor
Definition: CameraInfo.h:295
Model()=default
Default constructor
static const Model zividOnePlusMedium
zividOnePlusMedium
Definition: CameraInfo.h:275
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:306
static const Model zivid2PlusM60
zivid2PlusM60
Definition: CameraInfo.h:280
friend std::ostream & operator<<(std::ostream &stream, const Model &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:324
static std::set< ValueType > validValues()
All valid values of Model
Definition: CameraInfo.h:284
ValueType
The type of the underlying value
Definition: CameraInfo.h:264
static const Model zividOnePlusLarge
zividOnePlusLarge
Definition: CameraInfo.h:276
bool operator!=(const Model &other) const
Comparison operator
Definition: CameraInfo.h:318
static const Model zividTwoL100
zividTwoL100
Definition: CameraInfo.h:278
bool operator==(const Model &other) const
Comparison operator
Definition: CameraInfo.h:312
Major hardware revision number
Definition: CameraInfo.h:469
std::string toString() const
Get the value as string
bool operator!=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:513
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:484
friend std::ostream & operator<<(std::ostream &stream, const Major &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:543
static constexpr Range< uint32_t > validRange()
The range of valid values for Major
Definition: CameraInfo.h:487
bool operator>=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:537
bool operator<=(const Major &other) const
Comparison operator
Definition: CameraInfo.h:531
bool operator>(const Major &other) const
Comparison operator
Definition: CameraInfo.h:525
uint32_t value() const
Get the value
constexpr Major(uint32_t value)
Constructor
Definition: CameraInfo.h:496
bool operator<(const Major &other) const
Comparison operator
Definition: CameraInfo.h:519
Major()=default
Default constructor
bool operator==(const Major &other) const
Comparison operator
Definition: CameraInfo.h:507
Minor hardware revision number
Definition: CameraInfo.h:560
bool operator>(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:616
bool operator!=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:604
bool operator<=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:622
constexpr Minor(uint32_t value)
Constructor
Definition: CameraInfo.h:587
uint32_t ValueType
The type of the underlying value
Definition: CameraInfo.h:575
friend std::ostream & operator<<(std::ostream &stream, const Minor &value)
Operator to serialize the value to a stream
Definition: CameraInfo.h:634
bool operator==(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:598
std::string toString() const
Get the value as string
Minor()=default
Default constructor
bool operator>=(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:628
bool operator<(const Minor &other) const
Comparison operator
Definition: CameraInfo.h:610
static constexpr Range< uint32_t > validRange()
The range of valid values for Minor
Definition: CameraInfo.h:578
uint32_t value() const
Get the value
The hardware revision of the camera
Definition: CameraInfo.h:451
const Major & major() const
Get Major
Definition: CameraInfo.h:756
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:736
Minor & minor()
Get Minor
Definition: CameraInfo.h:781
Revision & set(const Minor &value)
Set Minor
Definition: CameraInfo.h:787
std::tuple< CameraInfo::Revision::Major, CameraInfo::Revision::Minor > Descendants
Definition: CameraInfo.h:647
Revision & set(const Major &value)
Set Major
Definition: CameraInfo.h:768
bool operator==(const Revision &other) const
Equality operator
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:804
std::string toString() const
Get the value as string
const Minor & minor() const
Get Minor
Definition: CameraInfo.h:775
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:831
Major & major()
Get Major
Definition: CameraInfo.h:762
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:796
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:823
Revision(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:675
friend std::ostream & operator<<(std::ostream &stream, const Revision &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:847
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:703
bool operator!=(const Revision &other) const
Inequality operator
The serial number of the camera
Definition: CameraInfo.h:869
SerialNumber(std::string value)
Constructor
Definition: CameraInfo.h:896
const std::string & value() const
Get the value
bool operator==(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:907
std::string ValueType
The type of the underlying value
Definition: CameraInfo.h:884
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:943
std::string toString() const
Get the value as string
bool operator>(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:925
bool operator<(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:919
bool operator<=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:931
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for SerialNumber
Definition: CameraInfo.h:887
bool operator>=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:937
bool operator!=(const SerialNumber &other) const
Comparison operator
Definition: CameraInfo.h:913
The maximum number of bytes of user data that can be stored in the camera
Definition: CameraInfo.h:980
bool operator!=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1026
bool operator<=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1044
bool operator>(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1038
MaxSizeBytes()=default
Default constructor
constexpr MaxSizeBytes(uint64_t value)
Constructor
Definition: CameraInfo.h:1009
uint64_t value() const
Get the value
bool operator<(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1032
bool operator==(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1020
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:1056
static constexpr Range< uint64_t > validRange()
The range of valid values for MaxSizeBytes
Definition: CameraInfo.h:1000
uint64_t ValueType
The type of the underlying value
Definition: CameraInfo.h:997
bool operator>=(const MaxSizeBytes &other) const
Comparison operator
Definition: CameraInfo.h:1050
Information about user data capabilities of the camera
Definition: CameraInfo.h:960
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:1216
MaxSizeBytes & maxSizeBytes()
Get MaxSizeBytes
Definition: CameraInfo.h:1181
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:1155
friend std::ostream & operator<<(std::ostream &stream, const UserData &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1231
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:1209
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1196
std::tuple< CameraInfo::UserData::MaxSizeBytes > Descendants
Definition: CameraInfo.h:1069
bool operator!=(const UserData &other) const
Inequality operator
UserData()
Default constructor
UserData(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1096
const MaxSizeBytes & maxSizeBytes() const
Get MaxSizeBytes
Definition: CameraInfo.h:1175
UserData & set(const MaxSizeBytes &value)
Set MaxSizeBytes
Definition: CameraInfo.h:1187
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1123
Information about camera model, serial number etc.
Definition: CameraInfo.h:123
bool operator==(const CameraInfo &other) const
Equality operator
Revision & revision()
Get Revision
Definition: CameraInfo.h:1451
const ModelName & modelName() const
Get ModelName
Definition: CameraInfo.h:1426
FirmwareVersion & firmwareVersion()
Get FirmwareVersion
Definition: CameraInfo.h:1394
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraInfo.h:1634
const UserData & userData() const
Get UserData
Definition: CameraInfo.h:1497
ModelName & modelName()
Get ModelName
Definition: CameraInfo.h:1432
bool operator!=(const CameraInfo &other) const
Inequality operator
CameraInfo & set(const Model &value)
Set Model
Definition: CameraInfo.h:1419
const CameraInfo::FirmwareVersion & get() const
Definition: CameraInfo.h:1525
const CameraInfo::Model & get() const
Definition: CameraInfo.h:1531
CameraInfo(const std::string &fileName)
Construct CameraInfo by loading from file
UserData & userData()
Get UserData
Definition: CameraInfo.h:1503
CameraInfo & set(const ModelName &value)
Set ModelName
Definition: CameraInfo.h:1438
const FirmwareVersion & firmwareVersion() const
Get FirmwareVersion
Definition: CameraInfo.h:1388
const CameraInfo::UserData::MaxSizeBytes & get() const
Definition: CameraInfo.h:1579
const Model & model() const
Get Model
Definition: CameraInfo.h:1407
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:1369
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:1622
Model & model()
Get Model
Definition: CameraInfo.h:1413
friend std::ostream & operator<<(std::ostream &stream, const CameraInfo &value)
Operator to send the value as string to a stream
Definition: CameraInfo.h:1654
const CameraInfo::ModelName & get() const
Definition: CameraInfo.h:1537
CameraInfo & set(const UserData &value)
Set UserData
Definition: CameraInfo.h:1509
CameraInfo & set(const UserData::MaxSizeBytes &value)
Set UserData::MaxSizeBytes
Definition: CameraInfo.h:1516
CameraInfo(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraInfo.h:1294
const CameraInfo::UserData & get() const
Definition: CameraInfo.h:1571
const CameraInfo::Revision::Minor & get() const
Definition: CameraInfo.h:1559
const SerialNumber & serialNumber() const
Get SerialNumber
Definition: CameraInfo.h:1478
SerialNumber & serialNumber()
Get SerialNumber
Definition: CameraInfo.h:1484
const Revision & revision() const
Get Revision
Definition: CameraInfo.h:1445
std::tuple< CameraInfo::FirmwareVersion, CameraInfo::Model, CameraInfo::ModelName, CameraInfo::Revision, CameraInfo::Revision::Major, CameraInfo::Revision::Minor, CameraInfo::SerialNumber, CameraInfo::UserData, CameraInfo::UserData::MaxSizeBytes > Descendants
Definition: CameraInfo.h:1257
void load(const std::string &fileName)
Load from the given file
CameraInfo & set(const FirmwareVersion &value)
Set FirmwareVersion
Definition: CameraInfo.h:1400
const CameraInfo::Revision::Major & get() const
Definition: CameraInfo.h:1551
void set(Args &&...args)
Set multiple arguments
Definition: CameraInfo.h:1329
CameraInfo & set(const Revision &value)
Set Revision
Definition: CameraInfo.h:1457
CameraInfo & set(const Revision::Major &value)
Set Revision::Major
Definition: CameraInfo.h:1464
CameraInfo & set(const SerialNumber &value)
Set SerialNumber
Definition: CameraInfo.h:1490
const CameraInfo::SerialNumber & get() const
Definition: CameraInfo.h:1565
const CameraInfo::Revision & get() const
Definition: CameraInfo.h:1543
std::string toString() const
Get the value as string
CameraInfo()
Default constructor
CameraInfo & set(const Revision::Minor &value)
Set Revision::Minor
Definition: CameraInfo.h:1471
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:118
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99