~ubuntu-branches/ubuntu/intrepid/cairo/intrepid-updates

« back to all changes in this revision

Viewing changes to doc/public/html/cairo-cairo-matrix-t.html

  • Committer: Bazaar Package Importer
  • Author(s): Fabien Tassin
  • Date: 2008-09-25 16:22:33 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080925162233-btx61ymk181i7mcc
Tags: 1.7.6-0ubuntu1
* New upstream version. Most noticable changes are:
  - some API changes with especially the removal of
    cairo_font_options_set_lcd_filter and cairo_font_options_get_lcd_filter
  - xlib: Faster bookkeeping
  - PS: Fix gradients with non-constant alpha
  - Fix deadlock in user-font code
* debian/patches/00list: Remove 03_from_git_fix_lcd_filter_default.dpatch,
  add debian/patches/03_fix_ftbfs_withing_xcb.dpatch
* debian/libcairo2.symbols, debian/libcairo-directfb2.symbols: update
  list of symbols

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
4
 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
 
<title>cairo_matrix_t</title>
6
 
<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">
7
 
<link rel="home" href="index.html" title="Cairo: A Vector Graphics Library">
8
 
<link rel="up" href="Support.html" title="Utilities">
9
 
<link rel="prev" href="Support.html" title="Utilities">
10
 
<link rel="next" href="cairo-Error-Handling.html" title="Error handling">
11
 
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
12
 
<link rel="stylesheet" href="style.css" type="text/css">
13
 
<link rel="chapter" href="Drawing.html" title="Drawing">
14
 
<link rel="chapter" href="Fonts.html" title="Fonts">
15
 
<link rel="chapter" href="Surfaces.html" title="Surfaces">
16
 
<link rel="chapter" href="Support.html" title="Utilities">
17
 
<link rel="index" href="ix01.html" title="Index">
18
 
<link rel="index" href="index-1.2.html" title="Index of new symbols in 1.2">
19
 
<link rel="index" href="index-1.4.html" title="Index of new symbols in 1.4">
20
 
<link rel="index" href="index-1.6.html" title="Index of new symbols in 1.6">
21
 
<link rel="index" href="index-1.8.html" title="Index of new symbols in 1.8">
22
 
<link rel="appendix" href="language-bindings.html" title="Appendix A. Creating a language binding for cairo">
23
 
</head>
24
 
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
 
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
26
 
<tr valign="middle">
27
 
<td><a accesskey="p" href="Support.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
28
 
<td><a accesskey="u" href="Support.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
29
 
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
30
 
<th width="100%" align="center">Cairo: A Vector Graphics Library</th>
31
 
<td><a accesskey="n" href="cairo-Error-Handling.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
32
 
</tr>
33
 
<tr><td colspan="5" class="shortcuts"><nobr><a href="#cairo-cairo-matrix-t.synopsis" class="shortcut">Top</a>
34
 
                   | 
35
 
                  <a href="#cairo-cairo-matrix-t.description" class="shortcut">Description</a></nobr></td></tr>
36
 
</table>
37
 
<div class="refentry" lang="en">
38
 
<a name="cairo-cairo-matrix-t"></a><div class="titlepage"></div>
39
 
<div class="refnamediv"><table width="100%"><tr>
40
 
<td valign="top">
41
 
<h2><span class="refentrytitle"><a name="cairo-cairo-matrix-t.top_of_page"></a>cairo_matrix_t</span></h2>
42
 
<p>cairo_matrix_t — Generic matrix operations</p>
43
 
</td>
44
 
<td valign="top" align="right"></td>
45
 
</tr></table></div>
46
 
<div class="refsynopsisdiv">
47
 
<a name="cairo-cairo-matrix-t.synopsis"></a><h2>Synopsis</h2>
48
 
<pre class="synopsis">
49
 
                    <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a>;
50
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init" title="cairo_matrix_init ()">cairo_matrix_init</a>                   (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
51
 
                                                         double xx,
52
 
                                                         double yx,
53
 
                                                         double xy,
54
 
                                                         double yy,
55
 
                                                         double x0,
56
 
                                                         double y0);
