Returns the category this transform belongs to.
Applies a perspective projection transform.
This transform scales points in X and Y based on their Z value, scaling points with positive Z values away from the origin, and those with negative Z values towards the origin. Points on the z=0 plane are unchanged.
distance of the z=0 plane. Lower values give a more flattened pyramid and therefore a more pronounced perspective effect.
Converts a GskTransform
to a 2D transformation matrix.
self
must be a 2D transformation. If you are not
sure, use gsk_transform_get_category() >=
%GSK_TRANSFORM_CATEGORY_2D to check.
The returned values have the following layout:
| xx yx | | a b 0 |
| xy yy | = | c d 0 |
| dx dy | | tx ty 1 |
This function can be used to convert between a GskTransform
and a matrix type from other 2D drawing libraries, in particular
Cairo.
Converts a GskTransform
to 2D transformation factors.
To recreate an equivalent transform from the factors returned by this function, use
gsk_transform_skew (
gsk_transform_scale (
gsk_transform_rotate (
gsk_transform_translate (NULL, &GRAPHENE_POINT_T (dx, dy)),
angle),
scale_x, scale_y),
skew_x, skew_y)
self
must be a 2D transformation. If you are not sure, use
gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D
to check.
Converts a GskTransform
to 2D affine transformation factors.
To recreate an equivalent transform from the factors returned by this function, use
gsk_transform_scale (gsk_transform_translate (NULL,
&GRAPHENE_POINT_T (dx, dy)),
sx, sy)
self
must be a 2D affine transformation. If you are not
sure, use
gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D_AFFINE
to check.
Converts a matrix into a string that is suitable for printing.
The resulting string can be parsed with [funcGsk
.Transform.parse].
This is a wrapper around [methodGsk
.Transform.print].
Converts a GskTransform
to a translation operation.
self
must be a 2D transformation. If you are not
sure, use
gsk_transform_get_category() >= %GSK_TRANSFORM_CATEGORY_2D_TRANSLATE
to check.
Releases a reference on the given GskTransform
.
If the reference was the last, the resources associated to the self
are
freed.
Parses the given string
into a transform and puts it in
out_transform
.
Strings printed via [methodGsk
.Transform.to_string]
can be read in again successfully using this function.
If string
does not describe a valid transform, %FALSE is
returned and %NULL is put in out_transform
.
the string to parse
GskTransform
is an object to describe transform matrices.Unlike
graphene_matrix_t
,GskTransform
retains the steps in how a transform was constructed, and allows inspecting them. It is modeled after the way CSS describes transforms.GskTransform
objects are immutable and cannot be changed after creation. This means code can safely expose them as properties of objects without having to worry about others changing them.