libmypaint
1.6.0
|
Contains data used for symmetry calculations. More...
#include <mypaint-symmetry.h>
Public Member Functions | |
void | mypaint_update_symmetry_state (MyPaintSymmetryData *const symmetry_data) |
If necessary, recalculate symmetry_matrices. More... | |
MyPaintSymmetryData | mypaint_default_symmetry_data () |
Create a default symmetry data instance. More... | |
void | mypaint_symmetry_data_destroy (MyPaintSymmetryData *) |
Destroy resources used by the data struct, and the struct itself. More... | |
void | mypaint_symmetry_set_pending (MyPaintSymmetryData *data, gboolean active, float center_x, float center_y, float symmetry_angle, MyPaintSymmetryType symmetry_type, int rot_symmetry_lines) |
Update state_pending and active and set pending_changes to TRUE. More... | |
Data Fields | |
MyPaintSymmetryState | state_current |
The current symmetry state. More... | |
MyPaintSymmetryState | state_pending |
The pending symmetry state. More... | |
gboolean | pending_changes |
Flag used to check if state_pending needs to be compared against state_current (does not necessarily mean that the symmetry_matrices need to be recalculated. More... | |
gboolean | active |
Whether symmetry is used or not. More... | |
int | num_symmetry_matrices |
The size of symmetry_matrices, depends on type and num_lines of state_current. More... | |
MyPaintTransform * | symmetry_matrices |
The matrices used for the actual symmetry calculations. More... | |
Contains data used for symmetry calculations.
Instances contain a current and pending symmetry basis, and the matrices used for the actual symmetry transforms. When the pending state is modified, the "pending_changes" flag should be set. Matrix recalculation should not be performed during draw operations.
MyPaintSymmetryData mypaint_default_symmetry_data | ( | ) |
Create a default symmetry data instance.
Creates a symmetry data object in an inactive state. Also attempts to allocate space for an initial fixed number of matrices. If the allocation is successful, the data is initialized, otherwise symmetry_matrices is NULL, and the object is left uninitialized.
void mypaint_symmetry_data_destroy | ( | MyPaintSymmetryData * | ) |
Destroy resources used by the data struct, and the struct itself.
void mypaint_symmetry_set_pending | ( | MyPaintSymmetryData * | data, |
gboolean | active, | ||
float | center_x, | ||
float | center_y, | ||
float | symmetry_angle, | ||
MyPaintSymmetryType | symmetry_type, | ||
int | rot_symmetry_lines | ||
) |
Update state_pending and active and set pending_changes to TRUE.
Apart from active, the arguments correspond to the fields of MyPaintSymmetryState
void mypaint_update_symmetry_state | ( | MyPaintSymmetryData *const | symmetry_data | ) |
If necessary, recalculate symmetry_matrices.
gboolean MyPaintSymmetryData::active |
Whether symmetry is used or not.
int MyPaintSymmetryData::num_symmetry_matrices |
The size of symmetry_matrices, depends on type and num_lines of state_current.
gboolean MyPaintSymmetryData::pending_changes |
Flag used to check if state_pending needs to be compared against state_current (does not necessarily mean that the symmetry_matrices need to be recalculated.
MyPaintSymmetryState MyPaintSymmetryData::state_current |
The current symmetry state.
This is the data used for symmetry calculations if active is TRUE.
MyPaintSymmetryState MyPaintSymmetryData::state_pending |
The pending symmetry state.
This is copied to state_current when the symmetry_matrices are recalculated, and used to check whether the matrices need to be recalculated.
MyPaintTransform* MyPaintSymmetryData::symmetry_matrices |
The matrices used for the actual symmetry calculations.