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