Synopsis

#include <adg-1/adg.h>

const cairo_matrix_t * adg_matrix_identity              (void);
const cairo_matrix_t * adg_matrix_null                  (void);
void                adg_matrix_copy                     (cairo_matrix_t *matrix,
                                                         const cairo_matrix_t *src);
cairo_matrix_t *    adg_matrix_dup                      (const cairo_matrix_t *matrix);
gboolean            adg_matrix_equal                    (const cairo_matrix_t *matrix1,
                                                         const cairo_matrix_t *matrix2);
gboolean            adg_matrix_normalize                (cairo_matrix_t *matrix);
void                adg_matrix_transform                (cairo_matrix_t *matrix,
                                                         const cairo_matrix_t *transformation,
                                                         AdgTransformMode mode);
void                adg_matrix_dump                     (const cairo_matrix_t *matrix);

Description

The following functions augment the cairo_matrix_t available methods providing some useful addition.

Details

adg_matrix_identity ()

const cairo_matrix_t * adg_matrix_identity              (void);

A convenient constant providing an identity matrix.

Returns :

a pointer to the identity matrix. [transfer none]

Since 1.0


adg_matrix_null ()

const cairo_matrix_t * adg_matrix_null                  (void);

A convenient constant providing an null matrix, that is a matrix where all components are 0.

Returns :

a pointer to the null matrix. [transfer none]

Since 1.0


adg_matrix_copy ()

void                adg_matrix_copy                     (cairo_matrix_t *matrix,
                                                         const cairo_matrix_t *src);

Copies src to matrix.

matrix :

the destination cairo_matrix_t. [out caller-allocates]

src :

the source cairo_matrix_t

Since 1.0


adg_matrix_dup ()

cairo_matrix_t *    adg_matrix_dup                      (const cairo_matrix_t *matrix);

Duplicates matrix.

matrix :

the souce cairo_matrix_t

Returns :

a duplicate of matrix that must be freed with g_free() when no longer needed. [transfer full]

Since 1.0


adg_matrix_equal ()

gboolean            adg_matrix_equal                    (const cairo_matrix_t *matrix1,
                                                         const cairo_matrix_t *matrix2);

Compares matrix1 and matrix2 and returns TRUE if the matrices are equal.

matrix1 :

the first operand

matrix2 :

the second operand

Returns :

TRUE if matrix1 is equal to matrix2, FALSE otherwise

Since 1.0


adg_matrix_normalize ()

gboolean            adg_matrix_normalize                (cairo_matrix_t *matrix);

Gets rid of the scaling component of a matrix.

matrix :

the source/destination cairo_matrix_t. [inout]

Returns :

TRUE on success, FALSE on errors

Since 1.0


adg_matrix_transform ()

void                adg_matrix_transform                (cairo_matrix_t *matrix,
                                                         const cairo_matrix_t *transformation,
                                                         AdgTransformMode mode);

Modifies matrix applying transformation in the way specified by mode.

matrix :

the source/destination cairo_matrix_t. [inout]

transformation :

the transformation to apply

mode :

how transformation should be applied. [in]

Since 1.0


adg_matrix_dump ()

void                adg_matrix_dump                     (const cairo_matrix_t *matrix);

Dumps the specified matrix to stdout. Useful for debugging purposes.

matrix :

an cairo_matrix_t

Since 1.0