Cogl.Matrix.prototype.transform_points
function transform_points(n_components: Number(gint), stride_in: Number(gsize), points_in: void, stride_out: Number(gsize), points_out: void, n_points: Number(gint)): void { // Gjs wrapper for cogl_matrix_transform_points() }
Transforms an array of input points and writes the result to another array of output points. The input points can either have 2 or 3 components each. The output points always have 3 components. The output array can simply point to the input array to do the transform in-place.
If you need to transform 4 component points see Cogl.Matrix.prototype.project_points.
Here's an example with differing input/output strides: |[ typedef struct { float x,y; uint8_t r,g,b,a; float s,t,p; } MyInVertex; typedef struct { uint8_t r,g,b,a; float x,y,z; } MyOutVertex; MyInVertex vertices[N_VERTICES]; MyOutVertex results[N_VERTICES]; CoglMatrix matrix;
my_load_vertices (vertices); my_get_matrix (&matrix);
cogl_matrix_transform_points (&matrix, 2, sizeof (MyInVertex), &vertices[0].x, sizeof (MyOutVertex), &results[0].x, N_VERTICES); ]|
- n_components
The number of position components for each input point. (either 2 or 3)
- stride_in
The stride in bytes between input points.
- points_in
A pointer to the first component of the first input point.
- stride_out
The stride in bytes between output points.
- points_out
A pointer to the first component of the first output point.
- n_points
The number of points to transform.