gegl-matrix

gegl-matrix

Functions

Types and Values

Description

Functions

gegl_matrix3_new ()

GeglMatrix3 *
gegl_matrix3_new (void);

Return: A newly allocated GeglMatrix3


gegl_matrix3_identity ()

void
gegl_matrix3_identity (GeglMatrix3 *matrix);

Set the provided matrix to the identity matrix.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_round_error ()

void
gegl_matrix3_round_error (GeglMatrix3 *matrix);

Rounds numerical errors in matrix to the nearest integer.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_equal ()

gboolean
gegl_matrix3_equal (const GeglMatrix3 *matrix1,
                    const GeglMatrix3 *matrix2);

Check if two matrices are equal.

Returns TRUE if the matrices are equal.

Parameters

matrix1

a GeglMatrix3

 

matrix2

a GeglMatrix3

 

gegl_matrix3_is_identity ()

gboolean
gegl_matrix3_is_identity (const GeglMatrix3 *matrix);

Check if a matrix is the identity matrix.

Returns TRUE if the matrix is the identity matrix.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_is_scale ()

gboolean
gegl_matrix3_is_scale (const GeglMatrix3 *matrix);

Check if a matrix only does scaling.

Returns TRUE if the matrix only does scaling.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_is_translate ()

gboolean
gegl_matrix3_is_translate (const GeglMatrix3 *matrix);

Check if a matrix only does translation.

Returns TRUE if the matrix only does trasnlation.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_is_affine ()

gboolean
gegl_matrix3_is_affine (const GeglMatrix3 *matrix);

Check if a matrix only does an affine transformation.

Returns TRUE if the matrix only does an affine transformation.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_copy_into ()

void
gegl_matrix3_copy_into (GeglMatrix3 *dst,
                        const GeglMatrix3 *src);

Copies the matrix in src into dst .

Parameters

dst

a GeglMatrix3

 

src

a GeglMatrix3

 

gegl_matrix3_copy ()

GeglMatrix3 *
gegl_matrix3_copy (const GeglMatrix3 *matrix);

Returns a copy of src .

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_determinant ()

gdouble
gegl_matrix3_determinant (const GeglMatrix3 *matrix);

Returns the determinant for the matrix.

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_invert ()

void
gegl_matrix3_invert (GeglMatrix3 *matrix);

Inverts matrix .

Parameters

matrix

a GeglMatrix3

 

gegl_matrix3_multiply ()

void
gegl_matrix3_multiply (const GeglMatrix3 *left,
                       const GeglMatrix3 *right,
                       GeglMatrix3 *product);

Multiples product = left · right

Parameters

left

a GeglMatrix3

 

right

a GeglMatrix3

 

product

a GeglMatrix3 to store the result in.

 

gegl_matrix3_originate ()

void
gegl_matrix3_originate (GeglMatrix3 *matrix,
                        gdouble x,
                        gdouble y);

Shift the origin of the transformation specified by matrix to (x , y ). In other words, calculate the matrix that:

  1. Translates the input by (-x , -y ).

  2. Transforms the result using the original matrix .

  3. Translates the result by (x , y ).

Parameters

matrix

a GeglMatrix3

 

x

x coordinate of new origin

 

y

y coordinate of new origin.

 

gegl_matrix3_transform_point ()

void
gegl_matrix3_transform_point (const GeglMatrix3 *matrix,
                              gdouble *x,
                              gdouble *y);

transforms the coordinates provided in x and y and changes to the coordinates gotten when the transformed with the matrix.

Parameters

matrix

a GeglMatrix3

 

x

pointer to an x coordinate

 

y

pointer to an y coordinate

 

gegl_matrix3_parse_string ()

void
gegl_matrix3_parse_string (GeglMatrix3 *matrix,
                           const gchar *string);

Parse a transofmation matrix from a string.

Parameters

matrix

a GeglMatrix3

 

string

a string describing the matrix (right now a small subset of the transform strings allowed by SVG)

 

gegl_matrix3_to_string ()

gchar *
gegl_matrix3_to_string (const GeglMatrix3 *matrix);

Serialize a GeglMatrix3 to a string.

Returns a freshly allocated string representing that GeglMatrix3, the returned string should be g_free()'d.

Parameters

matrix

a GeglMatrix3

 

Types and Values

GeglMatrix3

typedef struct {
    gdouble coeff[3][3];
} GeglMatrix3;