2013-06-22 08:33:24 +08:00
|
|
|
{% import 'functional.cpp' as functional %}
|
2013-03-13 19:52:13 +08:00
|
|
|
/*
|
|
|
|
* file: {{fun.name}}.cpp
|
|
|
|
* author: A trusty code generator
|
2013-03-18 10:37:42 +08:00
|
|
|
* date: {{time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())}}
|
2013-03-13 19:52:13 +08:00
|
|
|
*
|
|
|
|
* This file was autogenerated, do not modify.
|
|
|
|
* See LICENCE for full modification and redistribution details.
|
2013-03-18 10:37:42 +08:00
|
|
|
* Copyright {{time.strftime("%Y", time.localtime())}} The OpenCV Foundation
|
2013-03-13 19:52:13 +08:00
|
|
|
*/
|
|
|
|
#include "mex.h"
|
|
|
|
#include "bridge.hpp"
|
2013-06-19 09:54:14 +08:00
|
|
|
#include <string>
|
2013-03-13 19:52:13 +08:00
|
|
|
#include <vector>
|
2013-06-19 14:37:57 +08:00
|
|
|
#include <exception>
|
2013-06-22 08:33:24 +08:00
|
|
|
#include <opencv2/{{ns}}.hpp>
|
2013-03-13 19:52:13 +08:00
|
|
|
{% block includes %}
|
|
|
|
{% endblock %}
|
2013-06-22 08:33:24 +08:00
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
2013-03-13 19:52:13 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* {{ fun.name }}
|
2013-03-18 08:35:43 +08:00
|
|
|
* Gateway routine
|
2013-03-13 19:52:13 +08:00
|
|
|
* nlhs - number of return arguments
|
|
|
|
* plhs - pointers to return arguments
|
|
|
|
* nrhs - number of input arguments
|
|
|
|
* prhs - pointers to input arguments
|
|
|
|
*/
|
|
|
|
void mexFunction(int nlhs, mxArray* plhs[],
|
|
|
|
int nrhs, const mxArray* prhs[]) {
|
|
|
|
|
2013-06-22 08:33:24 +08:00
|
|
|
// assertions
|
|
|
|
mxAssert(nrhs >= {{fun.req|length - fun.req|noutputs}}, "Too few required input arguments specified");
|
|
|
|
mxAssert(nrhs <= {{fun.req|length + fun.opt|length - fun.req|noutputs - fun.opt|noutputs}}, "Too many input arguments specified");
|
|
|
|
mxAssert(nlhs <= {{fun.ret|length + fun.req|noutputs + fun.opt|noutputs}}, "Too many output arguments specified");
|
2013-03-13 19:52:13 +08:00
|
|
|
|
2013-06-22 08:33:24 +08:00
|
|
|
// setup
|
|
|
|
vector<Bridge> inputs(plhs, plhs+nrhs);
|
|
|
|
vector<Bridge> outputs(nlhs);
|
2013-03-13 19:52:13 +08:00
|
|
|
|
2013-06-22 08:33:24 +08:00
|
|
|
{{ fun }}
|
2013-03-13 19:52:13 +08:00
|
|
|
|
2013-06-22 08:33:24 +08:00
|
|
|
{{ functional.generate(fun) }}
|
2013-03-13 19:52:13 +08:00
|
|
|
|
2013-06-22 08:33:24 +08:00
|
|
|
// setdown
|
2013-03-13 19:52:13 +08:00
|
|
|
}
|