w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ftcalc.h File Reference
#include <freetype/freetype.h>
#include "compiler-macros.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)   ( ( (x) + 32 - ( x < 0 ) ) & -64 )
 
#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_Long FT_MulDiv_No_Round (FT_Long a, FT_Long b, FT_Long c)
 
void FT_Matrix_Multiply_Scaled (const FT_Matrix *a, FT_Matrix *b, FT_Long scaling)
 
FT_Bool FT_Matrix_Check (const FT_Matrix *matrix)
 
void FT_Vector_Transform_Scaled (FT_Vector *vector, const FT_Matrix *matrix, FT_Long scaling)
 
FT_UInt32 FT_Vector_NormLen (FT_Vector *vector)
 
FT_Int ft_corner_orientation (FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
 
FT_Int ft_corner_is_flat (FT_Pos in_x, FT_Pos in_y, FT_Pos out_x, FT_Pos out_y)
 
FT_Int FT_MSB (FT_UInt32 z)
 
FT_Fixed 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 463 of file ftcalc.h.

◆ ADD_INT32

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

Definition at line 481 of file ftcalc.h.

◆ ADD_LONG

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

Definition at line 472 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 467 of file ftcalc.h.

◆ MUL_INT32

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

Definition at line 485 of file ftcalc.h.

◆ MUL_LONG

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

Definition at line 476 of file ftcalc.h.

◆ NEG_INT

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

Definition at line 469 of file ftcalc.h.

◆ NEG_INT32

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

Definition at line 487 of file ftcalc.h.

◆ NEG_LONG

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

Definition at line 478 of file ftcalc.h.

◆ ROUND_F26DOT6

#define ROUND_F26DOT6 (   x)    ( ( (x) + 32 - ( x < 0 ) ) & -64 )

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 465 of file ftcalc.h.

◆ SUB_INT32

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

Definition at line 483 of file ftcalc.h.

◆ SUB_LONG

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

Definition at line 474 of file ftcalc.h.

Function Documentation

◆ ft_corner_is_flat()

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

Definition at line 1046 of file ftcalc.c.

References FT_HYPOT, and FT_Pos.

Referenced by af_glyph_hints_reload().

◆ ft_corner_orientation()

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

Definition at line 980 of file ftcalc.c.

References ADD_LONG, delta, FT_ABS, ft_multo64(), MUL_LONG, check-static-inits::result, z1, and z2.

◆ FT_Hypot()

FT_Fixed FT_Hypot ( FT_Fixed  x,
FT_Fixed  y 
)

Definition at line 154 of file ftcalc.c.

References FT_Vector_Length(), v, cordic::x, and y.

Referenced by TT_Process_Composite_Component().

◆ FT_Matrix_Check()

FT_Bool FT_Matrix_Check ( const FT_Matrix matrix)

◆ FT_Matrix_Multiply_Scaled()

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

Definition at line 719 of file ftcalc.c.

References a, ADD_LONG, b, FT_MulDiv(), xx, and yy.

Referenced by cff_face_init().

◆ FT_MSB()

FT_Int FT_MSB ( FT_UInt32  z)

◆ FT_MulDiv_No_Round()

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

ftcalc.h

Arithmetic computations (specification).

Copyright (C) 1996-2020 by David Turner, Robert Wilhelm, and Werner Lemberg.

This file is part of the FreeType project, and may only be used, modified, and distributed under the terms of the FreeType project license, LICENSE.TXT. By continuing to use, modify, or distribute this file you indicate that you have read the license and understand and accept it fully. FT_MulDiv() and FT_MulFix() are declared in freetype.h. @function: FT_MulDiv_No_Round

@description: A very simple function used to perform the computation '(a*b)/c' (without rounding) with maximum accuracy (it uses a 64-bit intermediate integer whenever necessary).

This function isn't necessarily as fast as some processor-specific operations, but is at least completely portable.

@input: a :: The first multiplier. b :: The second multiplier. c :: The divisor.

Returns
: The result of '(a*b)/c'. This function never traps when trying to divide by zero; it simply returns 'MaxInt' or 'MinInt' depending on the signs of 'a' and 'b'.

Definition at line 463 of file ftcalc.c.

References a, b, c, ft_div64by32(), FT_MOVE_SIGN, ft_multo64(), NEG_LONG, s, and temp.

◆ FT_Vector_NormLen()

FT_UInt32 FT_Vector_NormLen ( FT_Vector vector)

Definition at line 845 of file ftcalc.c.

References b, FT_MOVE_SIGN, FT_MSB(), FT_Pos, cutout::l, shift, u, v, cordic::x, y, and z.

Referenced by FT_Outline_EmboldenXY().

◆ FT_Vector_Transform_Scaled()

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

Definition at line 820 of file ftcalc.c.

References ADD_LONG, FT_MulDiv(), FT_Pos, and matrix().

Referenced by cff_face_init().