"Initial commit to Gerrit"
[profile/ivi/cogl.git] / doc / reference / cogl / html / cogl-Fixed-Point-API.html
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>Fixed Point API</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
7 <link rel="home" href="index.html" title="Cogl Reference Manual">
8 <link rel="up" href="ch01.html" title="Cogl - a modern 3D graphics API">
9 <link rel="prev" href="cogl-Bitmaps.html" title="Bitmaps">
10 <link rel="next" href="cogl-GType-Integration-API.html" title="GType Integration API">
11 <meta name="generator" content="GTK-Doc V1.18.1 (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="2">
16 <tr valign="middle">
17 <td><a accesskey="p" href="cogl-Bitmaps.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">Cogl Reference Manual</th>
21 <td><a accesskey="n" href="cogl-GType-Integration-API.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
22 </tr>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#cogl-Fixed-Point-API.synopsis" class="shortcut">Top</a>
25                    | 
26                   <a href="#cogl-Fixed-Point-API.description" class="shortcut">Description</a>
27 </td></tr>
28 </table>
29 <div class="refentry">
30 <a name="cogl-Fixed-Point-API"></a><div class="titlepage"></div>
31 <div class="refnamediv"><table width="100%"><tr>
32 <td valign="top">
33 <h2><span class="refentrytitle"><a name="cogl-Fixed-Point-API.top_of_page"></a>Fixed Point API</span></h2>
34 <p>Fixed Point API — Fixed Point API</p>
35 </td>
36 <td valign="top" align="right"></td>
37 </tr></table></div>
38 <div class="refsynopsisdiv">
39 <a name="cogl-Fixed-Point-API.synopsis"></a><h2>Synopsis</h2>
40 <pre class="synopsis">typedef             <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed">CoglFixed</a>;
41 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-BITS:CAPS" title="COGL_FIXED_BITS">COGL_FIXED_BITS</a>
42 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-Q:CAPS" title="COGL_FIXED_Q">COGL_FIXED_Q</a>
43 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MAX:CAPS" title="COGL_FIXED_MAX">COGL_FIXED_MAX</a>
44 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MIN:CAPS" title="COGL_FIXED_MIN">COGL_FIXED_MIN</a>
45
46 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FROM-FLOAT:CAPS" title="COGL_FIXED_FROM_FLOAT()">COGL_FIXED_FROM_FLOAT</a>               (x)
47 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-TO-FLOAT:CAPS" title="COGL_FIXED_TO_FLOAT()">COGL_FIXED_TO_FLOAT</a>                 (x)
48 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FROM-INT:CAPS" title="COGL_FIXED_FROM_INT()">COGL_FIXED_FROM_INT</a>                 (x)
49 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-TO-INT:CAPS" title="COGL_FIXED_TO_INT()">COGL_FIXED_TO_INT</a>                   (x)
50 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FROM-DOUBLE:CAPS" title="COGL_FIXED_FROM_DOUBLE()">COGL_FIXED_FROM_DOUBLE</a>              (x)
51 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-TO-DOUBLE:CAPS" title="COGL_FIXED_TO_DOUBLE()">COGL_FIXED_TO_DOUBLE</a>                (x)
52 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FLOAT-TO-INT:CAPS" title="COGL_FLOAT_TO_INT()">COGL_FLOAT_TO_INT</a>                   (x)
53 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FLOAT-TO-UINT:CAPS" title="COGL_FLOAT_TO_UINT()">COGL_FLOAT_TO_UINT</a>                  (x)
54
55 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-EPSILON:CAPS" title="COGL_FIXED_EPSILON">COGL_FIXED_EPSILON</a>
56 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-1:CAPS" title="COGL_FIXED_1">COGL_FIXED_1</a>
57 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-0-5:CAPS" title="COGL_FIXED_0_5">COGL_FIXED_0_5</a>
58 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-30:CAPS" title="COGL_FIXED_30">COGL_FIXED_30</a>
59 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-45:CAPS" title="COGL_FIXED_45">COGL_FIXED_45</a>
60 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-60:CAPS" title="COGL_FIXED_60">COGL_FIXED_60</a>
61 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-90:CAPS" title="COGL_FIXED_90">COGL_FIXED_90</a>
62 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-120:CAPS" title="COGL_FIXED_120">COGL_FIXED_120</a>
63 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-180:CAPS" title="COGL_FIXED_180">COGL_FIXED_180</a>
64 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-240:CAPS" title="COGL_FIXED_240">COGL_FIXED_240</a>
65 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-255:CAPS" title="COGL_FIXED_255">COGL_FIXED_255</a>
66 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-270:CAPS" title="COGL_FIXED_270">COGL_FIXED_270</a>
67 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-360:CAPS" title="COGL_FIXED_360">COGL_FIXED_360</a>
68
69 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL:CAPS" title="COGL_FIXED_MUL()">COGL_FIXED_MUL</a>                      (a,
70                                                          b)
71 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-DIV:CAPS" title="COGL_FIXED_DIV()">COGL_FIXED_DIV</a>                      (a,
72                                                          b)
73 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL-DIV:CAPS" title="COGL_FIXED_MUL_DIV()">COGL_FIXED_MUL_DIV</a>                  (a,
74                                                          b,
75                                                          c)
76 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FAST-DIV:CAPS" title="COGL_FIXED_FAST_DIV()">COGL_FIXED_FAST_DIV</a>                 (a,
77                                                          b)
78 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FAST-MUL:CAPS" title="COGL_FIXED_FAST_MUL()">COGL_FIXED_FAST_MUL</a>                 (a,
79                                                          b)
80 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FRACTION:CAPS" title="COGL_FIXED_FRACTION()">COGL_FIXED_FRACTION</a>                 (x)
81 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-FLOOR:CAPS" title="COGL_FIXED_FLOOR()">COGL_FIXED_FLOOR</a>                    (x)
82 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-CEIL:CAPS" title="COGL_FIXED_CEIL()">COGL_FIXED_CEIL</a>                     (x)
83
84 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-2-PI:CAPS" title="COGL_FIXED_2_PI">COGL_FIXED_2_PI</a>
85 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-PI:CAPS" title="COGL_FIXED_PI">COGL_FIXED_PI</a>
86 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-PI-2:CAPS" title="COGL_FIXED_PI_2">COGL_FIXED_PI_2</a>
87 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-PI-4:CAPS" title="COGL_FIXED_PI_4">COGL_FIXED_PI_4</a>
88 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-RADIANS-TO-DEGREES:CAPS" title="COGL_RADIANS_TO_DEGREES">COGL_RADIANS_TO_DEGREES</a>
89
90 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-SQRTI-ARG-10-PERCENT:CAPS" title="COGL_SQRTI_ARG_10_PERCENT">COGL_SQRTI_ARG_10_PERCENT</a>
91 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-SQRTI-ARG-5-PERCENT:CAPS" title="COGL_SQRTI_ARG_5_PERCENT">COGL_SQRTI_ARG_5_PERCENT</a>
92 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-SQRTI-ARG-MAX:CAPS" title="COGL_SQRTI_ARG_MAX">COGL_SQRTI_ARG_MAX</a>
93 <span class="returnvalue">int</span>                 <a class="link" href="cogl-Fixed-Point-API.html#cogl-sqrti" title="cogl_sqrti ()">cogl_sqrti</a>                          (<em class="parameter"><code><span class="type">int</span> x</code></em>);
94
95 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-atan2" title="cogl_fixed_atan2 ()">cogl_fixed_atan2</a>                    (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
96                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);
97 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-atan" title="cogl_fixed_atan ()">cogl_fixed_atan</a>                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>);
98 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-cos" title="cogl_fixed_cos ()">cogl_fixed_cos</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);
99 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-log2" title="cogl_fixed_log2 ()">cogl_fixed_log2</a>                     (<em class="parameter"><code>unsigned <span class="type">int</span> x</code></em>);
100 unsigned <span class="returnvalue">int</span>        <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-pow" title="cogl_fixed_pow ()">cogl_fixed_pow</a>                      (<em class="parameter"><code>unsigned <span class="type">int</span> x</code></em>,
101                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> y</code></em>);
102 unsigned <span class="returnvalue">int</span>        <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-pow2" title="cogl_fixed_pow2 ()">cogl_fixed_pow2</a>                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> x</code></em>);
103 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-sin" title="cogl_fixed_sin ()">cogl_fixed_sin</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);
104 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-sqrt" title="cogl_fixed_sqrt ()">cogl_fixed_sqrt</a>                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> x</code></em>);
105 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-tan" title="cogl_fixed_tan ()">cogl_fixed_tan</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);
106 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-div" title="cogl_fixed_div ()">cogl_fixed_div</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
107                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);
108 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-mul" title="cogl_fixed_mul ()">cogl_fixed_mul</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
109                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);
110 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-fixed-mul-div" title="cogl_fixed_mul_div ()">cogl_fixed_mul_div</a>                  (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
111                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>,
112                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> c</code></em>);
113
114 typedef             <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle">CoglAngle</a>;
115 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-ANGLE-FROM-DEG:CAPS" title="COGL_ANGLE_FROM_DEG()">COGL_ANGLE_FROM_DEG</a>                 (x)
116 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-ANGLE-FROM-DEGX:CAPS" title="COGL_ANGLE_FROM_DEGX()">COGL_ANGLE_FROM_DEGX</a>                (x)
117 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-ANGLE-TO-DEG:CAPS" title="COGL_ANGLE_TO_DEG()">COGL_ANGLE_TO_DEG</a>                   (x)
118 #define             <a class="link" href="cogl-Fixed-Point-API.html#COGL-ANGLE-TO-DEGX:CAPS" title="COGL_ANGLE_TO_DEGX()">COGL_ANGLE_TO_DEGX</a>                  (x)
119 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-angle-cos" title="cogl_angle_cos ()">cogl_angle_cos</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);
120 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-angle-sin" title="cogl_angle_sin ()">cogl_angle_sin</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);
121 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           <a class="link" href="cogl-Fixed-Point-API.html#cogl-angle-tan" title="cogl_angle_tan ()">cogl_angle_tan</a>                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);
122 </pre>
123 </div>
124 <div class="refsect1">
125 <a name="cogl-Fixed-Point-API.description"></a><h2>Description</h2>
126 <p>
127 COGL has a fixed point API targeted at platforms without a floating
128 point unit, such as embedded devices. On such platforms this API should
129 be preferred to the floating point one as it does not trigger the slow
130 path of software emulation, relying on integer math for fixed-to-floating
131 and floating-to-fixed notations conversion.
132 </p>
133 <p>
134 It is not recommened for use on platforms with a floating point unit
135 (e.g. desktop systems), nor for use in language bindings.
136 </p>
137 <p>
138 Basic rules of Fixed Point arithmethic:
139 </p>
140 <div class="itemizedlist"><ul class="itemizedlist" type="disc">
141 <li class="listitem"><p>Two fixed point numbers can be directly added, subtracted and
142     have their modulus taken.</p></li>
143 <li class="listitem"><p>To add other numerical type to a fixed point number it has to
144     be first converted to fixed point.</p></li>
145 <li class="listitem"><p>A fixed point number can be directly multiplied or divided by
146     an integer.</p></li>
147 <li class="listitem"><p>Two fixed point numbers can only be multiplied and divided by
148     the provided <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL:CAPS" title="COGL_FIXED_MUL()"><code class="literal">COGL_FIXED_MUL</code></a> and <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-DIV:CAPS" title="COGL_FIXED_DIV()"><code class="literal">COGL_FIXED_DIV</code></a> macros.</p></li>
149 </ul></div>
150 <p>
151 </p>
152 <p>
153 The fixed point API is available since COGL 1.0.
154 </p>
155 </div>
156 <div class="refsect1">
157 <a name="cogl-Fixed-Point-API.details"></a><h2>Details</h2>
158 <div class="refsect2">
159 <a name="CoglFixed"></a><h3>CoglFixed</h3>
160 <pre class="programlisting">typedef gint32 CoglFixed;
161 </pre>
162 <p>
163 Fixed point number using a (16.16) notation.
164 </p>
165 </div>
166 <hr>
167 <div class="refsect2">
168 <a name="COGL-FIXED-BITS:CAPS"></a><h3>COGL_FIXED_BITS</h3>
169 <pre class="programlisting">#define COGL_FIXED_BITS         (32)
170 </pre>
171 <p>
172 Evaluates to the number of bits used by the <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> type.
173 </p>
174 <p class="since">Since 1.0</p>
175 </div>
176 <hr>
177 <div class="refsect2">
178 <a name="COGL-FIXED-Q:CAPS"></a><h3>COGL_FIXED_Q</h3>
179 <pre class="programlisting">#define COGL_FIXED_Q            (COGL_FIXED_BITS - 16)
180 </pre>
181 <p>
182 Evaluates to the number of bits used for the non-integer part
183 of the <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> type.
184 </p>
185 <p class="since">Since 1.0</p>
186 </div>
187 <hr>
188 <div class="refsect2">
189 <a name="COGL-FIXED-MAX:CAPS"></a><h3>COGL_FIXED_MAX</h3>
190 <pre class="programlisting">#define COGL_FIXED_MAX          (0x7fffffff)
191 </pre>
192 <p>
193 The biggest number representable using <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a>
194 </p>
195 <p class="since">Since 1.0</p>
196 </div>
197 <hr>
198 <div class="refsect2">
199 <a name="COGL-FIXED-MIN:CAPS"></a><h3>COGL_FIXED_MIN</h3>
200 <pre class="programlisting">#define COGL_FIXED_MIN          (0x80000000)
201 </pre>
202 <p>
203 The smallest number representable using <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a>
204 </p>
205 <p class="since">Since 1.0</p>
206 </div>
207 <hr>
208 <div class="refsect2">
209 <a name="COGL-FIXED-FROM-FLOAT:CAPS"></a><h3>COGL_FIXED_FROM_FLOAT()</h3>
210 <pre class="programlisting">#define COGL_FIXED_FROM_FLOAT(x)        ((float) cogl_double_to_fixed (x))
211 </pre>
212 <p>
213 Converts <em class="parameter"><code>x</code></em> from a floating point to a fixed point notation.
214 </p>
215 <div class="variablelist"><table border="0">
216 <col align="left" valign="top">
217 <tbody><tr>
218 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
219 <td>a floating point number</td>
220 </tr></tbody>
221 </table></div>
222 <p class="since">Since 1.0</p>
223 </div>
224 <hr>
225 <div class="refsect2">
226 <a name="COGL-FIXED-TO-FLOAT:CAPS"></a><h3>COGL_FIXED_TO_FLOAT()</h3>
227 <pre class="programlisting">#define COGL_FIXED_TO_FLOAT(x)          ((float) ((int)(x) / 65536.0))
228 </pre>
229 <p>
230 Converts <em class="parameter"><code>x</code></em> from a fixed point to a floating point notation, in
231 single precision.
232 </p>
233 <div class="variablelist"><table border="0">
234 <col align="left" valign="top">
235 <tbody><tr>
236 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
237 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
238 </tr></tbody>
239 </table></div>
240 <p class="since">Since 1.0</p>
241 </div>
242 <hr>
243 <div class="refsect2">
244 <a name="COGL-FIXED-FROM-INT:CAPS"></a><h3>COGL_FIXED_FROM_INT()</h3>
245 <pre class="programlisting">#define COGL_FIXED_FROM_INT(x)          ((x) &lt;&lt; COGL_FIXED_Q)
246 </pre>
247 <p>
248 Converts <em class="parameter"><code>x</code></em> from an integer to a fixed point notation.
249 </p>
250 <div class="variablelist"><table border="0">
251 <col align="left" valign="top">
252 <tbody><tr>
253 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
254 <td>an integer number</td>
255 </tr></tbody>
256 </table></div>
257 <p class="since">Since 1.0</p>
258 </div>
259 <hr>
260 <div class="refsect2">
261 <a name="COGL-FIXED-TO-INT:CAPS"></a><h3>COGL_FIXED_TO_INT()</h3>
262 <pre class="programlisting">#define COGL_FIXED_TO_INT(x)            ((x) &gt;&gt; COGL_FIXED_Q)
263 </pre>
264 <p>
265 Converts <em class="parameter"><code>x</code></em> from a fixed point notation to an integer, dropping
266 the fractional part without rounding.
267 </p>
268 <div class="variablelist"><table border="0">
269 <col align="left" valign="top">
270 <tbody><tr>
271 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
272 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
273 </tr></tbody>
274 </table></div>
275 <p class="since">Since 1.0</p>
276 </div>
277 <hr>
278 <div class="refsect2">
279 <a name="COGL-FIXED-FROM-DOUBLE:CAPS"></a><h3>COGL_FIXED_FROM_DOUBLE()</h3>
280 <pre class="programlisting">#define COGL_FIXED_FROM_DOUBLE(x)       (cogl_double_to_fixed (x))
281 </pre>
282 <p>
283 Converts <em class="parameter"><code>x</code></em> from a double precision, floating point to a fixed
284 point notation.
285 </p>
286 <div class="variablelist"><table border="0">
287 <col align="left" valign="top">
288 <tbody><tr>
289 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
290 <td>a floating point number</td>
291 </tr></tbody>
292 </table></div>
293 <p class="since">Since 1.0</p>
294 </div>
295 <hr>
296 <div class="refsect2">
297 <a name="COGL-FIXED-TO-DOUBLE:CAPS"></a><h3>COGL_FIXED_TO_DOUBLE()</h3>
298 <pre class="programlisting">#define COGL_FIXED_TO_DOUBLE(x)         ((double) ((int)(x) / 65536.0))
299 </pre>
300 <p>
301 Converts <em class="parameter"><code>x</code></em> from a fixed point to a floating point notation, in
302 double precision.
303 </p>
304 <div class="variablelist"><table border="0">
305 <col align="left" valign="top">
306 <tbody><tr>
307 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
308 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
309 </tr></tbody>
310 </table></div>
311 <p class="since">Since 1.0</p>
312 </div>
313 <hr>
314 <div class="refsect2">
315 <a name="COGL-FLOAT-TO-INT:CAPS"></a><h3>COGL_FLOAT_TO_INT()</h3>
316 <pre class="programlisting">#define COGL_FLOAT_TO_INT(x)            (cogl_double_to_int ((x)))
317 </pre>
318 <p>
319 Converts <em class="parameter"><code>x</code></em> from a floating point notation to a signed integer.
320 </p>
321 <div class="variablelist"><table border="0">
322 <col align="left" valign="top">
323 <tbody><tr>
324 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
325 <td>a floatint point number</td>
326 </tr></tbody>
327 </table></div>
328 <p class="since">Since 1.0</p>
329 </div>
330 <hr>
331 <div class="refsect2">
332 <a name="COGL-FLOAT-TO-UINT:CAPS"></a><h3>COGL_FLOAT_TO_UINT()</h3>
333 <pre class="programlisting">#define COGL_FLOAT_TO_UINT(x)           (cogl_double_to_uint ((x)))
334 </pre>
335 <p>
336 Converts <em class="parameter"><code>x</code></em> from a floating point notation to an unsigned integer.
337 </p>
338 <div class="variablelist"><table border="0">
339 <col align="left" valign="top">
340 <tbody><tr>
341 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
342 <td>a floatint point number</td>
343 </tr></tbody>
344 </table></div>
345 <p class="since">Since 1.0</p>
346 </div>
347 <hr>
348 <div class="refsect2">
349 <a name="COGL-FIXED-EPSILON:CAPS"></a><h3>COGL_FIXED_EPSILON</h3>
350 <pre class="programlisting">#define COGL_FIXED_EPSILON      (1)
351 </pre>
352 <p>
353 A very small number expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
354 </p>
355 <p class="since">Since 1.0</p>
356 </div>
357 <hr>
358 <div class="refsect2">
359 <a name="COGL-FIXED-1:CAPS"></a><h3>COGL_FIXED_1</h3>
360 <pre class="programlisting">#define COGL_FIXED_1            (1 &lt;&lt; COGL_FIXED_Q)
361 </pre>
362 <p>
363 The number 1 expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
364 </p>
365 <p class="since">Since 1.0</p>
366 </div>
367 <hr>
368 <div class="refsect2">
369 <a name="COGL-FIXED-0-5:CAPS"></a><h3>COGL_FIXED_0_5</h3>
370 <pre class="programlisting">#define COGL_FIXED_0_5          (32768)
371 </pre>
372 <p>
373 The number 0.5 expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
374 </p>
375 <p class="since">Since 1.0</p>
376 </div>
377 <hr>
378 <div class="refsect2">
379 <a name="COGL-FIXED-30:CAPS"></a><h3>COGL_FIXED_30</h3>
380 <pre class="programlisting">#define COGL_FIXED_30           (COGL_FIXED_FROM_INT (30))
381 </pre>
382 <p>
383 Evaluates to the number 30 in fixed point notation.
384 </p>
385 <p class="since">Since 1.0</p>
386 </div>
387 <hr>
388 <div class="refsect2">
389 <a name="COGL-FIXED-45:CAPS"></a><h3>COGL_FIXED_45</h3>
390 <pre class="programlisting">#define COGL_FIXED_45           (COGL_FIXED_FROM_INT (45))
391 </pre>
392 <p>
393 Evaluates to the number 45 in fixed point notation.
394 </p>
395 <p class="since">Since 1.0</p>
396 </div>
397 <hr>
398 <div class="refsect2">
399 <a name="COGL-FIXED-60:CAPS"></a><h3>COGL_FIXED_60</h3>
400 <pre class="programlisting">#define COGL_FIXED_60           (COGL_FIXED_FROM_INT (60))
401 </pre>
402 <p>
403 Evaluates to the number 60 in fixed point notation.
404 </p>
405 <p class="since">Since 1.0</p>
406 </div>
407 <hr>
408 <div class="refsect2">
409 <a name="COGL-FIXED-90:CAPS"></a><h3>COGL_FIXED_90</h3>
410 <pre class="programlisting">#define COGL_FIXED_90           (COGL_FIXED_FROM_INT (90))
411 </pre>
412 <p>
413 Evaluates to the number 90 in fixed point notation.
414 </p>
415 <p class="since">Since 1.0</p>
416 </div>
417 <hr>
418 <div class="refsect2">
419 <a name="COGL-FIXED-120:CAPS"></a><h3>COGL_FIXED_120</h3>
420 <pre class="programlisting">#define COGL_FIXED_120          (COGL_FIXED_FROM_INT (120))
421 </pre>
422 <p>
423 Evaluates to the number 120 in fixed point notation.
424 </p>
425 <p class="since">Since 1.0</p>
426 </div>
427 <hr>
428 <div class="refsect2">
429 <a name="COGL-FIXED-180:CAPS"></a><h3>COGL_FIXED_180</h3>
430 <pre class="programlisting">#define COGL_FIXED_180          (COGL_FIXED_FROM_INT (180))
431 </pre>
432 <p>
433 Evaluates to the number 180 in fixed point notation.
434 </p>
435 <p class="since">Since 1.0</p>
436 </div>
437 <hr>
438 <div class="refsect2">
439 <a name="COGL-FIXED-240:CAPS"></a><h3>COGL_FIXED_240</h3>
440 <pre class="programlisting">#define COGL_FIXED_240          (COGL_FIXED_FROM_INT (240))
441 </pre>
442 <p>
443 Evaluates to the number 240 in fixed point notation.
444 </p>
445 <p class="since">Since 1.0</p>
446 </div>
447 <hr>
448 <div class="refsect2">
449 <a name="COGL-FIXED-255:CAPS"></a><h3>COGL_FIXED_255</h3>
450 <pre class="programlisting">#define COGL_FIXED_255          (COGL_FIXED_FROM_INT (255))
451 </pre>
452 <p>
453 Evaluates to the number 255 in fixed point notation.
454 </p>
455 <p class="since">Since 1.0</p>
456 </div>
457 <hr>
458 <div class="refsect2">
459 <a name="COGL-FIXED-270:CAPS"></a><h3>COGL_FIXED_270</h3>
460 <pre class="programlisting">#define COGL_FIXED_270          (COGL_FIXED_FROM_INT (270))
461 </pre>
462 <p>
463 Evaluates to the number 270 in fixed point notation.
464 </p>
465 <p class="since">Since 1.0</p>
466 </div>
467 <hr>
468 <div class="refsect2">
469 <a name="COGL-FIXED-360:CAPS"></a><h3>COGL_FIXED_360</h3>
470 <pre class="programlisting">#define COGL_FIXED_360          (COGL_FIXED_FROM_INT (360))
471 </pre>
472 <p>
473 Evaluates to the number 360 in fixed point notation.
474 </p>
475 <p class="since">Since 1.0</p>
476 </div>
477 <hr>
478 <div class="refsect2">
479 <a name="COGL-FIXED-MUL:CAPS"></a><h3>COGL_FIXED_MUL()</h3>
480 <pre class="programlisting">#define COGL_FIXED_MUL(a,b)             (cogl_fixed_mul ((a), (b)))
481 </pre>
482 <p>
483 Computes (a * b).
484 </p>
485 <div class="variablelist"><table border="0">
486 <col align="left" valign="top">
487 <tbody>
488 <tr>
489 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
490 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
491 </tr>
492 <tr>
493 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
494 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
495 </tr>
496 </tbody>
497 </table></div>
498 <p class="since">Since 1.0</p>
499 </div>
500 <hr>
501 <div class="refsect2">
502 <a name="COGL-FIXED-DIV:CAPS"></a><h3>COGL_FIXED_DIV()</h3>
503 <pre class="programlisting">#define COGL_FIXED_DIV(a,b)             (cogl_fixed_div ((a), (b)))
504 </pre>
505 <p>
506 Computes (a / b).
507 </p>
508 <div class="variablelist"><table border="0">
509 <col align="left" valign="top">
510 <tbody>
511 <tr>
512 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
513 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
514 </tr>
515 <tr>
516 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
517 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
518 </tr>
519 </tbody>
520 </table></div>
521 <p class="since">Since 1.0</p>
522 </div>
523 <hr>
524 <div class="refsect2">
525 <a name="COGL-FIXED-MUL-DIV:CAPS"></a><h3>COGL_FIXED_MUL_DIV()</h3>
526 <pre class="programlisting">#define COGL_FIXED_MUL_DIV(a,b,c)       (cogl_fixed_mul_div ((a), (b), (c)))
527 </pre>
528 <p>
529 Computes ((a * b) / c). It is logically equivalent to:
530 </p>
531 <p>
532 </p>
533 <div class="informalexample">
534   <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
535     <tbody>
536       <tr>
537         <td class="listing_lines" align="right"><pre>1</pre></td>
538         <td class="listing_code"><pre class="programlisting"><span class="normal">res </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="cogl-Fixed-Point-API.html#COGL-FIXED-DIV:CAPS">COGL_FIXED_DIV</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL:CAPS">COGL_FIXED_MUL</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">a</span><span class="symbol">,</span><span class="normal"> b</span><span class="symbol">),</span><span class="normal"> c</span><span class="symbol">);</span></pre></td>
539       </tr>
540     </tbody>
541   </table>
542 </div>
543
544 <p>
545 </p>
546 <p>
547 But it is shorter to type.
548 </p>
549 <div class="variablelist"><table border="0">
550 <col align="left" valign="top">
551 <tbody>
552 <tr>
553 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
554 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
555 </tr>
556 <tr>
557 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
558 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
559 </tr>
560 <tr>
561 <td><p><span class="term"><em class="parameter"><code>c</code></em> :</span></p></td>
562 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
563 </tr>
564 </tbody>
565 </table></div>
566 <p class="since">Since 1.0</p>
567 </div>
568 <hr>
569 <div class="refsect2">
570 <a name="COGL-FIXED-FAST-DIV:CAPS"></a><h3>COGL_FIXED_FAST_DIV()</h3>
571 <pre class="programlisting">#define COGL_FIXED_FAST_DIV(a,b)        ((((a) &lt;&lt; 8) / (b)) &lt;&lt; 8)
572 </pre>
573 <p>
574 Fast version of <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-DIV:CAPS" title="COGL_FIXED_DIV()"><code class="literal">COGL_FIXED_DIV</code></a>, implemented as a macro.
575 </p>
576 <p>
577 </p>
578 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
579 <h3 class="title">Note</h3>This macro might lose precision. If the precision of the result
580 is important use <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-DIV:CAPS" title="COGL_FIXED_DIV()"><code class="literal">COGL_FIXED_DIV</code></a> instead.</div>
581 <p>
582 </p>
583 <div class="variablelist"><table border="0">
584 <col align="left" valign="top">
585 <tbody>
586 <tr>
587 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
588 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
589 </tr>
590 <tr>
591 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
592 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
593 </tr>
594 </tbody>
595 </table></div>
596 <p class="since">Since 1.0</p>
597 </div>
598 <hr>
599 <div class="refsect2">
600 <a name="COGL-FIXED-FAST-MUL:CAPS"></a><h3>COGL_FIXED_FAST_MUL()</h3>
601 <pre class="programlisting">#define COGL_FIXED_FAST_MUL(a,b)        ((a) &gt;&gt; 8) * ((b) &gt;&gt; 8)
602 </pre>
603 <p>
604 Fast version of <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL:CAPS" title="COGL_FIXED_MUL()"><code class="literal">COGL_FIXED_MUL</code></a>, implemented as a macro.
605 </p>
606 <p>
607 </p>
608 <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
609 <h3 class="title">Note</h3>This macro might lose precision. If the precision of the result
610 is important use <a class="link" href="cogl-Fixed-Point-API.html#COGL-FIXED-MUL:CAPS" title="COGL_FIXED_MUL()"><code class="literal">COGL_FIXED_MUL</code></a> instead.</div>
611 <p>
612 </p>
613 <div class="variablelist"><table border="0">
614 <col align="left" valign="top">
615 <tbody>
616 <tr>
617 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
618 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
619 </tr>
620 <tr>
621 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
622 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
623 </tr>
624 </tbody>
625 </table></div>
626 <p class="since">Since 1.0</p>
627 </div>
628 <hr>
629 <div class="refsect2">
630 <a name="COGL-FIXED-FRACTION:CAPS"></a><h3>COGL_FIXED_FRACTION()</h3>
631 <pre class="programlisting">#define COGL_FIXED_FRACTION(x)          ((x) &amp; ((1 &lt;&lt; COGL_FIXED_Q) - 1))
632 </pre>
633 <p>
634 Retrieves the fractionary part of <em class="parameter"><code>x</code></em>.
635 </p>
636 <div class="variablelist"><table border="0">
637 <col align="left" valign="top">
638 <tbody><tr>
639 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
640 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
641 </tr></tbody>
642 </table></div>
643 <p class="since">Since 1.0</p>
644 </div>
645 <hr>
646 <div class="refsect2">
647 <a name="COGL-FIXED-FLOOR:CAPS"></a><h3>COGL_FIXED_FLOOR()</h3>
648 <pre class="programlisting">#define             COGL_FIXED_FLOOR(x)</pre>
649 <p>
650 Rounds down a fixed point number to the previous integer.
651 </p>
652 <div class="variablelist"><table border="0">
653 <col align="left" valign="top">
654 <tbody><tr>
655 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
656 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
657 </tr></tbody>
658 </table></div>
659 <p class="since">Since 1.0</p>
660 </div>
661 <hr>
662 <div class="refsect2">
663 <a name="COGL-FIXED-CEIL:CAPS"></a><h3>COGL_FIXED_CEIL()</h3>
664 <pre class="programlisting">#define COGL_FIXED_CEIL(x)              (COGL_FIXED_FLOOR ((x) + 0xffff))
665 </pre>
666 <p>
667 Rounds up a fixed point number to the next integer.
668 </p>
669 <div class="variablelist"><table border="0">
670 <col align="left" valign="top">
671 <tbody><tr>
672 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
673 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
674 </tr></tbody>
675 </table></div>
676 <p class="since">Since 1.0</p>
677 </div>
678 <hr>
679 <div class="refsect2">
680 <a name="COGL-FIXED-2-PI:CAPS"></a><h3>COGL_FIXED_2_PI</h3>
681 <pre class="programlisting">#define COGL_FIXED_2_PI         (0x0006487f)
682 </pre>
683 <p>
684 Two times pi, expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
685 </p>
686 <p class="since">Since 1.0</p>
687 </div>
688 <hr>
689 <div class="refsect2">
690 <a name="COGL-FIXED-PI:CAPS"></a><h3>COGL_FIXED_PI</h3>
691 <pre class="programlisting">#define COGL_FIXED_PI           (0x0003243f)
692 </pre>
693 <p>
694 The number pi, expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
695 </p>
696 <p class="since">Since 1.0</p>
697 </div>
698 <hr>
699 <div class="refsect2">
700 <a name="COGL-FIXED-PI-2:CAPS"></a><h3>COGL_FIXED_PI_2</h3>
701 <pre class="programlisting">#define COGL_FIXED_PI_2         (0x00019220)
702 </pre>
703 <p>
704 Half pi, expressed as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
705 </p>
706 <p class="since">Since 1.0</p>
707 </div>
708 <hr>
709 <div class="refsect2">
710 <a name="COGL-FIXED-PI-4:CAPS"></a><h3>COGL_FIXED_PI_4</h3>
711 <pre class="programlisting">#define COGL_FIXED_PI_4         (0x0000c910)
712 </pre>
713 <p>
714 pi / 4, expressed as <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number.
715 </p>
716 <p class="since">Since 1.0</p>
717 </div>
718 <hr>
719 <div class="refsect2">
720 <a name="COGL-RADIANS-TO-DEGREES:CAPS"></a><h3>COGL_RADIANS_TO_DEGREES</h3>
721 <pre class="programlisting">#define COGL_RADIANS_TO_DEGREES (0x394bb8)
722 </pre>
723 <p>
724 Evaluates to 180 / pi in fixed point notation.
725 </p>
726 <p class="since">Since 1.0</p>
727 </div>
728 <hr>
729 <div class="refsect2">
730 <a name="COGL-SQRTI-ARG-10-PERCENT:CAPS"></a><h3>COGL_SQRTI_ARG_10_PERCENT</h3>
731 <pre class="programlisting">#define COGL_SQRTI_ARG_10_PERCENT 5590
732 </pre>
733 <p>
734 Maximum argument that can be passed to <a class="link" href="cogl-Fixed-Point-API.html#cogl-sqrti" title="cogl_sqrti ()"><code class="function">cogl_sqrti()</code></a> for which the
735 resulting error is &lt; 10%
736 </p>
737 <p class="since">Since 1.0</p>
738 </div>
739 <hr>
740 <div class="refsect2">
741 <a name="COGL-SQRTI-ARG-5-PERCENT:CAPS"></a><h3>COGL_SQRTI_ARG_5_PERCENT</h3>
742 <pre class="programlisting">#define COGL_SQRTI_ARG_5_PERCENT 210
743 </pre>
744 <p>
745 Maximum argument that can be passed to <a class="link" href="cogl-Fixed-Point-API.html#cogl-sqrti" title="cogl_sqrti ()"><code class="function">cogl_sqrti()</code></a> for which the
746 resulting error is &lt; 5%
747 </p>
748 <p class="since">Since 1.0</p>
749 </div>
750 <hr>
751 <div class="refsect2">
752 <a name="COGL-SQRTI-ARG-MAX:CAPS"></a><h3>COGL_SQRTI_ARG_MAX</h3>
753 <pre class="programlisting">#define COGL_SQRTI_ARG_MAX 0x3fffff
754 </pre>
755 <p>
756 Maximum argument that can be passed to <a class="link" href="cogl-Fixed-Point-API.html#cogl-sqrti" title="cogl_sqrti ()"><code class="function">cogl_sqrti()</code></a> function.
757 </p>
758 <p class="since">Since 1.0</p>
759 </div>
760 <hr>
761 <div class="refsect2">
762 <a name="cogl-sqrti"></a><h3>cogl_sqrti ()</h3>
763 <pre class="programlisting"><span class="returnvalue">int</span>                 cogl_sqrti                          (<em class="parameter"><code><span class="type">int</span> x</code></em>);</pre>
764 <p>
765 Very fast fixed point implementation of square root for integers.
766 </p>
767 <p>
768 This function is at least 6x faster than clib <code class="function">sqrt()</code> on x86, and (this is
769 not a typo!) about 500x faster on ARM without FPU. It's error is &lt; 5%
770 for arguments &lt; <a class="link" href="cogl-Fixed-Point-API.html#COGL-SQRTI-ARG-5-PERCENT:CAPS" title="COGL_SQRTI_ARG_5_PERCENT"><code class="literal">COGL_SQRTI_ARG_5_PERCENT</code></a> and &lt; 10% for arguments &lt;
771 <a class="link" href="cogl-Fixed-Point-API.html#COGL-SQRTI-ARG-10-PERCENT:CAPS" title="COGL_SQRTI_ARG_10_PERCENT"><code class="literal">COGL_SQRTI_ARG_10_PERCENT</code></a>. The maximum argument that can be passed to
772 this function is COGL_SQRTI_ARG_MAX.
773 </p>
774 <div class="variablelist"><table border="0">
775 <col align="left" valign="top">
776 <tbody>
777 <tr>
778 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
779 <td>integer value</td>
780 </tr>
781 <tr>
782 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
783 <td>integer square root.</td>
784 </tr>
785 </tbody>
786 </table></div>
787 <p class="since">Since 0.2</p>
788 </div>
789 <hr>
790 <div class="refsect2">
791 <a name="cogl-fixed-atan2"></a><h3>cogl_fixed_atan2 ()</h3>
792 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_atan2                    (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
793                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);</pre>
794 <p>
795 Computes the arc tangent of <em class="parameter"><code>a</code></em> / <em class="parameter"><code>b</code></em> but uses the sign of both
796 arguments to return the angle in right quadrant.
797 </p>
798 <div class="variablelist"><table border="0">
799 <col align="left" valign="top">
800 <tbody>
801 <tr>
802 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
803 <td>the numerator as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
804 </tr>
805 <tr>
806 <td><p><span class="term"><em class="parameter"><code>b</code></em> :</span></p></td>
807 <td>the denominator as a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
808 </tr>
809 <tr>
810 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
811 <td>the arc tangent of the passed fraction, in fixed point
812 notation</td>
813 </tr>
814 </tbody>
815 </table></div>
816 <p class="since">Since 1.0</p>
817 </div>
818 <hr>
819 <div class="refsect2">
820 <a name="cogl-fixed-atan"></a><h3>cogl_fixed_atan ()</h3>
821 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_atan                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>);</pre>
822 <p>
823 Computes the arc tangent of <em class="parameter"><code>a</code></em>.
824 </p>
825 <div class="variablelist"><table border="0">
826 <col align="left" valign="top">
827 <tbody>
828 <tr>
829 <td><p><span class="term"><em class="parameter"><code>a</code></em> :</span></p></td>
830 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
831 </tr>
832 <tr>
833 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
834 <td>the arc tangent of the passed value, in fixed point notation</td>
835 </tr>
836 </tbody>
837 </table></div>
838 <p class="since">Since 1.0</p>
839 </div>
840 <hr>
841 <div class="refsect2">
842 <a name="cogl-fixed-cos"></a><h3>cogl_fixed_cos ()</h3>
843 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_cos                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);</pre>
844 <p>
845 Computes the cosine of <em class="parameter"><code>angle</code></em>.
846 </p>
847 <div class="variablelist"><table border="0">
848 <col align="left" valign="top">
849 <tbody>
850 <tr>
851 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
852 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
853 </tr>
854 <tr>
855 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
856 <td>the cosine of the passed angle, in fixed point notation</td>
857 </tr>
858 </tbody>
859 </table></div>
860 <p class="since">Since 1.0</p>
861 </div>
862 <hr>
863 <div class="refsect2">
864 <a name="cogl-fixed-log2"></a><h3>cogl_fixed_log2 ()</h3>
865 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_log2                     (<em class="parameter"><code>unsigned <span class="type">int</span> x</code></em>);</pre>
866 <p>
867 Calculates base 2 logarithm.
868 </p>
869 <p>
870 This function is some 2.5 times faster on x86, and over 12 times faster on
871 fpu-less arm, than using libc <code class="function">log()</code>.
872 </p>
873 <div class="variablelist"><table border="0">
874 <col align="left" valign="top">
875 <tbody>
876 <tr>
877 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
878 <td>value to calculate base 2 logarithm from</td>
879 </tr>
880 <tr>
881 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
882 <td>base 2 logarithm.</td>
883 </tr>
884 </tbody>
885 </table></div>
886 <p class="since">Since 1.0</p>
887 </div>
888 <hr>
889 <div class="refsect2">
890 <a name="cogl-fixed-pow"></a><h3>cogl_fixed_pow ()</h3>
891 <pre class="programlisting">unsigned <span class="returnvalue">int</span>        cogl_fixed_pow                      (<em class="parameter"><code>unsigned <span class="type">int</span> x</code></em>,
892                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> y</code></em>);</pre>
893 <p>
894 Calculates <em class="parameter"><code>x</code></em> to the <em class="parameter"><code>y</code></em> power.
895 </p>
896 <div class="variablelist"><table border="0">
897 <col align="left" valign="top">
898 <tbody>
899 <tr>
900 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
901 <td>base</td>
902 </tr>
903 <tr>
904 <td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
905 <td>
906 <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> exponent</td>
907 </tr>
908 <tr>
909 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
910 <td>the power of <em class="parameter"><code>x</code></em> to the <em class="parameter"><code>y</code></em>
911 </td>
912 </tr>
913 </tbody>
914 </table></div>
915 <p class="since">Since 1.0</p>
916 </div>
917 <hr>
918 <div class="refsect2">
919 <a name="cogl-fixed-pow2"></a><h3>cogl_fixed_pow2 ()</h3>
920 <pre class="programlisting">unsigned <span class="returnvalue">int</span>        cogl_fixed_pow2                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> x</code></em>);</pre>
921 <p>
922 Calculates 2 to the <em class="parameter"><code>x</code></em> power.
923 </p>
924 <p>
925 This function is around 11 times faster on x86, and around 22 times faster
926 on fpu-less arm than libc pow(2, x).
927 </p>
928 <div class="variablelist"><table border="0">
929 <col align="left" valign="top">
930 <tbody>
931 <tr>
932 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
933 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
934 </tr>
935 <tr>
936 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
937 <td>the power of 2 to the passed value</td>
938 </tr>
939 </tbody>
940 </table></div>
941 <p class="since">Since 1.0</p>
942 </div>
943 <hr>
944 <div class="refsect2">
945 <a name="cogl-fixed-sin"></a><h3>cogl_fixed_sin ()</h3>
946 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_sin                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);</pre>
947 <p>
948 Computes the sine of <em class="parameter"><code>angle</code></em>.
949 </p>
950 <div class="variablelist"><table border="0">
951 <col align="left" valign="top">
952 <tbody>
953 <tr>
954 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
955 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
956 </tr>
957 <tr>
958 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
959 <td>the sine of the passed angle, in fixed point notation</td>
960 </tr>
961 </tbody>
962 </table></div>
963 <p class="since">Since 1.0</p>
964 </div>
965 <hr>
966 <div class="refsect2">
967 <a name="cogl-fixed-sqrt"></a><h3>cogl_fixed_sqrt ()</h3>
968 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_sqrt                     (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> x</code></em>);</pre>
969 <p>
970 Computes the square root of <em class="parameter"><code>x</code></em>.
971 </p>
972 <div class="variablelist"><table border="0">
973 <col align="left" valign="top">
974 <tbody>
975 <tr>
976 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
977 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
978 </tr>
979 <tr>
980 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
981 <td>the square root of the passed value, in floating point
982 notation</td>
983 </tr>
984 </tbody>
985 </table></div>
986 <p class="since">Since 1.0</p>
987 </div>
988 <hr>
989 <div class="refsect2">
990 <a name="cogl-fixed-tan"></a><h3>cogl_fixed_tan ()</h3>
991 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_tan                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> angle</code></em>);</pre>
992 <p>
993 Computes the tangent of <em class="parameter"><code>angle</code></em>.
994 </p>
995 <div class="variablelist"><table border="0">
996 <col align="left" valign="top">
997 <tbody>
998 <tr>
999 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
1000 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> number</td>
1001 </tr>
1002 <tr>
1003 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1004 <td>the tangent of the passed angle, in fixed point notation</td>
1005 </tr>
1006 </tbody>
1007 </table></div>
1008 <p class="since">Since 1.0</p>
1009 </div>
1010 <hr>
1011 <div class="refsect2">
1012 <a name="cogl-fixed-div"></a><h3>cogl_fixed_div ()</h3>
1013 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_div                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
1014                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);</pre>
1015 </div>
1016 <hr>
1017 <div class="refsect2">
1018 <a name="cogl-fixed-mul"></a><h3>cogl_fixed_mul ()</h3>
1019 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_mul                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
1020                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>);</pre>
1021 </div>
1022 <hr>
1023 <div class="refsect2">
1024 <a name="cogl-fixed-mul-div"></a><h3>cogl_fixed_mul_div ()</h3>
1025 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_fixed_mul_div                  (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> a</code></em>,
1026                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> b</code></em>,
1027                                                          <em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="type">CoglFixed</span></a> c</code></em>);</pre>
1028 </div>
1029 <hr>
1030 <div class="refsect2">
1031 <a name="CoglAngle"></a><h3>CoglAngle</h3>
1032 <pre class="programlisting">typedef gint32 CoglAngle;
1033 </pre>
1034 <p>
1035 Integer representation of an angle such that 1024 corresponds to
1036 full circle (i.e., 2 * pi).
1037 </p>
1038 <p class="since">Since 1.0</p>
1039 </div>
1040 <hr>
1041 <div class="refsect2">
1042 <a name="COGL-ANGLE-FROM-DEG:CAPS"></a><h3>COGL_ANGLE_FROM_DEG()</h3>
1043 <pre class="programlisting">#define COGL_ANGLE_FROM_DEG(x)  (COGL_FLOAT_TO_INT (((float)(x) * 1024.0f) / 360.0f))
1044 </pre>
1045 <p>
1046 Converts an angle in degrees into a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>.
1047 </p>
1048 <div class="variablelist"><table border="0">
1049 <col align="left" valign="top">
1050 <tbody><tr>
1051 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1052 <td>an angle in degrees in floating point notation</td>
1053 </tr></tbody>
1054 </table></div>
1055 <p class="since">Since 1.0</p>
1056 </div>
1057 <hr>
1058 <div class="refsect2">
1059 <a name="COGL-ANGLE-FROM-DEGX:CAPS"></a><h3>COGL_ANGLE_FROM_DEGX()</h3>
1060 <pre class="programlisting">#define COGL_ANGLE_FROM_DEGX(x) (COGL_FIXED_TO_INT ((((x) / 360) * 1024) + COGL_FIXED_0_5))
1061 </pre>
1062 <p>
1063 Converts an angle in degrees into a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>.
1064 </p>
1065 <div class="variablelist"><table border="0">
1066 <col align="left" valign="top">
1067 <tbody><tr>
1068 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1069 <td>an angle in degrees in fixed point notation</td>
1070 </tr></tbody>
1071 </table></div>
1072 <p class="since">Since 1.0</p>
1073 </div>
1074 <hr>
1075 <div class="refsect2">
1076 <a name="COGL-ANGLE-TO-DEG:CAPS"></a><h3>COGL_ANGLE_TO_DEG()</h3>
1077 <pre class="programlisting">#define COGL_ANGLE_TO_DEG(x)    (((float)(x) * 360.0) / 1024.0)
1078 </pre>
1079 <p>
1080 Converts a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> into an angle in degrees, using floatint point
1081 notation.
1082 </p>
1083 <div class="variablelist"><table border="0">
1084 <col align="left" valign="top">
1085 <tbody><tr>
1086 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1087 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>
1088 </td>
1089 </tr></tbody>
1090 </table></div>
1091 <p class="since">Since 1.0</p>
1092 </div>
1093 <hr>
1094 <div class="refsect2">
1095 <a name="COGL-ANGLE-TO-DEGX:CAPS"></a><h3>COGL_ANGLE_TO_DEGX()</h3>
1096 <pre class="programlisting">#define COGL_ANGLE_TO_DEGX(x)   (COGL_FIXED_FROM_INT ((x) * 45) / 128)
1097 </pre>
1098 <p>
1099 Converts a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> into an angle in degrees, using fixed point notation
1100 </p>
1101 <div class="variablelist"><table border="0">
1102 <col align="left" valign="top">
1103 <tbody><tr>
1104 <td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
1105 <td>a <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>
1106 </td>
1107 </tr></tbody>
1108 </table></div>
1109 <p class="since">Since 1.0</p>
1110 </div>
1111 <hr>
1112 <div class="refsect2">
1113 <a name="cogl-angle-cos"></a><h3>cogl_angle_cos ()</h3>
1114 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_angle_cos                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);</pre>
1115 <p>
1116 Computes the cosine of <em class="parameter"><code>angle</code></em>
1117 </p>
1118 <div class="variablelist"><table border="0">
1119 <col align="left" valign="top">
1120 <tbody>
1121 <tr>
1122 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
1123 <td>an angle expressed using <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>
1124 </td>
1125 </tr>
1126 <tr>
1127 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1128 <td>the cosine of the passed angle</td>
1129 </tr>
1130 </tbody>
1131 </table></div>
1132 <p class="since">Since 1.0</p>
1133 </div>
1134 <hr>
1135 <div class="refsect2">
1136 <a name="cogl-angle-sin"></a><h3>cogl_angle_sin ()</h3>
1137 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_angle_sin                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);</pre>
1138 <p>
1139 Computes the sine of <em class="parameter"><code>angle</code></em>
1140 </p>
1141 <div class="variablelist"><table border="0">
1142 <col align="left" valign="top">
1143 <tbody>
1144 <tr>
1145 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
1146 <td>an angle expressed using <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>
1147 </td>
1148 </tr>
1149 <tr>
1150 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1151 <td>the sine of the passed angle</td>
1152 </tr>
1153 </tbody>
1154 </table></div>
1155 <p class="since">Since 1.0</p>
1156 </div>
1157 <hr>
1158 <div class="refsect2">
1159 <a name="cogl-angle-tan"></a><h3>cogl_angle_tan ()</h3>
1160 <pre class="programlisting"><a class="link" href="cogl-Fixed-Point-API.html#CoglFixed" title="CoglFixed"><span class="returnvalue">CoglFixed</span></a>           cogl_angle_tan                      (<em class="parameter"><code><a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a> angle</code></em>);</pre>
1161 <p>
1162 Computes the tangent of <em class="parameter"><code>angle</code></em>
1163 </p>
1164 <div class="variablelist"><table border="0">
1165 <col align="left" valign="top">
1166 <tbody>
1167 <tr>
1168 <td><p><span class="term"><em class="parameter"><code>angle</code></em> :</span></p></td>
1169 <td>an angle expressed using <a class="link" href="cogl-Fixed-Point-API.html#CoglAngle" title="CoglAngle"><span class="type">CoglAngle</span></a>
1170 </td>
1171 </tr>
1172 <tr>
1173 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1174 <td>the tangent of the passed angle</td>
1175 </tr>
1176 </tbody>
1177 </table></div>
1178 <p class="since">Since 1.0</p>
1179 </div>
1180 </div>
1181 </div>
1182 <div class="footer">
1183 <hr>
1184           Generated by GTK-Doc V1.18.1</div>
1185 </body>
1186 </html>