mutter/doc/reference/tmpl/clutter-fixed.sgml

326 lines
4.5 KiB
Plaintext
Raw Normal View History

<!-- ##### SECTION Title ##### -->
clutter-fixed
<!-- ##### SECTION Short_Description ##### -->
Fixed point API
<!-- ##### SECTION Long_Description ##### -->
<para>
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.
</para>
2007-01-18 05:33:24 -05: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>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF ClutterFixed ##### -->
<para>
</para>
<!-- ##### MACRO CFX_Q ##### -->
<para>
2007-01-17 11:00:00 -05:00
Number of bits used to store fractional part of #ClutterFixed.
</para>
<!-- ##### MACRO CFX_ONE ##### -->
<para>
2007-01-17 11:00:00 -05:00
#ClutterFixed representation of 1.
</para>
<!-- ##### MACRO CFX_MAX ##### -->
<para>
2007-01-17 11:00:00 -05:00
Maximum number representable by #ClutterFixed.
</para>
<!-- ##### MACRO CFX_MIN ##### -->
<para>
2007-01-17 11:00:00 -05:00
Minumum number representable by #ClutterFixed.
</para>
<!-- ##### TYPEDEF ClutterAngle ##### -->
<para>
</para>
<!-- ##### MACRO CFX_PI ##### -->
<para>
</para>
<!-- ##### MACRO CFX_2PI ##### -->
<para>
</para>
<!-- ##### MACRO CFX_PI_2 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_PI_4 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_120 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_180 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_240 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_360 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_60 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_255 ##### -->
<para>
</para>
<!-- ##### MACRO CFX_DIV ##### -->
<para>
2007-01-17 11:00:00 -05:00
Alias for #CLUTTER_FIXED_DIV.
</para>
<!-- ##### MACRO CFX_INT ##### -->
<para>
2007-01-17 11:00:00 -05:00
Alias for #CLUTTER_FIXED_INT.
</para>
<!-- ##### MACRO CFX_MUL ##### -->
<para>
2007-01-17 11:00:00 -05:00
Alias for #CLUTTER_FIXED_MUL.
</para>
<!-- ##### MACRO CLUTTER_FIXED_TO_FLOAT ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for converting #ClutterFixed to single precission floating point.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_TO_DOUBLE ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for converting #ClutterFixed to double precission floating point.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FLOAT_TO_FIXED ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for converting floating point numbers to #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: double or float
<!-- ##### MACRO CLUTTER_FLOAT_TO_INT ##### -->
<para>
2007-06-01 06:00:35 -04:00
Macro for converting floating point numbers to intergers; this conversion
is significantly faster that casting floats to int.
</para>
2007-06-01 06:00:35 -04:00
@x: float
<!-- ##### MACRO CLUTTER_INT_TO_FIXED ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for converting integers to #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: int
<!-- ##### MACRO CLUTTER_FIXED_INT ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro to obtain integer part of #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_FRACTION ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro to obtain the fraction of #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_FLOOR ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro to obtain greatest integer smaller than given #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_CEIL ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro to obtain smallest integer greater than given #ClutterFixed.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_MUL ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for multiplication of two #ClutterFixed numbers.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
@y: #ClutterFixed
<!-- ##### MACRO CLUTTER_FIXED_DIV ##### -->
<para>
2007-01-17 11:00:00 -05:00
Macro for difvision of two #ClutterFixed numbers.
</para>
2007-01-17 11:00:00 -05:00
@x: #ClutterFixed
@y: #ClutterFixed
<!-- ##### MACRO clutter_cosi ##### -->
<para>
</para>
@angle:
<!-- ##### MACRO clutter_cosx ##### -->
<para>
</para>
@angle:
<!-- ##### FUNCTION clutter_sini ##### -->
<para>
</para>
@angle:
@Returns:
<!-- ##### FUNCTION clutter_sinx ##### -->
<para>
</para>
@angle:
@Returns:
<!-- ##### FUNCTION clutter_sqrti ##### -->
<para>
</para>
@x:
@Returns:
<!-- ##### FUNCTION clutter_sqrtx ##### -->
<para>
</para>
@x:
@Returns: