![]() |
GFXprim
2D bitmap graphics library with emphasis on speed and correctness
|
Two dimensional vector. More...
Go to the source code of this file.
Functions | |
| static void * | gp_matrix_new (size_t cols, size_t rows, size_t unit) |
| Allocates a matrix. | |
| static size_t | gp_matrix_idx (size_t rows, size_t col, size_t row) |
| Returns an index into the vector that holds the matrix data. | |
| static void * | gp_matrix_cols_ins (void *self, size_t rows, size_t col, size_t len) |
| Inserts len columns at the offset col into the matrix. | |
| static void * | gp_matrix_cols_del (void *self, size_t rows, size_t col, size_t len) |
| Deletes len columns at the offset col from the matrix. | |
| void * | gp_matrix_rows_ins (void *self, size_t cols, size_t rows, size_t row, size_t len) |
| Inserts len rowss at the offset row into the matrix. | |
| void * | gp_matrix_rows_del (void *self, size_t cols, size_t rows, size_t row, size_t len) |
| Deletes len rows at the offset col from the matrix. | |
| static void | gp_matrix_free (void *self) |
| Frees the matrix. | |
Two dimensional vector.
Implements very simple matrix abstraction on the top of a gp_vec.
The matrix is stored in an linear array one row after another.
The caller is supposed to maintain number of columns and rows and the library provides is a set of high level functions to reallocate and reshuffle the matrix elements.
Definition in file gp_matrix.h.
|
inlinestatic |
Deletes len columns at the offset col from the matrix.
| self | A matrix. |
| rows | Number of rows. |
| col | Column index to delete the columns from. |
| len | How many columns we should delete. |
Definition at line 80 of file gp_matrix.h.
References gp_vec_del().
|
inlinestatic |
Inserts len columns at the offset col into the matrix.
| self | A matrix. |
| rows | Number of rows. |
| col | Column index to insert the columns into. |
| len | How many columns we should insert. |
Definition at line 65 of file gp_matrix.h.
References gp_vec_ins().
|
inlinestatic |
Frees the matrix.
| self | A matrix. |
Definition at line 116 of file gp_matrix.h.
References gp_vec_free().
|
inlinestatic |
Returns an index into the vector that holds the matrix data.
| rows | Number of rows. |
| col | Column index. |
| row | Row index. |
Definition at line 50 of file gp_matrix.h.
|
inlinestatic |
Allocates a matrix.
| cols | Number of columns. |
| rows | Number of rows. |
| unit | A size of a matrix element. |
Definition at line 36 of file gp_matrix.h.
References gp_vec_new().
| void * gp_matrix_rows_del | ( | void * | self, |
| size_t | cols, | ||
| size_t | rows, | ||
| size_t | row, | ||
| size_t | len ) |
Deletes len rows at the offset col from the matrix.
| self | A matrix. |
| cols | Number of columns. |
| rows | Number of rows. |
| row | Row index to delete the rows from. |
| len | How many rows we should delete. |
| void * gp_matrix_rows_ins | ( | void * | self, |
| size_t | cols, | ||
| size_t | rows, | ||
| size_t | row, | ||
| size_t | len ) |
Inserts len rowss at the offset row into the matrix.
| self | A matrix. |
| cols | Number of columns. |
| rows | Number of rows. |
| row | Row index to delete the rows from. |
| len | How many rows we should insert. |