[gimp] app: end point detection uses both the end point rate and clamped value.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: end point detection uses both the end point rate and clamped value.
- Date: Mon, 19 Nov 2018 13:46:22 +0000 (UTC)
commit 79571231c5adce73f336978f585c9b94d2e09769
Author: Jehan <jehan girinstud io>
Date: Mon Nov 19 14:44:26 2018 +0100
app: end point detection uses both the end point rate and clamped value.
app/core/gimplineart.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimplineart.c b/app/core/gimplineart.c
index baeb400aff..640cb9f7b1 100644
--- a/app/core/gimplineart.c
+++ b/app/core/gimplineart.c
@@ -235,6 +235,7 @@ gimp_lineart_close (GeglBuffer *line_art,
SplineCandidate *candidate;
guchar max_value = 0;
gfloat threshold;
+ gfloat clamped_threshold;
gint width = gegl_buffer_get_width (line_art);
gint height = gegl_buffer_get_height (line_art);
gint i;
@@ -306,14 +307,15 @@ gimp_lineart_close (GeglBuffer *line_art,
normal_estimate_mask_size);
radii = gimp_lineart_estimate_strokes_radii (strokes);
- threshold = MAX (0.25f, 1.0f - end_point_rate);
+ threshold = 1.0f - end_point_rate;
+ clamped_threshold = MAX (0.25f, threshold);
for (i = 0; i < width; i++)
{
gint j;
for (j = 0; j < height; j++)
{
if (smoothed_curvatures[i + j * width] >= (threshold / MAX (1.0f, radii[i + j * width])) ||
- curvatures[i + j * width] >= threshold)
+ curvatures[i + j * width] >= clamped_threshold)
curvatures[i + j * width] = 1.0;
else
curvatures[i + j * width] = 0.0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]