#include "Util/Types.H"
#include "Image/Point2D.H"
#include "Image/ImageSet.H"
#include <mex.h>
#include <vector>
Go to the source code of this file.
Classes | |
class | MexReturn |
Class to help manage return values in mex files. More... | |
Functions | |
template<class T > | |
Image< T > | mexArray2Image (const mxArray *arrptr) |
convert a mxArray into a grayscale image | |
template<class T > | |
Image< PixRGB< T > > | mexArray2RGBImage (const mxArray *arrptr) |
convert a mxArray into a RGB image | |
template<class T > | |
mxArray * | Image2mexArray (const Image< T > &img) |
convert a grayscale image into a mxArray | |
mxArray * | Image2mexArrayUint8 (const Image< byte > *img) |
convert a grayscale image into a mxArray of class 'uint8' | |
template<class T > | |
mxArray * | RGBImage2mexArray (const Image< PixRGB< T > > &img) |
convert a RGB image into a mxArray of class 'double' | |
mxArray * | RGBImage2mexArrayUint8 (const Image< PixRGB< byte > > *img) |
convert a RGB image into a mxArray of class 'uint8' | |
template<class T > | |
std::vector< T > | mexArr2Vector (const mxArray *vecptr, uint num_elements) |
convert the first num_elements elements of a mxArray into a std::vector | |
template<class T > | |
std::vector< T > | mexArr2Vector (const mxArray *vecptr) |
convert a mxArray vector into a std::vector | |
template<class T > | |
mxArray * | Vector2mexArr (const std::vector< T > &vect, uint num_elements) |
convert the first num_elements elements of a std::vector into a mxArray | |
template<class T > | |
mxArray * | Vector2mexArr (const std::vector< T > &vect) |
convert a std::vector into a mxArray vector | |
std::vector< Point2D< int > > | mexArr2Point2DVec (const mxArray *arrptr) |
convert a 2 x N mxArray into a std::vector<Point2D<int> > | |
mxArray * | Point2DVec2mexArr (const std::vector< Point2D< int > > &vect) |
convert a std::vector<Point2D<int> > into a 2 x N mxArray | |
template<class T > | |
mxArray * | ImgVec2mexArr (const ImageSet< T > &vect) |
convert a vector of pointers to images of equal size into a 3D mxArray | |
template<class T > | |
ImageSet< T > | mexArr2ImgVec (const mxArray *arrptr) |
convert a 3D mxArray into a vector of pointers to images of equal size | |
template<class T > | |
mxArray * | ImageSet2cellArr (const ImageSet< T > &imset) |
convert an ImageSet into a cell array of images | |
template<class T > | |
ImageSet< T > | cellArr2ImageSet (const mxArray *arrptr) |
convert a cell array of images into an ImageSet | |
template<class T > | |
mxArray * | ImageSetVec2cellArr (const std::vector< ImageSet< T > > &vec) |
convert a vector of ImageSet into a 2d cell array | |
template<class T > | |
std::vector< ImageSet< T > > | cellArr2ImageSetVec (const mxArray *arrptr) |
convert a 2d cell array into a vector of ImageSet | |
double | conv (const double *src, double *target) |
byte | conv (const double *src, byte *target) |
double | conv (const byte *src, double *target) |
byte | conv (const byte *src, byte *target) |
float | conv (const double *src, float *target) |
double | conv (const float *src, double *target) |
float | conv (const byte *src, float *target) |
conversions from ans to MEX arrays
Definition in file mexConverts.H.
ImageSet<T> cellArr2ImageSet | ( | const mxArray * | arrptr | ) | [inline] |
convert a cell array of images into an ImageSet
Definition at line 496 of file mexConverts.C.
References mexFatal().
std::vector< ImageSet<T> > cellArr2ImageSetVec | ( | const mxArray * | arrptr | ) | [inline] |
convert a 2d cell array into a vector of ImageSet
Definition at line 530 of file mexConverts.C.
References mexFatal().
mxArray* Image2mexArray | ( | const Image< T > & | img | ) | [inline] |
convert a grayscale image into a mxArray
Definition at line 172 of file mexConverts.C.
References Image< T >::begin(), Image< T >::getHeight(), Image< T >::getSize(), Image< T >::getWidth(), and height.
Referenced by ImageSet2cellArr(), ImageSetVec2cellArr(), mexFunction(), and MexReturn::store().
convert a grayscale image into a mxArray of class 'uint8'
We take a pointer rather than a reference to ensure that there are no implicit Image type conversions in calls to this function -- we want exactly an Image<byte>, and not an Image<float> or some other pixel type.
Definition at line 194 of file mexConverts.C.
References Image< T >::begin(), Image< T >::getHeight(), Image< T >::getWidth(), and height.
Referenced by mexFunction().
mxArray* ImageSet2cellArr | ( | const ImageSet< T > & | imset | ) | [inline] |
convert an ImageSet into a cell array of images
Definition at line 483 of file mexConverts.C.
References Image2mexArray(), and ImageSet< T >::size().
mxArray* ImageSetVec2cellArr | ( | const std::vector< ImageSet< T > > & | vec | ) | [inline] |
convert a vector of ImageSet into a 2d cell array
Definition at line 511 of file mexConverts.C.
References Image2mexArray().
mxArray* ImgVec2mexArr | ( | const ImageSet< T > & | vect | ) | [inline] |
convert a vector of pointers to images of equal size into a 3D mxArray
Definition at line 364 of file mexConverts.C.
References ImageSet< T >::isEmpty(), mexFatal(), and ImageSet< T >::size().
ImageSet<T> mexArr2ImgVec | ( | const mxArray * | arrptr | ) | [inline] |
convert a 3D mxArray into a vector of pointers to images of equal size
Definition at line 400 of file mexConverts.C.
References height, mexFatal(), NO_INIT, and sformat().
std::vector<Point2D<int> > mexArr2Point2DVec | ( | const mxArray * | arrptr | ) |
convert a 2 x N mxArray into a std::vector<Point2D<int> >
Definition at line 327 of file mexConverts.C.
References mexFatal().
std::vector<T> mexArr2Vector | ( | const mxArray * | vecptr | ) | [inline] |
convert a mxArray vector into a std::vector
Definition at line 297 of file mexConverts.C.
std::vector<T> mexArr2Vector | ( | const mxArray * | vecptr, | |
uint | num_elements | |||
) | [inline] |
convert the first num_elements elements of a mxArray into a std::vector
Definition at line 280 of file mexConverts.C.
Image<T> mexArray2Image | ( | const mxArray * | arrptr | ) | [inline] |
convert a mxArray into a grayscale image
Definition at line 49 of file mexConverts.C.
References Image< T >::beginw(), height, mexFatal(), NO_INIT, and sformat().
convert a mxArray into a RGB image
Definition at line 104 of file mexConverts.C.
References Image< T >::beginw(), height, mexFatal(), NO_INIT, and sformat().
mxArray* Point2DVec2mexArr | ( | const std::vector< Point2D< int > > & | vect | ) |
convert a std::vector<Point2D<int> > into a 2 x N mxArray
Definition at line 349 of file mexConverts.C.
convert a RGB image into a mxArray of class 'double'
Definition at line 217 of file mexConverts.C.
Referenced by mexFunction(), and MexReturn::store().
convert a RGB image into a mxArray of class 'uint8'
We take a pointer rather than a reference to ensure that there are no implicit Image type conversions in calls to this function -- we want exactly an Image<PixRGB<byte>>, and not an Image<PixRGB<float>> or some other pixel type.
Definition at line 246 of file mexConverts.C.
Referenced by mexFunction().
mxArray* Vector2mexArr | ( | const std::vector< T > & | vect | ) | [inline] |
convert a std::vector into a mxArray vector
Definition at line 321 of file mexConverts.C.
References Vector2mexArr().
mxArray* Vector2mexArr | ( | const std::vector< T > & | vect, | |
uint | num_elements | |||
) | [inline] |
convert the first num_elements elements of a std::vector into a mxArray
Definition at line 304 of file mexConverts.C.
References mexFatal(), and sformat().
Referenced by MexReturn::store(), and Vector2mexArr().