[gegl] spiral: fix area ratio calc. for log spirals
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] spiral: fix area ratio calc. for log spirals
- Date: Sat, 29 Apr 2017 18:20:24 +0000 (UTC)
commit b21eee39330e51b8551b2293bf25633e3c798fc0
Author: Ell <ell_se yahoo com>
Date: Sat Apr 29 14:15:30 2017 -0400
spiral: fix area ratio calc. for log spirals
operations/workshop/spiral.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/operations/workshop/spiral.c b/operations/workshop/spiral.c
index 9ec0548..f8f17eb 100644
--- a/operations/workshop/spiral.c
+++ b/operations/workshop/spiral.c
@@ -290,7 +290,6 @@ process_logarithmic (gfloat *out,
gfloat log_base;
gfloat log_base_inv;
gfloat lim;
- gfloat ratio;
gfloat x;
gfloat y;
gint i;
@@ -298,11 +297,11 @@ process_logarithmic (gfloat *out,
if (thickness == 0.0 || thickness == 1.0 || base == 1.0)
{
- const gfloat *color;
+ gfloat color[4];
- color = thickness > 0.5f ? color1 : color2;
+ blend (color2, color1, thickness, color);
- gegl_memset_pattern (out, color, 4 * sizeof (gfloat), width * height);
+ gegl_memset_pattern (out, color, sizeof (color), width * height);
return;
}
@@ -312,7 +311,6 @@ process_logarithmic (gfloat *out,
log_base = log (base);
log_base_inv = 1.0 / log_base;
lim = exp (log_base * thickness);
- ratio = (lim - 1.0) / (base - 1.0);
y = y0;
@@ -359,7 +357,7 @@ process_logarithmic (gfloat *out,
}
else
{
- a = ratio;
+ a = thickness;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]