[gimp/gimp-2-10] app: edit the bucket fill tool options with new line art options.



commit 6b1d7969edcffd55d5251d195378385ea3ef18b0
Author: Jehan <jehan girinstud io>
Date:   Wed Nov 7 14:22:10 2018 +0100

    app: edit the bucket fill tool options with new line art options.
    
    I have not added all the options for this new tool yet, but this sets
    the base. I also added a bit of TODO for several places where we need to
    make it settable, in particular the fuzzy select tool, but also simply
    PDB calls (this will need to be a PDB context settings.
    
    Maybe also I will want to make some LineArtOptions struct in order not
    to have infinite list of parameters to functions. And at some point, it
    may also be worth splitting a bit process with other type of
    selection/fill (since they barely share any settings anyway).
    
    Finally I take the opportunity to document a little more the parameters
    to gimp_lineart_close(), which can still be improved later (I should
    have documented these straight away when I re-implemented this all from
    G'Mic code, as I am a bit fuzzy on some details now and will need to
    re-understand code).
    
    (cherry picked from commit 824af12438838b1521cd6d3afb67e9c7369c3cf4)

 app/core/gimpchannel-select.c             |   1 +
 app/core/gimpdrawable-bucket-fill.c       |   7 ++
 app/core/gimpdrawable-bucket-fill.h       |   4 +
 app/core/gimplineart.c                    |  28 ++++---
 app/core/gimppickable-contiguous-region.c |  15 ++--
 app/core/gimppickable-contiguous-region.h |   6 +-
 app/pdb/drawable-edit-cmds.c              |   1 +
 app/tools/gimpbucketfilloptions.c         | 129 +++++++++++++++++++++++++-----
 app/tools/gimpbucketfilloptions.h         |  31 ++++---
 app/tools/gimpbucketfilltool.c            |  29 +++++--
 app/tools/gimpfuzzyselecttool.c           |   1 +
 pdb/groups/drawable_edit.pdb              |   1 +
 12 files changed, 199 insertions(+), 54 deletions(-)
---
diff --git a/app/core/gimpchannel-select.c b/app/core/gimpchannel-select.c
index dd6c433aee..d073635258 100644
--- a/app/core/gimpchannel-select.c
+++ b/app/core/gimpchannel-select.c
@@ -522,6 +522,7 @@ gimp_channel_select_fuzzy (GimpChannel         *channel,
                                                     select_transparent,
                                                     select_criterion,
                                                     diagonal_neighbors,
+                                                    0.92, -1, /* TODO */
                                                     x, y);
 
   if (! sample_merged)
diff --git a/app/core/gimpdrawable-bucket-fill.c b/app/core/gimpdrawable-bucket-fill.c
index 7bb12c18c7..9c854632e2 100644
--- a/app/core/gimpdrawable-bucket-fill.c
+++ b/app/core/gimpdrawable-bucket-fill.c
@@ -56,6 +56,8 @@ gimp_drawable_bucket_fill (GimpDrawable         *drawable,
                            gdouble               threshold,
                            gboolean              sample_merged,
                            gboolean              diagonal_neighbors,
+                           gfloat                stroke_threshold,
+                           gint                  erosion,
                            gdouble               seed_x,
                            gdouble               seed_y)
 {
@@ -75,6 +77,7 @@ gimp_drawable_bucket_fill (GimpDrawable         *drawable,
                                                  fill_transparent, fill_criterion,
                                                  threshold, sample_merged,
                                                  diagonal_neighbors,
+                                                 stroke_threshold, erosion,
                                                  seed_x, seed_y, NULL,
                                                  &mask_x, &mask_y, &width, &height);
 
@@ -138,6 +141,8 @@ gimp_drawable_get_bucket_fill_buffer (GimpDrawable         *drawable,
                                       gdouble               threshold,
                                       gboolean              sample_merged,
                                       gboolean              diagonal_neighbors,
+                                      gfloat                stroke_threshold,
+                                      gint                  erosion,
                                       gdouble               seed_x,
                                       gdouble               seed_y,
                                       GeglBuffer          **mask_buffer,
@@ -199,6 +204,8 @@ gimp_drawable_get_bucket_fill_buffer (GimpDrawable         *drawable,
                                                       fill_transparent,
                                                       fill_criterion,
                                                       diagonal_neighbors,
+                                                      stroke_threshold,
+                                                      erosion,
                                                       (gint) seed_x,
                                                       (gint) seed_y);
   if (mask_buffer && *mask_buffer)
diff --git a/app/core/gimpdrawable-bucket-fill.h b/app/core/gimpdrawable-bucket-fill.h
index f1d04c1ac6..fd895f3c73 100644
--- a/app/core/gimpdrawable-bucket-fill.h
+++ b/app/core/gimpdrawable-bucket-fill.h
@@ -27,6 +27,8 @@ void         gimp_drawable_bucket_fill            (GimpDrawable         *drawabl
                                                    gdouble               threshold,
                                                    gboolean              sample_merged,
                                                    gboolean              diagonal_neighbors,
+                                                   gfloat                stroke_threshold,
+                                                   gint                  erosion,
                                                    gdouble               x,
                                                    gdouble               y);
 GeglBuffer * gimp_drawable_get_bucket_fill_buffer (GimpDrawable         *drawable,
@@ -37,6 +39,8 @@ GeglBuffer * gimp_drawable_get_bucket_fill_buffer (GimpDrawable         *drawabl
                                                    gdouble               threshold,
                                                    gboolean              sample_merged,
                                                    gboolean              diagonal_neighbors,
+                                                   gfloat                stroke_threshold,
+                                                   gint                  erosion,
                                                    gdouble               seed_x,
                                                    gdouble               seed_y,
                                                    GeglBuffer          **mask_buffer,
diff --git a/app/core/gimplineart.c b/app/core/gimplineart.c
index 28af7bab99..31d3857d57 100644
--- a/app/core/gimplineart.c
+++ b/app/core/gimplineart.c
@@ -169,24 +169,34 @@ static void       gimp_edgelset_next8             (const GeglBuffer  *buffer,
 
 /**
  * gimp_lineart_close:
- * @line_art: the input #GeglBuffer
+ * @line_art: the input #GeglBuffer.
  * @select_transparent: whether we binarize the alpha channel or the
  *                      luminosity.
  * @stroke_threshold: [0-1] threshold value for detecting stroke pixels
  *                    (higher values will detect more stroke pixels).
- * @erosion:
- * @minimal_lineart_area:
+ * @erosion: size (in pixels) of the rectangular structure used to erode
+ *           the stroke pixels. 0 means no erosion will be done, and a
+ *           negative value will compute a median approximation of the
+ *           stroke width, for base of erosion.
+ * @minimal_lineart_area: the minimum size in number pixels for area to
+ *                        be considered as line art.
  * @normal_estimate_mask_size:
- * @end_point_rate: [0-1] range value.
- * @spline_max_length:
- * @spline_max_angle:
+ * @end_point_rate: threshold to estimate if a curvature is an end-point
+ *                  in [0-1] range value.
+ * @spline_max_length: the maximum length for creating splines between
+ *                     end points.
+ * @spline_max_angle: the maximum angle between end point normals for
+ *                    creating splines between them.
  * @end_point_connectivity:
  * @spline_roundness:
- * @allow_self_intersections:
+ * @allow_self_intersections: whether to allow created splines and
+ *                            segments to intersect.
  * @created_regions_significant_area:
  * @created_regions_minimum_area:
  * @small_segments_from_spline_sources:
- * @segments_max_length:
+ * @segments_max_length: the maximum length for creating segments
+ *                       between end points. Unlike splines, segments
+ *                       are straight lines.
  *
  * Creates a binarized version of the strokes of @line_art, detected either
  * with luminosity (light means background) or alpha values depending on
@@ -299,7 +309,7 @@ gimp_lineart_close (GeglBuffer          *line_art,
     {
       gimp_lineart_erode (strokes, erosion);
     }
-  else if (erosion == -1)
+  else if (erosion < 0)
     {
       const gfloat stroke_width = gimp_lineart_estimate_stroke_width (strokes);
       const gint   erode_size   = (gint) roundf (stroke_width / 5);
diff --git a/app/core/gimppickable-contiguous-region.c b/app/core/gimppickable-contiguous-region.c
index aab8674469..6976556aa8 100644
--- a/app/core/gimppickable-contiguous-region.c
+++ b/app/core/gimppickable-contiguous-region.c
@@ -100,7 +100,9 @@ static void     find_contiguous_region    (GeglBuffer          *src_buffer,
 
 GeglBuffer *
 gimp_pickable_contiguous_region_prepare_line_art (GimpPickable *pickable,
-                                                  gboolean      select_transparent)
+                                                  gboolean      select_transparent,
+                                                  gfloat        stroke_threshold,
+                                                  gint          erosion)
 {
   GeglBuffer *lineart;
   gboolean    has_alpha;
@@ -158,10 +160,8 @@ gimp_pickable_contiguous_region_prepare_line_art (GimpPickable *pickable,
 
   lineart = gimp_lineart_close (lineart,
                                 select_transparent,
-                                /*contour_detection_level,*/
-                                0.92,
-                                /* erosion, */
-                                -1,
+                                stroke_threshold,
+                                erosion,
                                 /*minimal_lineart_area,*/
                                 5,
                                 /*normal_estimate_mask_size,*/
@@ -200,6 +200,8 @@ gimp_pickable_contiguous_region_by_seed (GimpPickable        *pickable,
                                          gboolean             select_transparent,
                                          GimpSelectCriterion  select_criterion,
                                          gboolean             diagonal_neighbors,
+                                         gfloat               stroke_threshold,
+                                         gint                 erosion,
                                          gint                 x,
                                          gint                 y)
 {
@@ -224,7 +226,8 @@ gimp_pickable_contiguous_region_by_seed (GimpPickable        *pickable,
            * but it may not be always possible (for instance when
            * selecting/filling through a PDB call).
            */
-          line_art      = gimp_pickable_contiguous_region_prepare_line_art (pickable, select_transparent);
+          line_art      = gimp_pickable_contiguous_region_prepare_line_art (pickable, select_transparent,
+                                                                            stroke_threshold, erosion);
           free_line_art = TRUE;
         }
 
diff --git a/app/core/gimppickable-contiguous-region.h b/app/core/gimppickable-contiguous-region.h
index 7f8d693d92..6c2e26ba08 100644
--- a/app/core/gimppickable-contiguous-region.h
+++ b/app/core/gimppickable-contiguous-region.h
@@ -20,7 +20,9 @@
 
 
 GeglBuffer * gimp_pickable_contiguous_region_prepare_line_art (GimpPickable        *pickable,
-                                                               gboolean             select_transparent);
+                                                               gboolean             select_transparent,
+                                                               gfloat               stroke_threshold,
+                                                               gint                 erosion);
 GeglBuffer * gimp_pickable_contiguous_region_by_seed          (GimpPickable        *pickable,
                                                                GeglBuffer          *line_art,
                                                                gboolean             antialias,
@@ -28,6 +30,8 @@ GeglBuffer * gimp_pickable_contiguous_region_by_seed          (GimpPickable
                                                                gboolean             select_transparent,
                                                                GimpSelectCriterion  select_criterion,
                                                                gboolean             diagonal_neighbors,
+                                                               gfloat               stroke_threshold,
+                                                               gint                 erosion,
                                                                gint                 x,
                                                                gint                 y);
 
diff --git a/app/pdb/drawable-edit-cmds.c b/app/pdb/drawable-edit-cmds.c
index a5212bb1cd..0949746bc5 100644
--- a/app/pdb/drawable-edit-cmds.c
+++ b/app/pdb/drawable-edit-cmds.c
@@ -171,6 +171,7 @@ drawable_edit_bucket_fill_invoker (GimpProcedure         *procedure,
                                          GIMP_PDB_CONTEXT (context)->sample_threshold,
                                          GIMP_PDB_CONTEXT (context)->sample_merged,
                                          GIMP_PDB_CONTEXT (context)->diagonal_neighbors,
+                                         0.92, -1, /* TODO */
                                          x, y);
             }
           else
diff --git a/app/tools/gimpbucketfilloptions.c b/app/tools/gimpbucketfilloptions.c
index c88b254ca9..6672c95911 100644
--- a/app/tools/gimpbucketfilloptions.c
+++ b/app/tools/gimpbucketfilloptions.c
@@ -53,26 +53,39 @@ enum
   PROP_DIAGONAL_NEIGHBORS,
   PROP_ANTIALIAS,
   PROP_THRESHOLD,
+  PROP_LINE_ART_THRESHOLD,
+  PROP_LINE_ART_EROSION,
   PROP_FILL_CRITERION
 };
 
+struct _GimpBucketFillOptionsPrivate
+{
+  GtkWidget *diagonal_neighbors_checkbox;
+  GtkWidget *antialias_checkbox;
+  GtkWidget *threshold_scale;
+
+  GtkWidget *line_art_threshold_scale;
+  GtkWidget *line_art_erosion_scale;
+};
 
 static void   gimp_bucket_fill_options_config_iface_init (GimpConfigInterface *config_iface);
 
-static void   gimp_bucket_fill_options_set_property (GObject         *object,
-                                                     guint            property_id,
-                                                     const GValue    *value,
-                                                     GParamSpec      *pspec);
-static void   gimp_bucket_fill_options_get_property (GObject         *object,
-                                                     guint            property_id,
-                                                     GValue          *value,
-                                                     GParamSpec      *pspec);
+static void   gimp_bucket_fill_options_set_property      (GObject               *object,
+                                                          guint                  property_id,
+                                                          const GValue          *value,
+                                                          GParamSpec            *pspec);
+static void   gimp_bucket_fill_options_get_property      (GObject               *object,
+                                                          guint                  property_id,
+                                                          GValue                *value,
+                                                          GParamSpec            *pspec);
 
-static void   gimp_bucket_fill_options_reset        (GimpConfig      *config);
+static void   gimp_bucket_fill_options_reset             (GimpConfig            *config);
+static void   gimp_bucket_fill_options_update_criterion  (GimpBucketFillOptions *options);
 
 
 G_DEFINE_TYPE_WITH_CODE (GimpBucketFillOptions, gimp_bucket_fill_options,
                          GIMP_TYPE_PAINT_OPTIONS,
+                         G_ADD_PRIVATE (GimpBucketFillOptions)
                          G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
                                                 gimp_bucket_fill_options_config_iface_init))
 
@@ -144,6 +157,20 @@ gimp_bucket_fill_options_class_init (GimpBucketFillOptionsClass *klass)
                            0.0, 255.0, 15.0,
                            GIMP_PARAM_STATIC_STRINGS);
 
+  GIMP_CONFIG_PROP_DOUBLE (object_class, PROP_LINE_ART_THRESHOLD,
+                           "line-art-threshold",
+                           _("Line art detection threshold"),
+                           _("Threshold to detect contour (higher values will include more pixels)"),
+                           0.0, 1.0, 0.92,
+                           GIMP_PARAM_STATIC_STRINGS);
+
+  GIMP_CONFIG_PROP_INT (object_class, PROP_LINE_ART_EROSION,
+                        "line-art-erosion",
+                        _("Line art erosion"),
+                        _("Size in pixel to erode the line art"),
+                        -1, 200, -1,
+                        GIMP_PARAM_STATIC_STRINGS);
+
   GIMP_CONFIG_PROP_ENUM (object_class, PROP_FILL_CRITERION,
                          "fill-criterion",
                          _("Fill by"),
@@ -164,6 +191,7 @@ gimp_bucket_fill_options_config_iface_init (GimpConfigInterface *config_iface)
 static void
 gimp_bucket_fill_options_init (GimpBucketFillOptions *options)
 {
+  options->priv = gimp_bucket_fill_options_get_instance_private (options);
 }
 
 static void
@@ -197,8 +225,15 @@ gimp_bucket_fill_options_set_property (GObject      *object,
     case PROP_THRESHOLD:
       options->threshold = g_value_get_double (value);
       break;
+    case PROP_LINE_ART_THRESHOLD:
+      options->line_art_threshold = g_value_get_double (value);
+      break;
+    case PROP_LINE_ART_EROSION:
+      options->line_art_erosion = g_value_get_int (value);
+      break;
     case PROP_FILL_CRITERION:
       options->fill_criterion = g_value_get_enum (value);
+      gimp_bucket_fill_options_update_criterion (options);
       break;
 
     default:
@@ -238,6 +273,12 @@ gimp_bucket_fill_options_get_property (GObject    *object,
     case PROP_THRESHOLD:
       g_value_set_double (value, options->threshold);
       break;
+    case PROP_LINE_ART_THRESHOLD:
+      g_value_set_double (value, options->line_art_threshold);
+      break;
+    case PROP_LINE_ART_EROSION:
+      g_value_set_int (value, options->line_art_erosion);
+      break;
     case PROP_FILL_CRITERION:
       g_value_set_enum (value, options->fill_criterion);
       break;
@@ -264,20 +305,49 @@ gimp_bucket_fill_options_reset (GimpConfig *config)
   parent_config_iface->reset (config);
 }
 
+static void
+gimp_bucket_fill_options_update_criterion (GimpBucketFillOptions *options)
+{
+  /* GUI not created yet. */
+  if (! options->priv->antialias_checkbox)
+    return;
+
+  switch (options->fill_criterion)
+    {
+    case GIMP_SELECT_CRITERION_LINE_ART:
+      gtk_widget_hide (options->priv->antialias_checkbox);
+      gtk_widget_hide (options->priv->diagonal_neighbors_checkbox);
+      gtk_widget_hide (options->priv->threshold_scale);
+
+      gtk_widget_show (options->priv->line_art_erosion_scale);
+      gtk_widget_show (options->priv->line_art_threshold_scale);
+      break;
+    default:
+      gtk_widget_hide (options->priv->line_art_erosion_scale);
+      gtk_widget_hide (options->priv->line_art_threshold_scale);
+
+      gtk_widget_show (options->priv->antialias_checkbox);
+      gtk_widget_show (options->priv->diagonal_neighbors_checkbox);
+      gtk_widget_show (options->priv->threshold_scale);
+      break;
+    }
+}
+
 GtkWidget *
 gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
 {
-  GObject         *config = G_OBJECT (tool_options);
-  GtkWidget       *vbox   = gimp_paint_options_gui (tool_options);
-  GtkWidget       *vbox2;
-  GtkWidget       *frame;
-  GtkWidget       *hbox;
-  GtkWidget       *button;
-  GtkWidget       *scale;
-  GtkWidget       *combo;
-  gchar           *str;
-  GdkModifierType  extend_mask = gimp_get_extend_selection_mask ();
-  GdkModifierType  toggle_mask = gimp_get_toggle_behavior_mask ();
+  GimpBucketFillOptions *options = GIMP_BUCKET_FILL_OPTIONS (tool_options);
+  GObject               *config = G_OBJECT (tool_options);
+  GtkWidget             *vbox   = gimp_paint_options_gui (tool_options);
+  GtkWidget             *vbox2;
+  GtkWidget             *frame;
+  GtkWidget             *hbox;
+  GtkWidget             *button;
+  GtkWidget             *scale;
+  GtkWidget             *combo;
+  gchar                 *str;
+  GdkModifierType        extend_mask = gimp_get_extend_selection_mask ();
+  GdkModifierType        toggle_mask = gimp_get_toggle_behavior_mask ();
 
   /*  fill type  */
   str = g_strdup_printf (_("Fill Type  (%s)"),
@@ -335,17 +405,34 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
   /*  the diagonal neighbors toggle  */
   button = gimp_prop_check_button_new (config, "diagonal-neighbors", NULL);
   gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
+  options->priv->diagonal_neighbors_checkbox = button;
   gtk_widget_show (button);
 
   /*  the antialias toggle  */
   button = gimp_prop_check_button_new (config, "antialias", NULL);
   gtk_box_pack_start (GTK_BOX (vbox2), button, FALSE, FALSE, 0);
+  options->priv->antialias_checkbox = button;
   gtk_widget_show (button);
 
   /*  the threshold scale  */
   scale = gimp_prop_spin_scale_new (config, "threshold", NULL,
                                     1.0, 16.0, 1);
   gtk_box_pack_start (GTK_BOX (vbox2), scale, FALSE, FALSE, 0);
+  options->priv->threshold_scale = scale;
+  gtk_widget_show (scale);
+
+  /*  Line Art: erosion */
+  scale = gimp_prop_spin_scale_new (config, "line-art-erosion", NULL,
+                                    1, 10, 1);
+  gtk_box_pack_start (GTK_BOX (vbox2), scale, FALSE, FALSE, 0);
+  options->priv->line_art_erosion_scale = scale;
+  gtk_widget_show (scale);
+
+  /*  Line Art: stroke threshold */
+  scale = gimp_prop_spin_scale_new (config, "line-art-threshold", NULL,
+                                    0.05, 0.1, 2);
+  gtk_box_pack_start (GTK_BOX (vbox2), scale, FALSE, FALSE, 0);
+  options->priv->line_art_threshold_scale = scale;
   gtk_widget_show (scale);
 
   /*  the fill criterion combo  */
@@ -354,5 +441,7 @@ gimp_bucket_fill_options_gui (GimpToolOptions *tool_options)
   gtk_box_pack_start (GTK_BOX (vbox2), combo, FALSE, FALSE, 0);
   gtk_widget_show (combo);
 
+  gimp_bucket_fill_options_update_criterion (options);
+
   return vbox;
 }
diff --git a/app/tools/gimpbucketfilloptions.h b/app/tools/gimpbucketfilloptions.h
index bfff09ba61..750032cf2e 100644
--- a/app/tools/gimpbucketfilloptions.h
+++ b/app/tools/gimpbucketfilloptions.h
@@ -30,21 +30,28 @@
 #define GIMP_BUCKET_FILL_OPTIONS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), 
GIMP_TYPE_BUCKET_FILL_OPTIONS, GimpBucketFillOptionsClass))
 
 
-typedef struct _GimpBucketFillOptions GimpBucketFillOptions;
-typedef struct _GimpPaintOptionsClass GimpBucketFillOptionsClass;
+typedef struct _GimpBucketFillOptions        GimpBucketFillOptions;
+typedef struct _GimpBucketFillOptionsPrivate GimpBucketFillOptionsPrivate;
+typedef struct _GimpPaintOptionsClass        GimpBucketFillOptionsClass;
 
 struct _GimpBucketFillOptions
 {
-  GimpPaintOptions    paint_options;
-
-  GimpBucketFillMode  fill_mode;
-  gboolean            fill_selection;
-  gboolean            fill_transparent;
-  gboolean            sample_merged;
-  gboolean            diagonal_neighbors;
-  gboolean            antialias;
-  gdouble             threshold;
-  GimpSelectCriterion fill_criterion;
+  GimpPaintOptions              paint_options;
+
+  GimpBucketFillMode            fill_mode;
+  gboolean                      fill_selection;
+  gboolean                      fill_transparent;
+  gboolean                      sample_merged;
+  gboolean                      diagonal_neighbors;
+  gboolean                      antialias;
+  gdouble                       threshold;
+
+  gdouble                       line_art_threshold;
+  gint                          line_art_erosion;
+
+  GimpSelectCriterion           fill_criterion;
+
+  GimpBucketFillOptionsPrivate *priv;
 };
 
 
diff --git a/app/tools/gimpbucketfilltool.c b/app/tools/gimpbucketfilltool.c
index 1d00a9fa14..97d91262b5 100644
--- a/app/tools/gimpbucketfilltool.c
+++ b/app/tools/gimpbucketfilltool.c
@@ -382,6 +382,8 @@ gimp_bucket_fill_tool_preview (GimpBucketFillTool *tool,
                                                    options->threshold / 255.0,
                                                    options->sample_merged,
                                                    options->diagonal_neighbors,
+                                                   options->line_art_threshold,
+                                                   options->line_art_erosion,
                                                    x, y, &tool->priv->fill_mask,
                                                    &x, &y, NULL, NULL);
       if (line_art)
@@ -683,6 +685,8 @@ typedef struct
   GimpBucketFillTool *tool;
   GimpPickable       *pickable;
   gboolean            fill_transparent;
+  gdouble             line_art_threshold;
+  gint                line_art_erosion;
 } PrecomputeData;
 
 static void
@@ -700,7 +704,9 @@ gimp_bucket_fill_compute_line_art_async  (GimpAsync      *async,
   GeglBuffer *line_art;
 
   line_art = gimp_pickable_contiguous_region_prepare_line_art (data->pickable,
-                                                               data->fill_transparent);
+                                                               data->fill_transparent,
+                                                               data->line_art_threshold,
+                                                               data->line_art_erosion);
   precompute_data_free (data);
   if (gimp_async_is_canceled (async))
     {
@@ -760,9 +766,11 @@ gimp_bucket_fill_compute_line_art (GimpBucketFillTool *tool)
         {
           PrecomputeData *data = g_slice_new (PrecomputeData);
 
-          data->tool             = g_object_ref (tool);
-          data->pickable         = pickable;
-          data->fill_transparent = options->fill_transparent;
+          data->tool               = g_object_ref (tool);
+          data->pickable           = pickable;
+          data->fill_transparent   = options->fill_transparent;
+          data->line_art_threshold = options->line_art_threshold;
+          data->line_art_erosion   = options->line_art_erosion;
 
           if (tool->priv->async)
             {
@@ -802,6 +810,12 @@ gimp_bucket_fill_tool_connect_handlers (gpointer data)
       g_signal_connect (options, "notify::fill-transparent",
                         G_CALLBACK (gimp_bucket_fill_tool_options_notified),
                         tool);
+      g_signal_connect (options, "notify::line-art-erosion",
+                        G_CALLBACK (gimp_bucket_fill_tool_options_notified),
+                        tool);
+      g_signal_connect (options, "notify::line-art-threshold",
+                        G_CALLBACK (gimp_bucket_fill_tool_options_notified),
+                        tool);
 
       g_signal_connect (context, "image-changed",
                         G_CALLBACK (gimp_bucket_fill_tool_image_changed),
@@ -818,8 +832,11 @@ gimp_bucket_fill_tool_options_notified (GimpBucketFillOptions *options,
                                         GParamSpec            *pspec,
                                         GimpBucketFillTool    *tool)
 {
-  if ((! strcmp (pspec->name, "fill-criterion")   ||
-       ! strcmp (pspec->name, "fill-transparent") ||
+  if ((! strcmp (pspec->name, "fill-criterion")     ||
+       ! strcmp (pspec->name, "fill-transparent")   ||
+       ! strcmp (pspec->name, "line-art-erosion")   ||
+       ! strcmp (pspec->name, "line-art-erosion")   ||
+       ! strcmp (pspec->name, "line-art-threshold") ||
        ! strcmp (pspec->name, "sample-merged")) &&
       options->fill_criterion == GIMP_SELECT_CRITERION_LINE_ART)
     {
diff --git a/app/tools/gimpfuzzyselecttool.c b/app/tools/gimpfuzzyselecttool.c
index b3eee7d196..74b78b8c29 100644
--- a/app/tools/gimpfuzzyselecttool.c
+++ b/app/tools/gimpfuzzyselecttool.c
@@ -128,5 +128,6 @@ gimp_fuzzy_select_tool_get_mask (GimpRegionSelectTool *region_select,
                                                   options->select_transparent,
                                                   options->select_criterion,
                                                   options->diagonal_neighbors,
+                                                  0.92, -1, /* TODO */
                                                   x, y);
 }
diff --git a/pdb/groups/drawable_edit.pdb b/pdb/groups/drawable_edit.pdb
index 79b8c395c5..64696170b9 100644
--- a/pdb/groups/drawable_edit.pdb
+++ b/pdb/groups/drawable_edit.pdb
@@ -175,6 +175,7 @@ HELP
                                      GIMP_PDB_CONTEXT (context)->sample_threshold,
                                      GIMP_PDB_CONTEXT (context)->sample_merged,
                                      GIMP_PDB_CONTEXT (context)->diagonal_neighbors,
+                                     0.92, -1, /* TODO */
                                      x, y);
         }
       else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]