Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
efca746d
Commit
efca746d
authored
Sep 24, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12622 from cv3d:fix/js_property
parents
475c775b
0739d1c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
core_bindings.cpp
modules/js/src/core_bindings.cpp
+6
-0
embindgen.py
modules/js/src/embindgen.py
+2
-1
templates.py
modules/js/src/templates.py
+3
-0
No files found.
modules/js/src/core_bindings.cpp
View file @
efca746d
...
...
@@ -78,6 +78,12 @@ using namespace dnn;
namespace
binding_utils
{
template
<
typename
classT
,
typename
enumT
>
static
inline
typename
std
::
underlying_type
<
enumT
>::
type
classT
::*
underlying_ptr
(
enumT
classT
::*
enum_ptr
)
{
return
reinterpret_cast
<
typename
std
::
underlying_type
<
enumT
>::
type
classT
::*>
(
enum_ptr
);
}
template
<
typename
T
>
emscripten
::
val
matData
(
const
cv
::
Mat
&
mat
)
{
...
...
modules/js/src/embindgen.py
View file @
efca746d
...
...
@@ -856,7 +856,8 @@ class JSWrapperGenerator(object):
# Generate bindings for properties
for
property
in
class_info
.
props
:
class_bindings
.
append
(
class_property_template
.
substitute
(
js_name
=
property
.
name
,
cpp_name
=
'::'
.
join
(
_class_property
=
class_property_enum_template
if
property
.
tp
in
type_dict
else
class_property_template
class_bindings
.
append
(
_class_property
.
substitute
(
js_name
=
property
.
name
,
cpp_name
=
'::'
.
join
(
[
class_info
.
cname
,
property
.
name
])))
dv
=
''
...
...
modules/js/src/templates.py
View file @
efca746d
...
...
@@ -153,6 +153,9 @@ overload_class_static_function_template = Template("""
class_property_template
=
Template
(
"""
.property("$js_name", &$cpp_name)"""
)
class_property_enum_template
=
Template
(
"""
.property("$js_name", binding_utils::underlying_ptr(&$cpp_name))"""
)
ctr_template
=
Template
(
"""
.constructor(select_overload<$ret($args)$const>(&$cpp_name)$optional)"""
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment