33 #include FT_INTERNAL_OBJECTS_H 34 #include FT_INTERNAL_CALC_H 35 #include FT_TRIGONOMETRY_H 39 #define FT_TRIG_SCALE 0xDBD95B16UL 43 #define FT_TRIG_SAFE_MSB 29 46 #define FT_TRIG_MAX_ITERS 23 49 ft_trig_arctan_table[] =
51 1740967L, 919879L, 466945L, 234379L, 117304L, 58666L, 29335L,
52 14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,
53 57L, 29L, 14L, 7L, 4L, 2L, 1L
73 return ( s >= 0 ) ?
val : -
val;
96 lo1 = k1 * v2 + k2 *
v1;
98 lo2 = ( k2 *
v2 ) >> 16;
108 return ( s >= 0 ) ?
val : -
val;
173 arctanptr = ft_trig_arctan_table;
180 xtemp = x + ( ( y +
b ) >> i );
181 y = y - ( ( x +
b ) >> i );
183 theta += *arctanptr++;
187 xtemp = x - ( ( y +
b ) >> i );
188 y = y + ( ( x +
b ) >> i );
190 theta -= *arctanptr++;
200 ft_trig_pseudo_polarize(
FT_Vector* vec )
243 arctanptr = ft_trig_arctan_table;
250 xtemp = x + ( ( y +
b ) >> i );
251 y = y - ( ( x +
b ) >> i );
253 theta += *arctanptr++;
257 xtemp = x - ( ( y +
b ) >> i );
258 y = y + ( ( x +
b ) >> i );
260 theta -= *arctanptr++;
285 ft_trig_pseudo_rotate( &v,
angle );
287 return ( v.
x + 0x80L ) >> 8;
310 ft_trig_pseudo_rotate( &v,
angle );
325 if ( dx == 0 && dy == 0 )
330 ft_trig_prenorm( &v );
331 ft_trig_pseudo_polarize( &v );
345 ft_trig_pseudo_rotate( vec,
angle );
346 vec->
x = ( vec->
x + 0x80L ) >> 8;
347 vec->
y = ( vec->
y + 0x80L ) >> 8;
353 #define FT_SIGN_LONG( x ) ( (x) >> ( FT_SIZEOF_LONG * 8 - 1 ) ) 354 #define FT_SIGN_INT( x ) ( (x) >> ( FT_SIZEOF_INT * 8 - 1 ) ) 355 #define FT_SIGN_INT32( x ) ( (x) >> 31 ) 356 #define FT_SIGN_INT16( x ) ( (x) >> 15 ) 372 if ( angle && ( v.
x != 0 || v.
y != 0 ) )
374 shift = ft_trig_prenorm( &v );
375 ft_trig_pseudo_rotate( &v, angle );
376 v.
x = ft_trig_downscale( v.
x );
377 v.
y = ft_trig_downscale( v.
y );
419 shift = ft_trig_prenorm( &v );
420 ft_trig_pseudo_polarize( &v );
422 v.
x = ft_trig_downscale( v.
x );
425 return ( v.
x + ( 1 << ( shift - 1 ) ) ) >> shift;
444 if ( v.
x == 0 && v.
y == 0 )
447 shift = ft_trig_prenorm( &v );
448 ft_trig_pseudo_polarize( &v );
450 v.
x = ft_trig_downscale( v.
x );
452 *
length = ( shift >= 0 ) ? ( v.
x >> shift )
GLenum GLuint GLenum GLsizei length
FT_DivFix(FT_Long a, FT_Long b)
FT_BEGIN_HEADER typedef signed long FT_Pos
GLfloat GLfloat GLfloat v2
GLint GLint GLint GLint GLint GLint y
#define FT_TRIG_MAX_ITERS
GLint GLint GLint GLint GLint x
GLboolean GLboolean GLboolean b
FT_Atan2(FT_Fixed dx, FT_Fixed dy)
FT_Vector_From_Polar(FT_Vector *vec, FT_Fixed length, FT_Angle angle)
#define FT_PAD_ROUND(x, n)
FT_Vector_Rotate(FT_Vector *vec, FT_Angle angle)
FT_BEGIN_HEADER typedef FT_Fixed FT_Angle
FT_Vector_Unit(FT_Vector *vec, FT_Angle angle)
FT_Angle_Diff(FT_Angle angle1, FT_Angle angle2)
FT_Vector_Length(FT_Vector *vec)
struct FT_Int64_ FT_Int64
FT_Vector_Polarize(FT_Vector *vec, FT_Fixed *length, FT_Angle *angle)