ReactOS 0.4.16-dev-1019-g2c2cdfd
ftcalc.h File Reference
#include <ft2build.h>
Include dependency graph for ftcalc.h:

Go to the source code of this file.

Macros

#define INT_TO_F26DOT6(x)   ( (FT_Long)(x) * 64 ) /* << 6 */
 
#define INT_TO_F2DOT14(x)   ( (FT_Long)(x) * 16384 ) /* << 14 */
 
#define INT_TO_FIXED(x)   ( (FT_Long)(x) * 65536 ) /* << 16 */
 
#define F2DOT14_TO_FIXED(x)   ( (FT_Long)(x) * 4 ) /* << 2 */
 
#define FIXED_TO_INT(x)   ( FT_RoundFix( x ) >> 16 )
 
#define ROUND_F26DOT6(x)
 
#define ADD_INT(a, b)    (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )
 
#define SUB_INT(a, b)    (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )
 
#define MUL_INT(a, b)    (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )
 
#define NEG_INT(a)    (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )
 
#define ADD_LONG(a, b)    (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )
 
#define SUB_LONG(a, b)    (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )
 
#define MUL_LONG(a, b)    (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )
 
#define NEG_LONG(a)    (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )
 
#define ADD_INT32(a, b)    (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )
 
#define SUB_INT32(a, b)    (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )
 
#define MUL_INT32(a, b)    (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )
 
#define NEG_INT32(a)    (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
 

Functions

FT_BEGIN_HEADER FT_MulDiv_No_Round (FT_Long a, FT_Long b, FT_Long c)
 
 FT_Matrix_Multiply_Scaled (const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
 
 FT_Matrix_Check (const FT_Matrix *matrix)
 
 FT_Vector_Transform_Scaled (FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
 
 FT_Vector_NormLen (FT_Vector *vector)
 
 ft_corner_orientation (FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
 
 ft_corner_is_flat (FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
 
 FT_MSB (FT_UInt32 z)
 
 FT_Hypot (FT_Fixed x, FT_Fixed y)
 

Macro Definition Documentation

◆ ADD_INT

#define ADD_INT (   a,
  b 
)     (FT_Int)( (FT_UInt)(a) + (FT_UInt)(b) )

Definition at line 464 of file ftcalc.h.

◆ ADD_INT32

#define ADD_INT32 (   a,
  b 
)     (FT_Int32)( (FT_UInt32)(a) + (FT_UInt32)(b) )

Definition at line 482 of file ftcalc.h.

◆ ADD_LONG

#define ADD_LONG (   a,
  b 
)     (FT_Long)( (FT_ULong)(a) + (FT_ULong)(b) )

Definition at line 473 of file ftcalc.h.

◆ F2DOT14_TO_FIXED

#define F2DOT14_TO_FIXED (   x)    ( (FT_Long)(x) * 4 ) /* << 2 */

Definition at line 449 of file ftcalc.h.

◆ FIXED_TO_INT

#define FIXED_TO_INT (   x)    ( FT_RoundFix( x ) >> 16 )

Definition at line 450 of file ftcalc.h.

◆ INT_TO_F26DOT6

#define INT_TO_F26DOT6 (   x)    ( (FT_Long)(x) * 64 ) /* << 6 */

Definition at line 446 of file ftcalc.h.

◆ INT_TO_F2DOT14

#define INT_TO_F2DOT14 (   x)    ( (FT_Long)(x) * 16384 ) /* << 14 */

Definition at line 447 of file ftcalc.h.

◆ INT_TO_FIXED

#define INT_TO_FIXED (   x)    ( (FT_Long)(x) * 65536 ) /* << 16 */

Definition at line 448 of file ftcalc.h.

◆ MUL_INT

#define MUL_INT (   a,
  b 
)     (FT_Int)( (FT_UInt)(a) * (FT_UInt)(b) )

Definition at line 468 of file ftcalc.h.

◆ MUL_INT32

#define MUL_INT32 (   a,
  b 
)     (FT_Int32)( (FT_UInt32)(a) * (FT_UInt32)(b) )

Definition at line 486 of file ftcalc.h.

◆ MUL_LONG

#define MUL_LONG (   a,
  b 
)     (FT_Long)( (FT_ULong)(a) * (FT_ULong)(b) )

Definition at line 477 of file ftcalc.h.

◆ NEG_INT

#define NEG_INT (   a)     (FT_Int)( (FT_UInt)0 - (FT_UInt)(a) )

Definition at line 470 of file ftcalc.h.

◆ NEG_INT32

#define NEG_INT32 (   a)     (FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )

Definition at line 488 of file ftcalc.h.

