Open Source Computer Vision Library https://opencv.org/
 
 
 
 
 
 

44 lines
1.4 KiB

{% import 'functional.cpp' as functional %}
/*
* file: {{fun.name}}.cpp
* author: A trusty code generator
* date: {{time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime())}}
*
* This file was autogenerated, do not modify.
* See LICENCE for full modification and redistribution details.
* Copyright {{time.strftime("%Y", time.localtime())}} The OpenCV Foundation
*/
#include "mex.h"
#include "bridge.hpp"
#include <string>
#include <vector>
#include <exception>
#include <opencv2/{{includes}}.hpp>
{% block includes %}
{% endblock %}
/*
* {{ fun.name }}
* {{ fun }}
* Gateway routine
* 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[]) {
// assertions
mxAssert(nrhs >= {{fun.req|length - fun.req|outputs|length}}, "Too few required input arguments specified");
mxAssert(nrhs <= {{fun.req|length + fun.opt|length - fun.req|outputs|length - fun.opt|outputs|length}}, "Too many input arguments specified");
mxAssert(nlhs <= {{ fun.rtp|void|not + fun.req|outputs|length + fun.opt|outputs|length}}, "Too many output arguments specified");
// setup
std::vector<Bridge> inputs(plhs, plhs+nrhs);
std::vector<Bridge> outputs(nlhs);
{{ functional.generate(fun) }}
// setdown
}