opencv_binding_generator/settings/
generator_module_tweaks.rs1use super::TypeRefFactory;
2use crate::type_ref::TypeRefDesc;
3
4#[derive(Debug)]
5pub struct ModuleTweak<'l> {
6 pub generate_types: &'l [TypeRefFactory],
7}
8
9impl ModuleTweak<'_> {
10 pub fn empty() -> Self {
11 Self { generate_types: &[] }
12 }
13}
14
15pub fn generator_module_tweaks_factory(module: &str) -> ModuleTweak<'static> {
16 match module {
17 "core" => ModuleTweak {
18 generate_types: &[
19 TypeRefDesc::ptr_of_float,
20 TypeRefDesc::ptr_of_cv_keypoint,
22 ],
23 },
24 "aruco" => ModuleTweak {
25 generate_types: &[TypeRefDesc::vector_of_cv_vec3f, TypeRefDesc::vector_of_cv_vec3d],
26 },
27 "ccalib" => ModuleTweak {
28 generate_types: &[
29 TypeRefDesc::vector_of_vector_of_cv_vec3f,
31 TypeRefDesc::vector_of_vector_of_cv_vec3d,
32 TypeRefDesc::vector_of_vector_of_cv_point3f,
33 TypeRefDesc::vector_of_vector_of_cv_point3d,
34 TypeRefDesc::vector_of_vector_of_cv_vec2f,
36 TypeRefDesc::vector_of_vector_of_cv_point2f,
37 TypeRefDesc::vector_of_vector_of_cv_vec2d,
38 TypeRefDesc::vector_of_vector_of_cv_point2d,
39 ],
40 },
41 "calib3d" | "calib" | "3d" => ModuleTweak {
42 generate_types: &[
43 TypeRefDesc::vector_of_cv_point3i,
45 TypeRefDesc::vector_of_vector_of_cv_point3i,
46 TypeRefDesc::vector_of_cv_point3f,
47 TypeRefDesc::vector_of_vector_of_cv_point3f,
48 TypeRefDesc::vector_of_cv_point3d,
49 TypeRefDesc::vector_of_vector_of_cv_point3d,
50 TypeRefDesc::vector_of_cv_vec3f,
51 TypeRefDesc::vector_of_vector_of_cv_vec3f,
52 TypeRefDesc::vector_of_vector_of_double,
54 TypeRefDesc::vector_of_cv_point2d,
56 ],
57 },
58 "dnn" => ModuleTweak {
59 generate_types: &[TypeRefDesc::vector_of_vector_of_int], },
61 "features2d" | "features" => ModuleTweak {
62 generate_types: &[TypeRefDesc::ptr_of_cv_feature2d],
64 },
65 "imgproc" => ModuleTweak {
66 generate_types: &[
67 TypeRefDesc::vector_of_cv_vec4i,
69 TypeRefDesc::vector_of_vector_of_cv_point,
70 TypeRefDesc::vector_of_cv_vec2f,
72 TypeRefDesc::vector_of_cv_vec2d,
73 TypeRefDesc::vector_of_cv_vec3f,
74 TypeRefDesc::vector_of_cv_vec3d,
75 ],
76 },
77 _ => ModuleTweak::empty(),
78 }
79}