◆ NEG_LONG

#define NEG_LONG (   a)     (FT_Long)( (FT_ULong)0 - (FT_ULong)(a) )

Definition at line 479 of file ftcalc.h.

◆ ROUND_F26DOT6

#define ROUND_F26DOT6 (   x)
Value:
( x >= 0 ? ( ( (x) + 32 ) & -64 ) \
: ( -( ( 32 - (x) ) & -64 ) ) )
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Definition at line 452 of file ftcalc.h.

◆ SUB_INT

#define SUB_INT (   a,
  b 
)     (FT_Int)( (FT_UInt)(a) - (FT_UInt)(b) )

Definition at line 466 of file ftcalc.h.

◆ SUB_INT32

#define SUB_INT32 (   a,
  b 
)     (FT_Int32)( (FT_UInt32)(a) - (FT_UInt32)(b) )

Definition at line 484 of file ftcalc.h.

◆ SUB_LONG

#define SUB_LONG (   a,
  b 
)     (FT_Long)( (FT_ULong)(a) - (FT_ULong)(b) )

Definition at line 475 of file ftcalc.h.

Function Documentation

◆ ft_corner_is_flat()

ft_corner_is_flat ( FT_Pos  in_x,
FT_Pos  in_y,
FT_Pos  out_x,
FT_Pos  out_y 
)

Definition at line 1047 of file ftcalc.c.

1051 {
1052 FT_Pos ax = in_x + out_x;
1053 FT_Pos ay = in_y + out_y;
1054
1055 FT_Pos d_in, d_out, d_hypot;
1056
1057
1058 /* The idea of this function is to compare the length of the */
1059 /* hypotenuse with the `in' and `out' length. The `corner' */
1060 /* represented by `in' and `out' is flat if the hypotenuse's */
1061 /* length isn't too large. */
1062 /* */
1063 /* This approach has the advantage that the angle between */
1064 /* `in' and `out' is not checked. In case one of the two */
1065 /* vectors is `dominant', this is, much larger than the */
1066 /* other vector, we thus always have a flat corner. */
1067 /* */
1068 /* hypotenuse */
1069 /* x---------------------------x */
1070 /* \ / */
1071 /* \ / */
1072 /* in \ / out */
1073 /* \ / */
1074 /* o */
1075 /* Point */
1076
1077 d_in = FT_HYPOT( in_x, in_y );
1078 d_out = FT_HYPOT( out_x, out_y );
1079 d_hypot = FT_HYPOT( ax, ay );
1080
1081 /* now do a simple length comparison: */
1082 /* */
1083 /* d_in + d_out < 17/16 d_hypot */
1084
1085 return ( d_in + d_out - d_hypot ) < ( d_hypot >> 4 );
1086 }
FT_BEGIN_HEADER typedef signed long FT_Pos
Definition: ftimage.h:58
#define FT_HYPOT(x, y)
Definition: ftobjs.h:80
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esp ecx subl ebx pushl ecx ecx edx ecx shrl 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 psrlq mm1 psrlq mm5 paddd mm0 paddd mm4 psrad mm0 psrad mm4 packssdw mm0 packssdw mm4 mm1 punpckldq mm0 pand mm1 pand mm0 por mm1 movq edi esi edx edi decl ecx jnz popl ecx andl ecx jecxz mm0 mm0 mm1 mm1 mm2 mm2 mm3 mm3 paddd mm0 paddd mm0 paddd mm0 movq mm1 psrlq mm1 paddd mm0 psrad mm0 packssdw mm0 movd eax movw ax
Definition: synth_sse3d.h:180

Referenced by af_glyph_hints_reload().

◆ ft_corner_orientation()

ft_corner_orientation ( FT_Pos  in_x,
FT_Pos  in_y,
FT_Pos  out_x,
FT_Pos  out_y 
)

Definition at line 981 of file ftcalc.c.

