Skip to main content

opencv_binding_generator/typedef/
desc.rs

1use std::rc::Rc;
2
3use super::Typedef;
4use crate::type_ref::{TypeRef, TypeRefDesc};
5use crate::SupportedModule;
6
7pub struct TypedefDesc<'tu, 'ge> {
8	pub cpp_fullname: Rc<str>,
9	pub rust_module: SupportedModule,
10	pub underlying_type: TypeRef<'tu, 'ge>,
11}
12
13impl<'tu, 'ge> TypedefDesc<'tu, 'ge> {
14	pub fn new(cpp_fullname: impl Into<Rc<str>>, rust_module: SupportedModule, underlying_type: TypeRef<'tu, 'ge>) -> Self {
15		Self {
16			cpp_fullname: cpp_fullname.into(),
17			rust_module,
18			underlying_type,
19		}
20	}
21
22	/// `cv::Vec4i`
23	pub fn cv_vec4i() -> Typedef<'tu, 'ge> {
24		Typedef::new_desc(Self::new("cv::Vec4i", SupportedModule::Core, TypeRefDesc::cv_vec()))
25	}
26
27	/// `cv::Scalar`
28	pub fn cv_scalar() -> Typedef<'tu, 'ge> {
29		Typedef::new_desc(Self::new("cv::Scalar", SupportedModule::Core, TypeRefDesc::cv_scalar_()))
30	}
31
32	/// `cv::Size`
33	pub fn cv_size() -> Typedef<'tu, 'ge> {
34		Typedef::new_desc(Self::new("cv::Size", SupportedModule::Core, TypeRefDesc::cv_size_()))
35	}
36
37	/// `cv::Point`
38	pub fn cv_point() -> Typedef<'tu, 'ge> {
39		Typedef::new_desc(Self::new("cv::Point", SupportedModule::Core, TypeRefDesc::cv_point_()))
40	}
41
42	/// `cv::Point2f`
43	pub fn cv_point2f() -> Typedef<'tu, 'ge> {
44		Typedef::new_desc(Self::new("cv::Point2f", SupportedModule::Core, TypeRefDesc::cv_point_()))
45	}
46
47	/// `cv::Point2d`
48	pub fn cv_point2d() -> Typedef<'tu, 'ge> {
49		Typedef::new_desc(Self::new("cv::Point2d", SupportedModule::Core, TypeRefDesc::cv_point_()))
50	}
51
52	/// `cv::Point3i`
53	pub fn cv_point3i() -> Typedef<'tu, 'ge> {
54		Typedef::new_desc(Self::new("cv::Point3i", SupportedModule::Core, TypeRefDesc::cv_point_()))
55	}
56
57	/// `cv::Point3f`
58	pub fn cv_point3f() -> Typedef<'tu, 'ge> {
59		Typedef::new_desc(Self::new("cv::Point3f", SupportedModule::Core, TypeRefDesc::cv_point_()))
60	}
61
62	/// `cv::Point3d`
63	pub fn cv_point3d() -> Typedef<'tu, 'ge> {
64		Typedef::new_desc(Self::new("cv::Point3d", SupportedModule::Core, TypeRefDesc::cv_point_()))
65	}
66
67	/// `cv::Vec2f`
68	pub fn cv_vec2f() -> Typedef<'tu, 'ge> {
69		Typedef::new_desc(Self::new("cv::Vec2f", SupportedModule::Core, TypeRefDesc::cv_vec()))
70	}
71
72	/// `cv::Vec2d`
73	pub fn cv_vec2d() -> Typedef<'tu, 'ge> {
74		Typedef::new_desc(Self::new("cv::Vec2d", SupportedModule::Core, TypeRefDesc::cv_vec()))
75	}
76
77	/// `cv::Vec3f`
78	pub fn cv_vec3f() -> Typedef<'tu, 'ge> {
79		Typedef::new_desc(Self::new("cv::Vec3f", SupportedModule::Core, TypeRefDesc::cv_vec()))
80	}
81
82	/// `cv::Vec3d`
83	pub fn cv_vec3d() -> Typedef<'tu, 'ge> {
84		Typedef::new_desc(Self::new("cv::Vec3d", SupportedModule::Core, TypeRefDesc::cv_vec()))
85	}
86}