/* rimage_matlab.h * Created: Apr 3, 2006 * Author: Andrew Salamon * * Convert from matlab arrays to RImage's and back again. * Write and read Matlab images to/from a file. * Return values need to be deleted when the caller is done with them. */ #include "mat.h" #include "rimage.h" #include extern "C" { #include } // Most of these functions should probably be converted to a class that inherits from RImage. //extern "C" { RImage *rimageFromMatlabArray( const mxArray *array ); mxArray *matlabArrayFromRimage( const RImage *image ); mxArray * readImageMat( const char *fileName ); void writeImageMat( const mxArray *img, const char *fileName ); //} mxArray *matlabArrayFromDoubles( const double *image, int width, int height ); mxArray *matlabArrayFromComplex( const std::complex *image, int width, int height ); std::complex *complexFromMatlabArray( const mxArray *array ); mxArray *matlabArrayFromComplexFFTW( const fftw_complex *image, int width, int height );