Skip to main content

opencv_binding_generator/
supported_module.rs

1// !! Update `pub static SUPPORTED_MODULES` in `enums.rs` when changing this
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
3pub enum SupportedModule {
4	/// alphamat
5	AlphaMat,
6	/// aruco
7	Aruco,
8	/// aruco_detector
9	ArucoDetector,
10	/// barcode
11	Barcode,
12	/// bgsegm
13	BgSegm,
14	/// bioinspired
15	Bioinspired,
16	/// calib
17	Calib,
18	/// calib3d
19	Calib3d,
20	/// cannops
21	///
22	/// Not supported
23	CannOps,
24	/// ccalib
25	CCalib,
26	/// core
27	///
28	/// Always present
29	Core,
30	/// cudaarithm
31	CudaArithm,
32	/// cudabgsegm
33	CudaBgSegm,
34	/// cudacodec
35	CudaCodec,
36	/// cudafeatures2d
37	CudaFeatures2d,
38	/// cudafilters
39	CudaFilters,
40	/// cudaimgproc
41	CudaImgProc,
42	/// cudalegacy
43	CudaLegacy,
44	/// cudaobjdetect
45	CudaObjDetect,
46	/// cudaoptflow
47	CudaOptFlow,
48	/// cudastereo
49	CudaStereo,
50	/// cudawarping
51	CudaWarping,
52	/// cudev
53	///
54	/// Not supported
55	CuDev,
56	/// cvv
57	Cvv,
58	/// dnn
59	Dnn,
60	/// dnn_superres
61	DnnSuperRes,
62	/// dpm
63	Dpm,
64	/// face
65	Face,
66	/// features
67	Features,
68	/// features2d
69	Features2d,
70	/// flann
71	Flann,
72	/// freetype
73	Freetype,
74	/// fuzzy
75	Fuzzy,
76	/// gapi
77	Gapi,
78	/// geometry
79	Geometry,
80	/// hdf
81	Hdf,
82	/// hfs
83	Hfs,
84	/// highgui
85	HighGui,
86	/// img_hash
87	ImgHash,
88	/// imgcodecs
89	ImgCodecs,
90	/// imgproc
91	ImgProc,
92	/// intensity_transform
93	IntensityTransform,
94	/// line_descriptor
95	LineDescriptor,
96	/// mcc
97	Mcc,
98	/// ml
99	Ml,
100	/// objdetect
101	ObjDetect,
102	/// optflow
103	OptFlow,
104	/// ovis
105	Ovis,
106	/// phase_unwrapping
107	PhaseUnwrapping,
108	/// photo
109	Photo,
110	/// plot
111	Plot,
112	/// ptcloud
113	PtCloud,
114	/// quality
115	Quality,
116	/// rapid
117	Rapid,
118	/// rgbd
119	Rgbd,
120	/// saliency
121	Saliency,
122	/// sfm
123	Sfm,
124	/// shape
125	Shape,
126	/// signal
127	Signal,
128	/// stereo
129	Stereo,
130	/// stitching
131	Stitching,
132	/// structured_light
133	StructuredLight,
134	/// superres
135	SuperRes,
136	/// surface_matching
137	SurfaceMatching,
138	/// text
139	Text,
140	/// tracking
141	Tracking,
142	/// video
143	Video,
144	/// videoio
145	VideoIo,
146	/// videostab
147	VideoStab,
148	/// viz
149	Viz,
150	/// wechat_qrcode
151	WechatQrCode,
152	/// xfeatures2d
153	XFeatures2d,
154	/// ximgproc
155	XImgProc,
156	/// xobjdetect
157	XObjDetect,
158	/// xphoto
159	XPhoto,
160	/// xstereo
161	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}