Functions

void hal_gfx_mat3x3_load_identity (hal_gfx_matrix3x3_t m)
 Load Identity Matrix. More...
 
void hal_gfx_mat3x3_translate (hal_gfx_matrix3x3_t m, float tx, float ty)
 Apply translate transformation. More...
 
void hal_gfx_mat3x3_scale (hal_gfx_matrix3x3_t m, float sx, float sy)
 Apply scale transformation. More...
 
void hal_gfx_mat3x3_shear (hal_gfx_matrix3x3_t m, float shx, float shy)
 Apply shear transformation. More...
 
void hal_gfx_mat3x3_mirror (hal_gfx_matrix3x3_t m, int mx, int my)
 Apply mirror transformation. More...
 
void hal_gfx_mat3x3_rotate (hal_gfx_matrix3x3_t m, float angle_degrees)
 Apply rotation transformation. More...
 
void hal_gfx_mat3x3_mul (hal_gfx_matrix3x3_t m, hal_gfx_matrix3x3_t _m)
 Multiply two 3x3 matrices ( m = m*_m) More...
 
void hal_gfx_mat3x3_mul_vec (hal_gfx_matrix3x3_t m, float *x, float *y)
 Multiply vector with matrix. More...
 
void hal_gfx_mat3x3_mul_vec_affine (hal_gfx_matrix3x3_t m, float *x, float *y)
 Multiply vector with affine matrix. More...
 
void hal_gfx_mat3x3_adj (hal_gfx_matrix3x3_t m)
 Calculate adjoint. More...
 
void hal_gfx_mat3x3_div_scalar (hal_gfx_matrix3x3_t m, float s)
 Divide matrix with scalar value. More...
 
int hal_gfx_mat3x3_invert (hal_gfx_matrix3x3_t m)
 Invert matrix. More...
 
int hal_gfx_mat3x3_square_to_quad (float dx0, float dy0, float dx1, float dy1, float dx2, float dy2, float dx3, float dy3, hal_gfx_matrix3x3_t m)
 Square to quad transformation. More...
 
int hal_gfx_mat3x3_quad_to_rect (int width, int height, float sx0, float sy0, float sx1, float sy1, float sx2, float sy2, float sx3, float sy3, hal_gfx_matrix3x3_t m)
 Map rectangle to quadrilateral. More...
 

Detailed Description

Function Documentation

◆ hal_gfx_mat3x3_adj()

void hal_gfx_mat3x3_adj ( hal_gfx_matrix3x3_t  m)

Calculate adjoint.

Parameters
[in]mMatrix

◆ hal_gfx_mat3x3_div_scalar()

void hal_gfx_mat3x3_div_scalar ( hal_gfx_matrix3x3_t  m,
float  s 
)

Divide matrix with scalar value.

Parameters
[in]mMatrix to divide
[in]sscalar value

◆ hal_gfx_mat3x3_invert()

int hal_gfx_mat3x3_invert ( hal_gfx_matrix3x3_t  m)

Invert matrix.

Parameters
[in]mMatrix to invert

◆ hal_gfx_mat3x3_load_identity()

void hal_gfx_mat3x3_load_identity ( hal_gfx_matrix3x3_t  m)

Load Identity Matrix.

Parameters
[in]mMatrix to be loaded

◆ hal_gfx_mat3x3_mirror()

void hal_gfx_mat3x3_mirror ( hal_gfx_matrix3x3_t  m,
int  mx,
int  my 
)

Apply mirror transformation.

Parameters
[in]mMatrix to apply transformation
[in]mxif non-zero, mirror horizontally
[in]myif non-zero, mirror vertically

◆ hal_gfx_mat3x3_mul()

void hal_gfx_mat3x3_mul ( hal_gfx_matrix3x3_t  m,
hal_gfx_matrix3x3_t  _m 
)

Multiply two 3x3 matrices ( m = m*_m)

