Class to help manage return values in mex files. More...
#include <Matlab/mexConverts.H>
Public Member Functions | |
MexReturn (int nlhs, mxArray *plhs[]) | |
Constructor takes arguments from the mexFunction call. | |
virtual | ~MexReturn () |
Destructor checks that all arguments are assigned. | |
int | numArgs () |
returns the number of return arguments | |
bool | isNumOK (int num) |
test if 0 <= num < numArgs() | |
bool | store (int num, mxArray *val) |
store a mxArray as return argumnt num; true if successful | |
bool | store (int num, double val) |
store double scalar | |
template<class T > | |
bool | store (int num, const std::vector< T > &val) |
store a vector of numbers | |
template<class T > | |
bool | store (int num, const Image< T > &val) |
store a grayscale image | |
template<class T > | |
bool | store (int num, const Image< PixRGB< T > > &val) |
store an RGB image |
Class to help manage return values in mex files.
Definition at line 152 of file mexConverts.H.
MexReturn::MexReturn | ( | int | nlhs, | |
mxArray * | plhs[] | |||
) |
Constructor takes arguments from the mexFunction call.
MexReturn::~MexReturn | ( | ) | [virtual] |
Destructor checks that all arguments are assigned.
Definition at line 567 of file mexConverts.C.
References mexError(), mexFatal(), and sformat().
bool MexReturn::isNumOK | ( | int | num | ) |
test if 0 <= num < numArgs()
Definition at line 585 of file mexConverts.C.
References numArgs().
Referenced by store().
int MexReturn::numArgs | ( | ) |
returns the number of return arguments
Definition at line 581 of file mexConverts.C.
Referenced by isNumOK().
store an RGB image
Definition at line 618 of file mexConverts.C.
References isNumOK(), RGBImage2mexArray(), and store().
bool MexReturn::store | ( | int | num, | |
const Image< T > & | val | |||
) | [inline] |
store a grayscale image
Definition at line 610 of file mexConverts.C.
References Image2mexArray(), isNumOK(), and store().
bool MexReturn::store | ( | int | num, | |
const std::vector< T > & | val | |||
) | [inline] |
store a vector of numbers
Definition at line 602 of file mexConverts.C.
References isNumOK(), store(), and Vector2mexArr().
bool MexReturn::store | ( | int | num, | |
double | val | |||
) |
bool MexReturn::store | ( | int | num, | |
mxArray * | val | |||
) |
store a mxArray as return argumnt num; true if successful
Definition at line 589 of file mexConverts.C.
References isNumOK().
Referenced by store().