libmypaint
1.6.0
|
3x3 matrix of floats, row-major order. More...
#include <mypaint-matrix.h>
Public Member Functions | |
MyPaintTransform | mypaint_transform_unit () |
3x3 unit matrix More... | |
MyPaintTransform | mypaint_transform_rotate_cw (const MyPaintTransform transform, const float angle_radians) |
Create a new transform by rotating the input transform clockwise. More... | |
MyPaintTransform | mypaint_transform_rotate_ccw (const MyPaintTransform transform, const float angle_radians) |
Create a new transform by rotating the input transform counterclockwise. More... | |
MyPaintTransform | mypaint_transform_reflect (const MyPaintTransform transform, const float angle_radians) |
Create a new transform by reflecting the input transform across a line crossing 0,0. More... | |
MyPaintTransform | mypaint_transform_translate (const MyPaintTransform transform, const float x, const float y) |
Create a new transform by reflecting the input transform across a line crossing 0,0. More... | |
void | mypaint_transform_point (const MyPaintTransform *const transform, float x, float y, float *x_out, float *y_out) |
Apply transformation to a (x, y) point, writing the resulting coordinates to out parameters. More... | |
Data Fields | |
float | rows [3][3] |
3x3 matrix of floats, row-major order.
Only used in MyPaintTiledSurface2 for symmetry calculations, not required for any calls to public functions.
The containing header should probably not have been made public.
void mypaint_transform_point | ( | const MyPaintTransform *const | transform, |
float | x, | ||
float | y, | ||
float * | x_out, | ||
float * | y_out | ||
) |
Apply transformation to a (x, y) point, writing the resulting coordinates to out parameters.
transform | Transform to apply | |
x | x coordinate to transform | |
y | y coordinate to transform | |
[out] | x_out | pointer to x coordinate of the transformed point |
[out] | y_out | pointer to y coordinate of the transformed point |
MyPaintTransform mypaint_transform_reflect | ( | const MyPaintTransform | transform, |
const float | angle_radians | ||
) |
Create a new transform by reflecting the input transform across a line crossing 0,0.
transform | input transform |
angle_radians | the angle of the line to reflect across, in radians |
MyPaintTransform mypaint_transform_rotate_ccw | ( | const MyPaintTransform | transform, |
const float | angle_radians | ||
) |
Create a new transform by rotating the input transform counterclockwise.
transform | input transform |
angle_radians | The amount of rotation to apply, in radians. |
MyPaintTransform mypaint_transform_rotate_cw | ( | const MyPaintTransform | transform, |
const float | angle_radians | ||
) |
Create a new transform by rotating the input transform clockwise.
transform | input transform |
angle_radians | The amount of rotation to apply, in radians. |
MyPaintTransform mypaint_transform_translate | ( | const MyPaintTransform | transform, |
const float | x, | ||
const float | y | ||
) |
Create a new transform by reflecting the input transform across a line crossing 0,0.
transform | Input transform |
x,y | The translation to apply |
MyPaintTransform mypaint_transform_unit | ( | ) |
3x3 unit matrix
1 0 0 0 1 0 0 0 1
float MyPaintTransform::rows[3][3] |