opencv_binding_generator/
supported_module.rs

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