mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 16:40:41 -05:00
317 lines
4.3 KiB
Plaintext
317 lines
4.3 KiB
Plaintext
<!-- ##### 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>
|
|
|
|
<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>
|
|
|
|
|
|
<!-- ##### TYPEDEF ClutterAngle ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
<!-- ##### MACRO CFX_Q ##### -->
|
|
<para>
|
|
Number of bits used to store fractional part of #ClutterFixed.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_ONE ##### -->
|
|
<para>
|
|
#ClutterFixed representation of 1.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_MAX ##### -->
|
|
<para>
|
|
Maximum number representable by #ClutterFixed.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_MIN ##### -->
|
|
<para>
|
|
Minumum number representable by #ClutterFixed.
|
|
</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>
|
|
Alias for #CLUTTER_FIXED_DIV.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_INT ##### -->
|
|
<para>
|
|
Alias for #CLUTTER_FIXED_INT.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CFX_MUL ##### -->
|
|
<para>
|
|
Alias for #CLUTTER_FIXED_MUL.
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_TO_FLOAT ##### -->
|
|
<para>
|
|
Macro for converting #ClutterFixed to single precission floating point.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_TO_DOUBLE ##### -->
|
|
<para>
|
|
Macro for converting #ClutterFixed to double precission floating point.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FLOAT_TO_FIXED ##### -->
|
|
<para>
|
|
Macro for converting floating point numbers to #ClutterFixed.
|
|
</para>
|
|
|
|
@x: double or float
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_INT_TO_FIXED ##### -->
|
|
<para>
|
|
Macro for converting integers to #ClutterFixed.
|
|
</para>
|
|
|
|
@x: int
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_INT ##### -->
|
|
<para>
|
|
Macro to obtain integer part of #ClutterFixed.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_FRACTION ##### -->
|
|
<para>
|
|
Macro to obtain the fraction of #ClutterFixed.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_FLOOR ##### -->
|
|
<para>
|
|
Macro to obtain greatest integer smaller than given #ClutterFixed.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_CEIL ##### -->
|
|
<para>
|
|
Macro to obtain smallest integer greater than given #ClutterFixed.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_MUL ##### -->
|
|
<para>
|
|
Macro for multiplication of two #ClutterFixed numbers.
|
|
</para>
|
|
|
|
@x: #ClutterFixed
|
|
@y: #ClutterFixed
|
|
|
|
|
|
<!-- ##### MACRO CLUTTER_FIXED_DIV ##### -->
|
|
<para>
|
|
Macro for difvision of two #ClutterFixed numbers.
|
|
</para>
|
|
|
|
@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:
|
|
|
|
|