57
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-identity" title="cairo_matrix_init_identity ()">cairo_matrix_init_identity</a>          (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
58
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-translate" title="cairo_matrix_init_translate ()">cairo_matrix_init_translate</a>         (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
59
 
                                                         double tx,
60
 
                                                         double ty);
61
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-scale" title="cairo_matrix_init_scale ()">cairo_matrix_init_scale</a>             (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
62
 
                                                         double sx,
63
 
                                                         double sy);
64
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-rotate" title="cairo_matrix_init_rotate ()">cairo_matrix_init_rotate</a>            (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
65
 
                                                         double radians);
66
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-translate" title="cairo_matrix_translate ()">cairo_matrix_translate</a>              (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
67
 
                                                         double tx,
68
 
                                                         double ty);
69
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-scale" title="cairo_matrix_scale ()">cairo_matrix_scale</a>                  (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
70
 
                                                         double sx,
71
 
                                                         double sy);
72
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-rotate" title="cairo_matrix_rotate ()">cairo_matrix_rotate</a>                 (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
73
 
                                                         double radians);
74
 
<a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a>      <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-invert" title="cairo_matrix_invert ()">cairo_matrix_invert</a>                 (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);
75
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-multiply" title="cairo_matrix_multiply ()">cairo_matrix_multiply</a>               (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *result,
76
 
                                                         const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *a,
77
 
                                                         const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *b);
78
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-distance" title="cairo_matrix_transform_distance ()">cairo_matrix_transform_distance</a>     (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
79
 
                                                         double *dx,
80
 
                                                         double *dy);
81
 
void                <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-point" title="cairo_matrix_transform_point ()">cairo_matrix_transform_point</a>        (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
82
 
                                                         double *x,
83
 
                                                         double *y);
84
 
</pre>
85
 
</div>
86
 
<div class="refsect1" lang="en">
87
 
<a name="cairo-cairo-matrix-t.description"></a><h2>Description</h2>
88
 
<p>
89
 
    <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> is used throughout cairo to convert between different
90
 
    coordinate spaces.  A <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> holds an affine transformation,
91
 
    such as a scale, rotation, shear, or a combination of these.
92
 
    The transformation of a point (<code class="literal">x</code>,<code class="literal">y</code>)
93
 
    is given by:
94
 
  </p>
95
 
<pre class="programlisting">
96
 
    x_new = xx * x + xy * y + x0;
97
 
    y_new = yx * x + yy * y + y0;
98
 
  </pre>
99
 
<p>
100
 
    The current transformation matrix of a <a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a>, represented as a
101
 
    <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>, defines the transformation from user-space
102
 
    coordinates to device-space coordinates. See <a class="link" href="cairo-Transformations.html#cairo-get-matrix" title="cairo_get_matrix ()"><code class="function">cairo_get_matrix()</code></a> and
103
 
    <a class="link" href="cairo-Transformations.html#cairo-set-matrix" title="cairo_set_matrix ()"><code class="function">cairo_set_matrix()</code></a>.
104
 
  </p>
105
 
</div>
106
 
<div class="refsect1" lang="en">
107
 
<a name="cairo-cairo-matrix-t.details"></a><h2>Details</h2>
108
 
<div class="refsect2" lang="en">
109
 
<a name="cairo-matrix-t"></a><h3>cairo_matrix_t</h3>
110
 
<pre class="programlisting">typedef struct {
111
 
    double xx; double yx;
112
 
    double xy; double yy;
113
 
    double x0; double y0;
114
 
} cairo_matrix_t;
115
 
</pre>
116
 
<p>
117
 
A <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> holds an affine transformation, such as a scale,
118
 
rotation, shear, or a combination of those. The transformation of
119
 
a point (x, y) is given by:
120
 
</p>
121
 
<pre class="programlisting">
122
 
    x_new = xx * x + xy * y + x0;
123
 
    y_new = yx * x + yy * y + y0;
124
 
</pre>
125
 
<p>
126
 
 
127
 
</p>
128
 
<div class="variablelist"><table border="0">
129
 
<col align="left" valign="top">
130
 
<tbody>
131
 
<tr>
132
 
