Transform
Object Hierarchy:
Gsk.Transform
Gsk.Transform
Gsk.Transform
Description:
[ CCode ( ref_function = "gsk_transform_ref" , type_id = "gsk_transform_get_type ()" , unref_function = "gsk_transform_unref" ) ] [ Compact ]public class Transform
`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.
Content:
Static methods:
Creation methods:
Methods:
public unowned Transform ? @ref ()
Acquires a reference on the given `GskTransform`.
public bool equal (Transform ? second)
Checks two transforms for equality.
public TransformCategory get_category ()
Returns the category this transform belongs to.
public Transform ? invert ()
Inverts the given transform.
public Transform matrix (Matrix matrix)
Multiplies this with the given
matrix
.
public Transform perspective (float depth)
Applies a perspective projection transform.
public void print (StringBuilder string)
Converts this into a human-readable string
representation suitable for printing.
public Transform ? rotate (float angle)
Rotates this angle
degrees in
2D - or in 3D-speak, around the Z axis.
public Transform ? rotate_3d (float angle, Vec3 axis)
Rotates this angle
degrees
around axis
.
public Transform ? scale (float factor_x, float factor_y)
Scales this in 2-dimensional space by the
given factors.
public Transform ? scale_3d (float factor_x, float factor_y, float factor_z)
Scales this by the given factors.
public Transform ? skew (float skew_x, float skew_y)
Applies a skew transform.
public void to_2d (out float out_xx, out float out_yx, out float out_xy, out float out_yy, out float out_dx, out float out_dy)
Converts a `GskTransform` to a 2D transformation matrix.
public void to_2d_components (out float out_skew_x, out float out_skew_y, out float out_scale_x, out float out_scale_y, out float out_angle, out float out_dx, out float out_dy)
Converts a `GskTransform` to 2D transformation factors.
public void to_affine (out float out_scale_x, out float out_scale_y, out float out_dx, out float out_dy)
Converts a `GskTransform` to 2D affine transformation factors.
public Matrix to_matrix ()
Computes the actual value of this and
stores it in out_matrix
.
public string to_string ()
Converts a matrix into a string that is suitable for printing.
public void to_translate (out float out_dx, out float out_dy)
Converts a `GskTransform` to a translation operation.
public Transform ? transform (Transform ? other)
Applies all the operations from other
to
this .
public Rect transform_bounds (Rect rect)
Transforms a `graphene_rect_t` using the given transform
this .
public Point transform_point (Point point)
Transforms a `graphene_point_t` using the given transform
this .
public Transform ? translate (Point point)
Translates this in 2-dimensional space by
point
.
public Transform ? translate_3d (Point3D point)
Translates this by point
.
public void unref ()
Releases a reference on the given `GskTransform`.