lv_matrix.h
API reference for lv_matrix.h
Functions
lv_matrix_identity
Set matrix to identity matrix
void lv_matrix_identity(lv_matrix_t *matrix)| Name | Type | Description |
|---|---|---|
matrix | lv_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)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
tx | float | the amount of translate in y direction |
ty | float |
lv_matrix_scale
Change the scale factor of the matrix
void lv_matrix_scale(lv_matrix_t *matrix, float scale_x, float scale_y)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
scale_x | float | the scale factor for the X direction |
scale_y | float | the scale factor for the Y direction |
lv_matrix_rotate
Rotate the matrix with origin
void lv_matrix_rotate(lv_matrix_t *matrix, float degree)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
degree | float | angle 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)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
skew_x | float | the skew factor for x direction |
skew_y | float | the 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)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
mul | const lv_matrix_t * |
lv_matrix_inverse
Invert the matrix
bool lv_matrix_inverse(lv_matrix_t *matrix, const lv_matrix_t *m)| Name | Type | Description |
|---|---|---|
matrix | lv_matrix_t * | pointer to a matrix |
m | const 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)| Name | Type | Description |
|---|---|---|
matrix | const lv_matrix_t * | pointer to a matrix |
point | const 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)| Name | Type | Description |
|---|---|---|
matrix | const lv_matrix_t * | pointer to a matrix |
area | const 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)| Name | Type | Description |
|---|---|---|
matrix | const 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)| Name | Type | Description |
|---|---|---|
matrix | const 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)| Name | Type | Description |
|---|---|---|
src | const lv_matrix_t * | pointer to the source matrix. If NULL, the function returns. |
dst | lv_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
_lv_matrix_t
| Member | Type | Description |
|---|---|---|
m | float[3][3] |
Dependencies
How is this guide?
Last updated on