changed order of parameters to be consistent with gimp_drawable_process().

2008-05-22  Sven Neumann  <sven@gimp.org>

	* 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.

svn path=/trunk/; revision=25754
This commit is contained in:
Sven Neumann
2008-05-22 11:52:02 +00:00
committed by Sven Neumann
parent e3ffcae1bb
commit 8a62ba6a5d
16 changed files with 81 additions and 66 deletions

View File

@ -1,3 +1,25 @@
2008-05-22 Sven Neumann <sven@gimp.org>
* 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 <mitch@gimp.org> 2008-05-22 Michael Natterer <mitch@gimp.org>
* app/tools/gimpimagemaptool.[ch]: s/save/export/g, * app/tools/gimpimagemaptool.[ch]: s/save/export/g,

View File

@ -67,9 +67,8 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable,
NULL); NULL);
gimp_brightness_contrast_config_set_node (config, node); gimp_brightness_contrast_config_set_node (config, node);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress,
progress, _("Brightness_Contrast")); _("Brightness_Contrast"), node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else
@ -80,9 +79,8 @@ gimp_drawable_brightness_contrast (GimpDrawable *drawable,
config->contrast, config->contrast,
gimp_drawable_bytes (drawable)); gimp_drawable_bytes (drawable));
gimp_drawable_process (drawable, progress, _("Brightness-Contrast"), gimp_drawable_process_lut (drawable, progress, _("Brightness-Contrast"),
(PixelProcessorFunc) gimp_lut_process, lut); lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }

View File

@ -77,9 +77,8 @@ gimp_drawable_color_balance (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Color Balance"),
progress, _("Color Balance")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else

View File

@ -70,9 +70,8 @@ gimp_drawable_colorize (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Colorize"),
progress, _("Colorize")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else

View File

@ -162,9 +162,8 @@ gimp_drawable_curves (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Curves"),
progress, _("Curves")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else
@ -180,9 +179,7 @@ gimp_drawable_curves (GimpDrawable *drawable,
&cruft, &cruft,
gimp_drawable_bytes (drawable)); gimp_drawable_bytes (drawable));
gimp_drawable_process (drawable, progress, _("Curves"), gimp_drawable_process_lut (drawable, progress, _("Curves"), lut);
(PixelProcessorFunc) gimp_lut_process, lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }
} }

View File

@ -68,9 +68,8 @@ gimp_drawable_desaturate (GimpDrawable *drawable,
g_object_unref (config); g_object_unref (config);
gimp_drawable_apply_operation (drawable, desaturate, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Desaturate"),
progress, _("Desaturate")); desaturate, TRUE);
g_object_unref (desaturate); g_object_unref (desaturate);
} }
else else

View File

@ -50,8 +50,6 @@ gimp_drawable_equalize (GimpDrawable *drawable,
lut = equalize_lut_new (hist, gimp_drawable_bytes (drawable)); lut = equalize_lut_new (hist, gimp_drawable_bytes (drawable));
gimp_histogram_unref (hist); gimp_histogram_unref (hist);
gimp_drawable_process (drawable, NULL, _("Equalize"), gimp_drawable_process_lut (drawable, NULL, _("Equalize"), lut);
(PixelProcessorFunc) gimp_lut_process, lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }

View File

@ -75,9 +75,8 @@ gimp_drawable_hue_saturation (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Hue-Saturation"),
progress, _("Hue-Saturation")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else

View File

@ -52,18 +52,15 @@ gimp_drawable_invert (GimpDrawable *drawable,
invert = g_object_new (GEGL_TYPE_NODE, "operation", "invert", NULL); invert = g_object_new (GEGL_TYPE_NODE, "operation", "invert", NULL);
gimp_drawable_apply_operation (drawable, invert, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Invert"),
progress, _("Invert")); invert, TRUE);
g_object_unref (invert); g_object_unref (invert);
} }
else else
{ {
GimpLut *lut = invert_lut_new (gimp_drawable_bytes (drawable)); GimpLut *lut = invert_lut_new (gimp_drawable_bytes (drawable));
gimp_drawable_process (drawable, progress, _("Invert"), gimp_drawable_process_lut (drawable, progress, _("Invert"), lut);
(PixelProcessorFunc) gimp_lut_process, lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }
} }

View File

