Mathematics and Trigonometric functions.
More...
Modules |
| math2d |
| 2D Mathematics functions
|
| math3d |
| 3D Mathematics functions
|
Typedefs |
typedef Float | Fixed |
Detailed Description
*This section documents the math and trigo functions used in the GPAC framework. GPAC can be compiled with *fixed-point support, representing float values on a 16.16 signed integer, which implies a developer *must take care of float computations when using GPAC.
*A developper should not need to know in which mode the framework has been compiled as long as he uses *the math functions of GPAC which work in both float and fixed-point mode.
*Using fixed-point version is decided at compilation time and cannot be changed. The feature is signaled *through the following macros:
- GPAC_FIXED_POINT: when defined, GPAC has been compiled in fixed-point mode
- GPAC_NO_FIXED_POINT: when defined, GPAC has been compiled in regular (float) mode
Macro Definition Documentation
Conversion from integer to fixed
Conversion from float to fixed
Conversion from fixed to integer
Conversion from fixed to float
Epsilon Fixed (positive value closest to 0)
Maximum Fixed (maximum representable fixed value)
Minimum Fixed (minimum representable fixed value)
1/_a, expressed as fixed number
#define gf_mulfix |
( |
|
_a, |
|
|
|
_b |
|
) |
| |
_a*_b, expressed as fixed number
#define gf_muldiv |
( |
|
_a, |
|
|
|
_b, |
|
|
|
_c |
|
) |
| |
_a*_b/_c, expressed as fixed number
#define gf_divfix |
( |
|
_a, |
|
|
|
_b |
|
) |
| |
_a/_b, expressed as fixed number
sqrt(_a), expressed as fixed number
ceil(_a), expressed as fixed number
floor(_a), expressed as fixed number
cos(_a), expressed as fixed number
sin(_a), expressed as fixed number
tan(_a), expressed as fixed number
#define gf_atan2 |
( |
|
_y, |
|
|
|
_x |
|
) |
| |
atan2(_y,_x), expressed as fixed number
acos(_a), expressed as fixed number
asin(_a), expressed as fixed number
Typedef Documentation
Fixed is 32bit float number
- Note
- This documentation has been generated for a float version of the GPAC framework.
Function Documentation
u32 gf_get_bit_size |
( |
u32 |
MaxVal | ) |
|
Gets the number of bits needed to represent the value.
- Parameters
-
MaxVal | Maximum value to be represented. |
- Returns
- number of bits required to represent the value.
u32 gf_get_next_pow2 |
( |
u32 |
val | ) |
|
Gets the closest power of 2 greater or equal to the value.
- Parameters
-
- Returns
- requested power of 2.