<td><p><span class="term">double <em class="structfield"><code>xx</code></em>;</span></p></td>
133
 
<td> xx component of the affine transformation
134
 
</td>
135
 
</tr>
136
 
<tr>
137
 
<td><p><span class="term">double <em class="structfield"><code>yx</code></em>;</span></p></td>
138
 
<td> yx component of the affine transformation
139
 
</td>
140
 
</tr>
141
 
<tr>
142
 
<td><p><span class="term">double <em class="structfield"><code>xy</code></em>;</span></p></td>
143
 
<td> xy component of the affine transformation
144
 
</td>
145
 
</tr>
146
 
<tr>
147
 
<td><p><span class="term">double <em class="structfield"><code>yy</code></em>;</span></p></td>
148
 
<td> yy component of the affine transformation
149
 
</td>
150
 
</tr>
151
 
<tr>
152
 
<td><p><span class="term">double <em class="structfield"><code>x0</code></em>;</span></p></td>
153
 
<td> X translation component of the affine transformation
154
 
</td>
155
 
</tr>
156
 
<tr>
157
 
<td><p><span class="term">double <em class="structfield"><code>y0</code></em>;</span></p></td>
158
 
<td> Y translation component of the affine transformation
159
 
</td>
160
 
</tr>
161
 
</tbody>
162
 
</table></div>
163
 
</div>
164
 
<hr>
165
 
<div class="refsect2" lang="en">
166
 
<a name="cairo-matrix-init"></a><h3>cairo_matrix_init ()</h3>
167
 
<pre class="programlisting">void                cairo_matrix_init                   (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
168
 
                                                         double xx,
169
 
                                                         double yx,
170
 
                                                         double xy,
171
 
                                                         double yy,
172
 
                                                         double x0,
173
 
                                                         double y0);</pre>
174
 
<p>
175
 
Sets <em class="parameter"><code>matrix</code></em> to be the affine transformation given by
176
 
<em class="parameter"><code>xx</code></em>, <em class="parameter"><code>yx</code></em>, <em class="parameter"><code>xy</code></em>, <em class="parameter"><code>yy</code></em>, <em class="parameter"><code>x0</code></em>, <em class="parameter"><code>y0</code></em>. The transformation is given
177
 
by:
178
 
</p>
179
 
<pre class="programlisting">
180
 
 x_new = xx * x + xy * y + x0;
181
 
 y_new = yx * x + yy * y + y0;
182
 
</pre>
183
 
<p>
184
 
 
185
 
</p>
186
 
<div class="variablelist"><table border="0">
187
 
<col align="left" valign="top">
188
 
<tbody>
189
 
<tr>
190
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
191
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
192
 
</td>
193
 
</tr>
194
 
<tr>
195
 
<td><p><span class="term"><em class="parameter"><code>xx</code></em> :</span></p></td>
196
 
<td> xx component of the affine transformation
197
 
</td>
198
 
</tr>
199
 
<tr>
200
 
<td><p><span class="term"><em class="parameter"><code>yx</code></em> :</span></p></td>
201
 
<td> yx component of the affine transformation
202
 
</td>
203
 
</tr>
204
 
<tr>
205
 
<td><p><span class="term"><em class="parameter"><code>xy</code></em> :</span></p></td>
206
 
<td> xy component of the affine transformation
207
 
</td>
208
 
</tr>
209
 
<tr>
210
 
<td><p><span class="term"><em class="parameter"><code>yy</code></em> :</span></p></td>
211
 
<td> yy component of the affine transformation
212
 
</td>
213
 
</tr>
214
 
<tr>
215
 
<td><p><span class="term"><em class="parameter"><code>x0</code></em> :</span></p></td>
216
 
<td> X translation component of the affine transformation
217
 
</td>
218
 
</tr>
219
 
<tr>
220
 
<td><p><span class="term"><em class="parameter"><code>y0</code></em> :</span></p></td>
221
 
<td> Y translation component of the affine transformation
222
 
</td>
223
 
</tr>
224
 
</tbody>
225
 
</table></div>
226
 
</div>
227
 
<hr>
228
 
<div class="refsect2" lang="en">
229
 