985 {
986 /* we silently ignore overflow errors since such large values */
987 /* lead to even more (harmless) rendering errors later on */
988
989#ifdef FT_LONG64
990
991 FT_Int64 delta = SUB_INT64( MUL_INT64( in_x, out_y ),
992 MUL_INT64( in_y, out_x ) );
993
994
995 return ( delta > 0 ) - ( delta < 0 );
996
997#else
998
1000
1001
1002 if ( ADD_LONG( FT_ABS( in_x ), FT_ABS( out_y ) ) <= 131071L &&
1003 ADD_LONG( FT_ABS( in_y ), FT_ABS( out_x ) ) <= 131071L )
1004 {
1005 FT_Long z1 = MUL_LONG( in_x, out_y );
1006 FT_Long z2 = MUL_LONG( in_y, out_x );
1007
1008
1009 if ( z1 > z2 )
1010 result = +1;
1011 else if ( z1 < z2 )
1012 result = -1;
1013 else
1014 result = 0;
1015 }
1016 else /* products might overflow 32 bits */
1017 {
1018 FT_Int64 z1, z2;
1019
1020
1021 /* XXX: this function does not allow 64-bit arguments */
1022 ft_multo64( (FT_UInt32)in_x, (FT_UInt32)out_y, &z1 );
1023 ft_multo64( (FT_UInt32)in_y, (FT_UInt32)out_x, &z2 );
1024
1025 if ( z1.hi > z2.hi )
1026 result = +1;
1027 else if ( z1.hi < z2.hi )
1028 result = -1;
1029 else if ( z1.lo > z2.lo )
1030 result = +1;
1031 else if ( z1.lo < z2.lo )
1032 result = -1;
1033 else
1034 result = 0;
1035 }
1036
1037 /* XXX: only the sign of return value, +1/0/-1 must be used */
1038 return result;
1039
1040#endif
1041 }
static void ft_multo64(FT_UInt32 x, FT_UInt32 y, FT_Int64 *z)
Definition: ftcalc.c:280
#define MUL_LONG(a, b)
Definition: ftcalc.h:477
#define ADD_LONG(a, b)
Definition: ftcalc.h:473
#define FT_ABS(a)
Definition: ftobjs.h:73
signed long FT_Long
Definition: fttypes.h:242
signed int FT_Int
Definition: fttypes.h:220
GLuint64EXT * result
Definition: glext.h:11304
FT_UInt32 lo
Definition: ftcalc.c:53
FT_UInt32 hi
Definition: ftcalc.c:54

◆ FT_Hypot()

FT_Hypot ( FT_Fixed  x,
FT_Fixed  y 
)

Definition at line 155 of file ftcalc.c.

157 {
158 FT_Vector v;
159
160
161 v.x = x;
162 v.y = y;
163
164 return FT_Vector_Length( &v );
165 }
FT_Vector_Length(FT_Vector *vec)
Definition: fttrigon.c:418
const GLdouble * v
Definition: gl.h:2040
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by TT_Process_Composite_Component().

◆ FT_Matrix_Check()

FT_Matrix_Check ( const FT_Matrix matrix)

Definition at line 751 of file ftcalc.c.

752 {
753 FT_Matrix m;
754 FT_Fixed val[4];
755 FT_Fixed nonzero_minval, maxval;
756 FT_Fixed temp1, temp2;
757 FT_UInt i;
758
759
760 if ( !matrix )
761 return 0;
762
763 val[0] = FT_ABS( matrix->xx );
764 val[1] = FT_ABS( matrix->xy );
765 val[2] = FT_ABS( matrix->yx );
766 val[3] = FT_ABS( matrix->yy );
767
768 /*
769 * To avoid overflow, we ensure that each value is not larger than
770 *
771 * int(sqrt(2^31 / 4)) = 23170 ;
772 *
773 * we also check that no value becomes zero if we have to scale.
774 */
775
776 maxval = 0;
777 nonzero_minval = FT_LONG_MAX;
778
779 for ( i = 0; i < 4; i++ )
780 {
781 if ( val[i] > maxval )
782 maxval = val[i];
783 if ( val[i] && val[i] < nonzero_minval )
784 nonzero_minval = val[i];
785 }
786
787 /* we only handle 32bit values */
788 if ( maxval > 0x7FFFFFFFL )
789 return 0;
790
791 if ( maxval > 23170 )
792 {
793 FT_Fixed scale = FT_DivFix( maxval, 23170 );
794
795
796 if ( !FT_DivFix( nonzero_minval, scale ) )
797 return 0; /* value range too large */
798
799 m.xx = FT_DivFix( matrix->xx, scale );
800 m.xy = FT_DivFix( matrix->xy, scale );
801 m.yx = FT_DivFix( matrix->yx, scale );
802 m.yy = FT_DivFix( matrix->yy, scale );
803 }
804 else
805 m = *matrix;
806
807 temp1 = FT_ABS( m.xx * m.yy - m.xy * m.yx );
808 temp2 = m.xx * m.xx + m.xy * m.xy + m.yx * m.yx + m.yy * m.yy;
809
810 if ( temp1 == 0 ||
811 temp2 / temp1 > 50 )
812 return 0;
813
814 return 1;
815 }
FT_DivFix(FT_Long a_, FT_Long b_)
Definition: ftcalc.c:608
#define FT_LONG_MAX
Definition: ftstdlib.h:67
signed long FT_Fixed
Definition: fttypes.h:287
unsigned int FT_UInt
Definition: fttypes.h:231
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
GLuint GLenum matrix
Definition: glext.h:9407
GLuint GLfloat * val
Definition: glext.h:7180
const GLfloat * m
Definition: glext.h:10848
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
Definition: glfuncs.h:248

