1
1
use std:: collections:: HashSet ;
2
2
3
- use once_cell :: sync :: Lazy ;
3
+ pub type FuncExclude = HashSet < & ' static str > ;
4
4
5
- /// map of functions to exclude, value is Func.identifier()
6
- pub static FUNC_EXCLUDE : Lazy < HashSet < & str > > = Lazy :: new ( || {
5
+ pub fn func_exclude_factory ( module : & str ) -> FuncExclude {
6
+ match module {
7
+ "core" => core_factory ( ) ,
8
+ "cudaimgproc" => cudaimgproc_factory ( ) ,
9
+ "dnn" => dnn_factory ( ) ,
10
+ "gapi" => gapi_factory ( ) ,
11
+ "hdf" => hdf_factory ( ) ,
12
+ "imgproc" => imgproc_factory ( ) ,
13
+ "objdetect" => objdetect_factory ( ) ,
14
+ "optflow" => optflow_factory ( ) ,
15
+ "stitching" => stitching_factory ( ) ,
16
+ "surface_matching" => surface_matching_factory ( ) ,
17
+ "tracking" => tracking_factory ( ) ,
18
+ _ => FuncExclude :: default ( ) ,
19
+ }
20
+ }
21
+
22
+ fn core_factory ( ) -> FuncExclude {
7
23
HashSet :: from ( [
8
- // ### core ###
9
24
"cv_AsyncArray__getImpl_const" ,
10
- "cv_Mat_Mat_const_MatR_const_RangeX" , // duplicate of cv_Mat_Mat_Mat_VectorOfRange, but with pointers
11
- "cv_Mat_copySize_const_MatR" , // internal function
12
- "cv_Mat_operator___const_const_RangeX" , // duplicate of cv_Mat_operator___const_const_vectorLRangeGR, but with pointers
13
- "cv_Mat_push_back__const_voidX" , // internal method
14
- "cv_Mat_operatorST_const_MatR" , // unsafe with the safe version that moves
25
+ "cv_Mat_Mat_const_MatR_const_RangeX" , // duplicate of cv_Mat_Mat_Mat_VectorOfRange, but with pointers
26
+ "cv_Mat_copySize_const_MatR" , // internal function
27
+ "cv_Mat_operator___const_const_RangeX" , // duplicate of cv_Mat_operator___const_const_vectorLRangeGR, but with pointers
28
+ "cv_Mat_push_back__const_voidX" , // internal method
29
+ "cv_Mat_operatorST_const_MatR" , // unsafe with the safe version that moves
15
30
"cv_UMat_UMat_const_UMatR_const_RangeX" , // duplicate of cv_UMat_UMat_UMat_VectorOfRange, but with pointers
16
- "cv_UMat_copySize_const_UMatR" , // internal function
31
+ "cv_UMat_copySize_const_UMatR" , // internal function
17
32
"cv_UMat_operator___const_const_RangeX" , // duplicate of cv_UMat_operator___const_const_vectorLRangeGR, but with pointers
18
- "cv_RNG_MT19937_operator__" , // the same as calling to_u32() or next()
33
+ "cv_RNG_MT19937_operator__" , // the same as calling to_u32() or next()
19
34
"cv_addImpl_int_const_charX" ,
20
35
"cv_calcCovarMatrix_const_MatX_int_MatR_MatR_int_int" , // duplicate of cv_calcCovarMatrix_const__InputArrayR_const__OutputArrayR_const__InputOutputArrayR_int_int, but with pointers
21
36
"cv_cv_abs_short" ,
@@ -33,28 +48,57 @@ pub static FUNC_EXCLUDE: Lazy<HashSet<&str>> = Lazy::new(|| {
33
48
"cv_useCollection" ,
34
49
"cv_vconcat_const_MatX_size_t_const__OutputArrayR" , // duplicate of cv_vconcat_VectorOfMat_Mat, but with pointers
35
50
"cv_Mat_Mat_MatRR" , // Mat::copy that takes arg by value
36
- // ### cudaimgproc ###
51
+ // those function are marked as CV_EXPORTS, but they are missing from the shared libraries
52
+ "cv_MatConstIterator_MatConstIterator_const_MatX_const_intX" ,
53
+ "cv_SparseMatConstIterator_operatorSS" ,
54
+ "cv_SparseMatIterator_SparseMatIterator_SparseMatX_const_intX" ,
55
+ "cv__OutputArray__OutputArray_const_vectorLGpuMatGR" ,
56
+ "cv_cuda_convertFp16_const__InputArrayR_const__OutputArrayR_StreamR" ,
57
+ "cv_getImpl_vectorLintGR_vectorLStringGR" ,
58
+ ] )
59
+ }
60
+
61
+ fn cudaimgproc_factory ( ) -> FuncExclude {
62
+ HashSet :: from ( [
37
63
"cv_cuda_histEven_const__InputArrayR_GpuMatXX_intXX_intXX_intXX_StreamR" , // slice of boxed objects
38
64
"cv_cuda_histRange_const__InputArrayR_GpuMatXX_const_GpuMatXX_StreamR" , // slice of boxed objects
39
- // ### dnn ###
65
+ ] )
66
+ }
67
+
68
+ fn dnn_factory ( ) -> FuncExclude {
69
+ HashSet :: from ( [
40
70
"cv_dnn_DictValue_DictValue_const_StringR" , // effectively duplicate of cv_dnn_DictValue_DictValue_const_charX
41
71
"cv_dnn_Layer_finalize_const_vectorLMatXGR_vectorLMatGR" , // dup of cv_dnn_Layer_finalize_const__InputArrayR_const__OutputArrayR
42
72
"cv_dnn_Model_operator_cv_dnn_Net_const" , // fixme, should generate fine, it's a dup of get_network_() anyway
43
- // ### gapi ###
73
+ // those function are marked as CV_EXPORTS, but they are missing from the shared libraries
74
+ "cv_dnn_BackendNode_BackendNode_int" ,
75
+ ] )
76
+ }
77
+
78
+ fn gapi_factory ( ) -> FuncExclude {
79
+ HashSet :: from ( [
44
80
"cv_MediaFrame_IAdapter_access_Access" , // use of deleted function ‘cv::MediaFrame::View::View(const cv::MediaFrame::View&)’
45
81
"cv_MediaFrame_access_const_Access" , // use of deleted function ‘cv::MediaFrame::View::View(const cv::MediaFrame::View&)’
46
82
"cv_RMat_Adapter_access_Access" , // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
47
83
"cv_RMat_IAdapter_access_Access" , // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
48
84
"cv_RMat_access_const_Access" , // use of deleted function ‘cv::RMat::View::View(const cv::RMat::View&)’
49
- // ### hdf ###
85
+ ] )
86
+ }
87
+
88
+ fn hdf_factory ( ) -> FuncExclude {
89
+ HashSet :: from ( [
50
90
"cv_hdf_HDF5_dscreate_const_const_int_const_int_const_int_const_StringR_const_int_const_intX" , // has corresponding Vector version
51
91
"cv_hdf_HDF5_dsinsert_const_const__InputArrayR_const_StringR_const_intX" , // has corresponding Vector version
52
92
"cv_hdf_HDF5_dsinsert_const_const__InputArrayR_const_StringR_const_intX_const_intX" , // has corresponding Vector version
53
93
"cv_hdf_HDF5_dsread_const_const__OutputArrayR_const_StringR_const_intX" , // has corresponding Vector version
54
94
"cv_hdf_HDF5_dsread_const_const__OutputArrayR_const_StringR_const_intX_const_intX" , // has corresponding Vector version
55
95
"cv_hdf_HDF5_dswrite_const_const__InputArrayR_const_StringR_const_intX" , // has corresponding Vector version
56
96
"cv_hdf_HDF5_dswrite_const_const__InputArrayR_const_StringR_const_intX_const_intX" , // has corresponding Vector version
57
- // ### imgproc ###
97
+ ] )
98
+ }
99
+
100
+ fn imgproc_factory ( ) -> FuncExclude {
101
+ HashSet :: from ( [
58
102
"cv_calcBackProject_const_MatX_int_const_intX_const_SparseMatR_const__OutputArrayR_const_floatXX_double_bool" , // slice pointers
59
103
"cv_calcBackProject_const_MatX_int_const_intX_const__InputArrayR_const__OutputArrayR_const_floatXX_double_bool" , // slice pointers
60
104
"cv_calcHist_const_MatX_int_const_intX_const__InputArrayR_SparseMatR_int_const_intX_const_floatXX_bool_bool" , // slice pointers
@@ -65,30 +109,40 @@ pub static FUNC_EXCLUDE: Lazy<HashSet<&str>> = Lazy::new(|| {
65
109
"cv_fillPoly_const__InputOutputArrayR_const_PointXX_const_intX_int_const_ScalarR_int_int_Point" ,
66
110
"cv_polylines_MatR_const_PointXX_const_intX_int_bool_const_ScalarR_int_int_int" , // 3.2 3.4
67
111
"cv_polylines_const__InputOutputArrayR_const_PointXX_const_intX_int_bool_const_ScalarR_int_int_int" ,
68
- // ### objdetect ###
112
+ ] )
113
+ }
114
+
115
+ fn objdetect_factory ( ) -> FuncExclude {
116
+ HashSet :: from ( [
69
117
"cv_QRCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vectorLstringGR_const__OutputArrayR_const__OutputArrayR" , // fixme: stores data to Vector<String>, that doesn't work yet
70
- // ### optflow ###
118
+ ] )
119
+ }
120
+
121
+ fn optflow_factory ( ) -> FuncExclude {
122
+ HashSet :: from ( [
71
123
"cv_optflow_GPCTrainingSamples_operator_cv_optflow_GPCSamplesVector" , // support of "operator &" missing
72
- // ### text ###
73
- "cv_text_OCRBeamSearchDecoder_create_const_PtrLClassifierCallbackG_const_stringR_const__InputArrayR_const__InputArrayR" , // with OpenCV 4.2 this leads to https://github.com/twistedfall/opencv-rust/issues/505
74
- "cv_text_OCRBeamSearchDecoder_create_const_PtrLClassifierCallbackG_const_StringR_const__InputArrayR_const__InputArrayR" , // with OpenCV 4.2 this leads to https://github.com/twistedfall/opencv-rust/issues/505
124
+ ] )
125
+ }
126
+
127
+ fn stitching_factory ( ) -> FuncExclude {
128
+ HashSet :: from ( [
75
129
// those function are marked as CV_EXPORTS, but they are missing from the shared libraries
76
- // ### core ###
77
- "cv_MatConstIterator_MatConstIterator_const_MatX_const_intX" ,
78
- "cv_SparseMatConstIterator_operatorSS" ,
79
- "cv_SparseMatIterator_SparseMatIterator_SparseMatX_const_intX" ,
80
- "cv__OutputArray__OutputArray_const_vectorLGpuMatGR" ,
81
- "cv_cuda_convertFp16_const__InputArrayR_const__OutputArrayR_StreamR" ,
82
- "cv_getImpl_vectorLintGR_vectorLStringGR" ,
83
- // ### dnn ###
84
- "cv_dnn_BackendNode_BackendNode_int" ,
85
- // ### stitching ###
86
130
"cv_createStitcherScans_bool" ,
87
131
"cv_createStitcher_bool" ,
88
- // ### surface_matching ###
132
+ ] )
133
+ }
134
+
135
+ fn surface_matching_factory ( ) -> FuncExclude {
136
+ HashSet :: from ( [
137
+ // those function are marked as CV_EXPORTS, but they are missing from the shared libraries
89
138
"cv_ppf_match_3d_PPF3DDetector_read_const_FileNodeR" ,
90
139
"cv_ppf_match_3d_PPF3DDetector_write_const_FileStorageR" ,
91
- // ### tracking ###
140
+ ] )
141
+ }
142
+
143
+ fn tracking_factory ( ) -> FuncExclude {
144
+ HashSet :: from ( [
145
+ // those function are marked as CV_EXPORTS, but they are missing from the shared libraries
92
146
"cv_CvFeatureParams_CvFeatureParams" ,
93
147
"cv_CvFeatureParams_create_FeatureType" ,
94
148
"cv_CvFeatureParams_create_int" ,
@@ -106,4 +160,4 @@ pub static FUNC_EXCLUDE: Lazy<HashSet<&str>> = Lazy::new(|| {
106
160
"cv_SparseMatConstIterator_operatorSS" ,
107
161
"cv__OutputArray__OutputArray_const_vectorLGpuMatGR" ,
108
162
] )
109
- } ) ;
163
+ }
0 commit comments