1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

* updated python wrapper generator to properly handle C++20-style named parameters

* added sample filter2D[p]() function and a little python test for it to demonstrate the concept
This commit is contained in:
Vadim Pisarevsky
2020-12-18 20:00:42 +08:00
parent 9668831c13
commit ed8696566b
6 changed files with 138 additions and 22 deletions
+10 -1
View File
@@ -258,6 +258,10 @@ class CppHeaderParser(object):
if "CV_EXPORTS_W_MAP" in l:
l = l.replace("CV_EXPORTS_W_MAP", "")
modlist.append("/Map")
if "CV_EXPORTS_W_PARAMS" in l:
l = l.replace("CV_EXPORTS_W_PARAMS", "")
modlist.append("/Map")
modlist.append("/Params")
if "CV_EXPORTS_W_SIMPLE" in l:
l = l.replace("CV_EXPORTS_W_SIMPLE", "")
modlist.append("/Simple")
@@ -769,7 +773,12 @@ class CppHeaderParser(object):
var_list = [var_name1] + [i.strip() for i in var_list[1:]]
for v in var_list:
class_decl[3].append([var_type, v, "", var_modlist])
vv = v.split("=")
vname = vv[0].strip()
vdefval = ""
if len(vv) > 1:
vdefval = vv[1].strip()
class_decl[3].append([var_type, vname, vdefval, var_modlist])
return stmt_type, "", False, None
# something unknown