Referenced by cff_parse_font_matrix(), cid_parse_font_matrix(), t1_parse_font_matrix(), and t42_parse_font_matrix().

◆ FT_Matrix_Multiply_Scaled()

FT_Matrix_Multiply_Scaled ( const FT_Matrix a,
FT_Matrix b,
FT_Long  scaling 
)

Definition at line 720 of file ftcalc.c.

723 {
724 FT_Fixed xx, xy, yx, yy;
725
726 FT_Long val = 0x10000L * scaling;
727
728
729 if ( !a || !b )
730 return;
731
732 xx = ADD_LONG( FT_MulDiv( a->xx, b->xx, val ),
733 FT_MulDiv( a->xy, b->yx, val ) );
734 xy = ADD_LONG( FT_MulDiv( a->xx, b->xy, val ),
735 FT_MulDiv( a->xy, b->yy, val ) );
736 yx = ADD_LONG( FT_MulDiv( a->yx, b->xx, val ),
737 FT_MulDiv( a->yy, b->yx, val ) );
738 yy = ADD_LONG( FT_MulDiv( a->yx, b->xy, val ),
739 FT_MulDiv( a->yy, b->yy, val ) );
740
741 b->xx = xx;
742 b->xy = xy;
743 b->yx = yx;
744 b->yy = yy;
745 }
FT_MulDiv(FT_Long a_, FT_Long b_, FT_Long c_)
Definition: ftcalc.c:416
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int xx
Definition: npserver.c:29

Referenced by cff_face_init().

◆ FT_MSB()

FT_MSB ( FT_UInt32  z)

Definition at line 114 of file ftcalc.c.

115 {
116 FT_Int shift = 0;
117
118
119 /* determine msb bit index in `shift' */
120 if ( z & 0xFFFF0000UL )
121 {
122 z >>= 16;
123 shift += 16;
124 }
125 if ( z & 0x0000FF00UL )
126 {
127 z >>= 8;
128 shift += 8;
129 }
130 if ( z & 0x000000F0UL )
131 {
132 z >>= 4;
133 shift += 4;
134 }
135 if ( z & 0x0000000CUL )
136 {
137 z >>= 2;
138 shift += 2;
139 }
140 if ( z & 0x00000002UL )
141 {
142 /* z >>= 1; */
143 shift += 1;
144 }
145
146 return shift;
147 }
GLdouble GLdouble z
Definition: glext.h:5874
#define shift
Definition: input.c:1755

Referenced by af_loader_compute_darkening(), cf2_computeDarkening(), cubic_peak(), ft_div64by32(), FT_Outline_Get_Orientation(), ft_trig_prenorm(), FT_Vector_NormLen(), and pfr_face_get_kerning().

◆ FT_MulDiv_No_Round()

FT_BEGIN_HEADER FT_MulDiv_No_Round ( FT_Long  a,
FT_Long  b,
FT_Long  c 
)

Definition at line 464 of file ftcalc.c.

467 {
468 FT_Int s = 1;
469 FT_UInt32 a, b, c;
470
471
472 /* XXX: this function does not allow 64-bit arguments */
473
474 a = (FT_UInt32)a_;
475 b = (FT_UInt32)b_;
476 c = (FT_UInt32)c_;
477
478 FT_MOVE_SIGN( a_, a, s );
479 FT_MOVE_SIGN( b_, b, s );
480 FT_MOVE_SIGN( c_, c, s );
481
482 if ( c == 0 )
483 a = 0x7FFFFFFFUL;
484
485 else if ( a + b <= 131071UL )
486 a = a * b / c;
487
488 else
489 {
491
492
493 ft_multo64( a, b, &temp );
494
495 /* last attempt to ditch long division */
496 a = ( temp.hi == 0 ) ? temp.lo / c
497 : ft_div64by32( temp.hi, temp.lo, c );
498 }
499
500 a_ = (FT_Long)a;
501
502 return s < 0 ? NEG_LONG( a_ ) : a_;
503 }
#define FT_MOVE_SIGN(x, x_unsigned, s)
Definition: ftcalc.c:73
static FT_UInt32 ft_div64by32(FT_UInt32 hi, FT_UInt32 lo, FT_UInt32 y)
Definition: ftcalc.c:312
#define NEG_LONG(a)
Definition: ftcalc.h:479
GLdouble s
Definition: gl.h:2039
const GLubyte * c
Definition: glext.h:8905
#define a
Definition: ke_i.h:78
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79
static calc_node_t temp
Definition: rpn_ieee.c:38

