MatlabImageAdapter Class Reference

Provides an interface to Matlab images. More...

#include <MatlabImageAdapter.h>

Inheritance diagram for MatlabImageAdapter:

OvImageAdapter List of all members.

Public Member Functions

 MatlabImageAdapter (mxArray *im)
virtual ~MatlabImageAdapter ()
virtual double getPixel (int row, int column, int channel) const
virtual void setPixel (double value, int row, int column, int channel)

Protected Member Functions

template<class T>
double getPixelT (int row, int column, int channel) const
template<class T>
void setPixelT (double value, int row, int column, int channel)
double getPixeldoNothing (int row, int column, int channel) const
void setPixeldoNothing (double value, int row, int column, int channel)

Protected Attributes

mxArray * mMatlabImage
void * mImageDataPtr
double(MatlabImageAdapter::* getPixelfptr )(int row, int column, int channel) const
void(MatlabImageAdapter::* setPixelfptr )(double value, int row, int column, int channel)

Detailed Description

Provides an interface to Matlab images.

The MatlabImageAdapter class is inherited from the OvImageAdapter and provides a wrapper around Matlab's mxArray allowing the OpenVis3D library functions to access the dimensions and datatype of the image, and provides get and set methods to alter image pixels.

See also:
OvImageAdapter
Author:
Abhijit Ogale


Constructor & Destructor Documentation

MatlabImageAdapter::MatlabImageAdapter ( mxArray *  im  ) 

to prevent the default constructor from being used

MatlabImageAdapter::~MatlabImageAdapter (  )  [virtual]

Destructor.


Member Function Documentation

double MatlabImageAdapter::getPixel ( int  row,
int  column,
int  channel 
) const [virtual]

Returns a pixel value at a particular row, column and color channel.

Parameters:
row row of the image
column column of the image
channel channel of the image
Returns:
pixel value (type double)

Implements OvImageAdapter.

double MatlabImageAdapter::getPixeldoNothing ( int  row,
int  column,
int  channel 
) const [protected]

Dummy function for use when internal mxArray pointer is null or data type unknown.

Parameters:
row row of the image
column column of the image
channel channel of the image
Returns:
pixel value (type double)

template<class T>
double MatlabImageAdapter::getPixelT ( int  row,
int  column,
int  channel 
) const [protected]

Internal template function to handle any image datatype. Returns a pixel value at a particular row, column and color channel.

Parameters:
row row of the image
column column of the image
channel channel of the image
Returns:
pixel value (type double)

void MatlabImageAdapter::setPixel ( double  value,
int  row,
int  column,
int  channel 
) [virtual]

Sets a pixel value at a particular row, column and color channel.

Parameters:
value value to be set
row row of the image
column column of the image
channel channel of the image

Implements OvImageAdapter.

void MatlabImageAdapter::setPixeldoNothing ( double  value,
int  row,
int  column,
int  channel 
) [protected]

Dummy function for use when internal mxArray pointer is null or data type unknown.

Parameters:
value value to be set
row row of the image
column column of the image
channel channel of the image

template<class T>
void MatlabImageAdapter::setPixelT ( double  value,
int  row,
int  column,
int  channel 
) [protected]

Internal template function to handle any image datatype. Sets a pixel value at a particular row, column and color channel.

Parameters:
value value to be set
row row of the image
column column of the image
channel channel of the image


Member Data Documentation

double(MatlabImageAdapter::* MatlabImageAdapter::getPixelfptr)(int row, int column, int channel) const [protected]

function pointer used to store getpixel function appropriate for image datatype

void* MatlabImageAdapter::mImageDataPtr [protected]

saved pointer to the raw data array within the Matlab mxArray object

mxArray* MatlabImageAdapter::mMatlabImage [protected]

saved pointer to Matlab mxArray object

void(MatlabImageAdapter::* MatlabImageAdapter::setPixelfptr)(double value, int row, int column, int channel) [protected]

function pointer used to store setpixel function appropriate for image datatype


The documentation for this class was generated from the following files:
Generated on Thu Feb 1 15:58:49 2007 for OpenVis3D by  doxygen 1.4.7