libmypaint  1.6.0
Public Member Functions | Data Fields
MyPaintTransform Struct Reference

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]
 

Detailed Description

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.

Member Function Documentation

◆ mypaint_transform_point()

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.

Parameters
transformTransform to apply
xx coordinate to transform
yy coordinate to transform
[out]x_outpointer to x coordinate of the transformed point
[out]y_outpointer to y coordinate of the transformed point

◆ mypaint_transform_reflect()

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.

Parameters
transforminput transform
angle_radiansthe angle of the line to reflect across, in radians
Returns
the resulting transformation matrix

◆ mypaint_transform_rotate_ccw()

MyPaintTransform mypaint_transform_rotate_ccw ( const MyPaintTransform  transform,
const float  angle_radians 
)

Create a new transform by rotating the input transform counterclockwise.

Parameters
transforminput transform
angle_radiansThe amount of rotation to apply, in radians.
Returns
the resulting transformation matrix

◆ mypaint_transform_rotate_cw()

MyPaintTransform mypaint_transform_rotate_cw ( const MyPaintTransform  transform,
const float  angle_radians 
)

Create a new transform by rotating the input transform clockwise.

Parameters
transforminput transform
angle_radiansThe amount of rotation to apply, in radians.
Returns
a 3x3 unit matrix

◆ mypaint_transform_translate()

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.

Parameters
transformInput transform
x,yThe translation to apply
Returns
the resulting transformation matrix

◆ mypaint_transform_unit()

MyPaintTransform mypaint_transform_unit ( )

3x3 unit matrix

1 0 0
0 1 0
0 0 1

Field Documentation

◆ rows

float MyPaintTransform::rows[3][3]

The documentation for this struct was generated from the following file: