Generic matrix operations
<cairo-matrix-t> is used throughout cairo to convert between
different coordinate spaces. A
<cairo-matrix-t> holds an affine
transformation, such as a scale, rotation, shear, or a combination of
these. The transformation of a point (‘x’,‘y’) is given by:
x_new = xx * x + xy * y + x0; y_new = yx * x + yy * y + y0;
The current transformation matrix of a
<cairo-t>, represented as
<cairo-matrix-t>, defines the transformation from user-space
coordinates to device-space coordinates. See
Applies a translation by tx, ty to the transformation in matrix. The effect of the new transformation is to first translate the coordinates by tx and ty, then apply the original transformation to the coordinates.
- amount to translate in the X direction
- amount to translate in the Y direction
<cairo-matrix-t>) ⇒ (ret
Changes matrix to be the inverse of its original value. Not all transformation matrices have inverses; if the matrix collapses points together (it is degenerate), then it has no inverse and this function will fail.
- If matrix has an inverse, modifies matrix to be the inverse matrix and returns ‘CAIRO_STATUS_SUCCESS’. Otherwise, returns ‘CAIRO_STATUS_INVALID_MATRIX’.
Multiplies the affine transformations in a and b together and stores the result in result. The effect of the resulting transformation is to first apply the transformation in a to the coordinates and then apply the transformation in b to the coordinates.
It is allowable for result to be identical to either a or b.
<cairo-matrix-t>in which to store the result
<cairo-matrix-t>) ⇒ (dx
Transforms the distance vector (dx,dy) by matrix. This is similar to
cairo-matrix-transform-pointexcept that the translation components of the transformation are ignored. The calculation of the returned vector is as follows:dx2 = dx1 * a + dy1 * c; dy2 = dx1 * b + dy1 * d;
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.
- X component of a distance vector. An in/out parameter
- Y component of a distance vector. An in/out parameter