1 /***************************************************************************/
5 /* Arithmetic computations (specification). */
7 /* Copyright 1996-2001, 2002 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
10 /* This file is part of the FreeType project, and may only be used, */
11 /* modified, and distributed under the terms of the FreeType project */
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
13 /* this file you indicate that you have read the license and */
14 /* understand and accept it fully. */
16 /***************************************************************************/
24 #include FT_FREETYPE_H
30 FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x );
33 #define SQRT_32( x ) FT_Sqrt32( x )
36 /*************************************************************************/
42 /* Computes the square root of an Int32 integer (which will be */
43 /* handled as an unsigned long value). */
46 /* x :: The value to compute the root for. */
49 /* The result of `sqrt(x)'. */
52 FT_Sqrt32( FT_Int32 x );
55 /*************************************************************************/
57 /* FT_MulDiv() and FT_MulFix() are declared in freetype.h. */
59 /*************************************************************************/
62 #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 )
63 #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 )
64 #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 )
65 #define F2DOT14_TO_FIXED( x ) ( (FT_Long)(x) << 2 )
66 #define FLOAT_TO_FIXED( x ) ( (FT_Long)( x * 65536.0 ) )
68 #define ROUND_F26DOT6( x ) ( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
69 : ( -( ( 32 - (x) ) & -64 ) ) )
74 #endif /* __FTCALC_H__ */