libmypaint  1.6.0
Public Member Functions | Data Fields
MyPaintSymmetryData Struct Reference

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...
 
MyPaintTransformsymmetry_matrices
 The matrices used for the actual symmetry calculations. More...
 

Detailed Description

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.

See also
MyPaintTiledSurface2

Member Function Documentation

◆ mypaint_default_symmetry_data()

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.

◆ mypaint_symmetry_data_destroy()

void mypaint_symmetry_data_destroy ( MyPaintSymmetryData )

Destroy resources used by the data struct, and the struct itself.

◆ mypaint_symmetry_set_pending()

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

◆ mypaint_update_symmetry_state()

void mypaint_update_symmetry_state ( MyPaintSymmetryData *const  symmetry_data)

If necessary, recalculate symmetry_matrices.

Field Documentation

◆ active

gboolean MyPaintSymmetryData::active

Whether symmetry is used or not.

◆ num_symmetry_matrices

int MyPaintSymmetryData::num_symmetry_matrices

The size of symmetry_matrices, depends on type and num_lines of state_current.

◆ pending_changes

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.

◆ state_current

MyPaintSymmetryState MyPaintSymmetryData::state_current

The current symmetry state.

This is the data used for symmetry calculations if active is TRUE.

◆ state_pending

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.

◆ symmetry_matrices

MyPaintTransform* MyPaintSymmetryData::symmetry_matrices

The matrices used for the actual symmetry calculations.


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