Libraries:Gtk:Pango:Matrix
Types
T
Constants
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
_Alloc() : Gtk.Pango.Matrix.T
Methods
:"="(_ @ T, _ @ T)
:Concat(self @ T, new_matrix @ Gtk.Pango.Matrix.T) : Std.Object.T
Changes the transformation represented by matrix to be the transformation given by first applying transformation given by new_matrix then applying the original transformation.
:Copy(self @ T) : Gtk.Pango.Matrix.T
Copies a T.
matrix | a T, may be NULL |
Returns | the newly allocated T, which should be freed with Free, or NULL if matrix was NULL. |
:Free(self @ T) : Std.Object.T
:GetFontScaleFactor(self @ T) : Std.Real.T
Returns the scale factor of a matrix on the height of the font. That is, the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to.
matrix | a T, may be NULL. [allow-none] |
Returns | the scale factor of matrix on the height of the font, or 1.0 if matrix is NULL. |
:Rotate(self @ T, degrees @ Std.Real.T) : Std.Object.T
Changes the transformation represented by matrix to be the transformation given by first rotating by degrees degrees counter-clockwise then applying the original transformation.
matrix | a T |
degrees | degrees to rotate counter-clockwise |
:Scale(self @ T, scale_x @ Std.Real.T, scale_y @ Std.Real.T) : Std.Object.T
Changes the transformation represented by matrix to be the transformation given by first scaling by sx in the X direction and sy in the Y direction then applying the original transformation.
matrix | a T |
scale_x | amount to scale by in X direction |
scale_y | amount to scale by in Y direction |
:TransformDistance(self @ T, dx @ Std.Object.T, dy @ Std.Object.T) : Std.Object.T
Transforms the distance vector (dx,dy) by matrix. This is similar to TransformPoint except that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:
dx2 = dx1 * xx + dy1 * xy; dy2 = dx1 * yx + dy1 * yy;
Affine transformations are position invariant, so the same vector always transforms to the same vector. If (x1,y1) transforms to (x2,y2) then (x1+dx1,y1+dy1) will transform to (x1+dx2,y1+dy2) for all values of x1 and x2.
matrix | a T, or NULL |
dx | in/out X component of a distance vector. [inout] |
dy | in/out Y component of a distance vector. [inout] |
:TransformPixelRectangle(self @ T, rect @ Gtk.Pango.Rectangle.T) : Std.Object.T
First transforms the rect using matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in device units (pixels).
This function is useful for example when you want to draw a rotated PangoLayout to an image buffer, and want to know how large the image should be and how much you should shift the layout when rendering.
For better accuracy, you should use TransformRectangle on original rectangle in Pango units and convert to pixels afterward using Gtk.Pango.Global.ExtentsToPixels's first argument.
:TransformPoint(self @ T, x @ Std.Object.T, y @ Std.Object.T) : Std.Object.T
Transforms the point (x, y) by matrix.
:TransformRectangle(self @ T, rect @ Gtk.Pango.Rectangle.T) : Std.Object.T
First transforms rect using matrix, then calculates the bounding box of the transformed rectangle. The rectangle should be in Pango units.
This function is useful for example when you want to draw a rotated PangoLayout to an image buffer, and want to know how large the image should be and how much you should shift the layout when rendering.
If you have a rectangle in device units (pixels), use TransformPixelRectangle.
If you have the rectangle in Pango units and want to convert to transformed pixel bounding box, it is more accurate to transform it first (using this function) and pass the result to Gtk.Pango.Global.ExtentsToPixels, first argument, for an inclusive rounded rectangle. However, there are valid reasons that you may want to convert to pixels first and then transform, for example when the transformed coordinates may overflow in Pango units (large matrix translation for example).
:Translate(self @ T, tx @ Std.Real.T, ty @ Std.Real.T) : Std.Object.T
Changes the transformation represented by matrix to be the transformation given by first translating by (tx, ty) then applying the original transformation.
matrix | a T |
tx | amount to translate in the X direction |
ty | amount to translate in the Y direction |