[gimp] Adds a hue-saturation PDB call with the 'overlap' parameter. Fixes #634008



commit 9c4995d7b0b3c8288d588c3b2b956263a6a8598c
Author: João S. O. Bueno <gwidion gmail com>
Date:   Mon Jan 6 00:42:51 2014 -0200

    Adds a hue-saturation PDB call with the 'overlap' parameter. Fixes #634008

 tools/pdbgen/pdb/color.pdb |   67 ++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 65 insertions(+), 2 deletions(-)
---
diff --git a/tools/pdbgen/pdb/color.pdb b/tools/pdbgen/pdb/color.pdb
index a6430b7..9c2a31e 100644
--- a/tools/pdbgen/pdb/color.pdb
+++ b/tools/pdbgen/pdb/color.pdb
@@ -734,7 +734,7 @@ Modify hue, lightness, and saturation in the specified drawable.
 BLURB
 
     $help = <<'HELP';
-This procedures allows the hue, lightness, and saturation in the specified
+This procedure allows the hue, lightness, and saturation in the specified
 drawable to be modified. The 'hue-range' parameter provides the capability to
 limit range of affected hues.
 HELP
@@ -786,6 +786,69 @@ CODE
     );
 }
 
+sub hue_saturation_overlap {
+    $blurb = <<'BLURB';
+Modify hue, lightness, and saturation in the specified drawable.
+BLURB
+
+    $help = <<'HELP';
+This procedure allows the hue, lightness, and saturation in the specified
+drawable to be modified. The 'hue-range' parameter provides the capability to
+limit range of affected hues. The 'overlap' parameter provides blending into
+neighboring hue channels when rendering.
+HELP
+
+    &joao_pdb_misc('2014', '2.10');
+
+    $date = '2014';
+
+    @inargs = (
+        { name => 'drawable', type => 'drawable',
+          desc => 'The drawable' },
+        { name => 'hue_range', type => 'enum GimpHueRange',
+          desc => 'Range of affected hues' },
+        { name => 'hue_offset', type => '-180 <= float <= 180',
+          desc => 'Hue offset in degrees' },
+        { name => 'lightness', type => '-100 <= float <= 100',
+          desc => 'Lightness modification' },
+        { name => 'saturation', type => '-100 <= float <= 100',
+          desc => 'Saturation modification' },
+        { name => 'overlap', type => '0 <= float <= 100',
+          desc => 'Overlap other hue channels' }
+    );
+
+    %invoke = (
+        headers => [ qw("operations/gimphuesaturationconfig.h") ],
+        code => <<'CODE'
+{
+  if (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
+                                 GIMP_PDB_ITEM_CONTENT, error) &&
+      gimp_pdb_item_is_not_group (GIMP_ITEM (drawable), error))
+    {
+      GObject *config = g_object_new (GIMP_TYPE_HUE_SATURATION_CONFIG,
+                                      "range", hue_range,
+                                      NULL);
+
+       g_object_set (config,
+                     "hue",        hue_offset / 180.0,
+                     "saturation", saturation / 100.0,
+                     "lightness",  lightness  / 100.0,
+                     "overlap",    overlap / 100.0,
+                     NULL);
+
+      gimp_drawable_apply_operation_by_name (drawable, progress,
+                                             _("Hue-Saturation"),
+                                             "gimp:hue-saturation",
+                                             config);
+      g_object_unref (config);
+    }
+  else
+    success = FALSE;
+}
+CODE
+    );
+}
+
 sub threshold {
     $blurb = 'Threshold the specified drawable.';
 
@@ -853,7 +916,7 @@ CODE
             color_balance
             colorize
             histogram
-            hue_saturation
+            hue_saturation hue_saturation_overlap
             threshold);
 
 %exports = (app => [ procs], lib => [ procs]);


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