[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] anuj-distance-field 538cf0f 30/95: * src/sdf/ftsdf.c (MAX_NE
From: |
Anuj Verma |
Subject: |
[freetype2] anuj-distance-field 538cf0f 30/95: * src/sdf/ftsdf.c (MAX_NEWTON_DIVISIONS): Renamed to avoid confusion. |
Date: |
Sun, 2 Aug 2020 01:10:30 -0400 (EDT) |
branch: anuj-distance-field
commit 538cf0f1fd663623d53d8457136aa4c9c9c18fdf
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>
* src/sdf/ftsdf.c (MAX_NEWTON_DIVISIONS): Renamed to avoid confusion.
---
[GSoC]ChangeLog | 5 +++++
src/sdf/ftsdf.c | 13 ++++++++++---
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index fe90c78..632510a 100644
--- a/[GSoC]ChangeLog
+++ b/[GSoC]ChangeLog
@@ -1,3 +1,8 @@
+2020-07-03 Anuj Verma <anujv@iitbhilai.ac.in>
+
+ * src/sdf/ftsdf.c (MAX_NEWTON_ITERATION => MAX_NEWTON_DIVISIONS):
+ Renamed to avoid confusion.
+
2020-07-02 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf] Added Newton's method for shortest distance
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index 8ceb7dd..b2ede4d 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -31,7 +31,14 @@
# define USE_NEWTON_FOR_CONIC 1
#endif
- #define MAX_NEWTON_ITERATION 4
+ /* `MAX_NEWTON_DIVISIONS' is the number of intervals the bezier curve */
+ /* is sampled and checked for shortest distance. */
+ #define MAX_NEWTON_DIVISIONS 4
+
+ /* `MAX_NEWTON_STEPS' is the number of steps of Newton's iterations in */
+ /* each interval of the bezier curve. Basically for each division we */
+ /* run the Newton's approximation (i.e. x -= Q( t ) / Q'( t )) to get */
+ /* the shortest distance. */
#define MAX_NEWTON_STEPS 4
/**************************************************************************
@@ -1507,9 +1514,9 @@
cC.y = p0.y;
/* do newton's iterations */
- for ( iterations = 0; iterations <= MAX_NEWTON_ITERATION; iterations++ )
+ for ( iterations = 0; iterations <= MAX_NEWTON_DIVISIONS; iterations++ )
{
- FT_16D16 factor = FT_INT_16D16( iterations ) / MAX_NEWTON_ITERATION;
+ FT_16D16 factor = FT_INT_16D16( iterations ) / MAX_NEWTON_DIVISIONS;
FT_16D16 factor2;
FT_16D16 length;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] anuj-distance-field 538cf0f 30/95: * src/sdf/ftsdf.c (MAX_NEWTON_DIVISIONS): Renamed to avoid confusion.,
Anuj Verma <=