commit d7d10a866df51c219dc06589ab4c0c1704b90bbb
Author: Mattias Andrée <maandree_AT_kth.se>
AuthorDate: Mon Jul 3 16:35:20 2017 +0200
Commit: Mattias Andrée <maandree_AT_kth.se>
CommitDate: Mon Jul 3 16:35:20 2017 +0200
blind-cone-gradient: make the singularity's value 0.5
Signed-off-by: Mattias Andrée <maandree_AT_kth.se>
diff --git a/src/blind-cone-gradient.c b/src/blind-cone-gradient.c
index 63e6566..23906e0 100644
--- a/src/blind-cone-gradient.c
+++ b/src/blind-cone-gradient.c
_AT_@ -44,18 +44,22 @@ static int with_multiplier = 0;
y = (TYPE)iy - y1;\
for (ix = 0; ix < width; ix++) {\
x = (TYPE)ix - x1;\
- v = atan2(y, x);\
- v -= u;\
- v += 2 * (TYPE)M_PI;\
- v = mod(v, 2 * (TYPE)M_PI);\
- v /= 2 * (TYPE)M_PI;\
- if (anticlockwise)\
- v = 1 - v;\
- v *= m;\
- if (symmetric) {\
- v = mod(2 * v, (TYPE)2);\
- if (v > 1)\
- v = 2 - v;\
+ if (!x && !y) {\
+ v = 0.5;\
+ } else {\
+ v = atan2(y, x);\
+ v -= u;\
+ v += 2 * (TYPE)M_PI;\
+ v = mod(v, 2 * (TYPE)M_PI);\
+ v /= 2 * (TYPE)M_PI;\
+ if (anticlockwise)\
+ v = 1 - v;\
+ v *= m;\
+ if (symmetric) {\
+ v = mod(2 * v, (TYPE)2);\
+ if (v > 1)\
+ v = 2 - v;\
+ }\
}\
buf[ptr][0] = buf[ptr][1] = buf[ptr][2] = buf[ptr][3] = v;\
if (++ptr == ELEMENTSOF(buf)) {\
Received on Mon Jul 03 2017 - 16:35:31 CEST
This archive was generated by hypermail 2.3.0
: Mon Jul 03 2017 - 16:36:33 CEST