diff --git a/ChangeLog b/ChangeLog index 6c799286ed..f5f495e9dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2008-05-22 Sven Neumann + + * app/core/gimpdrawable-operation.[ch] + (gimp_drawable_apply_operation): changed order of parameters to be + consistent with gimp_drawable_process(). + + * app/core/gimpdrawable-process.[ch]: introduced a variant of + gimp_drawable_process() for processing a GimpLut with + gimp_lut_process(). + + * app/core/gimpdrawable-brightness-contrast.c + * app/core/gimpdrawable-color-balance.c + * app/core/gimpdrawable-colorize.c + * app/core/gimpdrawable-curves.c + * app/core/gimpdrawable-desaturate.c + * app/core/gimpdrawable-equalize.c + * app/core/gimpdrawable-hue-saturation.c + * app/core/gimpdrawable-invert.c + * app/core/gimpdrawable-levels.c + * app/core/gimpdrawable-posterize.c + * app/core/gimpdrawable-threshold.c: changed accordingly. + 2008-05-22 Michael Natterer * app/tools/gimpimagemaptool.[ch]: s/save/export/g, diff --git a/app/core/gimpdrawable-brightness-contrast.c b/app/core/gimpdrawable-brightness-contrast.c index 3a27950e29..32ee8bbb34 100644 --- a/app/core/gimpdrawable-brightness-contrast.c +++ b/app/core/gimpdrawable-brightness-contrast.c @@ -67,9 +67,8 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable, NULL); gimp_brightness_contrast_config_set_node (config, node); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Brightness_Contrast")); - + gimp_drawable_apply_operation (drawable, progress, + _("Brightness_Contrast"), node, TRUE); g_object_unref (node); } else @@ -80,9 +79,8 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable, config->contrast, gimp_drawable_bytes (drawable)); - gimp_drawable_process (drawable, progress, _("Brightness-Contrast"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, progress, _("Brightness-Contrast"), + lut); gimp_lut_free (lut); } diff --git a/app/core/gimpdrawable-color-balance.c b/app/core/gimpdrawable-color-balance.c index 22f7a9b443..5f731356e2 100644 --- a/app/core/gimpdrawable-color-balance.c +++ b/app/core/gimpdrawable-color-balance.c @@ -77,9 +77,8 @@ gimp_drawable_color_balance (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Color Balance")); - + gimp_drawable_apply_operation (drawable, progress, _("Color Balance"), + node, TRUE); g_object_unref (node); } else diff --git a/app/core/gimpdrawable-colorize.c b/app/core/gimpdrawable-colorize.c index ed0fcb044f..72e64ee7f5 100644 --- a/app/core/gimpdrawable-colorize.c +++ b/app/core/gimpdrawable-colorize.c @@ -70,9 +70,8 @@ gimp_drawable_colorize (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Colorize")); - + gimp_drawable_apply_operation (drawable, progress, _("Colorize"), + node, TRUE); g_object_unref (node); } else diff --git a/app/core/gimpdrawable-curves.c b/app/core/gimpdrawable-curves.c index 7fba79acec..a00aca5dbb 100644 --- a/app/core/gimpdrawable-curves.c +++ b/app/core/gimpdrawable-curves.c @@ -162,9 +162,8 @@ gimp_drawable_curves (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Curves")); - + gimp_drawable_apply_operation (drawable, progress, _("Curves"), + node, TRUE); g_object_unref (node); } else @@ -180,9 +179,7 @@ gimp_drawable_curves (GimpDrawable *drawable, &cruft, gimp_drawable_bytes (drawable)); - gimp_drawable_process (drawable, progress, _("Curves"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, progress, _("Curves"), lut); gimp_lut_free (lut); } } diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index fe2c182090..121bc72e97 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -68,9 +68,8 @@ gimp_drawable_desaturate (GimpDrawable *drawable, g_object_unref (config); - gimp_drawable_apply_operation (drawable, desaturate, TRUE, - progress, _("Desaturate")); - + gimp_drawable_apply_operation (drawable, progress, _("Desaturate"), + desaturate, TRUE); g_object_unref (desaturate); } else diff --git a/app/core/gimpdrawable-equalize.c b/app/core/gimpdrawable-equalize.c index 0be903d422..1cac6bef96 100644 --- a/app/core/gimpdrawable-equalize.c +++ b/app/core/gimpdrawable-equalize.c @@ -50,8 +50,6 @@ gimp_drawable_equalize (GimpDrawable *drawable, lut = equalize_lut_new (hist, gimp_drawable_bytes (drawable)); gimp_histogram_unref (hist); - gimp_drawable_process (drawable, NULL, _("Equalize"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, NULL, _("Equalize"), lut); gimp_lut_free (lut); } diff --git a/app/core/gimpdrawable-hue-saturation.c b/app/core/gimpdrawable-hue-saturation.c index 196ef006a6..63e536bc7d 100644 --- a/app/core/gimpdrawable-hue-saturation.c +++ b/app/core/gimpdrawable-hue-saturation.c @@ -75,9 +75,8 @@ gimp_drawable_hue_saturation (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Hue-Saturation")); - + gimp_drawable_apply_operation (drawable, progress, _("Hue-Saturation"), + node, TRUE); g_object_unref (node); } else diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index fec217b79b..15ac7af02a 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -52,18 +52,15 @@ gimp_drawable_invert (GimpDrawable *drawable, invert = g_object_new (GEGL_TYPE_NODE, "operation", "invert", NULL); - gimp_drawable_apply_operation (drawable, invert, TRUE, - progress, _("Invert")); - + gimp_drawable_apply_operation (drawable, progress, _("Invert"), + invert, TRUE); g_object_unref (invert); } else { GimpLut *lut = invert_lut_new (gimp_drawable_bytes (drawable)); - gimp_drawable_process (drawable, progress, _("Invert"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, progress, _("Invert"), lut); gimp_lut_free (lut); } } diff --git a/app/core/gimpdrawable-levels.c b/app/core/gimpdrawable-levels.c index 303524e84e..8d18a53703 100644 --- a/app/core/gimpdrawable-levels.c +++ b/app/core/gimpdrawable-levels.c @@ -151,28 +151,23 @@ gimp_drawable_levels_internal (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, levels, TRUE, - progress, _("Levels")); + gimp_drawable_apply_operation (drawable, progress, _("Levels"), + levels, TRUE); g_object_unref (levels); } else { Levels levels; - GimpLut *lut; + GimpLut *lut = gimp_lut_new (); gimp_levels_config_to_cruft (config, &levels, gimp_drawable_is_rgb (drawable)); - - lut = gimp_lut_new (); gimp_lut_setup (lut, - (GimpLutFunc) levels_lut_func, - &levels, + (GimpLutFunc) levels_lut_func, &levels, gimp_drawable_bytes (drawable)); - gimp_drawable_process (drawable, progress, _("Levels"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, progress, _("Levels"), lut); gimp_lut_free (lut); } } diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c index b24777f475..fb7b786e82 100644 --- a/app/core/gimpdrawable-operation.c +++ b/app/core/gimpdrawable-operation.c @@ -36,15 +36,16 @@ #warning FIXME: gegl_node_add_child() is not public API #endif -extern GeglNode * gegl_node_add_child (GeglNode *self, - GeglNode *child); +extern GeglNode * gegl_node_add_child (GeglNode *self, + GeglNode *child); + void gimp_drawable_apply_operation (GimpDrawable *drawable, - GeglNode *operation, - gboolean linear, GimpProgress *progress, - const gchar *undo_desc) + const gchar *undo_desc, + GeglNode *operation, + gboolean linear) { GeglNode *gegl; GeglNode *input; @@ -55,9 +56,9 @@ gimp_drawable_apply_operation (GimpDrawable *drawable, g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); - g_return_if_fail (GEGL_IS_NODE (operation)); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); g_return_if_fail (undo_desc != NULL); + g_return_if_fail (GEGL_IS_NODE (operation)); if (! gimp_drawable_mask_intersect (drawable, &rect.x, &rect.y, diff --git a/app/core/gimpdrawable-operation.h b/app/core/gimpdrawable-operation.h index 1143f40c43..c063d9d254 100644 --- a/app/core/gimpdrawable-operation.h +++ b/app/core/gimpdrawable-operation.h @@ -26,10 +26,10 @@ void gimp_drawable_apply_operation (GimpDrawable *drawable, - GeglNode *operation, - gboolean linear, GimpProgress *progress, - const gchar *undo_desc); + const gchar *undo_desc, + GeglNode *operation, + gboolean linear); #endif /* __GIMP_DRAWABLE_OPERATION_H__ */ diff --git a/app/core/gimpdrawable-posterize.c b/app/core/gimpdrawable-posterize.c index c9e5dee49c..fde280fd16 100644 --- a/app/core/gimpdrawable-posterize.c +++ b/app/core/gimpdrawable-posterize.c @@ -67,9 +67,8 @@ gimp_drawable_posterize (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Posterize")); - + gimp_drawable_apply_operation (drawable, progress, _("Posterize"), + node, TRUE); g_object_unref (node); } else @@ -78,9 +77,7 @@ gimp_drawable_posterize (GimpDrawable *drawable, lut = posterize_lut_new (config->levels, gimp_drawable_bytes (drawable)); - gimp_drawable_process (drawable, progress, _("Posterize"), - (PixelProcessorFunc) gimp_lut_process, lut); - + gimp_drawable_process_lut (drawable, progress, _("Posterize"), lut); gimp_lut_free (lut); } diff --git a/app/core/gimpdrawable-process.c b/app/core/gimpdrawable-process.c index 69eac3586a..82c6a32e73 100644 --- a/app/core/gimpdrawable-process.c +++ b/app/core/gimpdrawable-process.c @@ -22,6 +22,7 @@ #include "core-types.h" +#include "base/gimplut.h" #include "base/pixel-processor.h" #include "base/pixel-region.h" @@ -43,6 +44,7 @@ gimp_drawable_process (GimpDrawable *drawable, g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); + g_return_if_fail (undo_desc != NULL); if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) { @@ -61,3 +63,12 @@ gimp_drawable_process (GimpDrawable *drawable, gimp_drawable_update (drawable, x, y, width, height); } } +void +gimp_drawable_process_lut (GimpDrawable *drawable, + GimpProgress *progress, + const gchar *undo_desc, + GimpLut *lut) +{ + gimp_drawable_process (drawable, progress, undo_desc, + (PixelProcessorFunc) gimp_lut_process, lut); +} diff --git a/app/core/gimpdrawable-process.h b/app/core/gimpdrawable-process.h index 6ee652f751..dfb847466b 100644 --- a/app/core/gimpdrawable-process.h +++ b/app/core/gimpdrawable-process.h @@ -20,11 +20,15 @@ #define __GIMP_DRAWABLE_PROCESS_H__ -void gimp_drawable_process (GimpDrawable *drawable, - GimpProgress *progress, - const gchar *undo_desc, - PixelProcessorFunc func, - gpointer data); +void gimp_drawable_process (GimpDrawable *drawable, + GimpProgress *progress, + const gchar *undo_desc, + PixelProcessorFunc func, + gpointer data); +void gimp_drawable_process_lut (GimpDrawable *drawable, + GimpProgress *progress, + const gchar *undo_desc, + GimpLut *lut); #endif /* __GIMP_DRAWABLE_PROCESS_H__ */ diff --git a/app/core/gimpdrawable-threshold.c b/app/core/gimpdrawable-threshold.c index 95194c3f74..69d73f34a5 100644 --- a/app/core/gimpdrawable-threshold.c +++ b/app/core/gimpdrawable-threshold.c @@ -68,9 +68,8 @@ gimp_drawable_threshold (GimpDrawable *drawable, "config", config, NULL); - gimp_drawable_apply_operation (drawable, node, TRUE, - progress, _("Threshold")); - + gimp_drawable_apply_operation (drawable, progress, _("Threshold"), + node, TRUE); g_object_unref (node); } else