37 #include FT_TRIGONOMETRY_H 38 #include FT_INTERNAL_CALC_H 39 #include FT_INTERNAL_DEBUG_H 40 #include FT_INTERNAL_OBJECTS_H 43 #ifdef FT_MULFIX_ASSEMBLER 68 #define FT_COMPONENT trace_calc 73 #define FT_MOVE_SIGN( x, x_unsigned, s ) \ 77 x_unsigned = 0U - (x_unsigned); \ 90 return (
ADD_LONG(
a, 0x8000L - (
a < 0 ) ) ) & ~0xFFFF
L;
120 if (
z & 0xFFFF0000UL )
125 if (
z & 0x0000FF00UL )
130 if (
z & 0x000000F0UL )
135 if (
z & 0x0000000CUL )
140 if (
z & 0x00000002UL )
179 FT_UInt64
a,
b,
c,
d;
191 d =
c > 0 ? (
a *
b + (
c >> 1 ) ) /
c 208 FT_UInt64
a,
b,
c,
d;
220 d =
c > 0 ?
a *
b /
c 235 #ifdef FT_MULFIX_ASSEMBLER 237 return FT_MULFIX_ASSEMBLER( (FT_Int32)a_, (FT_Int32)b_ );
244 return (
FT_Long)( (
ab + 0x8000
L - ( ab < 0 ) ) >> 16 );
267 q =
b > 0 ? ( (
a << 16 ) + (
b >> 1 ) ) /
b 284 FT_UInt32 lo1, hi1, lo2, hi2, lo, hi, i1, i2;
287 lo1 =
x & 0x0000FFFF
U; hi1 =
x >> 16;
288 lo2 =
y & 0x0000FFFF
U; hi2 =
y >> 16;
297 hi += (FT_UInt32)( i1 < i2 ) << 16;
321 return (FT_UInt32)0x7FFFFFFF
L;
329 r = ( hi <<
i ) | ( lo >> ( 32 -
i ) ); lo <<=
i;
337 r = (
r << 1 ) | ( lo >> 31 ); lo <<= 1;
359 hi =
x->hi +
y->hi + ( lo <
x->lo );
437 else if (
a +
b <= 129894
UL - (
c >> 17 ) )
438 a = (
a *
b + (
c >> 1 ) ) /
c;
485 else if (
a +
b <= 131071
UL )
512 #ifdef FT_MULFIX_ASSEMBLER 514 return FT_MULFIX_ASSEMBLER( a_, b_ );
547 sa = ( a_ >> (
sizeof ( a_ ) * 8 - 1 ) );
548 a = ( a_ ^
sa ) -
sa;
549 sb = ( b_ >> (
sizeof ( b_ ) * 8 - 1 ) );
550 b = ( b_ ^
sb ) -
sb;
555 if (
a + (
b >> 8 ) <= 8190
UL )
556 a = (
a *
b + 0x8000U ) >> 16;
559 FT_UInt32 al =
a & 0xFFFF
UL;
562 a = (
a >> 16 ) *
b + al * (
b >> 16 ) +
563 ( ( al * (
b & 0xFFFF
UL ) + 0x8000UL ) >> 16 );
585 if (
a + (
b >> 8 ) <= 8190
UL )
586 a = (
a *
b + 0x8000
UL ) >> 16;
589 FT_UInt32 al =
a & 0xFFFF
UL;
592 a = (
a >> 16 ) *
b + al * (
b >> 16 ) +
593 ( ( al * (
b & 0xFFFF
UL ) + 0x8000UL ) >> 16 );
629 else if (
a <= 65535
UL - (
b >> 17 ) )
632 q = ( (
a << 16 ) + (
b >> 1 ) ) /
b;
695 return FT_THROW( Invalid_Argument );
702 return FT_THROW( Invalid_Argument );
781 FT_UInt32
x,
y,
u,
v,
l;
809 l =
x >
y ?
x + (
y >> 1 )
821 l =
x >
y ?
x + (
y >> 1 )
832 b = 0x10000 - (FT_Int32)
l;
840 u = (FT_UInt32)( x_ + ( x_ *
b >> 16 ) );
841 v = (FT_UInt32)( y_ + ( y_ *
b >> 16 ) );
846 z = -(FT_Int32)(
u *
u +
v *
v ) / 0x200;
847 z =
z * ( ( 0x10000 +
b ) >> 8 ) / 0x10000;
859 l = (FT_UInt32)( 0x10000 + (FT_Int32)(
u *
x +
v *
y ) / 0x10000 );
874 FT_SqrtFixed( FT_Int32
x )
876 FT_UInt32
root, rem_hi, rem_lo, test_div;
885 rem_lo = (FT_UInt32)
x;
889 rem_hi = ( rem_hi << 2 ) | ( rem_lo >> 30 );
892 test_div = (
root << 1 ) + 1;
894 if ( rem_hi >= test_div )
902 return (FT_Int32)
root;
921 return ( delta > 0 ) - ( delta < 0 );
950 ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 );
951 ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 );
955 else if ( z1.
hi < z2.
hi )
957 else if ( z1.
lo > z2.
lo )
959 else if ( z1.
lo < z2.
lo )
983 FT_Pos d_in, d_out, d_hypot;
1013 return ( d_in + d_out - d_hypot ) < ( d_hypot >> 4 );
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
FT_Matrix_Multiply_Scaled(const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
FT_Matrix_Multiply(const FT_Matrix *a, FT_Matrix *b)
FT_BEGIN_HEADER typedef signed long FT_Pos
ft_corner_orientation(FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
FT_DivFix(FT_Long a_, FT_Long b_)
static FT_UInt32 ft_div64by32(FT_UInt32 hi, FT_UInt32 lo, FT_UInt32 y)
GLdouble GLdouble GLdouble r
GLuint GLuint GLsizei count
#define FT_MOVE_SIGN(x, x_unsigned, s)
GLint GLint GLint GLint GLint x
FT_MulDiv(FT_Long a_, FT_Long b_, FT_Long c_)
FT_MulDiv_No_Round(FT_Long a_, FT_Long b_, FT_Long c_)
ecx edi ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx ecx mm0 mm4 mm0 mm4 mm1 mm5 mm1 mm5 mm2 mm6 mm2 mm6 mm3 mm7 mm3 mm7 paddd mm0 paddd mm4 paddd mm0 paddd mm4 paddd mm0 paddd mm4 movq mm1 movq mm5 mm1 mm5 paddd mm0 paddd mm4 mm0 mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 mm1 paddd mm0 mm0 packssdw mm0 movd eax movw ax
ft_corner_is_flat(FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
UCHAR ab[sizeof("Hello World!") -1]
FT_Vector_Transform_Scaled(FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
static void FT_Add64(FT_Int64 *x, FT_Int64 *y, FT_Int64 *z)
GLboolean GLboolean GLboolean b
FT_Matrix_Invert(FT_Matrix *matrix)
FT_Vector_NormLen(FT_Vector *vector)
FT_Hypot(FT_Fixed x, FT_Fixed y)
GLdouble GLdouble GLdouble GLdouble q
static void ft_multo64(FT_UInt32 x, FT_UInt32 y, FT_Int64 *z)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
FT_MulFix(FT_Long a_, FT_Long b_)
GLint GLint GLint GLint GLint GLint y
FT_Vector_Length(FT_Vector *vec)
struct FT_Int64_ FT_Int64
GLboolean GLboolean GLboolean GLboolean a
static struct sockaddr_in sa