1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
3pub enum SupportedModule {
4 AlphaMat,
6 Aruco,
8 ArucoDetector,
10 Barcode,
12 BgSegm,
14 Bioinspired,
16 Calib,
18 Calib3d,
20 CannOps,
24 CCalib,
26 Core,
30 CudaArithm,
32 CudaBgSegm,
34 CudaCodec,
36 CudaFeatures2d,
38 CudaFilters,
40 CudaImgProc,
42 CudaLegacy,
44 CudaObjDetect,
46 CudaOptFlow,
48 CudaStereo,
50 CudaWarping,
52 CuDev,
56 Cvv,
58 Dnn,
60 DnnSuperRes,
62 Dpm,
64 Face,
66 Features,
68 Features2d,
70 Flann,
72 Freetype,
74 Fuzzy,
76 Gapi,
78 Geometry,
80 Hdf,
82 Hfs,
84 HighGui,
86 ImgHash,
88 ImgCodecs,
90 ImgProc,
92 IntensityTransform,
94 LineDescriptor,
96 Mcc,
98 Ml,
100 ObjDetect,
102 OptFlow,
104 Ovis,
106 PhaseUnwrapping,
108 Photo,
110 Plot,
112 PtCloud,
114 Quality,
116 Rapid,
118 Rgbd,
120 Saliency,
122 Sfm,
124 Shape,
126 Signal,
128 Stereo,
130 Stitching,
132 StructuredLight,
134 SuperRes,
136 SurfaceMatching,
138 Text,
140 Tracking,
142 Video,
144 VideoIo,
146 VideoStab,
148 Viz,
150 WechatQrCode,
152 XFeatures2d,
154 XImgProc,
156 XObjDetect,
158 XPhoto,
160 XStereo,
162}
163
164impl SupportedModule {
165 pub fn try_from_opencv_name(name: &str) -> Option<Self> {
166 match name {
167 "alphamat" => Some(Self::AlphaMat),
168 "aruco" => Some(Self::Aruco),
169 "aruco_detector" => Some(Self::ArucoDetector),
170 "barcode" => Some(Self::Barcode),
171 "bgsegm" => Some(Self::BgSegm),
172 "bioinspired" => Some(Self::Bioinspired),
173 "calib" => Some(Self::Calib),
174 "calib3d" => Some(Self::Calib3d),
175 "cannops" => Some(Self::CannOps),
176 "ccalib" => Some(Self::CCalib),
177 "core" => Some(Self::Core),
178 "cudaarithm" => Some(Self::CudaArithm),
179 "cudabgsegm" => Some(Self::CudaBgSegm),
180 "cudacodec" => Some(Self::CudaCodec),
181 "cudafeatures2d" => Some(Self::CudaFeatures2d),
182 "cudafilters" => Some(Self::CudaFilters),
183 "cudaimgproc" => Some(Self::CudaImgProc),
184 "cudalegacy" => Some(Self::CudaLegacy),
185 "cudaobjdetect" => Some(Self::CudaObjDetect),
186 "cudaoptflow" => Some(Self::CudaOptFlow),
187 "cudastereo" => Some(Self::CudaStereo),
188 "cudawarping" => Some(Self::CudaWarping),
189 "cudev" => Some(Self::CuDev),
190 "cvv" => Some(Self::Cvv),
191 "dnn" => Some(Self::Dnn),
192 "dnn_superres" => Some(Self::DnnSuperRes),
193 "dpm" => Some(Self::Dpm),
194 "face" => Some(Self::Face),
195 "features" => Some(Self::Features),
196 "features2d" => Some(Self::Features2d),
197 "flann" => Some(Self::Flann),
198 "freetype" => Some(Self::Freetype),
199 "fuzzy" => Some(Self::Fuzzy),
200 "gapi" => Some(Self::Gapi),
201 "geometry" => Some(Self::Geometry),
202 "hdf" => Some(Self::Hdf),
203 "hfs" => Some(Self::Hfs),
204 "highgui" => Some(Self::HighGui),
205 "img_hash" => Some(Self::ImgHash),
206 "imgcodecs" => Some(Self::ImgCodecs),
207 "imgproc" => Some(Self::ImgProc),
208 "intensity_transform" => Some(Self::IntensityTransform),
209 "line_descriptor" => Some(Self::LineDescriptor),
210 "mcc" => Some(Self::Mcc),
211 "ml" => Some(Self::Ml),
212 "objdetect" => Some(Self::ObjDetect),
213 "optflow" => Some(Self::OptFlow),
214 "ovis" => Some(Self::Ovis),
215 "phase_unwrapping" => Some(Self::PhaseUnwrapping),
216 "photo" => Some(Self::Photo),
217 "plot" => Some(Self::Plot),
218 "ptcloud" => Some(Self::PtCloud),
219 "quality" => Some(Self::Quality),
220 "rapid" => Some(Self::Rapid),
221 "rgbd" => Some(Self::Rgbd),
222 "saliency" => Some(Self::Saliency),
223 "sfm" => Some(Self::Sfm),
224 "shape" => Some(Self::Shape),
225 "signal" => Some(Self::Signal),
226 "stereo" => Some(Self::Stereo),
227 "stitching" => Some(Self::Stitching),
228 "structured_light" => Some(Self::StructuredLight),
229 "superres" => Some(Self::SuperRes),
230 "surface_matching" => Some(Self::SurfaceMatching),
231 "text" => Some(Self::Text),
232 "tracking" => Some(Self::Tracking),
233 "video" => Some(Self::Video),
234 "videoio" => Some(Self::VideoIo),
235 "videostab" => Some(Self::VideoStab),
236 "viz" => Some(Self::Viz),
237 "wechat_qrcode" => Some(Self::WechatQrCode),
238 "xfeatures2d" => Some(Self::XFeatures2d),
239 "ximgproc" => Some(Self::XImgProc),
240 "xobjdetect" => Some(Self::XObjDetect),
241 "xphoto" => Some(Self::XPhoto),
242 "xstereo" => Some(Self::XStereo),
243 _ => None,
244 }
245 }
246
247 pub fn opencv_name(self) -> &'static str {
248 match self {
249 Self::AlphaMat => "alphamat",
250 Self::Aruco => "aruco",
251 Self::ArucoDetector => "aruco_detector",
252 Self::Barcode => "barcode",
253 Self::BgSegm => "bgsegm",
254 Self::Bioinspired => "bioinspired",
255 Self::Calib => "calib",
256 Self::Calib3d => "calib3d",
257 Self::CannOps => "cannops",
258 Self::CCalib => "ccalib",
259 Self::Core => "core",
260 Self::CudaArithm => "cudaarithm",
261 Self::CudaBgSegm => "cudabgsegm",
262 Self::CudaCodec => "cudacodec",
263 Self::CudaFeatures2d => "cudafeatures2d",
264 Self::CudaFilters => "cudafilters",
265 Self::CudaImgProc => "cudaimgproc",
266 Self::CudaLegacy => "cudalegacy",
267 Self::CudaObjDetect => "cudaobjdetect",
268 Self::CudaOptFlow => "cudaoptflow",
269 Self::CudaStereo => "cudastereo",
270 Self::CuDev => "cudev",
271 Self::CudaWarping => "cudawarping",
272 Self::Cvv => "cvv",
273 Self::Dnn => "dnn",
274 Self::DnnSuperRes => "dnn_superres",
275 Self::Dpm => "dpm",
276 Self::Face => "face",
277 Self::Features => "features",
278 Self::Features2d => "features2d",
279 Self::Flann => "flann",
280 Self::Freetype => "freetype",
281 Self::Fuzzy => "fuzzy",
282 Self::Gapi => "gapi",
283 Self::Geometry => "geometry",
284 Self::Hdf => "hdf",
285 Self::Hfs => "hfs",
286 Self::HighGui => "highgui",
287 Self::ImgCodecs => "imgcodecs",
288 Self::ImgHash => "img_hash",
289 Self::ImgProc => "imgproc",
290 Self::IntensityTransform => "intensity_transform",
291 Self::LineDescriptor => "line_descriptor",
292 Self::Mcc => "mcc",
293 Self::Ml => "ml",
294 Self::ObjDetect => "objdetect",
295 Self::OptFlow => "optflow",
296 Self::Ovis => "ovis",
297 Self::PhaseUnwrapping => "phase_unwrapping",
298 Self::Photo => "photo",
299 Self::Plot => "plot",
300 Self::PtCloud => "ptcloud",
301 Self::Quality => "quality",
302 Self::Rapid => "rapid",
303 Self::Rgbd => "rgbd",
304 Self::Saliency => "saliency",
305 Self::Sfm => "sfm",
306 Self::Shape => "shape",
307 Self::Signal => "signal",
308 Self::Stereo => "stereo",
309 Self::Stitching => "stitching",
310 Self::StructuredLight => "structured_light",
311 Self::SuperRes => "superres",
312 Self::SurfaceMatching => "surface_matching",
313 Self::Text => "text",
314 Self::Tracking => "tracking",
315 Self::Video => "video",
316 Self::VideoIo => "videoio",
317 Self::VideoStab => "videostab",
318 Self::Viz => "viz",
319 Self::WechatQrCode => "wechat_qrcode",
320 Self::XFeatures2d => "xfeatures2d",
321 Self::XImgProc => "ximgproc",
322 Self::XObjDetect => "xobjdetect",
323 Self::XPhoto => "xphoto",
324 Self::XStereo => "xstereo",
325 }
326 }
327
328 pub fn rust_name(self) -> &'static str {
329 self.opencv_name()
330 }
331}