Started documentation skeleton

pull/1384/head
hbristow 11 years ago
parent b654413567
commit 8f92973b8c
  1. 3
      modules/matlab/generator/gen_matlab.py
  2. 30
      modules/matlab/generator/templates/functional.cpp
  3. 38
      modules/matlab/generator/templates/template_doc_base.m

@ -72,6 +72,9 @@ class MatlabWrapperGenerator(object):
populated = tfunction.render(fun=method, time=time, includes=namespace.name) populated = tfunction.render(fun=method, time=time, includes=namespace.name)
with open(output_source_dir+'/'+method.name+'.cpp', 'wb') as f: with open(output_source_dir+'/'+method.name+'.cpp', 'wb') as f:
f.write(populated) 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 # classes
for clss in namespace.classes: for clss in namespace.classes:
# cpp converter # cpp converter

@ -27,6 +27,36 @@
{%- endmacro %} {%- 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 * composeWithExceptionHandler
* compose a function call wrapped in exception traps * compose a function call wrapped in exception traps

@ -1,6 +1,36 @@
% {{ fun.name | upper }} {{ fun.doc.short_desc }} {% import 'functional.cpp' as functional %}
{{ fun.doc.long_desc | comment('%',80) }} %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

Loading…
Cancel
Save