CVR-Lib last update 20 Sep 2009

cvr::matrixProcessingInterface< T > Class Template Reference
[Programming interfaces]

Class matrixProcessingInterface. More...

#include <cvrMatrixProcessingInterface.h>

Inheritance diagram for cvr::matrixProcessingInterface< T >:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ~matrixProcessingInterface ()
virtual bool apply (matrix< T > &srcdest) const =0
virtual bool apply (const matrix< T > &src, matrix< T > &dest) const =0


Detailed Description

template<typename T>
class cvr::matrixProcessingInterface< T >

Class matrixProcessingInterface.

Very simple interface to allow virtualization of classes that transform a matrix into another one, like convolution, correlation, matrixTransform, etc.

Note that it is required that the apply methods do not alter the internal state of the class.


Constructor & Destructor Documentation

template<typename T>
virtual cvr::matrixProcessingInterface< T >::~matrixProcessingInterface (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T>
virtual bool cvr::matrixProcessingInterface< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
) const [pure virtual]

On-copy processing apply.

The inherited methods take the src matrix and process it leaving the result in the dest matrix.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
Returns:
true if apply successful or false otherwise.

Implemented in cvr::geometricTransform< I >, cvr::histogramEqualization, cvr::histogramEqualization, cvr::matrixTransform< I >, cvr::noise, cvr::noise, and cvr::geometricTransform< I >.

template<typename T>
virtual bool cvr::matrixProcessingInterface< T >::apply ( matrix< T > &  srcdest  )  const [pure virtual]

On-place processing apply.

The inherited methods should take the srcdest matrix, process it in some way, and on the same matrix leave the result. No restrictions are imposed on whether the memory block of the resulting matrix will be the same that the one in the original matrix. As a matter of fact, it usually won't be.

If you need to ensure the memory constancy, and assuming the resulting matrix will always have the same size than the original one, then you can use the following code:

 matrixProcessingInterfaceInheritedClass<T> theFunctor;
 matrix<T> tmp;
 theFunctor.apply(srcdest,tmp);
 srcdest.fill(tmp)

which of course will be slower as it requires to copy all the data of the result in the original matrix.

Parameters:
srcdest matrix<T> with the source data. The result will be left here too.
Returns:
true if apply successful or false otherwise.

Implemented in cvr::geometricTransform< I >, cvr::histogramEqualization, cvr::histogramEqualization, cvr::matrixTransform< I >, cvr::noise, cvr::noise, and cvr::geometricTransform< I >.


The documentation for this class was generated from the following file:

Generated on Sun Sep 20 22:08:49 2009 for CVR-Lib by Doxygen 1.5.8