ULIS  dev4.0.7
Utility Library for Imaging Systems
Public Types | Public Member Functions | Static Public Member Functions | List of all members
TMatrix3< T > Class Template Reference

The TMatrix3 class provides a simple 3x3 square matrix class for geometry applications. More...

Public Types

typedef TVector3< T > tColumn
 
typedef TVector3< T > tRow
 

Public Member Functions

 TMatrix3 ()
 
 TMatrix3 (const tColumn &iCol0, const tColumn &iCol1, const tColumn &iCol2)
 
 TMatrix3 (const TMatrix3 &iOther)
 
template<typename U >
 TMatrix3 (const TMatrix3< U > &iOther)
 
 TMatrix3 (T iM00, T iM01, T iM02, T iM10, T iM11, T iM12, T iM20, T iM21, T iM22)
 
 TMatrix3 (T iValue)
 
TVector2< T > ApplyHomography (const TVector2< T > &iPoint) const
 
T * Data ()
 
const T * Data () const
 
void Decompose (T *oTx, T *oTy, T *oRotation, T *oScaleX, T *oScaleY, T *oSkewX, T *oSkewY) const
 
Determinant () const
 
TMatrix3 Inverse () const
 
bool operator!= (const TMatrix3 &iOther) const
 
TMatrix3operator*= (const TMatrix3 &iOther)
 
TMatrix3operator*= (T iValue)
 
TMatrix3operator+= (const TMatrix3 &iOther)
 
TMatrix3operator+= (T iValue)
 
TMatrix3 operator- () const
 
TMatrix3operator-= (const TMatrix3 &iOther)
 
TMatrix3operator-= (T iValue)
 
TMatrix3operator/= (const TMatrix3 &iOther)
 
TMatrix3operator/= (T iValue)
 
TMatrix3operator= (const TMatrix3 &iOther)
 
bool operator== (const TMatrix3 &iOther) const
 
tColumnoperator[] (int iIndex)
 
const tColumnoperator[] (int iIndex) const
 
TMatrix3 Transpose () const
 

Static Public Member Functions

static TMatrix3 MakeHomography (const TVector2< T > iSrc[], const TVector2< T > iDst[])
 
static TMatrix3 MakeRotationMatrix (T iAngleRad)
 
static TMatrix3 MakeScaleMatrix (T iScaleX, T iScaleY)
 
static TMatrix3 MakeSkewMatrix (T iSkewX, T iSkewY)
 
static TMatrix3 MakeTranslationMatrix (T iX, T iY)
 

Detailed Description

template<typename T>
class TMatrix3< T >

The TMatrix3 class is a template class that provides basic matrix functionnalities, it can be used with any numeric types, ranging from integer values to floating point values.

TMatrix3 are column-major ordered.

Member Typedef Documentation

◆ tColumn

template<typename T >
typedef TVector3< T > TMatrix3< T >::tColumn

◆ tRow

template<typename T >
typedef TVector3< T > TMatrix3< T >::tRow

Constructor & Destructor Documentation

◆ TMatrix3() [1/6]

template<typename T >
TMatrix3< T >::TMatrix3 ( )

Default constructor ( identity matrix ).

◆ TMatrix3() [2/6]

template<typename T >
TMatrix3< T >::TMatrix3 ( iValue)

Constructor from input diagonal value.

◆ TMatrix3() [3/6]

template<typename T >
TMatrix3< T >::TMatrix3 ( iM00,
iM01,
iM02,
iM10,
iM11,
iM12,
iM20,
iM21,
iM22 
)

Constructor from input cells values.

◆ TMatrix3() [4/6]

template<typename T >
TMatrix3< T >::TMatrix3 ( const tColumn iCol0,
const tColumn iCol1,
const tColumn iCol2 
)

Constructor from row vector values.

◆ TMatrix3() [5/6]

template<typename T >
TMatrix3< T >::TMatrix3 ( const TMatrix3< T > &  iOther)

Copy constructor.

◆ TMatrix3() [6/6]

template<typename T >
template<typename U >
TMatrix3< T >::TMatrix3 ( const TMatrix3< U > &  iOther)

Conversion constructor from other matrix type.

Member Function Documentation

