|
|
@ -119,6 +119,7 @@ type_dict = { |
|
|
|
'InputOutputArray': 'cv::Mat&', |
|
|
|
'InputOutputArray': 'cv::Mat&', |
|
|
|
'InputArrayOfArrays': 'const std::vector<cv::Mat>&', |
|
|
|
'InputArrayOfArrays': 'const std::vector<cv::Mat>&', |
|
|
|
'OutputArrayOfArrays': 'std::vector<cv::Mat>&', |
|
|
|
'OutputArrayOfArrays': 'std::vector<cv::Mat>&', |
|
|
|
|
|
|
|
'string': 'std::string', |
|
|
|
'String': 'std::string', |
|
|
|
'String': 'std::string', |
|
|
|
'const String&':'const std::string&' |
|
|
|
'const String&':'const std::string&' |
|
|
|
} |
|
|
|
} |
|
|
@ -462,8 +463,7 @@ class JSWrapperGenerator(object): |
|
|
|
ret_type = type_dict[ptr_type] |
|
|
|
ret_type = type_dict[ptr_type] |
|
|
|
for key in type_dict: |
|
|
|
for key in type_dict: |
|
|
|
if key in ret_type: |
|
|
|
if key in ret_type: |
|
|
|
ret_type = ret_type.replace(key, type_dict[key]) |
|
|
|
ret_type = re.sub('(^|[^\w])' + key + '($|[^\w])', type_dict[key], ret_type) |
|
|
|
|
|
|
|
|
|
|
|
arg_types = [] |
|
|
|
arg_types = [] |
|
|
|
unwrapped_arg_types = [] |
|
|
|
unwrapped_arg_types = [] |
|
|
|
for arg in variant.args: |
|
|
|
for arg in variant.args: |
|
|
@ -567,7 +567,7 @@ class JSWrapperGenerator(object): |
|
|
|
# consider the default parameter variants |
|
|
|
# consider the default parameter variants |
|
|
|
args_num = len(variant.args) - j |
|
|
|
args_num = len(variant.args) - j |
|
|
|
if args_num in class_info.constructor_arg_num: |
|
|
|
if args_num in class_info.constructor_arg_num: |
|
|
|
# FIXME: workaournd for constructor overload with same args number |
|
|
|
# FIXME: workaround for constructor overload with same args number |
|
|
|
# e.g. DescriptorMatcher |
|
|
|
# e.g. DescriptorMatcher |
|
|
|
continue |
|
|
|
continue |
|
|
|
class_info.constructor_arg_num.add(args_num) |
|
|
|
class_info.constructor_arg_num.add(args_num) |
|
|
@ -627,7 +627,6 @@ class JSWrapperGenerator(object): |
|
|
|
ret_type = 'void' if variant.rettype.strip() == '' else variant.rettype |
|
|
|
ret_type = 'void' if variant.rettype.strip() == '' else variant.rettype |
|
|
|
|
|
|
|
|
|
|
|
ret_type = ret_type.strip() |
|
|
|
ret_type = ret_type.strip() |
|
|
|
|
|
|
|
|
|
|
|
if ret_type.startswith('Ptr'): #smart pointer |
|
|
|
if ret_type.startswith('Ptr'): #smart pointer |
|
|
|
ptr_type = ret_type.replace('Ptr<', '').replace('>', '') |
|
|
|
ptr_type = ret_type.replace('Ptr<', '').replace('>', '') |
|
|
|
if ptr_type in type_dict: |
|
|
|
if ptr_type in type_dict: |
|
|
|