Skip to content

Commit 914a83f

Browse files
committed
Fix enum generation issues.
1 parent 3fbaad3 commit 914a83f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

modules/js/generator/embindgen.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def makeNamespacePrefixOverride(module_list):
132132
namespace_prefix_override = None
133133

134134
# Features to be exported
135-
export_enums = False
135+
export_enums = True
136136
export_consts = True
137137
with_wrapped_functions = True
138138
with_default_params = True
@@ -916,7 +916,7 @@ def gen(self, dst_file, src_files, core_bindings):
916916
if ns_name.split('.')[0] != 'cv':
917917
continue
918918
for name, enum in sorted(ns.enums.items()):
919-
if not name.endswith('.anonymous'):
919+
if '.unnamed_' not in name:
920920
name = name.replace("cv.", "")
921921
enum_values = []
922922
for enum_val in enum:
@@ -936,7 +936,10 @@ def gen(self, dst_file, src_files, core_bindings):
936936
for ns_name, ns in sorted(self.namespaces.items()):
937937
if ns_name.split('.')[0] != 'cv':
938938
continue
939+
# TODO CALIB_FIX_FOCAL_LENGTH is defined both in cv:: and cv::fisheye
940+
prefix = 'FISHEYE_' if 'fisheye' in ns_name else ''
939941
for name, const in sorted(ns.consts.items()):
942+
name = prefix + name
940943
# print("Gen consts: ", name, const)
941944
self.bindings.append(const_template.substitute(js_name=name, value=const))
942945

0 commit comments

Comments
 (0)