<a name="cairo-matrix-init-identity"></a><h3>cairo_matrix_init_identity ()</h3>
230
 
<pre class="programlisting">void                cairo_matrix_init_identity          (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
231
 
<p>
232
 
Modifies <em class="parameter"><code>matrix</code></em> to be an identity transformation.</p>
233
 
<p>
234
 
 
235
 
</p>
236
 
<div class="variablelist"><table border="0">
237
 
<col align="left" valign="top">
238
 
<tbody><tr>
239
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
240
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
241
 
</td>
242
 
</tr></tbody>
243
 
</table></div>
244
 
</div>
245
 
<hr>
246
 
<div class="refsect2" lang="en">
247
 
<a name="cairo-matrix-init-translate"></a><h3>cairo_matrix_init_translate ()</h3>
248
 
<pre class="programlisting">void                cairo_matrix_init_translate         (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
249
 
                                                         double tx,
250
 
                                                         double ty);</pre>
251
 
<p>
252
 
Initializes <em class="parameter"><code>matrix</code></em> to a transformation that translates by <em class="parameter"><code>tx</code></em> and
253
 
<em class="parameter"><code>ty</code></em> in the X and Y dimensions, respectively.</p>
254
 
<p>
255
 
 
256
 
</p>
257
 
<div class="variablelist"><table border="0">
258
 
<col align="left" valign="top">
259
 
<tbody>
260
 
<tr>
261
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
262
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
263
 
</td>
264
 
</tr>
265
 
<tr>
266
 
<td><p><span class="term"><em class="parameter"><code>tx</code></em> :</span></p></td>
267
 
<td> amount to translate in the X direction
268
 
</td>
269
 
</tr>
270
 
<tr>
271
 
<td><p><span class="term"><em class="parameter"><code>ty</code></em> :</span></p></td>
272
 
<td> amount to translate in the Y direction
273
 
</td>
274
 
</tr>
275
 
</tbody>
276
 
</table></div>
277
 
</div>
278
 
<hr>
279
 
<div class="refsect2" lang="en">
280
 
<a name="cairo-matrix-init-scale"></a><h3>cairo_matrix_init_scale ()</h3>
281
 
<pre class="programlisting">void                cairo_matrix_init_scale             (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
282
 
                                                         double sx,
283
 
                                                         double sy);</pre>
284
 
<p>
285
 
Initializes <em class="parameter"><code>matrix</code></em> to a transformation that scales by <em class="parameter"><code>sx</code></em> and <em class="parameter"><code>sy</code></em>
286
 
in the X and Y dimensions, respectively.</p>
287
 
<p>
288
 
 
289
 
</p>
290
 
<div class="variablelist"><table border="0">
291
 
<col align="left" valign="top">
292
 
<tbody>
293
 
<tr>
294
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
295
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
296
 
</td>
297
 
</tr>
298
 
<tr>
299
 
<td><p><span class="term"><em class="parameter"><code>sx</code></em> :</span></p></td>
300
 
<td> scale factor in the X direction
301
 
</td>
302
 
</tr>
303
 
<tr>
304
 
<td><p><span class="term"><em class="parameter"><code>sy</code></em> :</span></p></td>
305
 
<td> scale factor in the Y direction
306
 
</td>
307
 
</tr>
308
 
</tbody>
309
 
</table></div>
310
 
</div>
311
 
<hr>
312
 
<div class="refsect2" lang="en">
313
 
<a name="cairo-matrix-init-rotate"></a><h3>cairo_matrix_init_rotate ()</h3>
314
 
<pre class="programlisting">void                cairo_matrix_init_rotate            (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
315
 
                                                         double radians);</pre>
316
 
<p>
317
 
Initialized <em class="parameter"><code>matrix</code></em> to a transformation that rotates by <em class="parameter"><code>radians</code></em>.</p>
318
 
<p>
319
 
 
320
 
</p>
321
 
<div class="variablelist"><table border="0">
322
 
<col align="left" valign="top">
323
 
<tbody>
324
 
<tr>
325
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
326
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
327
 
</td>
328
 
</tr>
329
 
<tr>
330
 
<td><p><span class="term"><em class="parameter"><code>radians</code></em> :</span></p></td>
331
 
<td> angle of rotation, in radians. The direction of rotation
332
 
is defined such that positive angles rotate in the direction from
333
 
the positive X axis toward the positive Y axis. With the default
334
 
axis orientation of cairo, positive angles rotate in a clockwise
335
 
direction.
336
 
</td>
337
 
</tr>
338
 
</tbody>
339
 
</table></div>
340
 
</div>
341
 
<hr>
342
 
<div class="refsect2" lang="en">
343
 
<a name="cairo-matrix-translate"></a><h3>cairo_matrix_translate ()</h3>
344
 
<pre class="programlisting">void                cairo_matrix_translate              (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
345
 
                                                         double tx,
346
 
                                                         double ty);</pre>
347
 
<p>
348
 
Applies a translation by <em class="parameter"><code>tx</code></em>, <em class="parameter"><code>ty</code></em> to the transformation in
349
 
<em class="parameter"><code>matrix</code></em>. The effect of the new transformation is to first translate
350
 
the coordinates by <em class="parameter"><code>tx</code></em> and <em class="parameter"><code>ty</code></em>, then apply the original transformation
351
 
to the coordinates.</p>
352
 
<p>
353
 
 
354
 
</p>
355
 
<div class="variablelist"><table border="0">
356
 
<col align="left" valign="top">
357
 
<tbody>
358
 
<tr>
359
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
360
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
361
 
</td>
362
 
</tr>
363
 
<tr>
364
 
<td><p><span class="term"><em class="parameter"><code>tx</code></em> :</span></p></td>
365
 
<td> amount to translate in the X direction
366
 
</td>
367
 
</tr>
368
 
<tr>
369
 
<td><p><span class="term"><em class="parameter"><code>ty</code></em> :</span></p></td>
370
 
<td> amount to translate in the Y direction
371
 
</td>
372
 
</tr>
373
 
</tbody>
374
 
</table></div>
375
 
</div>
376
 
<hr>
377
 
<div class="refsect2" lang="en">
378
 
<a name="cairo-matrix-scale"></a><h3>cairo_matrix_scale ()</h3>
379
 
<pre class="programlisting">void                cairo_matrix_scale                  (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
380
 
                                                         double sx,
381
 
                                                         double sy);</pre>
382
 
<p>
383
 
Applies scaling by <em class="parameter"><code>sx</code></em>, <em class="parameter"><code>sy</code></em> to the transformation in <em class="parameter"><code>matrix</code></em>. The
384
 
effect of the new transformation is to first scale the coordinates
385
 
by <em class="parameter"><code>sx</code></em> and <em class="parameter"><code>sy</code></em>, then apply the original transformation to the coordinates.</p>
386
 
<p>
387
 
 
388
 
</p>
389
 
<div class="variablelist"><table border="0">
390
 
<col align="left" valign="top">
391
 
<tbody>
392
 
<tr>
393
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
394
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
395
 
</td>
396
 
</tr>
397
 
<tr>
398
 
<td><p><span class="term"><em class="parameter"><code>sx</code></em> :</span></p></td>
399
 
<td> scale factor in the X direction
400
 
</td>
401
 
</tr>
402
 
<tr>
403
 
<td><p><span class="term"><em class="parameter"><code>sy</code></em> :</span></p></td>
404
 
<td> scale factor in the Y direction
405
 
</td>
406
 
</tr>
407
 
</tbody>
408
 
</table></div>
409
 
</div>
410
 
<hr>
411
 
<div class="refsect2" lang="en">
412
 
<a name="cairo-matrix-rotate"></a><h3>cairo_matrix_rotate ()</h3>
413
 
<pre class="programlisting">void                cairo_matrix_rotate                 (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
414
 
                                                         double radians);</pre>
415
 
<p>
416
 
Applies rotation by <em class="parameter"><code>radians</code></em> to the transformation in
417
 
<em class="parameter"><code>matrix</code></em>. The effect of the new transformation is to first rotate the
418
 
coordinates by <em class="parameter"><code>radians</code></em>, then apply the original transformation
419
 
to the coordinates.</p>
420
 
<p>
421
 
 
422
 
</p>
423
 
<div class="variablelist"><table border="0">
424
 
<col align="left" valign="top">
425
 
<tbody>
426
 
<tr>
427
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
428
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
429
 
</td>
430
 
</tr>
431
 
<tr>
432
 
<td><p><span class="term"><em class="parameter"><code>radians</code></em> :</span></p></td>
433
 
<td> angle of rotation, in radians. The direction of rotation
434
 
is defined such that positive angles rotate in the direction from
435
 
the positive X axis toward the positive Y axis. With the default
436
 
axis orientation of cairo, positive angles rotate in a clockwise
437
 
direction.
438
 
</td>
439
 
</tr>
440
 
</tbody>
441
 
</table></div>
442
 
</div>
443
 
<hr>
444
 
<div class="refsect2" lang="en">
445
 
<a name="cairo-matrix-invert"></a><h3>cairo_matrix_invert ()</h3>
446
 
<pre class="programlisting"><a class="link" href="cairo-Error-Handling.html#cairo-status-t" title="enum cairo_status_t">cairo_status_t</a>      cairo_matrix_invert                 (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix);</pre>
447
 
<p>
448
 
Changes <em class="parameter"><code>matrix</code></em> to be the inverse of it's original value. Not
449
 
all transformation matrices have inverses; if the matrix
450
 
collapses points together (it is <em class="firstterm">degenerate</em>),
451
 
then it has no inverse and this function will fail.</p>
452
 
<p>
453
 
 
454
 
</p>
455
 
<div class="variablelist"><table border="0">
456
 
<col align="left" valign="top">
457
 
<tbody>
458
 
<tr>
459
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
460
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
461
 
</td>
462
 
</tr>
463
 
<tr>
464
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
465
 
<td> If <em class="parameter"><code>matrix</code></em> has an inverse, modifies <em class="parameter"><code>matrix</code></em> to
466
 
 be the inverse matrix and returns <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-SUCCESS:CAPS"><code class="literal">CAIRO_STATUS_SUCCESS</code></a>. Otherwise,
467
 
 returns <a class="link" href="cairo-Error-Handling.html#CAIRO-STATUS-INVALID-MATRIX:CAPS"><code class="literal">CAIRO_STATUS_INVALID_MATRIX</code></a>.
468
 
</td>
469
 
</tr>
470
 
</tbody>
471
 
</table></div>
472
 
</div>
473
 
<hr>
474
 
<div class="refsect2" lang="en">
475
 
<a name="cairo-matrix-multiply"></a><h3>cairo_matrix_multiply ()</h3>
476
 
<pre class="programlisting">void                cairo_matrix_multiply               (<a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *result,
477
 
                                                         const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *a,
478
 
                                                         const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *b);</pre>
479
 
<p>
480
 
Multiplies the affine transformations in <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> together
481
 
and stores the result in <em class="parameter"><code>result</code></em>. The effect of the resulting
482
 
transformation is to first apply the transformation in <em class="parameter"><code>a</code></em> to the
483
 
coordinates and then apply the transformation in <em class="parameter"><code>b</code></em> to the
484
 
coordinates.
485
 
</p>
486
 
<p>
487
 
It is allowable for <em class="parameter"><code>result</code></em> to be identical to either <em class="parameter"><code>a</code></em> or <em class="parameter"><code>b</code></em>.</p>
488
 
<p>
489
 
 
490
 
</p>
491
 
<div class="variablelist"><table border="0">
492
 
<col align="left" valign="top">
493
 
<tbody>
494
 
<tr>
495
 
<td><p><span class="term"><em class="parameter"><code>result</code></em> :</span></p></td>
496
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> in which to store the result
497
 
</td>
498
 
</tr>
499
 
<tr>
500
 
<td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
501
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
502
 
</td>
503
 
</tr>
504
 
<tr>
505
 
<td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
506
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
507
 
</td>
508
 
</tr>
509
 
</tbody>
510
 
</table></div>
511
 
</div>
512
 
<hr>
513
 
<div class="refsect2" lang="en">
514
 
<a name="cairo-matrix-transform-distance"></a><h3>cairo_matrix_transform_distance ()</h3>
515
 
<pre class="programlisting">void                cairo_matrix_transform_distance     (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
516
 
                                                         double *dx,
517
 
                                                         double *dy);</pre>
518
 
<p>
519
 
Transforms the distance vector (<em class="parameter"><code>dx</code></em>,<em class="parameter"><code>dy</code></em>) by <em class="parameter"><code>matrix</code></em>. This is
520
 
similar to <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-point" title="cairo_matrix_transform_point ()"><code class="function">cairo_matrix_transform_point()</code></a> except that the translation
521
 
components of the transformation are ignored. The calculation of
522
 
the returned vector is as follows:
523
 
</p>
524
 
<p>
525
 
</p>
526
 
<pre class="programlisting">
527
 
dx2 = dx1 * a + dy1 * c;
528
 
dy2 = dx1 * b + dy1 * d;
529
 
</pre>
530
 
<p>
531
 
</p>
532
 
<p>
533
 
Affine transformations are position invariant, so the same vector
534
 
always transforms to the same vector. If (<em class="parameter"><code>x1</code></em>,<em class="parameter"><code>y1</code></em>) transforms
535
 
to (<em class="parameter"><code>x2</code></em>,<em class="parameter"><code>y2</code></em>) then (<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx1</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy1</code></em>) will transform to
536
 
(<em class="parameter"><code>x1</code></em>+<em class="parameter"><code>dx2</code></em>,<em class="parameter"><code>y1</code></em>+<em class="parameter"><code>dy2</code></em>) for all values of <em class="parameter"><code>x1</code></em> and <em class="parameter"><code>x2</code></em>.</p>
537
 
<p>
538
 
 
539
 
</p>
540
 
<div class="variablelist"><table border="0">
541
 
<col align="left" valign="top">
542
 
<tbody>
543
 
<tr>
544
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
545
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
546
 
</td>
547
 
</tr>
548
 
<tr>
549
 
<td><p><span class="term"><em class="parameter"><code>dx</code></em> :</span></p></td>
550
 
<td> X component of a distance vector. An in/out parameter
551
 
</td>
552
 
</tr>
553
 
<tr>
554
 
<td><p><span class="term"><em class="parameter"><code>dy</code></em> :</span></p></td>
555
 
<td> Y component of a distance vector. An in/out parameter
556
 
</td>
557
 
</tr>
558
 
</tbody>
559
 
</table></div>
560
 
</div>
561
 
<hr>
562
 
<div class="refsect2" lang="en">
563
 
<a name="cairo-matrix-transform-point"></a><h3>cairo_matrix_transform_point ()</h3>
564
 
<pre class="programlisting">void                cairo_matrix_transform_point        (const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a> *matrix,
565
 
                                                         double *x,
566
 
                                                         double *y);</pre>
567
 
<p>
568
 
Transforms the point (<em class="parameter"><code>x</code></em>, <em class="parameter"><code>y</code></em>) by <em class="parameter"><code>matrix</code></em>.</p>
569
 
<p>
570
 
 
571
 
</p>
572
 
<div class="variablelist"><table border="0">
573
 
<col align="left" valign="top">
574
 
<tbody>
575
 
<tr>
576
 
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
577
 
<td> a <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a>
578
 
</td>
579
 
</tr>
580
 
<tr>
581
 
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
582
 
<td> X position. An in/out parameter
583
 
</td>
584
 
</tr>
585
 
<tr>
586
 
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
587
 
<td> Y position. An in/out parameter
588
 
</td>
589
 
</tr>
590
 
</tbody>
591
 
</table></div>
592
 
</div>
593
 
</div>
594
 
<div class="refsect1" lang="en">
595
 
<a name="cairo-cairo-matrix-t.see-also"></a><h2>See Also</h2>
596
 
<p>
597
 
</p>
598
 
<div class="itemizedlist"><ul type="disc"><li><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a></li></ul></div>
599
 
<p>
600
 
</p>
601
 
</div>
602
 
</div>
603
 
<div class="footer">
604
 
<hr>
605
 
          Generated by GTK-Doc V1.10</div>
606
 
</body>
607
 
</html>