opencv_binding_generator/settings/
generator_module_tweaks.rsuse super::TypeRefFactory;
use crate::type_ref::TypeRefDesc;
#[derive(Debug)]
pub struct ModuleTweak<'l> {
pub generate_types: &'l [TypeRefFactory],
}
impl ModuleTweak<'_> {
pub fn empty() -> Self {
Self { generate_types: &[] }
}
}
pub fn generator_module_tweaks_factory(module: &str) -> ModuleTweak<'static> {
match module {
"core" => ModuleTweak {
generate_types: &[
TypeRefDesc::ptr_of_float,
TypeRefDesc::ptr_of_cv_keypoint,
],
},
"aruco" => ModuleTweak {
generate_types: &[TypeRefDesc::vector_of_cv_vec3f, TypeRefDesc::vector_of_cv_vec3d],
},
"ccalib" => ModuleTweak {
generate_types: &[
TypeRefDesc::vector_of_vector_of_cv_vec3f,
TypeRefDesc::vector_of_vector_of_cv_vec3d,
TypeRefDesc::vector_of_vector_of_cv_point3f,
TypeRefDesc::vector_of_vector_of_cv_point3d,
TypeRefDesc::vector_of_vector_of_cv_vec2f,
TypeRefDesc::vector_of_vector_of_cv_point2f,
TypeRefDesc::vector_of_vector_of_cv_vec2d,
TypeRefDesc::vector_of_vector_of_cv_point2d,
],
},
"calib3d" | "calib" | "3d" => ModuleTweak {
generate_types: &[
TypeRefDesc::vector_of_cv_point3i,
TypeRefDesc::vector_of_vector_of_cv_point3i,
TypeRefDesc::vector_of_cv_point3f,
TypeRefDesc::vector_of_vector_of_cv_point3f,
TypeRefDesc::vector_of_cv_point3d,
TypeRefDesc::vector_of_vector_of_cv_point3d,
TypeRefDesc::vector_of_cv_vec3f,
TypeRefDesc::vector_of_vector_of_cv_vec3f,
TypeRefDesc::vector_of_vector_of_double,
TypeRefDesc::vector_of_cv_point2d,
],
},
"dnn" => ModuleTweak {
generate_types: &[TypeRefDesc::vector_of_vector_of_int], },
"features2d" | "features" => ModuleTweak {
generate_types: &[TypeRefDesc::ptr_of_cv_feature2d],
},
"imgproc" => ModuleTweak {
generate_types: &[
TypeRefDesc::vector_of_cv_vec4i,
TypeRefDesc::vector_of_vector_of_cv_point,
TypeRefDesc::vector_of_cv_vec2f,
TypeRefDesc::vector_of_cv_vec2d,
TypeRefDesc::vector_of_cv_vec3f,
TypeRefDesc::vector_of_cv_vec3d,
],
},
_ => ModuleTweak::empty(),
}
}