Commit 41674893 authored by Øyvind "pippin" Kolås's avatar Øyvind "pippin" Kolås Committed by Michael Natterer

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

...invert operation

Add linear invert menu item, and improve invert tooltips.
parent 69adce4c
......@@ -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);
......
......@@ -80,13 +80,29 @@ 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);
gimp_image_flush (image);
}
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);
}
......
......@@ -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,
......
......@@ -568,6 +568,7 @@
<separator />
<placeholder name="Invert">
<menuitem action="drawable-invert" />
<menuitem action="drawable-linear-invert" />
<menuitem action="drawable-value-invert" />
</placeholder>
<separator />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment