[gimp] pdb: Use the diagonal-neighbors setting from GimpPDBContext...



commit 7b89fe65366e37934be580756f68eefad92d7453
Author: Ell <ell_se yahoo com>
Date:   Mon Jan 11 10:44:21 2016 +0000

    pdb: Use the diagonal-neighbors setting from GimpPDBContext...
    
    ...in gimp-image-select-contiguous-color()
    
    This and the last 5 commits fix bug 760481.

 app/pdb/context-cmds.c            |    3 ++-
 app/pdb/image-select-cmds.c       |    4 ++--
 libgimp/gimpcontext_pdb.c         |    2 ++
 libgimp/gimpimageselect_pdb.c     |    3 ++-
 tools/pdbgen/pdb/context.pdb      |    3 +++
 tools/pdbgen/pdb/image_select.pdb |    4 ++--
 6 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/app/pdb/context-cmds.c b/app/pdb/context-cmds.c
index 1c67391..a2f8d8e 100644
--- a/app/pdb/context-cmds.c
+++ b/app/pdb/context-cmds.c
@@ -4601,7 +4601,8 @@ register_context_procs (GimpPDB *pdb)
   gimp_procedure_set_static_strings (procedure,
                                      "gimp-context-set-diagonal-neighbors",
                                      "Set the diagonal neighbors setting.",
-                                     "This procedure modifies the diagonal neighbors setting. If the 
affected region of an operation is based on a seed point, like when doing a seed fill, then, when this 
setting is TRUE, all eight neighbors of each pixel are considered when calculating the affected region; in 
contrast, when this setting is FALSE, only the four orthogonal neighors of each pixel are considered.",
+                                     "This procedure modifies the diagonal neighbors setting. If the 
affected region of an operation is based on a seed point, like when doing a seed fill, then, when this 
setting is TRUE, all eight neighbors of each pixel are considered when calculating the affected region; in 
contrast, when this setting is FALSE, only the four orthogonal neighors of each pixel are considered.\n"
+                                     "This setting affects the following procedures: 
'gimp-image-select-contiguous-color'.",
                                      "Ell",
                                      "Ell",
                                      "2016",
diff --git a/app/pdb/image-select-cmds.c b/app/pdb/image-select-cmds.c
index 3bbfac2..823e4f2 100644
--- a/app/pdb/image-select-cmds.c
+++ b/app/pdb/image-select-cmds.c
@@ -129,7 +129,7 @@ image_select_contiguous_color_invoker (GimpProcedure         *procedure,
                                      pdb_context->sample_threshold,
                                      pdb_context->sample_transparent,
                                      pdb_context->sample_criterion,
-                                     FALSE /* no diagonal neighnors */,
+                                     pdb_context->diagonal_neighbors,
                                      operation,
                                      pdb_context->antialias,
                                      pdb_context->feather,
@@ -411,7 +411,7 @@ register_image_select_procs (GimpPDB *pdb)
                                      "gimp-image-select-contiguous-color",
                                      "Create a selection by selecting all pixels around specified 
coordinates with the same (or similar) color to that at the coordinates.",
                                      "This tool creates a contiguous selection over the specified image. A 
contiguous color selection is determined by a seed fill under the constraints of the current context 
settings. Essentially, the color at the specified coordinates (in the drawable) is measured and the selection 
expands outwards from that point to any adjacent pixels which are not significantly different (as determined 
by the threshold and criterion context settings). This process continues until no more expansion is possible. 
If antialiasing is turned on, the final selection mask will contain intermediate values based on close misses 
to the threshold bar at pixels along the seed fill boundary.\n"
-                                     "This procedure is affected by the following context setters: 
'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 
'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 
'gimp-context-set-sample-transparent'.\n"
+                                     "This procedure is affected by the following context setters: 
'gimp-context-set-antialias', 'gimp-context-set-feather', 'gimp-context-set-feather-radius', 
'gimp-context-set-sample-merged', 'gimp-context-set-sample-criterion', 'gimp-context-set-sample-threshold', 
'gimp-context-set-sample-transparent', 'gimp-context-set-diagonal-neighbors'.\n"
                                      "In the case of a merged sampling, the supplied drawable is ignored. If 
the sample is merged, the specified coordinates are relative to the image origin; otherwise, they are 
relative to the drawable's origin.",
                                      "David Gowers",
                                      "David Gowers",
diff --git a/libgimp/gimpcontext_pdb.c b/libgimp/gimpcontext_pdb.c
index d9898b0..9b3dc4e 100644
--- a/libgimp/gimpcontext_pdb.c
+++ b/libgimp/gimpcontext_pdb.c
@@ -2621,6 +2621,8 @@ gimp_context_get_diagonal_neighbors (void)
  * neighbors of each pixel are considered when calculating the affected
  * region; in contrast, when this setting is FALSE, only the four
  * orthogonal neighors of each pixel are considered.
+ * This setting affects the following procedures:
+ * gimp_image_select_contiguous_color().
  *
  * Returns: TRUE on success.
  *
diff --git a/libgimp/gimpimageselect_pdb.c b/libgimp/gimpimageselect_pdb.c
index 58023c8..59c969d 100644
--- a/libgimp/gimpimageselect_pdb.c
+++ b/libgimp/gimpimageselect_pdb.c
@@ -116,7 +116,8 @@ gimp_image_select_color (gint32          image_ID,
  * gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
  * gimp_context_set_sample_criterion(),
  * gimp_context_set_sample_threshold(),
- * gimp_context_set_sample_transparent().
+ * gimp_context_set_sample_transparent(),
+ * gimp_context_set_diagonal_neighbors().
  * In the case of a merged sampling, the supplied drawable is ignored.
  * If the sample is merged, the specified coordinates are relative to
  * the image origin; otherwise, they are relative to the drawable's
diff --git a/tools/pdbgen/pdb/context.pdb b/tools/pdbgen/pdb/context.pdb
index 5bd6d17..80b2976 100644
--- a/tools/pdbgen/pdb/context.pdb
+++ b/tools/pdbgen/pdb/context.pdb
@@ -2309,6 +2309,9 @@ fill, then, when this setting is TRUE, all eight neighbors of each pixel
 are considered when calculating the affected region; in contrast, when
 this setting is FALSE, only the four orthogonal neighors of each pixel
 are considered.
+
+This setting affects the following procedures:
+gimp_image_select_contiguous_color().
 HELP
 
     $author = 'Ell';
diff --git a/tools/pdbgen/pdb/image_select.pdb b/tools/pdbgen/pdb/image_select.pdb
index 7b04ecd..1db4820 100644
--- a/tools/pdbgen/pdb/image_select.pdb
+++ b/tools/pdbgen/pdb/image_select.pdb
@@ -103,7 +103,7 @@ This procedure is affected by the following context setters:
 gimp_context_set_antialias(), gimp_context_set_feather(),
 gimp_context_set_feather_radius(), gimp_context_set_sample_merged(),
 gimp_context_set_sample_criterion(), gimp_context_set_sample_threshold(),
-gimp_context_set_sample_transparent().
+gimp_context_set_sample_transparent(), gimp_context_set_diagonal_neighbors().
 
 In the case of a merged sampling, the supplied drawable is ignored.
 If the sample is merged, the specified coordinates are relative to the
@@ -143,7 +143,7 @@ HELP
                                  pdb_context->sample_threshold,
                                  pdb_context->sample_transparent,
                                  pdb_context->sample_criterion,
-                                 FALSE /* no diagonal neighnors */,
+                                 pdb_context->diagonal_neighbors,
                                  operation,
                                  pdb_context->antialias,
                                  pdb_context->feather,


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