| 1 |
|
| 2 |
@c %start of fragment |
| 3 |
|
| 4 |
@deffn Function cairo-matrix-translate (@var{matrix}@tie{}@code{<cairo-matrix-t>}) (@var{tx}@tie{}@code{<double>}) (@var{ty}@tie{}@code{<double>}) |
| 5 |
Applies a translation by @var{tx}, @var{ty} to the transformation in |
| 6 |
@var{matrix}. The effect of the new transformation is to first translate |
| 7 |
the coordinates by @var{tx} and @var{ty}, then apply the original |
| 8 |
transformation to the coordinates. |
| 9 |
|
| 10 |
@table @var |
| 11 |
@item matrix |
| 12 |
a @code{<cairo-matrix-t>} |
| 13 |
|
| 14 |
@item tx |
| 15 |
amount to translate in the X direction |
| 16 |
|
| 17 |
@item ty |
| 18 |
amount to translate in the Y direction |
| 19 |
|
| 20 |
@end table |
| 21 |
|
| 22 |
@end deffn |
| 23 |
|
| 24 |
@deffn Function cairo-matrix-invert (@var{matrix}@tie{}@code{<cairo-matrix-t>}) @result{}@tie{} (@var{ret}@tie{}@code{<cairo-status-t>}) |
| 25 |
Changes @var{matrix} to be the inverse of its original value. Not all |
| 26 |
transformation matrices have inverses; if the matrix collapses points |
| 27 |
together (it is @dfn{degenerate}), then it has no inverse and this |
| 28 |
function will fail. |
| 29 |
|
| 30 |
@table @var |
| 31 |
@item matrix |
| 32 |
a @code{<cairo-matrix-t>} |
| 33 |
|
| 34 |
@item ret |
| 35 |
If @var{matrix} has an inverse, modifies @var{matrix} to be the inverse |
| 36 |
matrix and returns @samp{CAIRO_STATUS_SUCCESS}. Otherwise, returns |
| 37 |
@samp{CAIRO_STATUS_INVALID_MATRIX}. |
| 38 |
|
| 39 |
@end table |
| 40 |
|
| 41 |
@end deffn |
| 42 |
|
| 43 |
@deffn Function cairo-matrix-multiply (@var{result}@tie{}@code{<cairo-matrix-t>}) (@var{a}@tie{}@code{<cairo-matrix-t>}) (@var{b}@tie{}@code{<cairo-matrix-t>}) |
| 44 |
Multiplies the affine transformations in @var{a} and @var{b} together |
| 45 |
and stores the result in @var{result}. The effect of the resulting |
| 46 |
transformation is to first apply the transformation in @var{a} to the |
| 47 |
coordinates and then apply the transformation in @var{b} to the |
| 48 |
coordinates. |
| 49 |
|
| 50 |
It is allowable for @var{result} to be identical to either @var{a} or |
| 51 |
@var{b}. |
| 52 |
|
| 53 |
@table @var |
| 54 |
@item result |
| 55 |
a @code{<cairo-matrix-t>} in which to store the result |
| 56 |
|
| 57 |
@item a |
| 58 |
a @code{<cairo-matrix-t>} |
| 59 |
|
| 60 |
@item b |
| 61 |
a @code{<cairo-matrix-t>} |
| 62 |
|
| 63 |
@end table |
| 64 |
|
| 65 |
@end deffn |
| 66 |
|
| 67 |
@deffn Function cairo-matrix-transform-distance (@var{matrix}@tie{}@code{<cairo-matrix-t>}) @result{}@tie{} (@var{dx}@tie{}@code{<double>}) (@var{dy}@tie{}@code{<double>}) |
| 68 |
Transforms the distance vector (@var{dx},@var{dy}) by @var{matrix}. This |
| 69 |
is similar to @code{cairo-matrix-transform-point} except that the |
| 70 |
translation components of the transformation are ignored. The |
| 71 |
calculation of the returned vector is as follows: |
| 72 |
|
| 73 |
@example |
| 74 |
|
| 75 |
dx2 = dx1 * a + dy1 * c; |
| 76 |
dy2 = dx1 * b + dy1 * d; |
| 77 |
@end example |
| 78 |
|
| 79 |
Affine transformations are position invariant, so the same vector always |
| 80 |
transforms to the same vector. If (@var{x1},@var{y1}) transforms to |
| 81 |
(@var{x2},@var{y2}) then (@var{x1}+@var{dx1},@var{y1}+@var{dy1}) will |
| 82 |
transform to (@var{x1}+@var{dx2},@var{y1}+@var{dy2}) for all values of |
| 83 |
@var{x1} and @var{x2}. |
| 84 |
|
| 85 |
@table @var |
| 86 |
@item matrix |
| 87 |
a @code{<cairo-matrix-t>} |
| 88 |
|
| 89 |
@item dx |
| 90 |
X component of a distance vector. An in/out parameter |
| 91 |
|
| 92 |
@item dy |
| 93 |
Y component of a distance vector. An in/out parameter |
| 94 |
|
| 95 |
@end table |
| 96 |
|
| 97 |
@end deffn |
| 98 |
|
| 99 |
@deffn Function cairo-matrix-transform-point (@var{matrix}@tie{}@code{<cairo-matrix-t>}) @result{}@tie{} (@var{x}@tie{}@code{<double>}) (@var{y}@tie{}@code{<double>}) |
| 100 |
Transforms the point (@var{x}, @var{y}) by @var{matrix}. |
| 101 |
|
| 102 |
@table @var |
| 103 |
@item matrix |
| 104 |
a @code{<cairo-matrix-t>} |
| 105 |
|
| 106 |
@item x |
| 107 |
X position. An in/out parameter |
| 108 |
|
| 109 |
@item y |
| 110 |
Y position. An in/out parameter |
| 111 |
|
| 112 |
@end table |
| 113 |
|
| 114 |
@end deffn |
| 115 |
|
| 116 |
|
| 117 |
@c %end of fragment |