◆ FT_Vector_NormLen()

FT_Vector_NormLen ( FT_Vector vector)

Definition at line 846 of file ftcalc.c.

847 {
848 FT_Int32 x_ = vector->x;
849 FT_Int32 y_ = vector->y;
850 FT_Int32 b, z;
851 FT_UInt32 x, y, u, v, l;
852 FT_Int sx = 1, sy = 1, shift;
853
854
855 x = (FT_UInt32)x_;
856 y = (FT_UInt32)y_;
857
858 FT_MOVE_SIGN( x_, x, sx );
859 FT_MOVE_SIGN( y_, y, sy );
860
861 /* trivial cases */
862 if ( x == 0 )
863 {
864 if ( y > 0 )
865 vector->y = sy * 0x10000;
866 return y;
867 }
868 else if ( y == 0 )
869 {
870 if ( x > 0 )
871 vector->x = sx * 0x10000;
872 return x;
873 }
874
875 /* Estimate length and prenormalize by shifting so that */
876 /* the new approximate length is between 2/3 and 4/3. */
877 /* The magic constant 0xAAAAAAAAUL (2/3 of 2^32) helps */
878 /* achieve this in 16.16 fixed-point representation. */
879 l = x > y ? x + ( y >> 1 )
880 : y + ( x >> 1 );
881
882 shift = 31 - FT_MSB( l );
883 shift -= 15 + ( l >= ( 0xAAAAAAAAUL >> shift ) );
884
885 if ( shift > 0 )
886 {
887 x <<= shift;
888 y <<= shift;
889
890 /* re-estimate length for tiny vectors */
891 l = x > y ? x + ( y >> 1 )
892 : y + ( x >> 1 );
893 }
894 else
895 {
896 x >>= -shift;
897 y >>= -shift;
898 l >>= -shift;
899 }
900
901 /* lower linear approximation for reciprocal length minus one */
902 b = 0x10000 - (FT_Int32)l;
903
904 x_ = (FT_Int32)x;
905 y_ = (FT_Int32)y;
906
907 /* Newton's iterations */
908 do
909 {
910 u = (FT_UInt32)( x_ + ( x_ * b >> 16 ) );
911 v = (FT_UInt32)( y_ + ( y_ * b >> 16 ) );
912
913 /* Normalized squared length in the parentheses approaches 2^32. */
914 /* On two's complement systems, converting to signed gives the */
915 /* difference with 2^32 even if the expression wraps around. */
916 z = -(FT_Int32)( u * u + v * v ) / 0x200;
917 z = z * ( ( 0x10000 + b ) >> 8 ) / 0x10000;
918
919 b += z;
920
921 } while ( z > 0 );
922
923 vector->x = sx < 0 ? -(FT_Pos)u : (FT_Pos)u;
924 vector->y = sy < 0 ? -(FT_Pos)v : (FT_Pos)v;
925
926 /* Conversion to signed helps to recover from likely wrap around */
927 /* in calculating the prenormalized length, because it gives the */
928 /* correct difference with 2^32 on two's complement systems. */
929 l = (FT_UInt32)( 0x10000 + (FT_Int32)( u * x + v * y ) / 0x10000 );
930 if ( shift > 0 )
931 l = ( l + ( 1 << ( shift - 1 ) ) ) >> shift;
932 else
933 l <<= -shift;
934
935 return l;
936 }
r l[0]
Definition: byte_order.h:168
FT_MSB(FT_UInt32 z)
Definition: ftcalc.c:114
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
Definition: glfuncs.h:240

Referenced by FT_Outline_EmboldenXY().

◆ FT_Vector_Transform_Scaled()

FT_Vector_Transform_Scaled ( FT_Vector vector,
const FT_Matrix matrix,
FT_Long  scaling 
)

Definition at line 821 of file ftcalc.c.

824 {
825 FT_Pos xz, yz;
826
827 FT_Long val = 0x10000L * scaling;
828
829
830 if ( !vector || !matrix )
831 return;
832
833 xz = ADD_LONG( FT_MulDiv( vector->x, matrix->xx, val ),
834 FT_MulDiv( vector->y, matrix->xy, val ) );
835 yz = ADD_LONG( FT_MulDiv( vector->x, matrix->yx, val ),
836 FT_MulDiv( vector->y, matrix->yy, val ) );
837
838 vector->x = xz;
839 vector->y = yz;
840 }

Referenced by cff_face_init().