Parameters
[in]mleft matrix, will be overwritten by the result
[in]_mright matrix

◆ hal_gfx_mat3x3_mul_vec()

void hal_gfx_mat3x3_mul_vec ( hal_gfx_matrix3x3_t  m,
float *  x,
float *  y 
)

Multiply vector with matrix.

Parameters
[in]mMatrix to multiply with
[in]xVector x coefficient
[in]yVector y coefficient

◆ hal_gfx_mat3x3_mul_vec_affine()

void hal_gfx_mat3x3_mul_vec_affine ( hal_gfx_matrix3x3_t  m,
float *  x,
float *  y 
)

Multiply vector with affine matrix.

Parameters
[in]mMatrix to multiply with
[in]xVector x coefficient
[in]yVector y coefficient

◆ hal_gfx_mat3x3_quad_to_rect()

int hal_gfx_mat3x3_quad_to_rect ( int  width,
int  height,
float  sx0,
float  sy0,
float  sx1,
float  sy1,
float  sx2,
float  sy2,
float  sx3,
float  sy3,
hal_gfx_matrix3x3_t  m 
)

Map rectangle to quadrilateral.

Parameters
[in]widthRectangle width
[in]heightRectangle height
[in]sx0x coordinate at the first vertex of the quadrilateral
[in]sy0y coordinate at the first vertex of the quadrilateral
[in]sx1x coordinate at the second vertex of the quadrilateral
[in]sy1y coordinate at the second vertex of the quadrilateral
[in]sx2x coordinate at the third vertex of the quadrilateral
[in]sy2y coordinate at the third vertex of the quadrilateral
[in]sx3x coordinate at the fourth vertex of the quadrilateral
[in]sy3y coordinate at the fourth vertex of the quadrilateral
[in]mMapping matrix

◆ hal_gfx_mat3x3_rotate()

void hal_gfx_mat3x3_rotate ( hal_gfx_matrix3x3_t  m,
float  angle_degrees 
)

Apply rotation transformation.

Parameters
[in]mMatrix to apply transformation
[in]angle_degreesAngle to rotate in degrees

◆ hal_gfx_mat3x3_scale()

void hal_gfx_mat3x3_scale ( hal_gfx_matrix3x3_t  m,
float  sx,
float  sy 
)

Apply scale transformation.

Parameters
[in]mMatrix to apply transformation
[in]sxX scaling factor
[in]syY scaling factor

◆ hal_gfx_mat3x3_shear()

void hal_gfx_mat3x3_shear ( hal_gfx_matrix3x3_t  m,
float  shx,
float  shy 
)

Apply shear transformation.

Parameters
[in]mMatrix to apply transformation
[in]shxX shearing factor
[in]shyY shearing factor

◆ hal_gfx_mat3x3_square_to_quad()

int hal_gfx_mat3x3_square_to_quad ( float  dx0,
float  dy0,
float  dx1,
float  dy1,
float  dx2,
float  dy2,
float  dx3,
float  dy3,
hal_gfx_matrix3x3_t  m 
)

Square to quad transformation.

Parameters
[in]dx0x coordinate at the first vertex of the quadrilateral
[in]dy0y coordinate at the first vertex of the quadrilateral
[in]dx1x coordinate at the second vertex of the quadrilateral
[in]dy1y coordinate at the second vertex of the quadrilateral
[in]dx2x coordinate at the third vertex of the quadrilateral
[in]dy2y coordinate at the third vertex of the quadrilateral
[in]dx3x coordinate at the fourth vertex of the quadrilateral
[in]dy3y coordinate at the fourth vertex of the quadrilateral
[in]mStore converted matrix

◆ hal_gfx_mat3x3_translate()

void hal_gfx_mat3x3_translate ( hal_gfx_matrix3x3_t  m,
float  tx,
float  ty 
)

Apply translate transformation.

Parameters
[in]mMatrix to apply transformation
[in]txX translation factor
[in]tyY translation factor