CMatrix Class Template Reference

#include <matrix.h>

Inheritance diagram for CMatrix:

Inheritance graph
List of all members.

Detailed Description

template<class T>
class imgfusion::CMatrix< T >

2D matrix. CMatrix uses shared data buffer to share data with other matrices.


Public Types

typedef T Type
typedef CMatrixIterator< T > Iterator
typedef CMatrixIteratorConst<
T > 
ConstIterator

Public Member Functions

CMatrix< T > & operator *= (T S)
 CMatrix ()
 CMatrix (int W, int H)
 CMatrix (const CMatrix< T > &M)
 ~CMatrix ()
CMatrix< T > Clone () const
CMatrix< T > & operator= (const CMatrix &M)
int Width () const
int Height () const
bool IsShared () const
T & operator() (int Col, int Row)
const T & operator() (int Col, int Row) const
Iterator Begin ()
ConstIterator Begin () const
Iterator End ()
ConstIterator End () const
Iterator BeginRow (int Row)
ConstIterator BeginRow (int Row) const
Iterator BeginColumn (int Col)
ConstIterator BeginColumn (int Col) const
CMatrix SubMatrix (int Col, int Row, int W, int H)
const CMatrix SubMatrix (int Col, int Row, int W, int H) const
void Zero ()
void Resize (int W, int H)


Member Typedef Documentation

typedef CMatrixIteratorConst<T> ConstIterator
 

Const row or column iterator that can be used to examine but not to modify the matrix contents.

typedef CMatrixIterator<T> Iterator
 

Row or column iterator that can be used to examine and modify the matrix contents.

typedef T Type
 

The data type.


Constructor & Destructor Documentation

CMatrix  )  [inline]
 

Create empty matrix of size 0x0.

CMatrix int  W,
int  H
[inline]
 

Create a zero matrix of size WxH.

Parameters:
W Width of the matrix.
H Height of the matrix.

CMatrix const CMatrix< T > &  M  )  [inline]
 

Create a shared copy of M.

Parameters:
M Source matrix.

~CMatrix  )  [inline]
 

Destroy matrix, keep data if shared.


Member Function Documentation

ConstIterator Begin  )  const [inline]
 

Return const iterator pointing to the beginning of the matrix.

Iterator Begin  )  [inline]
 

Return iterator pointing to the beginning of the matrix.

Bug:
Doesn't work corectly now, must jump on boundaries!

ConstIterator BeginColumn int  Col  )  const [inline]
 

Return const column iterator.

Parameters:
Col The column to iterate.

Iterator BeginColumn int  Col  )  [inline]
 

Return column iterator.

Parameters:
Col The column to iterate.

ConstIterator BeginRow int  Row  )  const [inline]
 

Return const row iterator.

Parameters:
Row The row to iterate.

Iterator BeginRow int  Row  )  [inline]
 

Return row iterator.

Parameters:
Row The row to iterate.

CMatrix<T> Clone  )  const [inline]
 

Return a new copy of this matrix (with unshared data buffer).

ConstIterator End  )  const [inline]
 

Return iterator pointing to the end of the matrix.

Iterator End  )  [inline]
 

Return iterator pointing to the end of the matrix.

int Height  )  const [inline]
 

Return height of the matrix.

bool IsShared  )  const [inline]
 

Return true if the matrix shares data (fully or partially) with another matrix, false otherwise.

CMatrix<T>& operator *= S  )  [inline]
 

Scalar multiplication.

const T& operator() int  Col,
int  Row
const [inline]
 

Const member access.

T& operator() int  Col,
int  Row
[inline]
 

Member access.

CMatrix<T>& operator= const CMatrix< T > &  M  )  [inline]
 

Assignment operator.

Matrices become shared.

void Resize int  W,
int  H
[inline]
 

Resize the matrix to new dimensions.

Parameters:
W Width of the matrix.
H Height of the matrix.

const CMatrix SubMatrix int  Col,
int  Row,
int  W,
int  H
const [inline]
 

Create a view on this matrix.

Both matrices share data.

Parameters:
Row Top left corner of the sub-matrix.
Col Top left corner of the sub-matrix.
W Width of the sub-matrix.
H Height of the sub-matrix.

CMatrix SubMatrix int  Col,
int  Row,
int  W,
int  H
[inline]
 

Create a view on this matrix.

Both matrices share data.

Parameters:
Row Top left corner of the sub-matrix.
Col Top left corner of the sub-matrix.
W Width of the sub-matrix.
H Height of the sub-matrix.

int Width  )  const [inline]
 

Return width of the matrix.

void Zero  )  [inline]
 

Set the matrix to zero matrix.


Generated on Tue Jul 11 11:22:32 2006 for ImgFusion by  doxygen 1.4.6