Skip to main content

opencv_binding_generator/settings/
func_exclude.rs

1use std::collections::HashSet;
2
3use crate::SupportedModule;
4
5pub type FuncExclude = HashSet<&'static str>;
6
7pub fn func_exclude_factory(module: SupportedModule) -> FuncExclude {
8	match module {
9		SupportedModule::Core => core_factory(),
10		SupportedModule::CudaImgProc => cudaimgproc_factory(),
11		SupportedModule::Dnn => dnn_factory(),
12		SupportedModule::Gapi => gapi_factory(),
13		SupportedModule::Hdf => hdf_factory(),
14		SupportedModule::ImgProc => imgproc_factory(),
15		SupportedModule::ObjDetect => objdetect_factory(),
16		SupportedModule::OptFlow => optflow_factory(),
17		SupportedModule::Stitching => stitching_factory(),
18		SupportedModule::SurfaceMatching => surface_matching_factory(),
19		SupportedModule::Tracking => tracking_factory(),
20		_ => FuncExclude::default(),
21	}
22}
23
24fn core_factory() -> FuncExclude {
25	HashSet::from([
26		"cv_AsyncArray__getImpl_const",
27		"cv_Mat_Mat_const_MatR_const_RangeX", // duplicate of cv_Mat_Mat_Mat_VectorOfRange, but with pointers
28		"cv_Mat_copySize_const_MatR",         // internal function
29		"cv_Mat_operator___const_const_RangeX", // duplicate of cv_Mat_operator___const_const_vectorLRangeGR, but with pointers
30		"cv_Mat_push_back__const_voidX",      // internal method
31		"cv_Mat_operatorST_const_MatR",       // unsafe with the safe version that moves
32		"cv_UMat_UMat_const_UMatR_const_RangeX", // duplicate of cv_UMat_UMat_UMat_VectorOfRange, but with pointers
33		"cv_UMat_copySize_const_UMatR",       // internal function
34		"cv_UMat_operator___const_const_RangeX", // duplicate of cv_UMat_operator___const_const_vectorLRangeGR, but with pointers
35		"cv_RNG_MT19937_operator__",          // the same as calling to_u32() or next()
36		"cv_addImpl_int_const_charX",
37		"cv_calcCovarMatrix_const_MatX_int_MatR_MatR_int_int", // duplicate of cv_calcCovarMatrix_const__InputArrayR_const__OutputArrayR_const__InputOutputArrayR_int_int, but with pointers
38		"cv_cv_abs_short",
39		"cv_detail_depthToString__int",                                   // detail function
40		"cv_detail_typeToString__int",                                    // detail function
41		"cv_fastFree_voidX",                                              // manual memory allocation
42		"cv_fastMalloc_size_t",                                           // manual memory allocation
43		"cv_format_const_charX",                                          // accepts varargs
44		"cv_hconcat_const_MatX_size_t_const__OutputArrayR",               // duplicate of cv_hconcat_VectorOfMat_Mat, but with pointers
45		"cv_hfloat_hfloat", // looks like it's not zeroing the memory (failed test with macOS framework build)
46		"cv_merge_const_MatX_size_t_const__OutputArrayR", // duplicate of cv_merge_const__InputArrayR_const__OutputArrayR, but with pointers
47		"cv_mixChannels_const_MatX_size_t_MatX_size_t_const_intX_size_t", // duplicate of cv_mixChannels_VectorOfMat_VectorOfMat_VectorOfint, but with pointers
48		"cv_ocl_ProgramSource_ProgramSource_const_charX",                 // has duplicate with String
49		"cv_setImpl_int",
50		"cv_setUseCollection_bool",
51		"cv_useCollection",
52		"cv_vconcat_const_MatX_size_t_const__OutputArrayR", // duplicate of cv_vconcat_VectorOfMat_Mat, but with pointers
53		"cv_Mat_Mat_MatRR",                                 // Mat::copy that takes arg by value
54		"cv_MatShape_MatShape_const_intX_const_intX_DataLayout_int", // takes pointers to the beginning and the end
55		// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
56		"cv_MatConstIterator_MatConstIterator_const_MatX_const_intX",
57		"cv_SparseMatConstIterator_operatorSS",
58		"cv_SparseMatIterator_SparseMatIterator_SparseMatX_const_intX",
59		"cv__OutputArray__OutputArray_const_vectorLGpuMatGR",
60		"cv_cuda_convertFp16_const__InputArrayR_const__OutputArrayR_StreamR",
61		"cv_getImpl_vectorLintGR_vectorLStringGR",
62		"cv__OutputArray_fit_const_Size_int_int_bool_DepthMask",    // 5.0.0
63		"cv__OutputArray_fit_const_int_int_int_int_bool_DepthMask", // 5.0.0
64		"cv__OutputArray_fit_const_const_MatShapeR_int_int_bool_DepthMask", // 5.0.0
65		"cv__OutputArray_fitSameSize_const_const__InputArrayR_int", // 5.0.0
66	])
67}
68
69fn cudaimgproc_factory() -> FuncExclude {
70	HashSet::from([
71		"cv_cuda_histEven_const__InputArrayR_GpuMatXX_intXX_intXX_intXX_StreamR", // slice of boxed objects
72		"cv_cuda_histRange_const__InputArrayR_GpuMatXX_const_GpuMatXX_StreamR",   // slice of boxed objects
73	])
74}
75
76fn dnn_factory() -> FuncExclude {
77	HashSet::from([
78		"cv_dnn_DictValue_DictValue_const_StringR", // effectively duplicate of cv_dnn_DictValue_DictValue_const_charX
79		"cv_dnn_Layer_finalize_const_vectorLMatXGR_vectorLMatGR", // dup of cv_dnn_Layer_finalize_const__InputArrayR_const__OutputArrayR
80		"cv_dnn_Model_operator_cv_dnn_Net_const",   // fixme, should generate fine, it's a dup of get_network_() anyway
81		// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
82		"cv_dnn_BackendNode_BackendNode_int",
83	])
84}
85
86fn gapi_factory() -> FuncExclude {
87	HashSet::from([
88		"cv_MediaFrame_IAdapter_access_Access", // use of deleted function ‘cv::MediaFrame::View::View(const cv::MediaFrame::View&)’
89		"cv_MediaFrame_access_const_Access",    // use of deleted function ‘cv::MediaFrame::View::View(const cv::MediaFrame::View&)’
90		"cv_RMat_Adapter_access_Access",        // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
91		"cv_RMat_IAdapter_access_Access",       // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
92		"cv_RMat_access_const_Access",          // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
93	])
94}
95
96fn hdf_factory() -> FuncExclude {
97	HashSet::from([
98		"cv_hdf_HDF5_dscreate_const_const_int_const_int_const_int_const_StringR_const_int_const_intX", // has corresponding Vector version
99		"cv_hdf_HDF5_dsinsert_const_const__InputArrayR_const_StringR_const_intX", // has corresponding Vector version
100		"cv_hdf_HDF5_dsinsert_const_const__InputArrayR_const_StringR_const_intX_const_intX", // has corresponding Vector version
101		"cv_hdf_HDF5_dsread_const_const__OutputArrayR_const_StringR_const_intX",  // has corresponding Vector version
102		"cv_hdf_HDF5_dsread_const_const__OutputArrayR_const_StringR_const_intX_const_intX", // has corresponding Vector version
103		"cv_hdf_HDF5_dswrite_const_const__InputArrayR_const_StringR_const_intX",  // has corresponding Vector version
104		"cv_hdf_HDF5_dswrite_const_const__InputArrayR_const_StringR_const_intX_const_intX", // has corresponding Vector version
105	])
106}
107
108fn imgproc_factory() -> FuncExclude {
109	HashSet::from([
110		"cv_calcBackProject_const_MatX_int_const_intX_const_SparseMatR_const__OutputArrayR_const_floatXX_double_bool", // slice pointers
111		"cv_calcBackProject_const_MatX_int_const_intX_const__InputArrayR_const__OutputArrayR_const_floatXX_double_bool", // slice pointers
112		"cv_calcHist_const_MatX_int_const_intX_const__InputArrayR_SparseMatR_int_const_intX_const_floatXX_bool_bool", // slice pointers
113		"cv_calcHist_const_MatX_int_const_intX_const__InputArrayR_const__OutputArrayR_int_const_intX_const_floatXX_bool_bool", // slice pointers
114		"cv_fillConvexPoly_MatR_const_PointX_int_const_ScalarR_int_int",                                                       // 3.4
115		"cv_fillConvexPoly_const__InputOutputArrayR_const_PointX_int_const_ScalarR_int_int",
116		"cv_fillPoly_MatR_const_PointXX_const_intX_int_const_ScalarR_int_int_Point", // 3.4
117		"cv_fillPoly_const__InputOutputArrayR_const_PointXX_const_intX_int_const_ScalarR_int_int_Point",
118		"cv_polylines_MatR_const_PointXX_const_intX_int_bool_const_ScalarR_int_int_int", // 3.4
119		"cv_polylines_const__InputOutputArrayR_const_PointXX_const_intX_int_bool_const_ScalarR_int_int_int",
120	])
121}
122
123fn objdetect_factory() -> FuncExclude {
124	HashSet::from([
125		"cv_QRCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vectorLstringGR_const__OutputArrayR_const__OutputArrayR", // fixme: stores data to Vector<String>, that doesn't work yet
126	])
127}
128
129fn optflow_factory() -> FuncExclude {
130	HashSet::from([
131		"cv_optflow_GPCTrainingSamples_operator_cv_optflow_GPCSamplesVector", // support of "operator &" missing
132	])
133}
134
135fn stitching_factory() -> FuncExclude {
136	HashSet::from([
137		// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
138		"cv_createStitcherScans_bool",
139		"cv_createStitcher_bool",
140	])
141}
142
143fn surface_matching_factory() -> FuncExclude {
144	HashSet::from([
145		// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
146		"cv_ppf_match_3d_PPF3DDetector_read_const_FileNodeR",
147		"cv_ppf_match_3d_PPF3DDetector_write_const_FileStorageR",
148	])
149}
150
151fn tracking_factory() -> FuncExclude {
152	HashSet::from([
153		// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
154		"cv_CvFeatureParams_CvFeatureParams",
155		"cv_CvFeatureParams_create_FeatureType",
156		"cv_CvFeatureParams_create_int",
157		"cv_CvHaarEvaluator_FeatureHaar_FeatureHaar_Size",
158		"cv_CvHaarEvaluator_FeatureHaar_eval_const_const_MatR_Rect_floatX",
159		"cv_CvHaarEvaluator_FeatureHaar_getAreas_const",
160		"cv_CvHaarEvaluator_FeatureHaar_getInitMean_const",
161		"cv_CvHaarEvaluator_FeatureHaar_getInitSigma_const",
162		"cv_CvHaarEvaluator_FeatureHaar_getNumAreas",
163		"cv_CvHaarEvaluator_FeatureHaar_getWeights_const",
164		"cv_CvHaarEvaluator_getFeatures_const",
165		"cv_CvHaarEvaluator_setWinSize_Size",
166		"cv_CvHaarEvaluator_setWinSize_const",
167		"cv_CvHaarEvaluator_writeFeature_const_FileStorageR",
168		"cv_SparseMatConstIterator_operatorSS",
169		"cv__OutputArray__OutputArray_const_vectorLGpuMatGR",
170	])
171}