PicoVGA  1.0-cmake
VGA/TV display on Raspberry Pico
cMat2D< m2type > Class Template Reference

Transformation matrix. More...

#include <mat2d.h>

Public Member Functions

m2type GetX (m2type x, m2type y) const
 Transform X.
 
m2type GetY (m2type x, m2type y) const
 Transform Y.
 
void Unit ()
 Set unit matrix.
 
void Copy (const cMat2D *m)
 Copy matrix.
 
void TransX (m2type tx)
 Translate in X direction. More...
 
void TransY (m2type ty)
 Translate in Y direction. More...
 
void ScaleX (m2type sx)
 Scale in X direction. More...
 
void ScaleY (m2type sy)
 Scale in Y direction. More...
 
void RotSC (m2type sina, m2type cosa)
 Rotate, using sin and cos. More...
 
void Rot (m2type a)
 Rotate, using angle.
 
void Rot90 ()
 Rotate by 90 deg (sina=1, cosa=0)
 
void Rot180 ()
 Rotate by 180 deg (=flipX and flipY) (sina=0, cosa=-1)
 
void Rot270 ()
 Rotate by 270 deg (sina=-1, cosa=0)
 
void ShearX (m2type dx)
 Shear in X direction. More...
 
void ShearY (m2type dy)
 Shear in Y direction. More...
 
void FlipY ()
 Flip in Y direction. More...
 
void FlipX ()
 Flip in X direction. More...
 

Data Fields

m2type m11
 
m2type m12
 
m2type m13
 
m2type m21
 
m2type m22
 
m2type m23
 

Detailed Description

template<typename m2type>
class cMat2D< m2type >

Transformation matrix.

Member Function Documentation

◆ TransX()

template<typename m2type >
void cMat2D< m2type >::TransX ( m2type  tx)
inline

Translate in X direction.

 1  0 tx   m11 m12 m13   m11 m12 m13+tx
 0  1  0 * m21 m22 m23 = m21 m22 m23
 0  0  1     0   0   1    0   0   1

◆ TransY()

template<typename m2type >
void cMat2D< m2type >::TransY ( m2type  ty)
inline

Translate in Y direction.

 1  0  0   m11 m12 m13   m11 m12 m13
 0  1 ty * m21 m22 m23 = m21 m22 m23+ty
 0  0  1     0   0   1    0   0   1

◆ ScaleX()

template<typename m2type >
void cMat2D< m2type >::ScaleX ( m2type  sx)
inline

Scale in X direction.

 sx 0  0   m11 m12 m13    m11*sx m12*sx m13*sx
 0  1  0 * m21 m22 m23  = m21    m22    m23
 0  0  1     0   0   1      0      0      1

◆ ScaleY()

template<typename m2type >
void cMat2D< m2type >::ScaleY ( m2type  sy)
inline

Scale in Y direction.

 1  0  0   m11 m12 m13    m11    m12    m13
 0  sy 0 * m21 m22 m23  = m21*sy m22*sy m23*sy
 0  0  1     0   0   1      0      0      1

◆ RotSC()

template<typename m2type >
void cMat2D< m2type >::RotSC ( m2type  sina,
m2type  cosa 
)
inline

Rotate, using sin and cos.

 cosa -sina  0   m11 m12 m13   m11*cosa-m21*sina  m12*cosa-m22*sina  m13*cosa-m23*sina
 sina  cosa  0 * m21 m22 m23 = m11*sina+m21*cosa  m12*sina+m22*cosa  m13*sina+m23*cosa
  0      0   1     0   0   1           0                    0                 1

◆ ShearX()

template<typename m2type >
void cMat2D< m2type >::ShearX ( m2type  dx)
inline

Shear in X direction.

 1  dx 0   m11 m12 m13   m11+m21*dx m12+m22*dx m13+m23*dx
 0  1  0 * m21 m22 m23 = m21        m22        m23
 0  0  1     0   0   1     0          0          1

◆ ShearY()

template<typename m2type >
void cMat2D< m2type >::ShearY ( m2type  dy)
inline

Shear in Y direction.

 1  0  0   m11 m12 m13   m11        m12        m13
 dy 1  0 * m21 m22 m23 = m21+m11*dy m22+m12*dy m23+m13*dy
 0  0  1     0   0   1     0          0          1

◆ FlipY()

template<typename m2type >
void cMat2D< m2type >::FlipY ( )
inline

Flip in Y direction.

 1  0  0   m11 m12 m13     m11   m12    m13
 0 -1  0 * m21 m22 m23  = -m21  -m22   -m23
 0  0  1     0   0   1      0     0      1

◆ FlipX()

template<typename m2type >
void cMat2D< m2type >::FlipX ( )
inline

Flip in X direction.

 -1 0  0   m11 m12 m13    -m11  -m12   -m13
 0  1  0 * m21 m22 m23  = m21    m22    m23
 0  0  1     0   0   1      0      0      1

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