js: fix enum generation issues#26147
Conversation
|
RFC: what should we do for namespaces for const/enums? As we have a collision here, I prepended the |
|
Thx @asmorkalov , fixed. Does that mean that |
|
In long term - yes. |
| # TODO CALIB_FIX_FOCAL_LENGTH is defined both in cv:: and cv::fisheye | ||
| prefix = 'FISHEYE_' if 'fisheye' in ns_name else '' | ||
| for name, const in sorted(ns.consts.items()): | ||
| name = prefix + name |
There was a problem hiding this comment.
What if use namespace_prefix_override solution like for the functions? Namespace is already appended to the function names, if it's not overridden by config. It's less hacky and more obvious.
There was a problem hiding this comment.
I guess that would work but I don't know how to use it. Should all the enums be added to
opencv/modules/js/generator/embindgen.py
Line 989 in 450e741
|
@asmorkalov , do you want me to split this PR in 3 per the 3 points I mentioned ? 2 should be easy to merge, the Python script needs more review (though parts of it can easily be merged, like the |
|
Yes, let's split. |
|
#26644 was also split out of this PR. The PR now only contains enum-related changes. |
enums were not taken into account
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request