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

Merge branch 4.x

This commit is contained in:
OpenCV Developers
2022-04-23 21:42:17 +00:00
324 changed files with 34982 additions and 9803 deletions
+13
View File
@@ -82,6 +82,9 @@ ManualFuncs = {}
# { class : { func : { arg_name : {"ctype" : ctype, "attrib" : [attrib]} } } }
func_arg_fix = {}
# { class : { func : { prolog : "", epilog : "" } } }
header_fix = {}
# { class : { enum: fixed_enum } }
enum_fix = {}
@@ -485,6 +488,9 @@ class FuncInfo(GeneralInfo):
self.ctype = re.sub(r"^CvTermCriteria", "TermCriteria", decl[1] or "")
self.args = []
func_fix_map = func_arg_fix.get(self.classname or module, {}).get(self.objc_name, {})
header_fixes = header_fix.get(self.classname or module, {}).get(self.objc_name, {})
self.prolog = header_fixes.get('prolog', None)
self.epilog = header_fixes.get('epilog', None)
for a in decl[3]:
arg = a[:]
arg_fix_map = func_fix_map.get(arg[1], {})
@@ -1178,6 +1184,9 @@ class ObjectiveCWrapperGenerator(object):
objc_name = fi.objc_name if not constructor else ("init" + ("With" + (args[0].name[0].upper() + args[0].name[1:]) if len(args) > 0 else ""))
)
if fi.prolog is not None:
method_declarations.write("\n%s\n\n" % fi.prolog)
method_declarations.write( Template(
"""$prototype$swift_name$deprecation_decl;
@@ -1189,6 +1198,9 @@ class ObjectiveCWrapperGenerator(object):
)
)
if fi.epilog is not None:
method_declarations.write("%s\n\n" % fi.epilog)
method_implementations.write( Template(
"""$prototype {$prologue
$ret_val$obj_deref$cv_name($cv_args)$tail;$epilogue$ret
@@ -1654,6 +1666,7 @@ if __name__ == "__main__":
AdditionalImports[module] = gen_type_dict.get("AdditionalImports", {})
ManualFuncs.update(gen_type_dict.get("ManualFuncs", {}))
func_arg_fix.update(gen_type_dict.get("func_arg_fix", {}))
header_fix.update(gen_type_dict.get("header_fix", {}))
enum_fix.update(gen_type_dict.get("enum_fix", {}))
const_fix.update(gen_type_dict.get("const_fix", {}))
namespaces_dict.update(gen_type_dict.get("namespaces_dict", {}))