fttrigon.c File Reference

#include <ft2build.h>

Go to the source code of this file.

Defines

#define FT_TRIG_COSCALE   0x11616E8EUL
#define FT_TRIG_MAX_ITERS   23
#define FT_TRIG_SCALE   1166391785UL
#define FT_SIGN_LONG(x)   ( (x) >> ( FT_SIZEOF_LONG * 8 - 1 ) )
#define FT_SIGN_INT(x)   ( (x) >> ( FT_SIZEOF_INT * 8 - 1 ) )
#define FT_SIGN_INT32(x)   ( (x) >> 31 )
#define FT_SIGN_INT16(x)   ( (x) >> 15 )

Functions

static FT_Fixed ft_trig_downscale (FT_Fixed val)
static FT_Int ft_trig_prenorm (FT_Vector *vec)
static void ft_trig_pseudo_rotate (FT_Vector *vec, FT_Angle theta)
static void ft_trig_pseudo_polarize (FT_Vector *vec)
 FT_Cos (FT_Angle angle)
 FT_Sin (FT_Angle angle)
 FT_Tan (FT_Angle angle)
 FT_Atan2 (FT_Fixed dx, FT_Fixed dy)
 FT_Vector_Unit (FT_Vector *vec, FT_Angle angle)
 FT_Vector_Rotate (FT_Vector *vec, FT_Angle angle)
 FT_Vector_Length (FT_Vector *vec)
 FT_Vector_Polarize (FT_Vector *vec, FT_Fixed *length, FT_Angle *angle)
 FT_Vector_From_Polar (FT_Vector *vec, FT_Fixed length, FT_Angle angle)
 FT_Angle_Diff (FT_Angle angle1, FT_Angle angle2)

Variables

static const FT_Fixed ft_trig_arctan_table [24]


Define Documentation

#define FT_SIGN_INT ( x   )     ( (x) >> ( FT_SIZEOF_INT * 8 - 1 ) )

Definition at line 409 of file fttrigon.c.

#define FT_SIGN_INT16 ( x   )     ( (x) >> 15 )

Definition at line 411 of file fttrigon.c.

#define FT_SIGN_INT32 ( x   )     ( (x) >> 31 )

Definition at line 410 of file fttrigon.c.

#define FT_SIGN_LONG ( x   )     ( (x) >> ( FT_SIZEOF_LONG * 8 - 1 ) )

Definition at line 408 of file fttrigon.c.

Referenced by FT_Vector_Rotate().

#define FT_TRIG_COSCALE   0x11616E8EUL

Definition at line 25 of file fttrigon.c.

Referenced by FT_Cos(), FT_Tan(), and FT_Vector_Unit().

#define FT_TRIG_MAX_ITERS   23

Definition at line 28 of file fttrigon.c.

Referenced by ft_trig_pseudo_polarize(), and ft_trig_pseudo_rotate().

#define FT_TRIG_SCALE   1166391785UL

Definition at line 39 of file fttrigon.c.

Referenced by ft_trig_downscale().


Function Documentation

FT_Angle_Diff ( FT_Angle  angle1,
FT_Angle  angle2 
)

Definition at line 529 of file fttrigon.c.

References FT_Angle, FT_ANGLE_2PI, and FT_ANGLE_PI.

Referenced by ft_conic_is_small_enough(), ft_cubic_is_small_enough(), FT_Outline_Embolden(), ft_stroker_arcto(), FT_Stroker_ConicTo(), FT_Stroker_EndSubPath(), ft_stroker_inside(), ft_stroker_outside(), and ft_stroker_process_corner().

FT_Atan2 ( FT_Fixed  dx,
FT_Fixed  dy 
)

Definition at line 374 of file fttrigon.c.

References ft_trig_prenorm(), and ft_trig_pseudo_polarize().

Referenced by ft_conic_is_small_enough(), ft_cubic_is_small_enough(), FT_Outline_Embolden(), FT_Stroker_LineTo(), and test_atan2().

FT_Cos ( FT_Angle  angle  ) 

Definition at line 333 of file fttrigon.c.

References FT_TRIG_COSCALE, and ft_trig_pseudo_rotate().

Referenced by FT_Outline_Embolden(), FT_Sin(), ft_stroke_border_arcto(), FT_Stroker_ConicTo(), FT_Stroker_CubicTo(), ft_stroker_inside(), ft_stroker_outside(), and test_cos().

