Struct pango::Matrix[][src]

pub struct Matrix(_);
Expand description

A structure specifying a transformation between user-space coordinates and device coordinates. The transformation is given by

<programlisting> x_device = x_user * matrix->xx + y_user * matrix->xy + matrix->x0; y_device = x_user * matrix->yx + y_user * matrix->yy + matrix->y0; </programlisting>

Implementations

Changes the transformation represented by self to be the transformation given by first applying transformation given by new_matrix then applying the original transformation.

new_matrix

a Matrix

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. If the scale in the X coordinate is needed as well, use font_scale_factors().

Returns

the scale factor of self on the height of the font, or 1.0 if self is None.

Calculates the scale factor of a matrix on the width and height of the font. That is, xscale is the scale factor in the direction of the X coordinate, and yscale is the scale factor in the direction perpendicular to the vector that the X coordinate is mapped to.

Note that output numbers will always be non-negative.

Returns

xscale

output scale factor in the x direction, or None

yscale

output scale factor perpendicular to the x direction, or None

Changes the transformation represented by self to be the transformation given by first rotating by degrees degrees counter-clockwise then applying the original transformation.

degrees

degrees to rotate counter-clockwise

Changes the transformation represented by self 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.

scale_x

amount to scale by in X direction

scale_y

amount to scale by in Y direction

Transforms the distance vector (dx,dy) by self. This is similar to transform_point() except that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:

<programlisting> dx2 = dx1 * xx + dy1 * xy; dy2 = dx1 * yx + dy1 * yy; </programlisting>

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.

dx

in/out X component of a distance vector

dy

in/out Y component of a distance vector

Transforms the point (x, y) by self.

x

in/out X position

y

in/out Y position

Changes the transformation represented by self to be the transformation given by first translating by (tx, ty) then applying the original transformation.

tx

amount to translate in the X direction

ty

amount to translate in the Y direction

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.