Implement settings-cleanup helper and use it to clean up settings
ADD
binding-generator/src/bin/settings-cleanup.rs
+use std::{
+ collections::HashSet,
+ env,
+ path::{Path, PathBuf},
+};
+
+use clang::{Clang, Entity, EntityKind, Type};
+
+use opencv_binding_generator::{
+ Class,
+ Element,
+ EntityExt,
+ EntityWalker,
+ EntityWalkerVisitor,
+ Func,
+ Generator,
+ GeneratorEnv,
+ main_module_from_path,
+ module_from_path,
+ settings,
+};
+
+struct FunctionFinder<'tu, 'f> {
+ pub gen_env: GeneratorEnv<'tu>,
+ pub func_rename_unused: &'f mut HashSet<&'static str>,
+ pub func_cfg_attr_unused: &'f mut HashSet<&'static str>,
+ pub func_unsafe_unused: &'f mut HashSet<&'static str>,
+ pub func_manual_unused: &'f mut HashSet<&'static str>,
+ pub func_specialize_unused: &'f mut HashSet<&'static str>,
+ pub slice_argument_unused: &'f mut HashSet<&'static str>, // fixme, doesn't seem to work perfectly (shows cv::mixChannels, but it's def used)
+}
+
+impl<'tu, 'f> FunctionFinder<'tu, 'f> {
+ pub fn update_used_func_identifier(&mut self, identifier: &str) {
+ self.func_rename_unused.remove(identifier);
+ self.func_cfg_attr_unused.remove(identifier);
+ self.func_unsafe_unused.remove(identifier);
+ self.func_manual_unused.remove(identifier);
+ self.func_specialize_unused.remove(identifier);
+ }
+
+ pub fn update_used_func_cpp_fullname(&mut self, cpp_fullname: &str) {
+ self.slice_argument_unused.remove(cpp_fullname);
+ }
+}
+
+impl<'tu> EntityWalkerVisitor<'tu> for FunctionFinder<'tu, '_> {
+ fn wants_file(&mut self, path: &Path) -> bool {
+ module_from_path(path).map_or(false, |m| m == self.gen_env.module())
+ || main_module_from_path(path).map_or(false, |m| m == self.gen_env.module())
+ }
+
+ fn visit_resolve_type(&mut self, _typ: Type<'tu>) -> bool {
+ false
+ }
+
+ fn visit_entity(&mut self, entity: Entity<'tu>) -> bool {
+ match entity.get_kind() {
+ EntityKind::ClassDecl | EntityKind::ClassTemplate | EntityKind::ClassTemplatePartialSpecialization
+ | EntityKind::StructDecl => {
+ let c = Class::new(entity, &self.gen_env);
+ if !c.is_template() {
+ let fields = c.fields();
+ let mut methods = c.methods().into_iter()
+ .chain(c.field_methods(fields.iter()))
+ .collect::<Vec<_>>();
+ entity.walk_methods_while(|child| {
+ let func = Func::new(child, &self.gen_env);
+ if func.is_generic() {
+ methods.push(func);
+ }
+ true
+ });
+ let methods = methods.into_iter()
+ .map(|m| (m.identifier().into_owned(), m.cpp_fullname().into_owned()))
+ .collect::<Vec<_>>();
+ for (identifier, cpp_fullname) in methods {
+ self.update_used_func_identifier(&identifier);
+ self.update_used_func_cpp_fullname(&cpp_fullname);
+ }
+ }
+ true
+ }
+ EntityKind::FunctionDecl => {
+ let f = Func::new(entity, &self.gen_env);
+ let identifier = f.identifier().into_owned();
+ self.update_used_func_identifier(&identifier);
+ true
+ }
+ _ => true
+ }
+ }
+}
+
+fn main() {
+ let mut args = env::args_os().skip(1);
+ let opencv_header_base_dir = PathBuf::from(args.next().expect("1st argument must be OpenCV header dir"));
+ let src_cpp_dir = PathBuf::from(args.next().expect("2nd argument must be dir with custom cpp"));
+ let opencv_header_dirs = opencv_header_base_dir.read_dir().expect("Can't read opencv_header_base_dir")
+ .map(|p| p.expect("Bad path").path())
+ .filter(|p| p.is_dir());
+ let clang = Clang::new().expect("Cannot initialize clang");
+ let mut func_rename_unused = settings::FUNC_RENAME.keys().copied().collect::<HashSet<_>>();
+ let mut func_cfg_attr_unused = settings::FUNC_CFG_ATTR.keys().copied().collect::<HashSet<_>>();
+ let mut func_unsafe_unused = settings::FUNC_UNSAFE.clone();
+ let mut func_manual_unused = settings::FUNC_MANUAL.keys().copied().collect::<HashSet<_>>();
+ let mut func_specialize_unused = settings::FUNC_SPECIALIZE.keys().copied().collect::<HashSet<_>>();
+ let mut slice_argument_unused = settings::SLICE_ARGUMENT.keys().copied()
+ .map(|(cpp_fullname, _)| cpp_fullname)
+ .collect::<HashSet<_>>();
+ for opencv_header_dir in opencv_header_dirs {
+ println!("Processing header dir: {}", opencv_header_dir.display());
+ let modules = opencv_header_dir.join("opencv2").read_dir().expect("Can't read dir")
+ .map(|p| p.expect("Bad path").path())
+ .filter(|p| p.is_file()
+ && p.extension()
+ .map_or(false, |e| e == "hpp")
+ )
+ .filter_map(|mut p| {
+ p.set_extension("");
+ p.file_name()
+ .and_then(|f| f.to_str())
+ .map(|f| f.to_string())
+ });
+ for module in modules {
+ println!(" {}", module);
+ Generator::new(None, &opencv_header_dir, &src_cpp_dir, &clang)
+ .process_module(&module, |root_entity| {
+ let gen_env = GeneratorEnv::new(root_entity, &module);
+ let walker = EntityWalker::new(root_entity);
+ walker.walk_opencv_entities(FunctionFinder {
+ gen_env,
+ func_rename_unused: &mut func_rename_unused,
+ func_cfg_attr_unused: &mut func_cfg_attr_unused,
+ func_unsafe_unused: &mut func_unsafe_unused,
+ func_manual_unused: &mut func_manual_unused,
+ func_specialize_unused: &mut func_specialize_unused,
+ slice_argument_unused: &mut slice_argument_unused,
+ });
+ });
+ }
+ }
+ println!("Unused entries in settings::FUNC_RENAME:");
+ for f in func_rename_unused {
+ println!("{}", f);
+ }
+ println!("Unused entries in settings::FUNC_CFG_ATTR:");
+ for f in func_cfg_attr_unused {
+ println!("{}", f);
+ }
+ println!("Unused entries in settings::FUNC_UNSAFE:");
+ for f in func_unsafe_unused {
+ println!("{}", f);
+ }
+ println!("Unused entries in settings::FUNC_UNSAFE:");
+ for f in func_manual_unused {
+ println!("{}", f);
+ }
+ println!("Unused entries in settings::FUNC_SPECIALIZE:");
+ for f in func_specialize_unused {
+ println!("{}", f);
+ }
+ println!("Unused entries in settings::SLICE_ARGUMENT:");
+ for f in slice_argument_unused {
+ println!("{}", f);
+ }
+}