FT_Sin ( FT_Angle  angle  ) 

Definition at line 349 of file fttrigon.c.

References FT_ANGLE_PI2, and FT_Cos().

Referenced by ft_stroke_border_arcto(), ft_stroker_outside(), and test_sin().

FT_Tan ( FT_Angle  angle  ) 

Definition at line 358 of file fttrigon.c.

References FT_DivFix(), FT_TRIG_COSCALE, and ft_trig_pseudo_rotate().

Referenced by test_tan().

static FT_Fixed ft_trig_downscale ( FT_Fixed  val  )  [static]

Definition at line 65 of file fttrigon.c.

References FT_TRIG_SCALE, hi, Rgl::Mc::k1, Rgl::Mc::k2, s, and v1.

Referenced by FT_Vector_Length(), FT_Vector_Polarize(), and FT_Vector_Rotate().

static FT_Int ft_trig_prenorm ( FT_Vector vec  )  [static]

Definition at line 100 of file fttrigon.c.

References RooFitShortHand::L(), FT_Vector_::x, x, FT_Vector_::y, and y.

Referenced by FT_Atan2(), FT_Vector_Length(), FT_Vector_Polarize(), and FT_Vector_Rotate().

static void ft_trig_pseudo_polarize ( FT_Vector vec  )  [static]

Definition at line 256 of file fttrigon.c.

References FT_ANGLE_PI2, FT_PAD_ROUND, ft_trig_arctan_table, FT_TRIG_MAX_ITERS, i, theta, FT_Vector_::x, x, FT_Vector_::y, and y.

Referenced by FT_Atan2(), FT_Vector_Length(), and FT_Vector_Polarize().

static void ft_trig_pseudo_rotate ( FT_Vector vec,
FT_Angle  theta 
) [static]

Definition at line 186 of file fttrigon.c.

References FT_ANGLE_PI, FT_ANGLE_PI2, ft_trig_arctan_table, FT_TRIG_MAX_ITERS, i, FT_Vector_::x, x, FT_Vector_::y, and y.

Referenced by FT_Cos(), FT_Tan(), FT_Vector_Rotate(), and FT_Vector_Unit().

FT_Vector_From_Polar ( FT_Vector vec,
FT_Fixed  length,
FT_Angle  angle 
)

Definition at line 515 of file fttrigon.c.

References FT_Vector_Rotate().

Referenced by FT_Outline_Embolden(), ft_stroke_border_arcto(), ft_stroker_cap(), FT_Stroker_ConicTo(), FT_Stroker_CubicTo(), ft_stroker_inside(), FT_Stroker_LineTo(), ft_stroker_outside(), and ft_stroker_subpath_start().

FT_Vector_Length ( FT_Vector vec  ) 

Definition at line 455 of file fttrigon.c.

References ft_trig_downscale(), ft_trig_prenorm(), and ft_trig_pseudo_polarize().

Referenced by test_length().

FT_Vector_Polarize ( FT_Vector vec,
FT_Fixed length,
FT_Angle angle 
)

Definition at line 489 of file fttrigon.c.

References ft_trig_downscale(), ft_trig_prenorm(), and ft_trig_pseudo_polarize().

FT_Vector_Rotate ( FT_Vector vec,
FT_Angle  angle 
)

Definition at line 417 of file fttrigon.c.

References FT_SIGN_LONG, ft_trig_downscale(), ft_trig_prenorm(), ft_trig_pseudo_rotate(), and RooFitShortHand::L().

Referenced by FT_Vector_From_Polar(), and test_rotate().

FT_Vector_Unit ( FT_Vector vec,
FT_Angle  angle 
)

Definition at line 395 of file fttrigon.c.

References FT_TRIG_COSCALE, and ft_trig_pseudo_rotate().

Referenced by test_unit().


Variable Documentation

const FT_Fixed ft_trig_arctan_table[24] [static]

Initial value:

  {
    4157273L, 2949120L, 1740967L, 919879L, 466945L, 234379L, 117304L,
    58666L, 29335L, 14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,
    57L, 29L, 14L, 7L, 4L, 2L, 1L
  }

Definition at line 31 of file fttrigon.c.

Referenced by ft_trig_pseudo_polarize(), and ft_trig_pseudo_rotate().


Generated on Tue Jul 5 15:58:22 2011 for ROOT_528-00b_version by  doxygen 1.5.1