cairo.matrix
Module for [Matrix] struct
struct Matrix
Types 1
structMatrix
A #cairo_matrix_t holds an affine transformation, such as a scale, rotation, shear, or a combination of those. The transformation of a point (x, y) is given by: <programlisting> x_new = xx x + xy y + x0; y_new = yx x + yy y + y0; </programlisting>
Fields
double xxxx component of the affine transformationdouble yxyx component of the affine transformationdouble xyxy component of the affine transformationdouble yyyy component of the affine transformationdouble x0X translation component of the affine transformationdouble y0Y translation component of the affine transformationMethods
void * boxCopy() nothrowvoid init_(double xx, double yx, double xy, double yy, double x0, double y0) nothrowSets matrix to be the affine transformation given by xx, yx, xy, yy, x0, y0. The transformation is given by: <programlisting> x_new = xx x + xy y + x0; y_new = yx x + yy y + y0; </programlisting>void initRotate(double radians) nothrowInitialized matrix to a transformation that rotates by radians.void initScale(double sx, double sy) nothrowInitializes matrix to a transformation that scales by sx and sy in the X and Y dimensions, respectively.void initTranslate(double tx, double ty) nothrowInitializes matrix to a transformation that translates by tx and ty in the X and Y dimensions, respectively.cairo.types.Status invert() nothrowChanges matrix to be the inverse of its original value. Not all transformation matrices have inverses; if the matrix collapses points together (it is <firstterm>degenerate</firstterm>), then it has...void multiply(cairo.matrix.Matrix a, cairo.matrix.Matrix b) nothrowMultiplies 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 coordina...void rotate(double radians) nothrowApplies rotation by radians to the transformation in matrix. The effect of the new transformation is to first rotate the coordinates by radians, then apply the original transformation to the coordi...void scale(double sx, double sy) nothrowApplies scaling by sx, sy to the transformation in matrix. The effect of the new transformation is to first scale the coordinates by sx and sy, then apply the original transformation to the coordin...void transformDistance(out double dx, out double dy) nothrowTransforms the distance vector (dx,dy) by matrix. This is similar to [cairo.matrix.Matrix.transformPoint] except that the translation components of the transformation are ignored. The calculation o...void translate(double tx, double ty) nothrowApplies 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 t...