Matrices are mainly used in Reindeer to do linear transformations as described in Chapter 5, Transformation.
RenMatrix* ren_matrix_new( |
ren_size width, |
| ren_size height, | |
| RenType type, | |
ren_bool transposed); |
Define a new matrix. Matrix data will be internally allocated, with matrix width, height and element type as specified.
Matrix data is expected to be stored in column-major order. If your
program uses row-major order matrices, you should set
transposed to TRUE,
otherwise set it to FALSE.
RenMatrix* ren_matrix_ref( |
RenMatrix* matrix); |
Increases the reference count of the Matrix instance and then returns it.
void ren_matrix_unref( |
RenMatrix* matrix); |
Decreases the reference count of the Matrix instance. When its reference count drops to 0, it will be destroyed automatically.
void* ren_matrix_begin_edit( |
RenMatrix* matrix); |
Get the internal data of the matrix with the intention of modifying it. This function may lock while some other thread is already using the data.
void ren_matrix_end_edit( |
RenMatrix* matrix); |
Mark an end of modifying the internal data. The pointer received with
ren_matrix_begin_edit must not be used anymore.