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.

Constructors

this
this(GskTransform* gskTransform, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

doref
alias doref = ref_
Undocumented in source.

Functions

equal
bool equal(Transform second)

Checks two transforms for equality.

getCategory
GskTransformCategory getCategory()

Returns the category this transform belongs to.

getStruct
void* getStruct()

the main Gtk struct as a void*

getTransformStruct
GskTransform* getTransformStruct(bool transferOwnership)

Get the main Gtk struct

invert
Transform invert()

Inverts the given transform.

matrix
Transform matrix(Matrix matrix)

Multiplies @next with the given @matrix.

perspective
Transform perspective(float depth)

Applies a perspective projection transform.

print
void print(StringG string_)

Converts @self into a human-readable string representation suitable for printing.

ref_
Transform ref_()

Acquires a reference on the given GskTransform.

rotate
Transform rotate(float angle)

Rotates @next @angle degrees in 2D - or in 3D-speak, around the z axis.

rotate3d
Transform rotate3d(float angle, Vec3 axis)

Rotates @next @angle degrees around @axis.

scale
Transform scale(float factorX, float factorY)

Scales @next in 2-dimensional space by the given factors.

scale3d
Transform scale3d(float factorX, float factorY, float factorZ)

Scales @next by the given factors.

to2d
void to2d(float outXx, float outYx, float outXy, float outYy, float outDx, float outDy)

Converts a GskTransform to a 2D transformation matrix.

toAffine
void toAffine(float outScaleX, float outScaleY, float outDx, float outDy)

Converts a GskTransform to 2D affine transformation factors.

toMatrix
void toMatrix(Matrix outMatrix)

Computes the actual value of @self and stores it in @out_matrix.

toString
string toString()

Converts a matrix into a string that is suitable for printing.

toTranslate
void toTranslate(float outDx, float outDy)

Converts a GskTransform to a translation operation.

transform
Transform transform(Transform other)

Applies all the operations from @other to @next.

transformBounds
void transformBounds(Rect rect, Rect outRect)

Transforms a graphene_rect_t using the given transform @self.

transformPoint
void transformPoint(Point point, Point outPoint)

Transforms a graphene_point_t using the given transform @self.

translate
Transform translate(Point point)

Translates @next in 2-dimensional space by @point.

translate3d
Transform translate3d(Point3D point)

Translates @next by @point.

unref
void unref()

Releases a reference on the given GskTransform.

Static functions

getType
GType getType()
parse
bool parse(string string_, Transform outTransform)

Parses the given @string into a transform and puts it in @out_transform.

Variables

gskTransform
GskTransform* gskTransform;

the main Gtk struct

ownedRef
bool ownedRef;
Undocumented in source.

Meta