◆ ApplyHomography()

template<typename T >
TVector2< T > TMatrix3< T >::ApplyHomography ( const TVector2< T > &  iPoint) const

Apply the projective perspective transform or homography to the point

◆ Data() [1/2]

template<typename T >
T * TMatrix3< T >::Data ( )

Return a pointer to the base storage.

◆ Data() [2/2]

template<typename T >
const T * TMatrix3< T >::Data ( ) const

Return a pointer to the base storage.

◆ Decompose()

template<typename T >
void TMatrix3< T >::Decompose ( T *  oTx,
T *  oTy,
T *  oRotation,
T *  oScaleX,
T *  oScaleY,
T *  oSkewX,
T *  oSkewY 
) const

Decompose the matrix if it represents an affine transform

◆ Determinant()

template<typename T >
T TMatrix3< T >::Determinant ( ) const

Obtain the determinant of the matrix.

◆ Inverse()

template<typename T >
TMatrix3< T > TMatrix3< T >::Inverse ( ) const

Obtain the inverse of the matrix.

◆ MakeHomography()

template<typename T >
TMatrix3< T > TMatrix3< T >::MakeHomography ( const TVector2< T >  iSrc[],
const TVector2< T >  iDst[] 
)
static

Static maker for homography, 2D perspective transform.

◆ MakeRotationMatrix()

template<typename T >
TMatrix3< T > TMatrix3< T >::MakeRotationMatrix ( iAngleRad)
static

Static maker for 2D 3x3 rotation matrix.

◆ MakeScaleMatrix()

template<typename T >
TMatrix3< T > TMatrix3< T >::MakeScaleMatrix ( iScaleX,
iScaleY 
)
static

Static maker for 2D 3x3 scale matrix.

◆ MakeSkewMatrix()

template<typename T >
TMatrix3< T > TMatrix3< T >::MakeSkewMatrix ( iSkewX,
iSkewY 
)
static

Static maker for 2D 3x3 skew matrix.

◆ MakeTranslationMatrix()

template<typename T >
TMatrix3< T > TMatrix3< T >::MakeTranslationMatrix ( iX,
iY 
)
static

Static maker for 2D 3x3 translation matrix.

◆ operator!=()

template<typename T >
bool TMatrix3< T >::operator!= ( const TMatrix3< T > &  iOther) const

Inequality operator.

◆ operator*=() [1/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator*= ( const TMatrix3< T > &  iOther)

Unary multiplication operator with matrix.

◆ operator*=() [2/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator*= ( iValue)

Unary multiplication operator with value.

◆ operator+=() [1/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator+= ( const TMatrix3< T > &  iOther)

Unary addition operator with matrix.

◆ operator+=() [2/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator+= ( iValue)

Unary addition operator with value.

◆ operator-()

template<typename T >
TMatrix3< T > TMatrix3< T >::operator- ( ) const

Unary negative operator.

◆ operator-=() [1/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator-= ( const TMatrix3< T > &  iOther)

Unary substraction operator with matrix.

◆ operator-=() [2/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator-= ( iValue)

Unary substraction operator with value.

◆ operator/=() [1/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator/= ( const TMatrix3< T > &  iOther)

Unary division operator with matrix.

◆ operator/=() [2/2]

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator/= ( iValue)

Unary division operator with value.

◆ operator=()

template<typename T >
TMatrix3< T > & TMatrix3< T >::operator= ( const TMatrix3< T > &  iOther)

Assignment operator from matrix.

◆ operator==()

template<typename T >
bool TMatrix3< T >::operator== ( const TMatrix3< T > &  iOther) const

Equality operator.

◆ operator[]() [1/2]

template<typename T >
TMatrix3< T >::tColumn & TMatrix3< T >::operator[] ( int  iIndex)

Subscript accessor for matrix columns.

◆ operator[]() [2/2]

template<typename T >
const TMatrix3< T >::tColumn & TMatrix3< T >::operator[] ( int  iIndex) const

Subscript accessor for const matrix columns.

◆ Transpose()

template<typename T >
TMatrix3< T > TMatrix3< T >::Transpose ( ) const

Obtain the transpose of the matrix.