2001-05-12 20:04:08 +02:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* fttrigon.c */
|
|
|
|
/* */
|
|
|
|
/* FreeType trigonometric functions (body). */
|
|
|
|
/* */
|
2013-01-16 20:08:35 +01:00
|
|
|
/* Copyright 2001-2005, 2012-2013 by */
|
2001-05-12 20:04:08 +02:00
|
|
|
/* 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. */
|
|
|
|
/* */
|
|
|
|
/***************************************************************************/
|
|
|
|
|
2013-01-09 05:29:44 +01:00
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* This is a fixed-point CORDIC implementation of trigonometric */
|
|
|
|
/* functions as well as transformations between Cartesian and polar */
|
2013-01-10 20:16:20 +01:00
|
|
|
/* coordinates. The angles are represented as 16.16 fixed-point values */
|
|
|
|
/* in degrees, i.e., the angular resolution is 2^-16 degrees. Note that */
|
2013-01-09 05:29:44 +01:00
|
|
|
/* only vectors longer than 2^16*180/pi (or at least 22 bits) on a */
|
2013-01-10 20:16:20 +01:00
|
|
|
/* discrete Cartesian grid can have the same or better angular */
|
|
|
|
/* resolution. Therefore, to maintain this precision, some functions */
|
|
|
|
/* require an interim upscaling of the vectors, whereas others operate */
|
|
|
|
/* with 24-bit long vectors directly. */
|
2013-01-09 05:29:44 +01:00
|
|
|
/* */
|
|
|
|
/*************************************************************************/
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
#include <ft2build.h>
|
2003-12-26 08:26:08 +01:00
|
|
|
#include FT_INTERNAL_OBJECTS_H
|
2013-01-25 00:40:56 +01:00
|
|
|
#include FT_INTERNAL_CALC_H
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
#include FT_TRIGONOMETRY_H
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2013-01-03 04:21:37 +01:00
|
|
|
/* the Cordic shrink factor 0.858785336480436 * 2^32 */
|
2013-01-11 04:29:07 +01:00
|
|
|
#define FT_TRIG_SCALE 0xDBD95B16UL
|
|
|
|
|
2013-01-11 08:29:22 +01:00
|
|
|
/* the highest bit in overflow-safe vector components, */
|
|
|
|
/* MSB of 0.858785336480436 * sqrt(0.5) * 2^30 */
|
2013-01-11 04:29:07 +01:00
|
|
|
#define FT_TRIG_SAFE_MSB 29
|
2012-12-20 07:03:22 +01:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
/* this table was generated for FT_PI = 180L << 16, i.e. degrees */
|
2001-05-12 20:04:08 +02:00
|
|
|
#define FT_TRIG_MAX_ITERS 23
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
static const FT_Fixed
|
2013-01-03 04:21:37 +01:00
|
|
|
ft_trig_arctan_table[] =
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 04:21:37 +01:00
|
|
|
1740967L, 919879L, 466945L, 234379L, 117304L, 58666L, 29335L,
|
|
|
|
14668L, 7334L, 3667L, 1833L, 917L, 458L, 229L, 115L,
|
2001-06-18 16:23:45 +02:00
|
|
|
57L, 29L, 14L, 7L, 4L, 2L, 1L
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-11-17 11:45:24 +01:00
|
|
|
#ifdef FT_LONG64
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* multiply a given value by the CORDIC shrink factor */
|
2001-06-27 18:18:10 +02:00
|
|
|
static FT_Fixed
|
|
|
|
ft_trig_downscale( FT_Fixed val )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Fixed s;
|
|
|
|
FT_Int64 v;
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
s = val;
|
2013-01-09 06:25:32 +01:00
|
|
|
val = FT_ABS( val );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
v = ( val * (FT_Int64)FT_TRIG_SCALE ) + 0x100000000UL;
|
|
|
|
val = (FT_Fixed)( v >> 32 );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
return ( s >= 0 ) ? val : -val;
|
|
|
|
}
|
|
|
|
|
2012-11-17 11:45:24 +01:00
|
|
|
#else /* !FT_LONG64 */
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* multiply a given value by the CORDIC shrink factor */
|
2001-06-27 18:18:10 +02:00
|
|
|
static FT_Fixed
|
|
|
|
ft_trig_downscale( FT_Fixed val )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Fixed s;
|
|
|
|
FT_UInt32 v1, v2, k1, k2, hi, lo1, lo2, lo3;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
s = val;
|
2013-01-09 06:25:32 +01:00
|
|
|
val = FT_ABS( val );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
v1 = (FT_UInt32)val >> 16;
|
2012-11-17 11:45:24 +01:00
|
|
|
v2 = (FT_UInt32)( val & 0xFFFFL );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2012-11-17 11:45:24 +01:00
|
|
|
k1 = (FT_UInt32)FT_TRIG_SCALE >> 16; /* constant */
|
|
|
|
k2 = (FT_UInt32)( FT_TRIG_SCALE & 0xFFFFL ); /* constant */
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
hi = k1 * v1;
|
|
|
|
lo1 = k1 * v2 + k2 * v1; /* can't overflow */
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
lo2 = ( k2 * v2 ) >> 16;
|
2013-01-09 06:25:32 +01:00
|
|
|
lo3 = FT_MAX( lo1, lo2 );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
lo1 += lo2;
|
|
|
|
|
|
|
|
hi += lo1 >> 16;
|
2001-05-12 20:04:08 +02:00
|
|
|
if ( lo1 < lo3 )
|
2009-07-31 17:30:24 +02:00
|
|
|
hi += (FT_UInt32)0x10000UL;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
val = (FT_Fixed)hi;
|
|
|
|
|
|
|
|
return ( s >= 0 ) ? val : -val;
|
|
|
|
}
|
|
|
|
|
2012-11-17 11:45:24 +01:00
|
|
|
#endif /* !FT_LONG64 */
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
static FT_Int
|
|
|
|
ft_trig_prenorm( FT_Vector* vec )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-05-04 18:57:56 +02:00
|
|
|
FT_Pos x, y;
|
|
|
|
FT_Int shift;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
x = vec->x;
|
|
|
|
y = vec->y;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2013-01-24 01:43:28 +01:00
|
|
|
shift = FT_MSB( FT_ABS( x ) | FT_ABS( y ) );
|
2005-10-28 18:14:14 +02:00
|
|
|
|
2013-01-11 04:29:07 +01:00
|
|
|
if ( shift <= FT_TRIG_SAFE_MSB )
|
2005-10-28 18:14:14 +02:00
|
|
|
{
|
2013-01-11 04:29:07 +01:00
|
|
|
shift = FT_TRIG_SAFE_MSB - shift;
|
2013-05-04 18:57:56 +02:00
|
|
|
vec->x = (FT_Pos)( (FT_ULong)x << shift );
|
|
|
|
vec->y = (FT_Pos)( (FT_ULong)y << shift );
|
2005-10-28 18:14:14 +02:00
|
|
|
}
|
2005-11-15 18:30:56 +01:00
|
|
|
else
|
2005-10-28 18:14:14 +02:00
|
|
|
{
|
2013-01-11 04:29:07 +01:00
|
|
|
shift -= FT_TRIG_SAFE_MSB;
|
2001-05-12 20:04:08 +02:00
|
|
|
vec->x = x >> shift;
|
|
|
|
vec->y = y >> shift;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
shift = -shift;
|
|
|
|
}
|
2005-11-12 08:34:40 +01:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
return shift;
|
|
|
|
}
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
static void
|
|
|
|
ft_trig_pseudo_rotate( FT_Vector* vec,
|
|
|
|
FT_Angle theta )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2001-05-12 20:04:08 +02:00
|
|
|
FT_Int i;
|
2013-01-03 05:45:14 +01:00
|
|
|
FT_Fixed x, y, xtemp, b;
|
2001-05-12 20:04:08 +02:00
|
|
|
const FT_Fixed *arctanptr;
|
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
x = vec->x;
|
|
|
|
y = vec->y;
|
|
|
|
|
2013-01-03 04:21:37 +01:00
|
|
|
/* Rotate inside [-PI/4,PI/4] sector */
|
|
|
|
while ( theta < -FT_ANGLE_PI4 )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 04:21:37 +01:00
|
|
|
xtemp = y;
|
|
|
|
y = -x;
|
|
|
|
x = xtemp;
|
|
|
|
theta += FT_ANGLE_PI2;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2013-01-03 04:21:37 +01:00
|
|
|
while ( theta > FT_ANGLE_PI4 )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 04:21:37 +01:00
|
|
|
xtemp = -y;
|
|
|
|
y = x;
|
|
|
|
x = xtemp;
|
|
|
|
theta -= FT_ANGLE_PI2;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
arctanptr = ft_trig_arctan_table;
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2012-12-20 07:03:22 +01:00
|
|
|
/* Pseudorotations, with right shifts */
|
2013-01-03 05:45:14 +01:00
|
|
|
for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2001-05-12 20:04:08 +02:00
|
|
|
if ( theta < 0 )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 05:45:14 +01:00
|
|
|
xtemp = x + ( ( y + b ) >> i );
|
|
|
|
y = y - ( ( x + b ) >> i );
|
2001-05-12 20:04:08 +02:00
|
|
|
x = xtemp;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
theta += *arctanptr++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-03 05:45:14 +01:00
|
|
|
xtemp = x - ( ( y + b ) >> i );
|
|
|
|
y = y + ( ( x + b ) >> i );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
x = xtemp;
|
|
|
|
theta -= *arctanptr++;
|
|
|
|
}
|
2013-01-03 05:45:14 +01:00
|
|
|
}
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
vec->x = x;
|
|
|
|
vec->y = y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
static void
|
|
|
|
ft_trig_pseudo_polarize( FT_Vector* vec )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2012-12-20 04:46:27 +01:00
|
|
|
FT_Angle theta;
|
|
|
|
FT_Int i;
|
2013-01-03 05:45:14 +01:00
|
|
|
FT_Fixed x, y, xtemp, b;
|
2001-05-12 20:04:08 +02:00
|
|
|
const FT_Fixed *arctanptr;
|
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
x = vec->x;
|
|
|
|
y = vec->y;
|
|
|
|
|
2013-01-03 04:21:37 +01:00
|
|
|
/* Get the vector into [-PI/4,PI/4] sector */
|
|
|
|
if ( y > x )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 04:21:37 +01:00
|
|
|
if ( y > -x )
|
|
|
|
{
|
|
|
|
theta = FT_ANGLE_PI2;
|
|
|
|
xtemp = y;
|
|
|
|
y = -x;
|
|
|
|
x = xtemp;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
theta = y > 0 ? FT_ANGLE_PI : -FT_ANGLE_PI;
|
|
|
|
x = -x;
|
|
|
|
y = -y;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( y < -x )
|
|
|
|
{
|
|
|
|
theta = -FT_ANGLE_PI2;
|
|
|
|
xtemp = -y;
|
|
|
|
y = x;
|
|
|
|
x = xtemp;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
theta = 0;
|
|
|
|
}
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
arctanptr = ft_trig_arctan_table;
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2012-12-20 07:03:22 +01:00
|
|
|
/* Pseudorotations, with right shifts */
|
2013-01-03 05:45:14 +01:00
|
|
|
for ( i = 1, b = 1; i < FT_TRIG_MAX_ITERS; b <<= 1, i++ )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2012-12-20 04:46:27 +01:00
|
|
|
if ( y > 0 )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-03 05:45:14 +01:00
|
|
|
xtemp = x + ( ( y + b ) >> i );
|
|
|
|
y = y - ( ( x + b ) >> i );
|
2012-12-20 04:46:27 +01:00
|
|
|
x = xtemp;
|
|
|
|
theta += *arctanptr++;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-01-03 05:45:14 +01:00
|
|
|
xtemp = x - ( ( y + b ) >> i );
|
|
|
|
y = y + ( ( x + b ) >> i );
|
2012-12-20 04:46:27 +01:00
|
|
|
x = xtemp;
|
|
|
|
theta -= *arctanptr++;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
2013-01-03 05:45:14 +01:00
|
|
|
}
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
/* round theta */
|
|
|
|
if ( theta >= 0 )
|
2003-12-24 02:10:46 +01:00
|
|
|
theta = FT_PAD_ROUND( theta, 32 );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
else
|
2005-03-03 18:09:08 +01:00
|
|
|
theta = -FT_PAD_ROUND( -theta, 32 );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
vec->x = x;
|
|
|
|
vec->y = theta;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Fixed )
|
|
|
|
FT_Cos( FT_Angle angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Vector v;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2013-01-09 05:29:44 +01:00
|
|
|
v.x = FT_TRIG_SCALE >> 8;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v.y = 0;
|
|
|
|
ft_trig_pseudo_rotate( &v, angle );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2013-01-09 05:29:44 +01:00
|
|
|
return ( v.x + 0x80L ) >> 8;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Fixed )
|
|
|
|
FT_Sin( FT_Angle angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2001-05-12 20:04:08 +02:00
|
|
|
return FT_Cos( FT_ANGLE_PI2 - angle );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Fixed )
|
|
|
|
FT_Tan( FT_Angle angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Vector v;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2013-01-09 05:29:44 +01:00
|
|
|
v.x = FT_TRIG_SCALE >> 8;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v.y = 0;
|
|
|
|
ft_trig_pseudo_rotate( &v, angle );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
return FT_DivFix( v.y, v.x );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Angle )
|
|
|
|
FT_Atan2( FT_Fixed dx,
|
|
|
|
FT_Fixed dy )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Vector v;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
if ( dx == 0 && dy == 0 )
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
v.x = dx;
|
2001-06-28 19:49:10 +02:00
|
|
|
v.y = dy;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
ft_trig_prenorm( &v );
|
|
|
|
ft_trig_pseudo_polarize( &v );
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
return v.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Vector_Unit( FT_Vector* vec,
|
|
|
|
FT_Angle angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2013-01-09 05:29:44 +01:00
|
|
|
vec->x = FT_TRIG_SCALE >> 8;
|
2001-05-12 20:04:08 +02:00
|
|
|
vec->y = 0;
|
|
|
|
ft_trig_pseudo_rotate( vec, angle );
|
2013-01-09 05:29:44 +01:00
|
|
|
vec->x = ( vec->x + 0x80L ) >> 8;
|
|
|
|
vec->y = ( vec->y + 0x80L ) >> 8;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-05-17 14:07:45 +02:00
|
|
|
/* these macros return 0 for positive numbers,
|
|
|
|
and -1 for negative ones */
|
|
|
|
#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 )
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Vector_Rotate( FT_Vector* vec,
|
|
|
|
FT_Angle angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
|
|
|
FT_Int shift;
|
|
|
|
FT_Vector v;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
2003-05-17 14:07:45 +02:00
|
|
|
v.x = vec->x;
|
|
|
|
v.y = vec->y;
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
if ( angle && ( v.x != 0 || v.y != 0 ) )
|
|
|
|
{
|
|
|
|
shift = ft_trig_prenorm( &v );
|
|
|
|
ft_trig_pseudo_rotate( &v, angle );
|
|
|
|
v.x = ft_trig_downscale( v.x );
|
|
|
|
v.y = ft_trig_downscale( v.y );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2003-05-17 14:07:45 +02:00
|
|
|
if ( shift > 0 )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2009-07-31 17:30:24 +02:00
|
|
|
FT_Int32 half = (FT_Int32)1L << ( shift - 1 );
|
2003-05-17 14:07:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
vec->x = ( v.x + half + FT_SIGN_LONG( v.x ) ) >> shift;
|
|
|
|
vec->y = ( v.y + half + FT_SIGN_LONG( v.y ) ) >> shift;
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shift = -shift;
|
2013-05-04 18:57:56 +02:00
|
|
|
vec->x = (FT_Pos)( (FT_ULong)v.x << shift );
|
|
|
|
vec->y = (FT_Pos)( (FT_ULong)v.y << shift );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( FT_Fixed )
|
|
|
|
FT_Vector_Length( FT_Vector* vec )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2001-05-12 20:04:08 +02:00
|
|
|
FT_Int shift;
|
|
|
|
FT_Vector v;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v = *vec;
|
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
/* handle trivial cases */
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
if ( v.x == 0 )
|
|
|
|
{
|
2013-01-09 06:25:32 +01:00
|
|
|
return FT_ABS( v.y );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
else if ( v.y == 0 )
|
|
|
|
{
|
2013-01-09 06:25:32 +01:00
|
|
|
return FT_ABS( v.x );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* general case */
|
|
|
|
shift = ft_trig_prenorm( &v );
|
|
|
|
ft_trig_pseudo_polarize( &v );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v.x = ft_trig_downscale( v.x );
|
2002-04-02 16:50:31 +02:00
|
|
|
|
|
|
|
if ( shift > 0 )
|
|
|
|
return ( v.x + ( 1 << ( shift - 1 ) ) ) >> shift;
|
|
|
|
|
2013-05-04 16:40:12 +02:00
|
|
|
return (FT_Fixed)( (FT_UInt32)v.x << -shift );
|
2001-06-28 19:49:10 +02:00
|
|
|
}
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
2001-06-27 18:18:10 +02:00
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Vector_Polarize( FT_Vector* vec,
|
|
|
|
FT_Fixed *length,
|
|
|
|
FT_Angle *angle )
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
{
|
2001-05-12 20:04:08 +02:00
|
|
|
FT_Int shift;
|
|
|
|
FT_Vector v;
|
|
|
|
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v = *vec;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
if ( v.x == 0 && v.y == 0 )
|
|
|
|
return;
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
shift = ft_trig_prenorm( &v );
|
|
|
|
ft_trig_pseudo_polarize( &v );
|
2001-06-28 19:49:10 +02:00
|
|
|
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
v.x = ft_trig_downscale( v.x );
|
|
|
|
|
2013-05-04 16:40:12 +02:00
|
|
|
*length = ( shift >= 0 ) ? ( v.x >> shift )
|
|
|
|
: (FT_Fixed)( (FT_UInt32)v.x << -shift );
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
*angle = v.y;
|
2001-06-28 19:49:10 +02:00
|
|
|
}
|
* include/freetype/fttrigon.h, src/base/fttrigon.c, src/base/ftbase.c,
src/base/Jamfile, src/base/rules.mk: adding trigonometric functions
to the core API (using Cordic algorithms).
* builds/top_level.mk, builds/newline, builds/detect.mk: fixed problems
with Make on Windows 2000, as well as problems when "make distclean" is
invoked on a non-Unix platform when there is no "config.mk" in the
current directory..
* builds/freetype.mk: fixed a problem with object deletions under
Dos/Windows/OS/2 systems
* src/tools: added new directory to hold tools and test programs
moved docmaker.py, glnames.py to it..
* src/tools/docmaker.py: improved the script to add the current date
at the footer of each web page (useful to distinguish between versions)
* Jamfile: fixed incorrect HDRMACRO argument.
* TODO: removed the cubic arc bbox computation note, since it has been
fixed recently..
* include/freetype/t1tables.h, include/freetype/config/ftoption.h:
formatting
2001-05-11 16:25:57 +02:00
|
|
|
|
|
|
|
|
2002-06-27 01:45:21 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( void )
|
|
|
|
FT_Vector_From_Polar( FT_Vector* vec,
|
|
|
|
FT_Fixed length,
|
|
|
|
FT_Angle angle )
|
|
|
|
{
|
|
|
|
vec->x = length;
|
|
|
|
vec->y = 0;
|
|
|
|
|
|
|
|
FT_Vector_Rotate( vec, angle );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-06-27 00:05:05 +02:00
|
|
|
/* documentation is in fttrigon.h */
|
|
|
|
|
|
|
|
FT_EXPORT_DEF( FT_Angle )
|
2002-07-01 23:35:17 +02:00
|
|
|
FT_Angle_Diff( FT_Angle angle1,
|
|
|
|
FT_Angle angle2 )
|
2002-06-27 00:05:05 +02:00
|
|
|
{
|
|
|
|
FT_Angle delta = angle2 - angle1;
|
2002-06-27 01:45:21 +02:00
|
|
|
|
2004-11-24 08:08:21 +01:00
|
|
|
|
2002-06-27 00:05:05 +02:00
|
|
|
delta %= FT_ANGLE_2PI;
|
2003-01-07 23:54:02 +01:00
|
|
|
if ( delta < 0 )
|
|
|
|
delta += FT_ANGLE_2PI;
|
2002-06-27 00:05:05 +02:00
|
|
|
|
|
|
|
if ( delta > FT_ANGLE_PI )
|
|
|
|
delta -= FT_ANGLE_2PI;
|
2002-06-27 01:45:21 +02:00
|
|
|
|
2002-06-27 00:05:05 +02:00
|
|
|
return delta;
|
2002-06-27 01:45:21 +02:00
|
|
|
}
|
2002-06-27 00:05:05 +02:00
|
|
|
|
|
|
|
|
2001-05-12 20:04:08 +02:00
|
|
|
/* END */
|