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
8f92973b
Commit
8f92973b
authored
Aug 06, 2013
by
hbristow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started documentation skeleton
parent
b6544135
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
4 deletions
+67
-4
gen_matlab.py
modules/matlab/generator/gen_matlab.py
+3
-0
functional.cpp
modules/matlab/generator/templates/functional.cpp
+30
-0
template_doc_base.m
modules/matlab/generator/templates/template_doc_base.m
+34
-4
No files found.
modules/matlab/generator/gen_matlab.py
View file @
8f92973b
...
...
@@ -72,6 +72,9 @@ class MatlabWrapperGenerator(object):
populated
=
tfunction
.
render
(
fun
=
method
,
time
=
time
,
includes
=
namespace
.
name
)
with
open
(
output_source_dir
+
'/'
+
method
.
name
+
'.cpp'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
populated
=
tdoc
.
render
(
fun
=
method
,
time
=
time
)
with
open
(
output_class_dir
+
'/'
+
method
.
name
+
'.m'
,
'wb'
)
as
f
:
f
.
write
(
populated
)
# classes
for
clss
in
namespace
.
classes
:
# cpp converter
...
...
modules/matlab/generator/templates/functional.cpp
View file @
8f92973b
...
...
@@ -27,6 +27,36 @@
{
%-
endmacro
%
}
/*
* composeMatlab
* compose a Matlab function call
* This macro takes as input a Method object and composes
* a Matlab function call by inspecting the types and argument names
*/
{
%
macro
composeMatlab
(
fun
)
%
}
{
#
-----------
Return
type
-------------
#
}
{
%-
if
fun
|
noutputs
>
1
-%
}[{
%
endif
-%
}
{
%-
if
not
fun
.
rtp
|
void
-%
}
LVALUE
{
%
endif
-%
}
{
%-
if
not
fun
.
rtp
|
void
and
fun
|
noutputs
>
1
-%
},{
%
endif
-%
}
{
#
-------------
Outputs
-------------
-
#
}
{
%-
for
arg
in
fun
.
req
|
outputs
+
fun
.
opt
|
outputs
-%
}
{{
arg
.
name
}}
{
%-
if
arg
.
I
-%
}
_out
{
%-
endif
-%
}
{
%-
if
not
loop
.
last
%
},
{
%
endif
%
}
{
%
endfor
%
}
{
%-
if
fun
|
noutputs
>
1
-%
}]{
%
endif
-%
}
{
%-
if
fun
|
noutputs
%
}
=
{
%
endif
-%
}
cv
.{{
fun
.
name
}}(
{
#
-
------------
Inputs
--------------
-
#
}
{
%-
for
arg
in
fun
.
req
|
inputs
+
fun
.
opt
|
inputs
-%
}
{{
arg
.
name
}}
{
%-
if
arg
.
O
-%
}
_in
{
%-
endif
-%
}
{
%-
if
not
loop
.
last
%
},
{
%
endif
-%
}
{
%
endfor
-%
}
);
{
%-
endmacro
%
}
/*
* composeWithExceptionHandler
* compose a function call wrapped in exception traps
...
...
modules/matlab/generator/templates/template_doc_base.m
View file @
8f92973b
% {{ fun.name | upper }} {{ fun.doc.short_desc }}
{{
fun
.
doc
.
long_desc
|
comment
(
'%'
,
80
)
}}
{% import 'functional.cpp' as functional %}
%CV.{{ fun.name | upper }}
% {{ functional.composeMatlab(fun) | upper }}
%
% See also: {{ fun.doc.see_also }}
{% if fun.rtp|void|not or fun.req|outputs|length or fun.opt|outputs|length %}
% Returns:
{% endif %}
{% if fun.rtp|void|not %}
% LVALUE
{% endif %}
{% for arg in fun.req|outputs + fun.opt|outputs %}
% {{arg.name | upper}}{%- if arg.I -%}_OUT{% endif %}
{% endfor %}
%
{% if fun.req|inputs|length %}
% Required Inputs:
{% endif %}
{% for arg in fun.req|inputs %}
% {{arg.name | upper}}{%- if arg.O -%}_OUT{% endif %}
{% endfor %}
%
{% if fun.opt|inputs|length %}
% Optional Inputs:
{% endif %}
{% for arg in fun.opt|inputs %}
% {{arg.name | upper}}{%- if arg.O -%}_OUT{% endif %}
{% endfor %}
%
% See also:
%
% Official documentation: http://docs.opencv.org
% Copyright {{ time.strftime("%Y", time.localtime()) }} The OpenCV Foundation
%
% Copyright {{ time.strftime("%Y", localtime()) }} The OpenCV Foundation
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