MODIFY
binding-generator/src/lib.rs
binding-generator/src/lib.rs
@@ -31,10 +31,8 @@ use dunce::canonicalize;
pub use class::Class;
pub use constant::Const;
-use element::{DefaultElement, EntityElement};
-pub use element::{Element, GeneratedElement};
-use element::{is_opencv_path, main_module_from_path, main_opencv_module_from_path, module_from_path};
-use entity::EntityExt;
+pub use element::{DefaultElement, Element, EntityElement, GeneratedElement, is_opencv_path, main_module_from_path, main_opencv_module_from_path, module_from_path};
+pub use entity::EntityExt;
pub use enumeration::Enum;
use field::{Field, FieldTypeHint};
pub use func::{Func, FunctionTypeHint};
@@ -42,7 +40,7 @@ use function::Function;
#[allow(unused)]
use generator::{dbg_clang_entity, dbg_clang_type};
pub use generator::{Generator, GeneratorVisitor};
-use generator_env::{ExportConfig, GeneratorEnv};
+pub use generator_env::{ExportConfig, GeneratorEnv};
pub use iterator_ext::IteratorExt;
#[allow(unused)]
use memoize::{memo, memo_map, Memoize, MemoizeMap};
@@ -53,7 +51,7 @@ pub use string_ext::{CompiledInterpolation, StrExt, StringExt};
use type_ref::{Constness, DependentTypeMode, TypeRef, TypeRefTypeHint};
pub use typedef::Typedef;
use vector::Vector;
-use walker::{EntityWalker, EntityWalkerVisitor};
+pub use walker::{EntityWalker, EntityWalkerVisitor};
mod class;
pub mod comment;

MODIFY
binding-generator/src/settings.rs
binding-generator/src/settings.rs
@@ -28,8 +28,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
// ### calib3d ###
"cv_LMSolver_create_const_Ptr_Callback_X_int_double" => "+_ext",
- "cv_findCirclesGrid_const__InputArrayX_Size_const__OutputArrayX_int_const_Ptr_FeatureDetector_X_const_CirclesGridFinderParametersX" => "+_params",
- "cv_findCirclesGrid_const__InputArrayX_Size_const__OutputArrayX_int_const_Ptr_FeatureDetector_X_CirclesGridFinderParameters" => "+_params", // 3.4
"cv_findEssentialMat_const__InputArrayX_const__InputArrayX_const__InputArrayX_int_double_double_const__OutputArrayX" => "+_matrix",
"cv_findFundamentalMat_const__InputArrayX_const__InputArrayX_const__OutputArrayX_int_double_double" => "+_mask",
"cv_findHomography_const__InputArrayX_const__InputArrayX_int_double_const__OutputArrayX_int_double" => "+_ext",
@@ -72,7 +70,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_MatOp_divide_const_double_const_MatExprX_MatExprX" => "+_f64",
"cv_MatOp_multiply_const_const_MatExprX_double_MatExprX" => "+_f64",
"cv_MatOp_subtract_const_const_ScalarX_const_MatExprX_MatExprX" => "+_scalar",
- "cv_MatOp_type_const_MatExpr" => "typ",
"cv_Mat_Mat_Size_int" => "+_size",
"cv_Mat_Mat_Size_int_const_ScalarX" => "+_size_with_default",
"cv_Mat_Mat_Size_int_voidX_size_t" => "+_size_with_data",
@@ -250,13 +247,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_operatorX_const_MatX_double" => "+_mat_f64",
"cv_operatorX_double_const_MatExprX" => "+_f64_matexpr",
"cv_operatorX_double_const_MatX" => "+_f64_mat",
- "cv_read_FileNode_Range_Range" => "+_range",
- "cv_read_FileNode_VectorOfDMatch_VectorOfDMatch" => "+_dmatch_vec",
- "cv_read_FileNode_VectorOfKeyPoint_VectorOfKeyPoint" => "+_keypoint_vec",
- "cv_read_FileNode_bool_bool" => "+_bool",
- "cv_read_FileNode_short_short" => "+_i16",
- "cv_read_FileNode_uchar_uchar" => "+_u8",
- "cv_read_FileNode_ushort_ushort" => "+_u16",
"cv_read_const_FileNodeX_DMatchX_const_DMatchX" => "+_dmatch",
"cv_read_const_FileNodeX_KeyPointX_const_KeyPointX" => "+_keypoint",
"cv_read_const_FileNodeX_MatX_const_MatX" => "+_mat",
@@ -284,53 +274,29 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_write_FileStorageX_const_StringX_double" => "+_f64",
"cv_write_FileStorageX_const_StringX_float" => "+_f32",
"cv_write_FileStorageX_const_StringX_int" => "+_i32",
- "cv_write_FileStorage_DMatch" => "+_dmatch",
- "cv_write_FileStorage_KeyPoint" => "+_keypoint",
- "cv_write_FileStorage_Range" => "+_range",
- "cv_write_FileStorage_String_DMatch" => "+_dmatch",
- "cv_write_FileStorage_String_KeyPoint" => "+_keypoint",
- "cv_write_FileStorage_String_Range" => "+_range",
- "cv_write_FileStorage_VectorOfDMatch" => "+_dmatch_vec",
- "cv_write_FileStorage_VectorOfKeyPoint" => "+_keypoint_vec",
"cv_AsyncArray__getImpl_const" => "-",
"cv_MatExpr_op_const" => "-", // fixme implement PointerOf types
"cv_Mat_Mat_const_MatX_const_RangeX" => "-", // duplicate of cv_Mat_Mat_Mat_VectorOfRange, but with pointers
- "cv_Mat_Mat_int_const_int_X_int" => "-", // duplicate of cv_Mat_Mat_VectorOfint_int, but with pointers
- "cv_Mat_Mat_int_const_int_X_int_Scalar" => "-", // duplicate of cv_Mat_Mat_VectorOfint_int_Scalar, but with pointers
- "cv_Mat_Mat_int_const_int_X_int_void_X_const_size_t_X" => "-", // duplicate of cv_Mat_Mat_VectorOfint_int_void_X_const_size_t_X, but with pointers
"cv_Mat_copySize_const_MatX" => "-", // internal function
"cv_Mat_push_back__const_voidX" => "-", // internal method
"cv_Mat_setSize_MatSize" => "-", // MatSize and MatStep types prevent assignment
"cv_Mat_setStep_MatStep" => "-", // MatSize and MatStep types prevent assignment
- "cv_Mat_set_size_MatSize" => "-", // doesn't allow writing
- "cv_Mat_set_step_MatStep" => "-", // same as above
"cv_UMat_UMat_const_UMatX_const_RangeX" => "-", // duplicate of cv_UMat_UMat_UMat_VectorOfRange, but with pointers
"cv_UMat_copySize_const_UMatX" => "-", // internal function
"cv_UMat_setSize_MatSize" => "-", // MatSize and MatStep types prevent assignment
"cv_UMat_setStep_MatStep" => "-", // MatSize and MatStep types prevent assignment
- "cv_UMat_set_size_MatSize" => "-", // doesn't allow writing
- "cv_UMat_set_step_MatStep" => "-", // same as above
"cv_addImpl_int_const_charX" => "-",
"cv_calcCovarMatrix_const_MatX_int_MatX_MatX_int_int" => "-", // duplicate of cv_calcCovarMatrix_const__InputArrayX_const__OutputArrayX_const__InputOutputArrayX_int_int, but with pointers
"cv_cv_abs_short" => "-",
- "cv_cv_abs_uchar" => "-",
"cv_detail_depthToString__int" => "-", // detail function
"cv_detail_typeToString__int" => "-", // detail function
- "cv_double_const" => "-",
"cv_fastFree_voidX" => "-", // manual memory allocation
"cv_fastMalloc_size_t" => "-", // manual memory allocation
- "cv_float_const" => "-",
"cv_format_const_charX" => "-", // 3.2 accepts varargs, duplicate definition
"cv_hconcat_const_MatX_size_t_const__OutputArrayX" => "-", // duplicate of cv_hconcat_VectorOfMat_Mat, but with pointers
- "cv_int_const" => "-",
"cv_mixChannels_const_MatX_size_t_MatX_size_t_const_intX_size_t" => "-", // duplicate of cv_mixChannels_VectorOfMat_VectorOfMat_VectorOfint, but with pointers
"cv_ocl_ProgramSource_ProgramSource_const_charX" => "-", // has duplicate with String
- "cv_ocl_internal_isCLBuffer_UMat" => "-",
- "cv_ocl_internal_isOpenCLForced" => "-",
- "cv_ocl_internal_isPerformanceCheckBypassed" => "-",
- "cv_operator_std_string_const" => "-",
- "cv_read_FileNode_schar_schar" => "-",
"cv_setImpl_int" => "-",
"cv_setUseCollection_bool" => "-",
"cv_useCollection" => "-",
@@ -347,7 +313,7 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_dnn_DictValue_get_double_const_int" => "+_f64",
"cv_dnn_DictValue_get_int64_t_const_int" => "+_i64",
"cv_dnn_DictValue_get_int_const_int" => "+_i32",
- "cv_dnn_Dict_ptr_String" => "ptr_mut",
+ "cv_dnn_Dict_ptr_const_StringX" => "+_mut",
"cv_dnn_Dict_set_cv_String_const_StringX_const_StringX" => "+_str",
"cv_dnn_Dict_set_double_const_StringX_const_doubleX" => "+_f64",
"cv_dnn_Dict_set_int64_t_const_StringX_const_int64_tX" => "+_i64",
@@ -362,7 +328,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_dnn_Net_getMemoryConsumption_const_int_const_vector_MatShape_X_size_tX_size_tX" => "+_for_layer",
"cv_dnn_blobFromImage_const__InputArrayX_const__OutputArrayX_double_const_SizeX_const_ScalarX_bool_bool_int" => "+_to",
"cv_dnn_blobFromImages_const__InputArrayX_const__OutputArrayX_double_Size_const_ScalarX_bool_bool_int" => "+_to",
- "cv_dnn_clamp_Range_int" => "clamp_range",
"cv_dnn_readNetFromCaffe_const_charX_size_t_const_charX_size_t" => "+_str",
"cv_dnn_readNetFromCaffe_const_vector_unsigned_char_X_const_vector_unsigned_char_X" => "+_buffer",
"cv_dnn_readNetFromDarknet_const_charX_size_t_const_charX_size_t" => "+_str",
@@ -378,16 +343,13 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
// ### face ###
"cv_face_FacemarkKazemi_setFaceDetector_bool__X__const_cv__InputArrayX__const_cv__OutputArrayX__voidX__voidX" => "-", // fixme
"cv_face_FacemarkLBF_Params_pupils" => "-", // fixme array of vectors
- "cv_face_FacemarkLBF_Params_setPupils_vector_int__X__2_" => "-", // fixme array of vectors
// ### features2d ###
"cv_AGAST_const__InputArrayX_vector_KeyPoint_X_int_bool" => "AGAST",
"cv_AGAST_const__InputArrayX_vector_KeyPoint_X_int_bool_DetectorType" => "AGAST_with_type",
"cv_AGAST_const__InputArrayX_vector_KeyPoint_X_int_bool_int" => "AGAST_with_type", // 3.x only
- "cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_const_Ptr_DescriptorExtractor_X_const_Ptr_DescriptorMatcher_X" => "+_with_dextractor",
"cv_BOWImgDescriptorExtractor_compute2_const_MatX_vector_KeyPoint_X_MatX" => "compute2",
"cv_BOWImgDescriptorExtractor_compute_const__InputArrayX_vector_KeyPoint_X_const__OutputArrayX_vector_vector_int__X_MatX" => "+_desc",
- "cv_BOWKMeansTrainer_BOWKMeansTrainer_int_TermCriteria_int_int" => "+_with_criteria",
"cv_BOWTrainer_cluster_const_const_MatX" => "+_with_descriptors", // 3.2
"cv_BRISK_create_const_vector_float_X_const_vector_int_X_float_float_const_vector_int_X" => "+_with_pattern",
"cv_BRISK_create_int_int_const_vector_float_X_const_vector_int_X_float_float_const_vector_int_X" => "+_with_pattern_threshold_octaves",
@@ -436,7 +398,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_calcHist_const_MatX_int_const_intX_const__InputArrayX_SparseMatX_int_const_intX_const_floatXX_bool_bool" => "-", // slice pointers
"cv_calcHist_const_MatX_int_const_intX_const__InputArrayX_const__OutputArrayX_int_const_intX_const_floatXX_bool_bool" => "-", // slice pointers
"cv_fillConvexPoly_MatX_const_PointX_int_const_ScalarX_int_int" => "-", // 3.2
- "cv_fillConvexPoly_Mat_const_Point_X_int_Scalar_int_int" => "-", // duplicate of cv_fillConvexPoly__InputOutputArrayX__InputArrayX_Scalar_int_int, but with pointers
"cv_fillConvexPoly_const__InputOutputArrayX_const_PointX_int_const_ScalarX_int_int" => "-",
"cv_fillPoly_MatX_const_PointXX_const_intX_int_const_ScalarX_int_int_Point" => "-", // 3.2
"cv_fillPoly_const__InputOutputArrayX_const_PointXX_const_intX_int_const_ScalarX_int_int_Point" => "-",
@@ -454,8 +415,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
// ### objdetect ###
"cv_BaseCascadeClassifier_detectMultiScale_const__InputArrayX_vector_Rect_X_vector_int_X_double_int_int_Size_Size" => "+_num",
"cv_BaseCascadeClassifier_detectMultiScale_const__InputArrayX_vector_Rect_X_vector_int_X_vector_double_X_double_int_int_Size_Size_bool" => "+_levels",
- "cv_CascadeClassifier_detectMultiScale__InputArrayX_VectorOfRect_VectorOfint_VectorOfdouble_double_int_int_Size_Size_bool" => "+_levels",
- "cv_CascadeClassifier_detectMultiScale__InputArrayX_VectorOfRect_VectorOfint_double_int_int_Size_Size" => "+_num",
"cv_HOGDescriptor_HOGDescriptor_const_StringX" => "+_from_file",
"cv_HOGDescriptor_detectMultiScale_const_const__InputArrayX_vector_Rect_X_vector_double_X_double_Size_Size_double_double_bool" => "+_weights",
"cv_HOGDescriptor_detect_const_const_MatX_vector_Point_X_vector_double_X_double_Size_Size_const_vector_Point_X" => "+_weights", // 3.2 3.4
@@ -468,7 +427,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
// ### photo ###
"cv_fastNlMeansDenoisingMulti_const__InputArrayX_const__OutputArrayX_int_int_const_vector_float_X_int_int_int" => "+_vec",
"cv_fastNlMeansDenoising_const__InputArrayX_const__OutputArrayX_const_vector_float_X_int_int_int" => "+_vec",
- "cv_fastNlMeansDenoising_Mat_Mat_float_int_int" => "+_window", // 3.x only?
"cv_AlignMTB_process_const__InputArrayX_vector_Mat_X_const__InputArrayX_const__InputArrayX" => "+_with_response",
"cv_MergeDebevec_process_const__InputArrayX_const__OutputArrayX_const__InputArrayX_const__InputArrayX" => "+_with_response",
"cv_MergeMertens_process_const__InputArrayX_const__OutputArrayX_const__InputArrayX_const__InputArrayX" => "+_with_response",
@@ -487,7 +445,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
"cv_text_ERStat_setPixels_vector_int_X" => "-", // fixme: reference to a vector, we don't handle it too well yet
// ### videoio ###
- "cv_VideoCapture_VideoCapture_String_int" => "from_file_with_backend", // 3.2
"cv_VideoCapture_VideoCapture_const_StringX" => "from_file_default", // 3.2
"cv_VideoCapture_VideoCapture_const_StringX_int" => "from_file",
"cv_VideoCapture_VideoCapture_int" => "+_default", // 3.4
@@ -500,9 +457,6 @@ pub static FUNC_RENAME: Lazy<HashMap<&str, &str>> = Lazy::new(|| hashmap! {
// ### videostab ###
"cv_videostab_KeypointBasedMotionEstimator_estimate_const_MatX_const_MatX_boolX" => "+_mat",
-
- // ### xfeatures2d ###
- "cv_xfeatures2d_AffineFeature2D_create_Ptr_FeatureDetector__Ptr_DescriptorExtractor_" => "+_with_extractor",
});
pub static FUNC_CFG_ATTR: Lazy<HashMap<&str, (&str, &str)>> = Lazy::new(|| hashmap! {
@@ -672,8 +626,8 @@ pub static FUNC_UNSAFE: Lazy<HashSet<&str>> = Lazy::new(|| hashset! {
"cv_Mat_ptr_int_int",
"cv_Mat_ptr_int_int_int",
// pointer to internal data
- "cv_dnn_Dict_ptr_String",
- "cv_dnn_Dict_ptr_const_String",
+ "cv_dnn_Dict_ptr_const_StringX",
+ "cv_dnn_Dict_ptr_const_const_StringX",
});
pub static IMPLEMENTED_FUNCTION_LIKE_MACROS: Lazy<HashSet<&str>> = Lazy::new(|| hashset! {
@@ -804,7 +758,7 @@ pub enum SliceHint {
ConvertSlice(&'static str, &'static str, usize),
}
-/// rust_leafname
+/// cpp_fullname
pub static SLICE_ARGUMENT: Lazy<HashMap<(&str, usize), SliceHint>> = Lazy::new(|| hashmap! {
("cv::Mat::at", 1) => SliceHint::ForceSlice("idx"),
("cv::Mat::ptr", 1) => SliceHint::ForceSlice("idx"),

Implement settings-cleanup helper and use it to clean up settings