2006-11-17 18:45:31 +00:00
|
|
|
<!-- ##### SECTION Title ##### -->
|
|
|
|
clutter-fixed
|
|
|
|
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
2006-12-05 05:16:03 +00:00
|
|
|
Fixed point API
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
|
|
<para>
|
2006-12-05 05:16:03 +00:00
|
|
|
Clutter has a fixed point API targeted at platforms without a floating
|
|
|
|
point unit, such as embedded devices. This API should be preferred to
|
|
|
|
the floating point one as it does not trigger the slow path of software
|
|
|
|
emulation, relying on integer math for fixed-to-floating and
|
|
|
|
floating-to-fixed conversion.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-18 10:33:24 +00:00
|
|
|
<section>
|
|
|
|
<title>Basic Rules of Fixed Point Arithmetic</title>
|
|
|
|
<itemizedlist>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Two fixed point numbers can be directly added and subtracted.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
To add other numerical type to a fixed point number it has to be first
|
|
|
|
converted to fixed point.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
A fixed point number can be directly multiplied or divided by an integer.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Two fixed point numbers can only be multiplied and divided by the provided
|
|
|
|
#CLUTTER_FIXED_MUL (aka #CFX_MUL) and #CLUTTER_FIXED_DIV (aka #CFX_DIV) macros.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
</section>
|
|
|
|
|
2006-11-17 18:45:31 +00:00
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### SECTION Stability_Level ##### -->
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### TYPEDEF ClutterFixed ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_Q ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Number of bits used to store fractional part of #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_ONE ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
#ClutterFixed representation of 1.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_MAX ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Maximum number representable by #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_MIN ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Minumum number representable by #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-18 12:33:15 +00:00
|
|
|
<!-- ##### TYPEDEF ClutterAngle ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
<!-- ##### MACRO CFX_PI ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_2PI ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_PI_2 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_PI_4 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_120 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_180 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_240 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_360 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_60 ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### MACRO CFX_255 ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### MACRO CFX_DIV ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Alias for #CLUTTER_FIXED_DIV.
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### MACRO CFX_INT ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Alias for #CLUTTER_FIXED_INT.
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### MACRO CFX_MUL ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Alias for #CLUTTER_FIXED_MUL.
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-17 18:45:31 +00:00
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_TO_FLOAT ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for converting #ClutterFixed to single precission floating point.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_TO_DOUBLE ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for converting #ClutterFixed to double precission floating point.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FLOAT_TO_FIXED ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for converting floating point numbers to #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: double or float
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
2007-03-22 20:23:29 +00:00
|
|
|
<!-- ##### MACRO CLUTTER_FLOAT_TO_INT ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@x:
|
|
|
|
|
|
|
|
|
2006-11-17 18:45:31 +00:00
|
|
|
<!-- ##### MACRO CLUTTER_INT_TO_FIXED ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for converting integers to #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: int
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_INT ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro to obtain integer part of #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_FRACTION ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro to obtain the fraction of #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_FLOOR ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro to obtain greatest integer smaller than given #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_CEIL ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro to obtain smallest integer greater than given #ClutterFixed.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_MUL ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for multiplication of two #ClutterFixed numbers.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
|
|
|
@y: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_DIV ##### -->
|
|
|
|
<para>
|
2007-01-17 16:00:00 +00:00
|
|
|
Macro for difvision of two #ClutterFixed numbers.
|
2006-11-17 18:45:31 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-17 16:00:00 +00:00
|
|
|
@x: #ClutterFixed
|
|
|
|
@y: #ClutterFixed
|
2006-11-17 18:45:31 +00:00
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### MACRO clutter_cosi ##### -->
|
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-18 08:53:50 +00:00
|
|
|
@angle:
|
2007-01-17 13:51:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### MACRO clutter_cosx ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
2007-01-18 08:53:50 +00:00
|
|
|
|
2007-01-16 14:37:54 +00:00
|
|
|
</para>
|
|
|
|
|
2007-01-18 08:53:50 +00:00
|
|
|
@angle:
|
2007-01-16 14:37:54 +00:00
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### FUNCTION clutter_sini ##### -->
|
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@angle:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
|
|
|
<!-- ##### FUNCTION clutter_sinx ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@angle:
|
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### FUNCTION clutter_sqrti ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
|
|
|
@x:
|
2007-01-17 13:51:14 +00:00
|
|
|
@Returns:
|
2007-01-16 14:37:54 +00:00
|
|
|
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
<!-- ##### FUNCTION clutter_sqrtx ##### -->
|
2007-01-16 14:37:54 +00:00
|
|
|
<para>
|
|
|
|
|
|
|
|
</para>
|
|
|
|
|
2007-01-17 13:51:14 +00:00
|
|
|
@x:
|
2007-01-16 14:37:54 +00:00
|
|
|
@Returns:
|
|
|
|
|
|
|
|
|