Mercurial > repos > rliterman > csp2
comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/share/gtk-doc/html/cairo/cairo-cairo-matrix-t.html @ 68:5028fdace37b
planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author | jpayne |
---|---|
date | Tue, 18 Mar 2025 16:23:26 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
67:0e9998148a16 | 68:5028fdace37b |
---|---|
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: Cairo: A Vector Graphics Library</title> | |
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> | |
7 <link rel="home" href="index.html" title="Cairo: A Vector Graphics Library"> | |
8 <link rel="up" href="cairo-support.html" title="Utilities"> | |
9 <link rel="prev" href="cairo-support.html" title="Utilities"> | |
10 <link rel="next" href="cairo-Error-handling.html" title="Error handling"> | |
11 <meta name="generator" content="GTK-Doc V1.27 (XML mode)"> | |
12 <link rel="stylesheet" href="style.css" type="text/css"> | |
13 </head> | |
14 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
15 <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> | |
16 <td width="100%" align="left" class="shortcuts"> | |
17 <a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> | |
18 <a href="#cairo-cairo-matrix-t.description" class="shortcut">Description</a></span> | |
19 </td> | |
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> | |
21 <td><a accesskey="u" href="cairo-support.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> | |
22 <td><a accesskey="p" href="cairo-support.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> | |
23 <td><a accesskey="n" href="cairo-Error-handling.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> | |
24 </tr></table> | |
25 <div class="refentry"> | |
26 <a name="cairo-cairo-matrix-t"></a><div class="titlepage"></div> | |
27 <div class="refnamediv"><table width="100%"><tr> | |
28 <td valign="top"> | |
29 <h2><span class="refentrytitle"><a name="cairo-cairo-matrix-t.top_of_page"></a>cairo_matrix_t</span></h2> | |
30 <p>cairo_matrix_t — Generic matrix operations</p> | |
31 </td> | |
32 <td class="gallery_image" valign="top" align="right"></td> | |
33 </tr></table></div> | |
34 <div class="refsect1"> | |
35 <a name="cairo-cairo-matrix-t.functions"></a><h2>Functions</h2> | |
36 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
37 <colgroup> | |
38 <col width="150px" class="functions_return"> | |
39 <col class="functions_name"> | |
40 </colgroup> | |
41 <tbody> | |
42 <tr> | |
43 <td class="function_type"> | |
44 <span class="returnvalue">void</span> | |
45 </td> | |
46 <td class="function_name"> | |
47 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init" title="cairo_matrix_init ()">cairo_matrix_init</a> <span class="c_punctuation">()</span> | |
48 </td> | |
49 </tr> | |
50 <tr> | |
51 <td class="function_type"> | |
52 <span class="returnvalue">void</span> | |
53 </td> | |
54 <td class="function_name"> | |
55 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-identity" title="cairo_matrix_init_identity ()">cairo_matrix_init_identity</a> <span class="c_punctuation">()</span> | |
56 </td> | |
57 </tr> | |
58 <tr> | |
59 <td class="function_type"> | |
60 <span class="returnvalue">void</span> | |
61 </td> | |
62 <td class="function_name"> | |
63 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-translate" title="cairo_matrix_init_translate ()">cairo_matrix_init_translate</a> <span class="c_punctuation">()</span> | |
64 </td> | |
65 </tr> | |
66 <tr> | |
67 <td class="function_type"> | |
68 <span class="returnvalue">void</span> | |
69 </td> | |
70 <td class="function_name"> | |
71 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-scale" title="cairo_matrix_init_scale ()">cairo_matrix_init_scale</a> <span class="c_punctuation">()</span> | |
72 </td> | |
73 </tr> | |
74 <tr> | |
75 <td class="function_type"> | |
76 <span class="returnvalue">void</span> | |
77 </td> | |
78 <td class="function_name"> | |
79 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-init-rotate" title="cairo_matrix_init_rotate ()">cairo_matrix_init_rotate</a> <span class="c_punctuation">()</span> | |
80 </td> | |
81 </tr> | |
82 <tr> | |
83 <td class="function_type"> | |
84 <span class="returnvalue">void</span> | |
85 </td> | |
86 <td class="function_name"> | |
87 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-translate" title="cairo_matrix_translate ()">cairo_matrix_translate</a> <span class="c_punctuation">()</span> | |
88 </td> | |
89 </tr> | |
90 <tr> | |
91 <td class="function_type"> | |
92 <span class="returnvalue">void</span> | |
93 </td> | |
94 <td class="function_name"> | |
95 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-scale" title="cairo_matrix_scale ()">cairo_matrix_scale</a> <span class="c_punctuation">()</span> | |
96 </td> | |
97 </tr> | |
98 <tr> | |
99 <td class="function_type"> | |
100 <span class="returnvalue">void</span> | |
101 </td> | |
102 <td class="function_name"> | |
103 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-rotate" title="cairo_matrix_rotate ()">cairo_matrix_rotate</a> <span class="c_punctuation">()</span> | |
104 </td> | |
105 </tr> | |
106 <tr> | |
107 <td class="function_type"> | |
108 <a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> | |
109 </td> | |
110 <td class="function_name"> | |
111 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-invert" title="cairo_matrix_invert ()">cairo_matrix_invert</a> <span class="c_punctuation">()</span> | |
112 </td> | |
113 </tr> | |
114 <tr> | |
115 <td class="function_type"> | |
116 <span class="returnvalue">void</span> | |
117 </td> | |
118 <td class="function_name"> | |
119 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-multiply" title="cairo_matrix_multiply ()">cairo_matrix_multiply</a> <span class="c_punctuation">()</span> | |
120 </td> | |
121 </tr> | |
122 <tr> | |
123 <td class="function_type"> | |
124 <span class="returnvalue">void</span> | |
125 </td> | |
126 <td class="function_name"> | |
127 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-distance" title="cairo_matrix_transform_distance ()">cairo_matrix_transform_distance</a> <span class="c_punctuation">()</span> | |
128 </td> | |
129 </tr> | |
130 <tr> | |
131 <td class="function_type"> | |
132 <span class="returnvalue">void</span> | |
133 </td> | |
134 <td class="function_name"> | |
135 <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-transform-point" title="cairo_matrix_transform_point ()">cairo_matrix_transform_point</a> <span class="c_punctuation">()</span> | |
136 </td> | |
137 </tr> | |
138 </tbody> | |
139 </table></div> | |
140 </div> | |
141 <div class="refsect1"> | |
142 <a name="cairo-cairo-matrix-t.other"></a><h2>Types and Values</h2> | |
143 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
144 <colgroup> | |
145 <col width="150px" class="name"> | |
146 <col class="description"> | |
147 </colgroup> | |
148 <tbody><tr> | |
149 <td class="datatype_keyword"> </td> | |
150 <td class="function_name"><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t">cairo_matrix_t</a></td> | |
151 </tr></tbody> | |
152 </table></div> | |
153 </div> | |
154 <div class="refsect1"> | |
155 <a name="cairo-cairo-matrix-t.description"></a><h2>Description</h2> | |
156 <p><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 | |
157 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, | |
158 such as a scale, rotation, shear, or a combination of these. | |
159 The transformation of a point (<code class="literal">x</code>,<code class="literal">y</code>) | |
160 is given by:</p> | |
161 <pre class="programlisting"> | |
162 x_new = xx * x + xy * y + x0; | |
163 y_new = yx * x + yy * y + y0; | |
164 </pre> | |
165 <p>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 | |
166 <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 | |
167 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 | |
168 <a class="link" href="cairo-Transformations.html#cairo-set-matrix" title="cairo_set_matrix ()"><code class="function">cairo_set_matrix()</code></a>.</p> | |
169 </div> | |
170 <div class="refsect1"> | |
171 <a name="cairo-cairo-matrix-t.functions_details"></a><h2>Functions</h2> | |
172 <div class="refsect2"> | |
173 <a name="cairo-matrix-init"></a><h3>cairo_matrix_init ()</h3> | |
174 <pre class="programlisting"><span class="returnvalue">void</span> | |
175 cairo_matrix_init (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
176 <em class="parameter"><code><span class="type">double</span> xx</code></em>, | |
177 <em class="parameter"><code><span class="type">double</span> yx</code></em>, | |
178 <em class="parameter"><code><span class="type">double</span> xy</code></em>, | |
179 <em class="parameter"><code><span class="type">double</span> yy</code></em>, | |
180 <em class="parameter"><code><span class="type">double</span> x0</code></em>, | |
181 <em class="parameter"><code><span class="type">double</span> y0</code></em>);</pre> | |
182 <p>Sets <em class="parameter"><code>matrix</code></em> | |
183 to be the affine transformation given by | |
184 <em class="parameter"><code>xx</code></em> | |
185 , <em class="parameter"><code>yx</code></em> | |
186 , <em class="parameter"><code>xy</code></em> | |
187 , <em class="parameter"><code>yy</code></em> | |
188 , <em class="parameter"><code>x0</code></em> | |
189 , <em class="parameter"><code>y0</code></em> | |
190 . The transformation is given | |
191 by:</p> | |
192 <pre class="programlisting"> | |
193 x_new = xx * x + xy * y + x0; | |
194 y_new = yx * x + yy * y + y0; | |
195 </pre> | |
196 <div class="refsect3"> | |
197 <a name="cairo-matrix-init.parameters"></a><h4>Parameters</h4> | |
198 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
199 <colgroup> | |
200 <col width="150px" class="parameters_name"> | |
201 <col class="parameters_description"> | |
202 <col width="200px" class="parameters_annotations"> | |
203 </colgroup> | |
204 <tbody> | |
205 <tr> | |
206 <td class="parameter_name"><p>matrix</p></td> | |
207 <td class="parameter_description"><p>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></p></td> | |
208 <td class="parameter_annotations"> </td> | |
209 </tr> | |
210 <tr> | |
211 <td class="parameter_name"><p>xx</p></td> | |
212 <td class="parameter_description"><p>xx component of the affine transformation</p></td> | |
213 <td class="parameter_annotations"> </td> | |
214 </tr> | |
215 <tr> | |
216 <td class="parameter_name"><p>yx</p></td> | |
217 <td class="parameter_description"><p>yx component of the affine transformation</p></td> | |
218 <td class="parameter_annotations"> </td> | |
219 </tr> | |
220 <tr> | |
221 <td class="parameter_name"><p>xy</p></td> | |
222 <td class="parameter_description"><p>xy component of the affine transformation</p></td> | |
223 <td class="parameter_annotations"> </td> | |
224 </tr> | |
225 <tr> | |
226 <td class="parameter_name"><p>yy</p></td> | |
227 <td class="parameter_description"><p>yy component of the affine transformation</p></td> | |
228 <td class="parameter_annotations"> </td> | |
229 </tr> | |
230 <tr> | |
231 <td class="parameter_name"><p>x0</p></td> | |
232 <td class="parameter_description"><p>X translation component of the affine transformation</p></td> | |
233 <td class="parameter_annotations"> </td> | |
234 </tr> | |
235 <tr> | |
236 <td class="parameter_name"><p>y0</p></td> | |
237 <td class="parameter_description"><p>Y translation component of the affine transformation</p></td> | |
238 <td class="parameter_annotations"> </td> | |
239 </tr> | |
240 </tbody> | |
241 </table></div> | |
242 </div> | |
243 <p class="since">Since: 1.0</p> | |
244 </div> | |
245 <hr> | |
246 <div class="refsect2"> | |
247 <a name="cairo-matrix-init-identity"></a><h3>cairo_matrix_init_identity ()</h3> | |
248 <pre class="programlisting"><span class="returnvalue">void</span> | |
249 cairo_matrix_init_identity (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);</pre> | |
250 <p>Modifies <em class="parameter"><code>matrix</code></em> | |
251 to be an identity transformation.</p> | |
252 <div class="refsect3"> | |
253 <a name="cairo-matrix-init-identity.parameters"></a><h4>Parameters</h4> | |
254 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
255 <colgroup> | |
256 <col width="150px" class="parameters_name"> | |
257 <col class="parameters_description"> | |
258 <col width="200px" class="parameters_annotations"> | |
259 </colgroup> | |
260 <tbody><tr> | |
261 <td class="parameter_name"><p>matrix</p></td> | |
262 <td class="parameter_description"><p>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></p></td> | |
263 <td class="parameter_annotations"> </td> | |
264 </tr></tbody> | |
265 </table></div> | |
266 </div> | |
267 <p class="since">Since: 1.0</p> | |
268 </div> | |
269 <hr> | |
270 <div class="refsect2"> | |
271 <a name="cairo-matrix-init-translate"></a><h3>cairo_matrix_init_translate ()</h3> | |
272 <pre class="programlisting"><span class="returnvalue">void</span> | |
273 cairo_matrix_init_translate (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
274 <em class="parameter"><code><span class="type">double</span> tx</code></em>, | |
275 <em class="parameter"><code><span class="type">double</span> ty</code></em>);</pre> | |
276 <p>Initializes <em class="parameter"><code>matrix</code></em> | |
277 to a transformation that translates by <em class="parameter"><code>tx</code></em> | |
278 and | |
279 <em class="parameter"><code>ty</code></em> | |
280 in the X and Y dimensions, respectively.</p> | |
281 <div class="refsect3"> | |
282 <a name="cairo-matrix-init-translate.parameters"></a><h4>Parameters</h4> | |
283 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
284 <colgroup> | |
285 <col width="150px" class="parameters_name"> | |
286 <col class="parameters_description"> | |
287 <col width="200px" class="parameters_annotations"> | |
288 </colgroup> | |
289 <tbody> | |
290 <tr> | |
291 <td class="parameter_name"><p>matrix</p></td> | |
292 <td class="parameter_description"><p>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></p></td> | |
293 <td class="parameter_annotations"> </td> | |
294 </tr> | |
295 <tr> | |
296 <td class="parameter_name"><p>tx</p></td> | |
297 <td class="parameter_description"><p>amount to translate in the X direction</p></td> | |
298 <td class="parameter_annotations"> </td> | |
299 </tr> | |
300 <tr> | |
301 <td class="parameter_name"><p>ty</p></td> | |
302 <td class="parameter_description"><p>amount to translate in the Y direction</p></td> | |
303 <td class="parameter_annotations"> </td> | |
304 </tr> | |
305 </tbody> | |
306 </table></div> | |
307 </div> | |
308 <p class="since">Since: 1.0</p> | |
309 </div> | |
310 <hr> | |
311 <div class="refsect2"> | |
312 <a name="cairo-matrix-init-scale"></a><h3>cairo_matrix_init_scale ()</h3> | |
313 <pre class="programlisting"><span class="returnvalue">void</span> | |
314 cairo_matrix_init_scale (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
315 <em class="parameter"><code><span class="type">double</span> sx</code></em>, | |
316 <em class="parameter"><code><span class="type">double</span> sy</code></em>);</pre> | |
317 <p>Initializes <em class="parameter"><code>matrix</code></em> | |
318 to a transformation that scales by <em class="parameter"><code>sx</code></em> | |
319 and <em class="parameter"><code>sy</code></em> | |
320 | |
321 in the X and Y dimensions, respectively.</p> | |
322 <div class="refsect3"> | |
323 <a name="cairo-matrix-init-scale.parameters"></a><h4>Parameters</h4> | |
324 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
325 <colgroup> | |
326 <col width="150px" class="parameters_name"> | |
327 <col class="parameters_description"> | |
328 <col width="200px" class="parameters_annotations"> | |
329 </colgroup> | |
330 <tbody> | |
331 <tr> | |
332 <td class="parameter_name"><p>matrix</p></td> | |
333 <td class="parameter_description"><p>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></p></td> | |
334 <td class="parameter_annotations"> </td> | |
335 </tr> | |
336 <tr> | |
337 <td class="parameter_name"><p>sx</p></td> | |
338 <td class="parameter_description"><p>scale factor in the X direction</p></td> | |
339 <td class="parameter_annotations"> </td> | |
340 </tr> | |
341 <tr> | |
342 <td class="parameter_name"><p>sy</p></td> | |
343 <td class="parameter_description"><p>scale factor in the Y direction</p></td> | |
344 <td class="parameter_annotations"> </td> | |
345 </tr> | |
346 </tbody> | |
347 </table></div> | |
348 </div> | |
349 <p class="since">Since: 1.0</p> | |
350 </div> | |
351 <hr> | |
352 <div class="refsect2"> | |
353 <a name="cairo-matrix-init-rotate"></a><h3>cairo_matrix_init_rotate ()</h3> | |
354 <pre class="programlisting"><span class="returnvalue">void</span> | |
355 cairo_matrix_init_rotate (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
356 <em class="parameter"><code><span class="type">double</span> radians</code></em>);</pre> | |
357 <p>Initialized <em class="parameter"><code>matrix</code></em> | |
358 to a transformation that rotates by <em class="parameter"><code>radians</code></em> | |
359 .</p> | |
360 <div class="refsect3"> | |
361 <a name="cairo-matrix-init-rotate.parameters"></a><h4>Parameters</h4> | |
362 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
363 <colgroup> | |
364 <col width="150px" class="parameters_name"> | |
365 <col class="parameters_description"> | |
366 <col width="200px" class="parameters_annotations"> | |
367 </colgroup> | |
368 <tbody> | |
369 <tr> | |
370 <td class="parameter_name"><p>matrix</p></td> | |
371 <td class="parameter_description"><p>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></p></td> | |
372 <td class="parameter_annotations"> </td> | |
373 </tr> | |
374 <tr> | |
375 <td class="parameter_name"><p>radians</p></td> | |
376 <td class="parameter_description"><p>angle of rotation, in radians. The direction of rotation | |
377 is defined such that positive angles rotate in the direction from | |
378 the positive X axis toward the positive Y axis. With the default | |
379 axis orientation of cairo, positive angles rotate in a clockwise | |
380 direction.</p></td> | |
381 <td class="parameter_annotations"> </td> | |
382 </tr> | |
383 </tbody> | |
384 </table></div> | |
385 </div> | |
386 <p class="since">Since: 1.0</p> | |
387 </div> | |
388 <hr> | |
389 <div class="refsect2"> | |
390 <a name="cairo-matrix-translate"></a><h3>cairo_matrix_translate ()</h3> | |
391 <pre class="programlisting"><span class="returnvalue">void</span> | |
392 cairo_matrix_translate (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
393 <em class="parameter"><code><span class="type">double</span> tx</code></em>, | |
394 <em class="parameter"><code><span class="type">double</span> ty</code></em>);</pre> | |
395 <p>Applies a translation by <em class="parameter"><code>tx</code></em> | |
396 , <em class="parameter"><code>ty</code></em> | |
397 to the transformation in | |
398 <em class="parameter"><code>matrix</code></em> | |
399 . The effect of the new transformation is to first translate | |
400 the coordinates by <em class="parameter"><code>tx</code></em> | |
401 and <em class="parameter"><code>ty</code></em> | |
402 , then apply the original transformation | |
403 to the coordinates.</p> | |
404 <div class="refsect3"> | |
405 <a name="cairo-matrix-translate.parameters"></a><h4>Parameters</h4> | |
406 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
407 <colgroup> | |
408 <col width="150px" class="parameters_name"> | |
409 <col class="parameters_description"> | |
410 <col width="200px" class="parameters_annotations"> | |
411 </colgroup> | |
412 <tbody> | |
413 <tr> | |
414 <td class="parameter_name"><p>matrix</p></td> | |
415 <td class="parameter_description"><p>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></p></td> | |
416 <td class="parameter_annotations"> </td> | |
417 </tr> | |
418 <tr> | |
419 <td class="parameter_name"><p>tx</p></td> | |
420 <td class="parameter_description"><p>amount to translate in the X direction</p></td> | |
421 <td class="parameter_annotations"> </td> | |
422 </tr> | |
423 <tr> | |
424 <td class="parameter_name"><p>ty</p></td> | |
425 <td class="parameter_description"><p>amount to translate in the Y direction</p></td> | |
426 <td class="parameter_annotations"> </td> | |
427 </tr> | |
428 </tbody> | |
429 </table></div> | |
430 </div> | |
431 <p class="since">Since: 1.0</p> | |
432 </div> | |
433 <hr> | |
434 <div class="refsect2"> | |
435 <a name="cairo-matrix-scale"></a><h3>cairo_matrix_scale ()</h3> | |
436 <pre class="programlisting"><span class="returnvalue">void</span> | |
437 cairo_matrix_scale (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
438 <em class="parameter"><code><span class="type">double</span> sx</code></em>, | |
439 <em class="parameter"><code><span class="type">double</span> sy</code></em>);</pre> | |
440 <p>Applies scaling by <em class="parameter"><code>sx</code></em> | |
441 , <em class="parameter"><code>sy</code></em> | |
442 to the transformation in <em class="parameter"><code>matrix</code></em> | |
443 . The | |
444 effect of the new transformation is to first scale the coordinates | |
445 by <em class="parameter"><code>sx</code></em> | |
446 and <em class="parameter"><code>sy</code></em> | |
447 , then apply the original transformation to the coordinates.</p> | |
448 <div class="refsect3"> | |
449 <a name="cairo-matrix-scale.parameters"></a><h4>Parameters</h4> | |
450 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
451 <colgroup> | |
452 <col width="150px" class="parameters_name"> | |
453 <col class="parameters_description"> | |
454 <col width="200px" class="parameters_annotations"> | |
455 </colgroup> | |
456 <tbody> | |
457 <tr> | |
458 <td class="parameter_name"><p>matrix</p></td> | |
459 <td class="parameter_description"><p>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></p></td> | |
460 <td class="parameter_annotations"> </td> | |
461 </tr> | |
462 <tr> | |
463 <td class="parameter_name"><p>sx</p></td> | |
464 <td class="parameter_description"><p>scale factor in the X direction</p></td> | |
465 <td class="parameter_annotations"> </td> | |
466 </tr> | |
467 <tr> | |
468 <td class="parameter_name"><p>sy</p></td> | |
469 <td class="parameter_description"><p>scale factor in the Y direction</p></td> | |
470 <td class="parameter_annotations"> </td> | |
471 </tr> | |
472 </tbody> | |
473 </table></div> | |
474 </div> | |
475 <p class="since">Since: 1.0</p> | |
476 </div> | |
477 <hr> | |
478 <div class="refsect2"> | |
479 <a name="cairo-matrix-rotate"></a><h3>cairo_matrix_rotate ()</h3> | |
480 <pre class="programlisting"><span class="returnvalue">void</span> | |
481 cairo_matrix_rotate (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
482 <em class="parameter"><code><span class="type">double</span> radians</code></em>);</pre> | |
483 <p>Applies rotation by <em class="parameter"><code>radians</code></em> | |
484 to the transformation in | |
485 <em class="parameter"><code>matrix</code></em> | |
486 . The effect of the new transformation is to first rotate the | |
487 coordinates by <em class="parameter"><code>radians</code></em> | |
488 , then apply the original transformation | |
489 to the coordinates.</p> | |
490 <div class="refsect3"> | |
491 <a name="cairo-matrix-rotate.parameters"></a><h4>Parameters</h4> | |
492 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
493 <colgroup> | |
494 <col width="150px" class="parameters_name"> | |
495 <col class="parameters_description"> | |
496 <col width="200px" class="parameters_annotations"> | |
497 </colgroup> | |
498 <tbody> | |
499 <tr> | |
500 <td class="parameter_name"><p>matrix</p></td> | |
501 <td class="parameter_description"><p>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></p></td> | |
502 <td class="parameter_annotations"> </td> | |
503 </tr> | |
504 <tr> | |
505 <td class="parameter_name"><p>radians</p></td> | |
506 <td class="parameter_description"><p>angle of rotation, in radians. The direction of rotation | |
507 is defined such that positive angles rotate in the direction from | |
508 the positive X axis toward the positive Y axis. With the default | |
509 axis orientation of cairo, positive angles rotate in a clockwise | |
510 direction.</p></td> | |
511 <td class="parameter_annotations"> </td> | |
512 </tr> | |
513 </tbody> | |
514 </table></div> | |
515 </div> | |
516 <p class="since">Since: 1.0</p> | |
517 </div> | |
518 <hr> | |
519 <div class="refsect2"> | |
520 <a name="cairo-matrix-invert"></a><h3>cairo_matrix_invert ()</h3> | |
521 <pre class="programlisting"><a class="link" href="cairo-Error-handling.html#cairo-status-t" title="enum cairo_status_t"><span class="returnvalue">cairo_status_t</span></a> | |
522 cairo_matrix_invert (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>);</pre> | |
523 <p>Changes <em class="parameter"><code>matrix</code></em> | |
524 to be the inverse of its original value. Not | |
525 all transformation matrices have inverses; if the matrix | |
526 collapses points together (it is <em class="firstterm">degenerate</em>), | |
527 then it has no inverse and this function will fail.</p> | |
528 <div class="refsect3"> | |
529 <a name="cairo-matrix-invert.parameters"></a><h4>Parameters</h4> | |
530 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
531 <colgroup> | |
532 <col width="150px" class="parameters_name"> | |
533 <col class="parameters_description"> | |
534 <col width="200px" class="parameters_annotations"> | |
535 </colgroup> | |
536 <tbody><tr> | |
537 <td class="parameter_name"><p>matrix</p></td> | |
538 <td class="parameter_description"><p>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></p></td> | |
539 <td class="parameter_annotations"> </td> | |
540 </tr></tbody> | |
541 </table></div> | |
542 </div> | |
543 <div class="refsect3"> | |
544 <a name="cairo-matrix-invert.returns"></a><h4>Returns</h4> | |
545 <p> If <em class="parameter"><code>matrix</code></em> | |
546 has an inverse, modifies <em class="parameter"><code>matrix</code></em> | |
547 to | |
548 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, | |
549 returns <a class="link" href="cairo-Error-handling.html#CAIRO-STATUS-INVALID-MATRIX:CAPS"><code class="literal">CAIRO_STATUS_INVALID_MATRIX</code></a>.</p> | |
550 </div> | |
551 <p class="since">Since: 1.0</p> | |
552 </div> | |
553 <hr> | |
554 <div class="refsect2"> | |
555 <a name="cairo-matrix-multiply"></a><h3>cairo_matrix_multiply ()</h3> | |
556 <pre class="programlisting"><span class="returnvalue">void</span> | |
557 cairo_matrix_multiply (<em class="parameter"><code><a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *result</code></em>, | |
558 <em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *a</code></em>, | |
559 <em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *b</code></em>);</pre> | |
560 <p>Multiplies the affine transformations in <em class="parameter"><code>a</code></em> | |
561 and <em class="parameter"><code>b</code></em> | |
562 together | |
563 and stores the result in <em class="parameter"><code>result</code></em> | |
564 . The effect of the resulting | |
565 transformation is to first apply the transformation in <em class="parameter"><code>a</code></em> | |
566 to the | |
567 coordinates and then apply the transformation in <em class="parameter"><code>b</code></em> | |
568 to the | |
569 coordinates.</p> | |
570 <p>It is allowable for <em class="parameter"><code>result</code></em> | |
571 to be identical to either <em class="parameter"><code>a</code></em> | |
572 or <em class="parameter"><code>b</code></em> | |
573 .</p> | |
574 <div class="refsect3"> | |
575 <a name="cairo-matrix-multiply.parameters"></a><h4>Parameters</h4> | |
576 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
577 <colgroup> | |
578 <col width="150px" class="parameters_name"> | |
579 <col class="parameters_description"> | |
580 <col width="200px" class="parameters_annotations"> | |
581 </colgroup> | |
582 <tbody> | |
583 <tr> | |
584 <td class="parameter_name"><p>result</p></td> | |
585 <td class="parameter_description"><p>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</p></td> | |
586 <td class="parameter_annotations"> </td> | |
587 </tr> | |
588 <tr> | |
589 <td class="parameter_name"><p>a</p></td> | |
590 <td class="parameter_description"><p>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></p></td> | |
591 <td class="parameter_annotations"> </td> | |
592 </tr> | |
593 <tr> | |
594 <td class="parameter_name"><p>b</p></td> | |
595 <td class="parameter_description"><p>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></p></td> | |
596 <td class="parameter_annotations"> </td> | |
597 </tr> | |
598 </tbody> | |
599 </table></div> | |
600 </div> | |
601 <p class="since">Since: 1.0</p> | |
602 </div> | |
603 <hr> | |
604 <div class="refsect2"> | |
605 <a name="cairo-matrix-transform-distance"></a><h3>cairo_matrix_transform_distance ()</h3> | |
606 <pre class="programlisting"><span class="returnvalue">void</span> | |
607 cairo_matrix_transform_distance (<em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
608 <em class="parameter"><code><span class="type">double</span> *dx</code></em>, | |
609 <em class="parameter"><code><span class="type">double</span> *dy</code></em>);</pre> | |
610 <p>Transforms the distance vector (<em class="parameter"><code>dx</code></em> | |
611 ,<em class="parameter"><code>dy</code></em> | |
612 ) by <em class="parameter"><code>matrix</code></em> | |
613 . This is | |
614 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 | |
615 components of the transformation are ignored. The calculation of | |
616 the returned vector is as follows:</p> | |
617 <pre class="programlisting"> | |
618 dx2 = dx1 * a + dy1 * c; | |
619 dy2 = dx1 * b + dy1 * d; | |
620 </pre> | |
621 <p>Affine transformations are position invariant, so the same vector | |
622 always transforms to the same vector. If (<em class="parameter"><code>x1</code></em> | |
623 ,<em class="parameter"><code>y1</code></em> | |
624 ) transforms | |
625 to (<em class="parameter"><code>x2</code></em> | |
626 ,<em class="parameter"><code>y2</code></em> | |
627 ) then (<em class="parameter"><code>x1</code></em> | |
628 +<em class="parameter"><code>dx1</code></em> | |
629 ,<em class="parameter"><code>y1</code></em> | |
630 +<em class="parameter"><code>dy1</code></em> | |
631 ) will transform to | |
632 (<em class="parameter"><code>x1</code></em> | |
633 +<em class="parameter"><code>dx2</code></em> | |
634 ,<em class="parameter"><code>y1</code></em> | |
635 +<em class="parameter"><code>dy2</code></em> | |
636 ) for all values of <em class="parameter"><code>x1</code></em> | |
637 and <em class="parameter"><code>x2</code></em> | |
638 .</p> | |
639 <div class="refsect3"> | |
640 <a name="cairo-matrix-transform-distance.parameters"></a><h4>Parameters</h4> | |
641 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
642 <colgroup> | |
643 <col width="150px" class="parameters_name"> | |
644 <col class="parameters_description"> | |
645 <col width="200px" class="parameters_annotations"> | |
646 </colgroup> | |
647 <tbody> | |
648 <tr> | |
649 <td class="parameter_name"><p>matrix</p></td> | |
650 <td class="parameter_description"><p>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></p></td> | |
651 <td class="parameter_annotations"> </td> | |
652 </tr> | |
653 <tr> | |
654 <td class="parameter_name"><p>dx</p></td> | |
655 <td class="parameter_description"><p>X component of a distance vector. An in/out parameter</p></td> | |
656 <td class="parameter_annotations"> </td> | |
657 </tr> | |
658 <tr> | |
659 <td class="parameter_name"><p>dy</p></td> | |
660 <td class="parameter_description"><p>Y component of a distance vector. An in/out parameter</p></td> | |
661 <td class="parameter_annotations"> </td> | |
662 </tr> | |
663 </tbody> | |
664 </table></div> | |
665 </div> | |
666 <p class="since">Since: 1.0</p> | |
667 </div> | |
668 <hr> | |
669 <div class="refsect2"> | |
670 <a name="cairo-matrix-transform-point"></a><h3>cairo_matrix_transform_point ()</h3> | |
671 <pre class="programlisting"><span class="returnvalue">void</span> | |
672 cairo_matrix_transform_point (<em class="parameter"><code>const <a class="link" href="cairo-cairo-matrix-t.html#cairo-matrix-t" title="cairo_matrix_t"><span class="type">cairo_matrix_t</span></a> *matrix</code></em>, | |
673 <em class="parameter"><code><span class="type">double</span> *x</code></em>, | |
674 <em class="parameter"><code><span class="type">double</span> *y</code></em>);</pre> | |
675 <p>Transforms the point (<em class="parameter"><code>x</code></em> | |
676 , <em class="parameter"><code>y</code></em> | |
677 ) by <em class="parameter"><code>matrix</code></em> | |
678 .</p> | |
679 <div class="refsect3"> | |
680 <a name="cairo-matrix-transform-point.parameters"></a><h4>Parameters</h4> | |
681 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
682 <colgroup> | |
683 <col width="150px" class="parameters_name"> | |
684 <col class="parameters_description"> | |
685 <col width="200px" class="parameters_annotations"> | |
686 </colgroup> | |
687 <tbody> | |
688 <tr> | |
689 <td class="parameter_name"><p>matrix</p></td> | |
690 <td class="parameter_description"><p>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></p></td> | |
691 <td class="parameter_annotations"> </td> | |
692 </tr> | |
693 <tr> | |
694 <td class="parameter_name"><p>x</p></td> | |
695 <td class="parameter_description"><p>X position. An in/out parameter</p></td> | |
696 <td class="parameter_annotations"> </td> | |
697 </tr> | |
698 <tr> | |
699 <td class="parameter_name"><p>y</p></td> | |
700 <td class="parameter_description"><p>Y position. An in/out parameter</p></td> | |
701 <td class="parameter_annotations"> </td> | |
702 </tr> | |
703 </tbody> | |
704 </table></div> | |
705 </div> | |
706 <p class="since">Since: 1.0</p> | |
707 </div> | |
708 </div> | |
709 <div class="refsect1"> | |
710 <a name="cairo-cairo-matrix-t.other_details"></a><h2>Types and Values</h2> | |
711 <div class="refsect2"> | |
712 <a name="cairo-matrix-t"></a><h3>cairo_matrix_t</h3> | |
713 <pre class="programlisting">typedef struct { | |
714 double xx; double yx; | |
715 double xy; double yy; | |
716 double x0; double y0; | |
717 } cairo_matrix_t; | |
718 </pre> | |
719 <p>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, | |
720 rotation, shear, or a combination of those. The transformation of | |
721 a point (x, y) is given by:</p> | |
722 <pre class="programlisting"> | |
723 x_new = xx * x + xy * y + x0; | |
724 y_new = yx * x + yy * y + y0; | |
725 </pre> | |
726 <div class="refsect3"> | |
727 <a name="cairo-matrix-t.members"></a><h4>Members</h4> | |
728 <div class="informaltable"><table class="informaltable" width="100%" border="0"> | |
729 <colgroup> | |
730 <col width="300px" class="struct_members_name"> | |
731 <col class="struct_members_description"> | |
732 <col width="200px" class="struct_members_annotations"> | |
733 </colgroup> | |
734 <tbody> | |
735 <tr> | |
736 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.xx"></a>xx</code></em>;</p></td> | |
737 <td class="struct_member_description"><p>xx component of the affine transformation</p></td> | |
738 <td class="struct_member_annotations"> </td> | |
739 </tr> | |
740 <tr> | |
741 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.yx"></a>yx</code></em>;</p></td> | |
742 <td class="struct_member_description"><p>yx component of the affine transformation</p></td> | |
743 <td class="struct_member_annotations"> </td> | |
744 </tr> | |
745 <tr> | |
746 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.xy"></a>xy</code></em>;</p></td> | |
747 <td class="struct_member_description"><p>xy component of the affine transformation</p></td> | |
748 <td class="struct_member_annotations"> </td> | |
749 </tr> | |
750 <tr> | |
751 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.yy"></a>yy</code></em>;</p></td> | |
752 <td class="struct_member_description"><p>yy component of the affine transformation</p></td> | |
753 <td class="struct_member_annotations"> </td> | |
754 </tr> | |
755 <tr> | |
756 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.x0"></a>x0</code></em>;</p></td> | |
757 <td class="struct_member_description"><p>X translation component of the affine transformation</p></td> | |
758 <td class="struct_member_annotations"> </td> | |
759 </tr> | |
760 <tr> | |
761 <td class="struct_member_name"><p><span class="type">double</span> <em class="structfield"><code><a name="cairo-matrix-t.y0"></a>y0</code></em>;</p></td> | |
762 <td class="struct_member_description"><p>Y translation component of the affine transformation</p></td> | |
763 <td class="struct_member_annotations"> </td> | |
764 </tr> | |
765 </tbody> | |
766 </table></div> | |
767 </div> | |
768 <p class="since">Since: 1.0</p> | |
769 </div> | |
770 </div> | |
771 <div class="refsect1"> | |
772 <a name="cairo-cairo-matrix-t.see-also"></a><h2>See Also</h2> | |
773 <p><a class="link" href="cairo-cairo-t.html#cairo-t" title="cairo_t"><span class="type">cairo_t</span></a></p> | |
774 </div> | |
775 </div> | |
776 <div class="footer"> | |
777 <hr>Generated by GTK-Doc V1.27</div> | |
778 </body> | |
779 </html> |