[gimp] Bug 757686 - There is no easy way to do a radiometrically correct...



commit 41674893b2651f9421d23bc1ca77b35a90571987
Author: Øyvind Kolås <pippin gimp org>
Date:   Sat Dec 24 03:53:19 2016 +0100

    Bug 757686 - There is no easy way to do a radiometrically correct...
    
    ...invert operation
    
    Add linear invert menu item, and improve invert tooltips.

 app/actions/drawable-actions.c  |   12 ++++++++++--
 app/actions/drawable-commands.c |   20 ++++++++++++++++++--
 app/actions/drawable-commands.h |    2 ++
 menus/image-menu.xml.in         |    1 +
 4 files changed, 31 insertions(+), 4 deletions(-)
---
diff --git a/app/actions/drawable-actions.c b/app/actions/drawable-actions.c
index f4ee705..e288dbb 100644
--- a/app/actions/drawable-actions.c
+++ b/app/actions/drawable-actions.c
@@ -49,13 +49,20 @@ static const GimpActionEntry drawable_actions[] =
 
   { "drawable-invert", GIMP_STOCK_INVERT,
     NC_("drawable-action", "In_vert"), NULL,
-    NC_("drawable-action", "Invert the colors"),
+    NC_("drawable-action", "Invert the colors perceptually"),
     G_CALLBACK (drawable_invert_cmd_callback),
     GIMP_HELP_LAYER_INVERT },
 
+  { "drawable-linear-invert", GIMP_STOCK_INVERT,
+    NC_("drawable-action", "_Linear Invert"), NULL,
+    NC_("drawable-action", "Invert the colors in linear light"),
+    G_CALLBACK (drawable_linear_invert_cmd_callback),
+    GIMP_HELP_LAYER_INVERT },
+
   { "drawable-value-invert", GIMP_STOCK_GEGL,
     NC_("drawable-action", "_Value Invert"), NULL,
-    NC_("drawable-action", "Invert the brightness of each pixel"),
+    NC_("drawable-action",
+        "Invert the brightness of each pixel, keeping the color"),
     G_CALLBACK (drawable_value_invert_cmd_callback),
     GIMP_HELP_LAYER_INVERT },
 
@@ -241,6 +248,7 @@ drawable_actions_update (GimpActionGroup *group,
 
   SET_SENSITIVE ("drawable-equalize",       writable && !children);
   SET_SENSITIVE ("drawable-invert",         writable && !children);
+  SET_SENSITIVE ("drawable-linear-invert",  writable && !children);
   SET_SENSITIVE ("drawable-value-invert",   writable && !children);
   SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
   SET_SENSITIVE ("drawable-dilate",         writable && !children);
diff --git a/app/actions/drawable-commands.c b/app/actions/drawable-commands.c
index bbdfdc3..3b282cf 100644
--- a/app/actions/drawable-commands.c
+++ b/app/actions/drawable-commands.c
@@ -80,7 +80,6 @@ drawable_invert_cmd_callback (GtkAction *action,
   return_if_no_drawable (image, drawable, data);
   return_if_no_display (display, data);
 
-  /* FIXME invert masks? */
   gimp_drawable_apply_operation_by_name (drawable, GIMP_PROGRESS (display),
                                          _("Invert"), "gegl:invert-gamma",
                                          NULL);
@@ -88,6 +87,23 @@ drawable_invert_cmd_callback (GtkAction *action,
 }
 
 void
+drawable_linear_invert_cmd_callback (GtkAction *action,
+                                     gpointer   data)
+{
+  GimpImage    *image;
+  GimpDrawable *drawable;
+  GimpDisplay  *display;
+  return_if_no_drawable (image, drawable, data);
+  return_if_no_display (display, data);
+
+  gimp_drawable_apply_operation_by_name (drawable, GIMP_PROGRESS (display),
+                                         _("Linear Invert"), "gegl:invert-linear",
+                                         NULL);
+  gimp_image_flush (image);
+}
+
+
+void
 drawable_value_invert_cmd_callback (GtkAction *action,
                                     gpointer   data)
 {
@@ -98,7 +114,7 @@ drawable_value_invert_cmd_callback (GtkAction *action,
   return_if_no_display (display, data);
 
   gimp_drawable_apply_operation_by_name (drawable, GIMP_PROGRESS (display),
-                                         _("Invert"), "gegl:value-invert",
+                                         _("Value Invert"), "gegl:value-invert",
                                          NULL);
   gimp_image_flush (image);
 }
diff --git a/app/actions/drawable-commands.h b/app/actions/drawable-commands.h
index 6159b10..90a8af8 100644
--- a/app/actions/drawable-commands.h
+++ b/app/actions/drawable-commands.h
@@ -23,6 +23,8 @@ void   drawable_equalize_cmd_callback       (GtkAction *action,
                                              gpointer   data);
 void   drawable_invert_cmd_callback         (GtkAction *action,
                                              gpointer   data);
+void   drawable_linear_invert_cmd_callback  (GtkAction *action,
+                                             gpointer   data);
 void   drawable_value_invert_cmd_callback   (GtkAction *action,
                                              gpointer   data);
 void   drawable_levels_stretch_cmd_callback (GtkAction *action,
diff --git a/menus/image-menu.xml.in b/menus/image-menu.xml.in
index 64687fc..c7999ce 100644
--- a/menus/image-menu.xml.in
+++ b/menus/image-menu.xml.in
@@ -568,6 +568,7 @@
       <separator />
       <placeholder name="Invert">
         <menuitem action="drawable-invert" />
+        <menuitem action="drawable-linear-invert" />
         <menuitem action="drawable-value-invert" />
       </placeholder>
       <separator />


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