lv_matrix.h

API reference for lv_matrix.h

Report on GitHub

Functions

lv_matrix_identity

Set matrix to identity matrix

 
void lv_matrix_identity(lv_matrix_t *matrix)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix

lv_matrix_translate

Translate the matrix to new position

 
void lv_matrix_translate(lv_matrix_t *matrix, float tx, float ty)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
txfloatthe amount of translate in y direction
tyfloat

lv_matrix_scale

Change the scale factor of the matrix

 
void lv_matrix_scale(lv_matrix_t *matrix, float scale_x, float scale_y)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
scale_xfloatthe scale factor for the X direction
scale_yfloatthe scale factor for the Y direction

lv_matrix_rotate

Rotate the matrix with origin

 
void lv_matrix_rotate(lv_matrix_t *matrix, float degree)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
degreefloatangle to rotate

lv_matrix_skew

Change the skew factor of the matrix

 
void lv_matrix_skew(lv_matrix_t *matrix, float skew_x, float skew_y)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
skew_xfloatthe skew factor for x direction
skew_yfloatthe skew factor for y direction

lv_matrix_multiply

Multiply two matrix and store the result to the first one

 
void lv_matrix_multiply(lv_matrix_t *matrix, const lv_matrix_t *mul)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
mulconst lv_matrix_t *

lv_matrix_inverse

Invert the matrix

 
bool lv_matrix_inverse(lv_matrix_t *matrix, const lv_matrix_t *m)
Parameters
NameTypeDescription
matrixlv_matrix_t *pointer to a matrix
mconst lv_matrix_t *pointer to another matrix (optional)

Returns: bool — true: the matrix is invertible, false: the matrix is singular and cannot be inverted

lv_matrix_transform_precise_point

Transform a point by a matrix

 
lv_point_precise_t lv_matrix_transform_precise_point(const lv_matrix_t *matrix, const lv_point_precise_t *point)
Parameters
NameTypeDescription
matrixconst lv_matrix_t *pointer to a matrix
pointconst lv_point_precise_t *pointer to a point

Returns: lv_point_precise_t — the transformed point

lv_matrix_transform_area

Transform an area by a matrix

 
lv_area_t lv_matrix_transform_area(const lv_matrix_t *matrix, const lv_area_t *area)
Parameters
NameTypeDescription
matrixconst lv_matrix_t *pointer to a matrix
areaconst lv_area_t *pointer to an area

Returns: lv_area_t — the transformed area

lv_matrix_is_identity

Check if the matrix is identity

 
bool lv_matrix_is_identity(const lv_matrix_t *matrix)
Parameters
NameTypeDescription
matrixconst lv_matrix_t *pointer to a matrix

Returns: bool — true: the matrix is identity , false: the matrix is not identity

lv_matrix_is_identity_or_translation

Check if the matrix is identity or translation matrix

 
bool lv_matrix_is_identity_or_translation(const lv_matrix_t *matrix)
Parameters
NameTypeDescription
matrixconst lv_matrix_t *pointer to a matrix

Returns: bool — true: the matrix is identity or translation matrix, false: the matrix is not identity or translation matrix

lv_matrix_transpose

Transpose a matrix.

 
void lv_matrix_transpose(const lv_matrix_t *src, lv_matrix_t *dst)
Parameters
NameTypeDescription
srcconst lv_matrix_t *pointer to the source matrix. If NULL, the function returns.
dstlv_matrix_t *pointer to the destination matrix. If NULL, the function returns. Note: src and dst may point to the same matrix for in-place transposition.

Structs

struct

_lv_matrix_t

MemberTypeDescription
mfloat[3][3]

Dependencies

How is this guide?

Last updated on

On this page