[gimp] app: add color-reduction to the colors menu



commit ccae8cffc33220f4595d2f3241d3eba81dcbd68b
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 23 12:56:24 2012 +0200

    app: add color-reduction to the colors menu

 app/actions/filters-actions.c |   33 ++++++++++++++++++++-------------
 app/tools/gimpgegltool.c      |    1 +
 menus/image-menu.xml.in       |    1 +
 3 files changed, 22 insertions(+), 13 deletions(-)
---
diff --git a/app/actions/filters-actions.c b/app/actions/filters-actions.c
index a3d2ca5..78de58e 100644
--- a/app/actions/filters-actions.c
+++ b/app/actions/filters-actions.c
@@ -39,6 +39,12 @@
 
 static const GimpStringActionEntry filters_actions[] =
 {
+  { "filters-color-reduction", GIMP_STOCK_GEGL,
+    NC_("filters-action", "Color _Reduction..."), NULL,
+    NC_("filters-action", "Reduce the number of colors in the image, with optional dithering"),
+    "gegl:color-reduction",
+    NULL /* FIXME GIMP_HELP_FILTER_COLOR_TEMPERATURE */ },
+
   { "filters-color-temperature", GIMP_STOCK_GEGL,
     NC_("filters-action", "Color T_emperature..."), NULL,
     NC_("filters-action", "Change the color temperature of the image"),
@@ -165,19 +171,20 @@ filters_actions_update (GimpActionGroup *group,
 #define SET_SENSITIVE(action,condition) \
         gimp_action_group_set_action_sensitive (group, action, (condition) != 0)
 
-  SET_SENSITIVE ("filters-color-temperature", writable && !gray);
-  SET_SENSITIVE ("filters-color-to-alpha",    writable && !gray && alpha);
-  SET_SENSITIVE ("filters-difference-of-gaussians",          writable);
-  SET_SENSITIVE ("filters-gaussian-blur",     writable);
-  SET_SENSITIVE ("filters-laplace",           writable);
-  SET_SENSITIVE ("filters-lens-distortion",   writable);
-  SET_SENSITIVE ("filters-pixelize",          writable);
-  SET_SENSITIVE ("filters-polar-coordinates", writable);
-  SET_SENSITIVE ("filters-ripple",            writable);
-  SET_SENSITIVE ("filters-sobel",             writable);
-  SET_SENSITIVE ("filters-semi-flatten",      writable && alpha);
-  SET_SENSITIVE ("filters-threshold-alpha",   writable && alpha);
-  SET_SENSITIVE ("filters-unsharp-mask",      writable);
+  SET_SENSITIVE ("filters-color-reduction",         writable);
+  SET_SENSITIVE ("filters-color-temperature",       writable && !gray);
+  SET_SENSITIVE ("filters-color-to-alpha",          writable && !gray && alpha);
+  SET_SENSITIVE ("filters-difference-of-gaussians", writable);
+  SET_SENSITIVE ("filters-gaussian-blur",           writable);
+  SET_SENSITIVE ("filters-laplace",                 writable);
+  SET_SENSITIVE ("filters-lens-distortion",         writable);
+  SET_SENSITIVE ("filters-pixelize",                writable);
+  SET_SENSITIVE ("filters-polar-coordinates",       writable);
+  SET_SENSITIVE ("filters-ripple",                  writable);
+  SET_SENSITIVE ("filters-sobel",                   writable);
+  SET_SENSITIVE ("filters-semi-flatten",            writable && alpha);
+  SET_SENSITIVE ("filters-threshold-alpha",         writable && alpha);
+  SET_SENSITIVE ("filters-unsharp-mask",            writable);
 
 #undef SET_SENSITIVE
 }
diff --git a/app/tools/gimpgegltool.c b/app/tools/gimpgegltool.c
index dd4d4df..99f389d 100644
--- a/app/tools/gimpgegltool.c
+++ b/app/tools/gimpgegltool.c
@@ -111,6 +111,7 @@ gimp_gegl_tool_operation_blacklisted (const gchar *name,
   static const gchar * const name_blacklist[] =
   {
     "gegl:color", /* pointless */
+    "gegl:color-reduction", /* in gimp */
     "gegl:color-temperature", /* in gimp */
     "gegl:color-to-alpha", /* in gimp */
     "gegl:colorize", /* in gimp */
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index 99768ab..0037683 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -525,6 +525,7 @@
       </menu>
       <separator />
       <menuitem action="filters-color-to-alpha" />
+      <menuitem action="filters-color-reduction" />
       <menuitem action="filters-color-temperature" />
       <placeholder name="Modify" />
     </menu>



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