work on #2100: pyopencv_to functions now can receive argument information through ArgInfo structure. Non-contiguous input numpy arrays are copied. In case of non-contiguous output array the TypeError is thrown.

This commit is contained in:
Alexander Mordvintesv
2012-08-07 21:03:17 +03:00
parent a717b7cbed
commit 0adf68ae62
2 changed files with 65 additions and 43 deletions

View File

@@ -329,6 +329,9 @@ class ArgInfo(object):
def isbig(self):
return self.tp == "Mat" or self.tp == "vector_Mat"# or self.tp.startswith("vector")
def crepr(self):
return "ArgInfo(\"%s\", %d)" % (self.name, self.outputarg)
class FuncVariant(object):
def __init__(self, classname, name, decl, isconstructor):
@@ -561,7 +564,7 @@ class FuncInfo(object):
if amapping[1] == "O":
code_decl += " PyObject* pyobj_%s = NULL;\n" % (a.name,)
parse_name = "pyobj_" + a.name
code_cvt_list.append("pyopencv_to(pyobj_%s, %s)" % (a.name, a.name))
code_cvt_list.append("pyopencv_to(pyobj_%s, %s, %s)" % (a.name, a.name, a.crepr()))
all_cargs.append([amapping, parse_name])