@ -151,28 +151,23 @@ gimp_drawable_levels_internal (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, levels, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Levels"),
progress, _("Levels")); levels, TRUE);
g_object_unref (levels); g_object_unref (levels);
} }
else else
{ {
Levels levels; Levels levels;
GimpLut *lut; GimpLut *lut = gimp_lut_new ();
gimp_levels_config_to_cruft (config, &levels, gimp_levels_config_to_cruft (config, &levels,
gimp_drawable_is_rgb (drawable)); gimp_drawable_is_rgb (drawable));
lut = gimp_lut_new ();
gimp_lut_setup (lut, gimp_lut_setup (lut,
(GimpLutFunc) levels_lut_func, (GimpLutFunc) levels_lut_func, &levels,
&levels,
gimp_drawable_bytes (drawable)); gimp_drawable_bytes (drawable));
gimp_drawable_process (drawable, progress, _("Levels"), gimp_drawable_process_lut (drawable, progress, _("Levels"), lut);
(PixelProcessorFunc) gimp_lut_process, lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }
} }

View File

@ -36,15 +36,16 @@
#warning FIXME: gegl_node_add_child() is not public API #warning FIXME: gegl_node_add_child() is not public API
#endif #endif
extern GeglNode * gegl_node_add_child (GeglNode *self, extern GeglNode * gegl_node_add_child (GeglNode *self,
GeglNode *child); GeglNode *child);
void void
gimp_drawable_apply_operation (GimpDrawable *drawable, gimp_drawable_apply_operation (GimpDrawable *drawable,
GeglNode *operation,
gboolean linear,
GimpProgress *progress, GimpProgress *progress,
const gchar *undo_desc) const gchar *undo_desc,
GeglNode *operation,
gboolean linear)
{ {
GeglNode *gegl; GeglNode *gegl;
GeglNode *input; 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_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (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 (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (undo_desc != NULL); g_return_if_fail (undo_desc != NULL);
g_return_if_fail (GEGL_IS_NODE (operation));
if (! gimp_drawable_mask_intersect (drawable, if (! gimp_drawable_mask_intersect (drawable,
&rect.x, &rect.y, &rect.x, &rect.y,

View File

@ -26,10 +26,10 @@
void gimp_drawable_apply_operation (GimpDrawable *drawable, void gimp_drawable_apply_operation (GimpDrawable *drawable,
GeglNode *operation,
gboolean linear,
GimpProgress *progress, GimpProgress *progress,
const gchar *undo_desc); const gchar *undo_desc,
GeglNode *operation,
gboolean linear);
#endif /* __GIMP_DRAWABLE_OPERATION_H__ */ #endif /* __GIMP_DRAWABLE_OPERATION_H__ */

View File

@ -67,9 +67,8 @@ gimp_drawable_posterize (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Posterize"),
progress, _("Posterize")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else
@ -78,9 +77,7 @@ gimp_drawable_posterize (GimpDrawable *drawable,
lut = posterize_lut_new (config->levels, gimp_drawable_bytes (drawable)); lut = posterize_lut_new (config->levels, gimp_drawable_bytes (drawable));
gimp_drawable_process (drawable, progress, _("Posterize"), gimp_drawable_process_lut (drawable, progress, _("Posterize"), lut);
(PixelProcessorFunc) gimp_lut_process, lut);
gimp_lut_free (lut); gimp_lut_free (lut);
} }

View File

@ -22,6 +22,7 @@
#include "core-types.h" #include "core-types.h"
#include "base/gimplut.h"
#include "base/pixel-processor.h" #include "base/pixel-processor.h"
#include "base/pixel-region.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_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (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 (progress == NULL || GIMP_IS_PROGRESS (progress));
g_return_if_fail (undo_desc != NULL);
if (gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) 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); 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);
}

View File

@ -20,11 +20,15 @@
#define __GIMP_DRAWABLE_PROCESS_H__ #define __GIMP_DRAWABLE_PROCESS_H__
void gimp_drawable_process (GimpDrawable *drawable, void gimp_drawable_process (GimpDrawable *drawable,
GimpProgress *progress, GimpProgress *progress,
const gchar *undo_desc, const gchar *undo_desc,
PixelProcessorFunc func, PixelProcessorFunc func,
gpointer data); gpointer data);
void gimp_drawable_process_lut (GimpDrawable *drawable,
GimpProgress *progress,
const gchar *undo_desc,
GimpLut *lut);
#endif /* __GIMP_DRAWABLE_PROCESS_H__ */ #endif /* __GIMP_DRAWABLE_PROCESS_H__ */

View File

@ -68,9 +68,8 @@ gimp_drawable_threshold (GimpDrawable *drawable,
"config", config, "config", config,
NULL); NULL);
gimp_drawable_apply_operation (drawable, node, TRUE, gimp_drawable_apply_operation (drawable, progress, _("Threshold"),
progress, _("Threshold")); node, TRUE);
g_object_unref (node); g_object_unref (node);
} }
else else