Zivid C++ API 2.9.0+4dbba385-1
Defining the Future of 3D Machine Vision
SettingsInfo.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 <Zivid/CameraInfo.h>
94#include <Zivid/Range.h>
95#include <Zivid/Resolution.h>
96#include <Zivid/Settings.h>
97#include <Zivid/Settings2D.h>
98
99#define ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(T) ZIVID_CORE_EXPORT T defaultValue(Tag<T> tag, const CameraInfo &cameraInfo);
100
101#define ZIVID_DETAIL_CAMERA_VALID_VALUES(T) \
102 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(T) \
103 ZIVID_CORE_EXPORT std::set<T::ValueType> validValues(Tag<T> tag, const CameraInfo &cameraInfo)
104
105#define ZIVID_DETAIL_CAMERA_VALID_RANGE(T) \
106 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(T) \
107 ZIVID_CORE_EXPORT Range<T::ValueType> validRange(Tag<T> tag, const CameraInfo &cameraInfo)
108
109namespace Zivid
110{
111#ifndef NO_DOC
113 namespace Detail
114 {
115 template<typename T>
116 using Tag = Detail::TypeTraits::TypeIdentity<T>;
117
118 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Acquisition);
119 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Acquisitions);
120 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Diagnostics);
121 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Experimental);
122 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Color::Balance);
123 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Color);
124 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Color::Experimental);
125 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Color::Experimental::Mode);
126 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Experimental::ContrastDistortion::Correction);
127 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Experimental::ContrastDistortion::Removal);
128 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Experimental::ContrastDistortion);
129 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Cluster::Removal);
130 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Cluster);
131 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Experimental);
132 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Experimental::HoleFilling);
133 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Noise::Removal);
134 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Noise);
135 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Outlier::Removal);
136 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Outlier);
137 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Reflection::Removal);
138 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Reflection::Removal::Experimental);
139 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Reflection::Removal::Experimental::Mode);
140 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Reflection);
141 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Smoothing::Gaussian);
142 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters::Smoothing);
143 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing::Filters);
144 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::Processing);
145 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest);
146 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Box);
147 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Box::Extents);
148 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Box::PointO);
149 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Box::PointA);
150 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Box::PointB);
151 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Depth);
152 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings::RegionOfInterest::Depth::Range);
154 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings2D::Acquisition);
155 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings2D::Acquisitions);
156 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings2D::Processing::Color::Balance);
157 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings2D::Processing::Color);
158 ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(Settings2D::Processing);
160
161 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Acquisition::Aperture);
162 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Acquisition::Brightness);
163 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Acquisition::ExposureTime);
164 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Acquisition::Gain);
165 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Color::Balance::Blue);
166 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Color::Balance::Green);
167 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Color::Balance::Red);
168 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Color::Gamma);
170 Settings::Processing::Filters::Experimental::ContrastDistortion::Correction::Strength);
171 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Cluster::Removal::MinArea);
172 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Cluster::Removal::MaxNeighborDistance);
174 Settings::Processing::Filters::Experimental::ContrastDistortion::Removal::Threshold);
175 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Experimental::HoleFilling::Strictness);
176 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Experimental::HoleFilling::HoleSize);
177 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Noise::Removal::Threshold);
178 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Outlier::Removal::Threshold);
179 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings::Processing::Filters::Smoothing::Gaussian::Sigma);
180 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Acquisition::Aperture);
181 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Acquisition::Brightness);
182 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Acquisition::ExposureTime);
183 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Acquisition::Gain);
184 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Processing::Color::Balance::Blue);
185 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Processing::Color::Balance::Green);
186 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Processing::Color::Balance::Red);
187 ZIVID_DETAIL_CAMERA_VALID_RANGE(Settings2D::Processing::Color::Gamma);
188
189 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Diagnostics::Enabled);
190 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Experimental::Engine);
191 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Color::Experimental::Mode);
193 Settings::Processing::Filters::Experimental::ContrastDistortion::Correction::Enabled);
194 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Cluster::Removal::Enabled);
196 Settings::Processing::Filters::Experimental::ContrastDistortion::Removal::Enabled);
197 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Experimental::HoleFilling::Enabled);
198 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Noise::Removal::Enabled);
199 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Outlier::Removal::Enabled);
200 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Reflection::Removal::Enabled);
201 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Reflection::Removal::Experimental::Mode);
202 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::Processing::Filters::Smoothing::Gaussian::Enabled);
203 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::RegionOfInterest::Depth::Enabled);
204 ZIVID_DETAIL_CAMERA_VALID_VALUES(Settings::RegionOfInterest::Box::Enabled);
205 } // namespace Detail
206#endif
207
208 namespace Experimental
209 {
210 namespace SettingsInfo
211 {
212 template<typename T>
213 T defaultValue(const CameraInfo &cameraInfo)
214 {
215 return Detail::defaultValue(Detail::Tag<T>{}, cameraInfo);
216 }
217
218 template<typename T>
219 std::set<typename T::ValueType> validValues(const CameraInfo &cameraInfo)
220 {
221 return Detail::validValues(Detail::Tag<T>{}, cameraInfo);
222 }
223
224 template<typename T, typename Ret = Range<typename T::ValueType>>
225 Ret validRange(const CameraInfo &cameraInfo)
226 {
227 return Detail::validRange(Detail::Tag<T>{}, cameraInfo);
228 }
229
230 ZIVID_CORE_EXPORT Resolution resolution(const CameraInfo &cameraInfo, const Settings &settings);
231 } // namespace SettingsInfo
232 } // namespace Experimental
233} // namespace Zivid
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
#define ZIVID_DETAIL_CAMERA_VALID_RANGE(T)
Definition: SettingsInfo.h:105
#define ZIVID_DETAIL_CAMERA_DEFAULT_VALUE(T)
Definition: SettingsInfo.h:99
#define ZIVID_DETAIL_CAMERA_VALID_VALUES(T)
Definition: SettingsInfo.h:101
Information about camera model, serial number etc.
Definition: CameraInfo.h:123
Class describing a given resolution
Definition: Resolution.h:101
Settings used when capturing with a Zivid camera
Definition: Settings.h:124
T defaultValue(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:213
ZIVID_CORE_EXPORT Resolution resolution(const CameraInfo &cameraInfo, const Settings &settings)
Ret validRange(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:225
std::set< typename T::ValueType > validValues(const CameraInfo &cameraInfo)
Definition: SettingsInfo.h:219
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99