diff --git a/ChangeLog b/ChangeLog index c179b48a22..9641a4a730 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-05-21 Michael Natterer + + * app/base/pixel-processor.h: remove PixelProcessorFunc typedef. + + * app/base/base-types.h: add it here. + + * app/config/gimpbaseconfig.c: #include "base/base-types.h" + + * app/core/gimpdrawable-curves.c + * app/core/gimpdrawable-desaturate.c + * app/core/gimpdrawable-invert.c: remove pixel processor include. + + * app/core/gimpdrawable-levels.c: port to gimp_drawable_process(). + 2008-05-21 Michael Natterer * app/core/gimpdrawable-process.c (gimp_drawable_process): add diff --git a/app/base/base-types.h b/app/base/base-types.h index 1f215b84b0..7a4d1c0c13 100644 --- a/app/base/base-types.h +++ b/app/base/base-types.h @@ -76,9 +76,10 @@ typedef struct _TilePyramid TilePyramid; /* functions */ -typedef void (* TileValidateProc) (TileManager *tm, - Tile *tile, - gpointer user_data); +typedef void (* TileValidateProc) (TileManager *tm, + Tile *tile, + gpointer user_data); +typedef void (* PixelProcessorFunc) (void); #endif /* __BASE_TYPES_H__ */ diff --git a/app/base/pixel-processor.h b/app/base/pixel-processor.h index ae28d11fae..eb3273b577 100644 --- a/app/base/pixel-processor.h +++ b/app/base/pixel-processor.h @@ -25,7 +25,6 @@ #define GIMP_MAX_NUM_THREADS 16 -typedef void (* PixelProcessorFunc) (void); typedef void (* PixelProcessorProgressFunc) (gpointer progress_data, gdouble fraction); diff --git a/app/config/gimpbaseconfig.c b/app/config/gimpbaseconfig.c index d8cc4bc00e..7516440aeb 100644 --- a/app/config/gimpbaseconfig.c +++ b/app/config/gimpbaseconfig.c @@ -32,6 +32,7 @@ #include "config-types.h" +#include "base/base-types.h" /* eek */ #include "base/base-utils.h" #include "base/pixel-processor.h" diff --git a/app/core/gimpdrawable-curves.c b/app/core/gimpdrawable-curves.c index a3a3ea10bb..7fba79acec 100644 --- a/app/core/gimpdrawable-curves.c +++ b/app/core/gimpdrawable-curves.c @@ -24,7 +24,6 @@ #include "base/curves.h" #include "base/gimplut.h" -#include "base/pixel-processor.h" #include "gegl/gimpcurvesconfig.h" diff --git a/app/core/gimpdrawable-desaturate.c b/app/core/gimpdrawable-desaturate.c index 53c6d80a2c..fe2c182090 100644 --- a/app/core/gimpdrawable-desaturate.c +++ b/app/core/gimpdrawable-desaturate.c @@ -23,7 +23,6 @@ #include "core-types.h" #include "base/desaturate.h" -#include "base/pixel-processor.h" #include "gegl/gimpdesaturateconfig.h" diff --git a/app/core/gimpdrawable-invert.c b/app/core/gimpdrawable-invert.c index da7e676629..fec217b79b 100644 --- a/app/core/gimpdrawable-invert.c +++ b/app/core/gimpdrawable-invert.c @@ -24,7 +24,6 @@ #include "base/gimplut.h" #include "base/lut-funcs.h" -#include "base/pixel-processor.h" /* temp */ #include "gimp.h" diff --git a/app/core/gimpdrawable-levels.c b/app/core/gimpdrawable-levels.c index 0baad3356d..303524e84e 100644 --- a/app/core/gimpdrawable-levels.c +++ b/app/core/gimpdrawable-levels.c @@ -25,8 +25,6 @@ #include "base/gimphistogram.h" #include "base/gimplut.h" #include "base/levels.h" -#include "base/pixel-processor.h" -#include "base/pixel-region.h" #include "gegl/gimplevelsconfig.h" @@ -38,7 +36,8 @@ #include "gimpdrawable-histogram.h" #include "gimpdrawable-levels.h" #include "gimpdrawable-operation.h" -#include "gimpdrawable-shadow.h" +#include "gimpdrawable-process.h" +#include "gimpprogress.h" #include "gimp-intl.h" @@ -67,6 +66,7 @@ gimp_drawable_levels (GimpDrawable *drawable, g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (! gimp_drawable_is_indexed (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 (channel >= GIMP_HISTOGRAM_VALUE && channel <= GIMP_HISTOGRAM_ALPHA); g_return_if_fail (low_input >= 0 && low_input <= 255); @@ -111,6 +111,7 @@ gimp_drawable_levels_stretch (GimpDrawable *drawable, g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (! gimp_drawable_is_indexed (drawable)); g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable))); + g_return_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress)); if (! gimp_drawable_mask_intersect (drawable, NULL, NULL, NULL, NULL)) return; @@ -157,14 +158,8 @@ gimp_drawable_levels_internal (GimpDrawable *drawable, } else { - PixelRegion srcPR, destPR; - Levels levels; - GimpLut *lut; - gint x, y; - gint width, height; - - if (! gimp_drawable_mask_intersect (drawable, &x, &y, &width, &height)) - return; + Levels levels; + GimpLut *lut; gimp_levels_config_to_cruft (config, &levels, gimp_drawable_is_rgb (drawable)); @@ -175,19 +170,9 @@ gimp_drawable_levels_internal (GimpDrawable *drawable, &levels, gimp_drawable_bytes (drawable)); - pixel_region_init (&srcPR, gimp_drawable_get_tiles (drawable), - x, y, width, height, FALSE); - pixel_region_init (&destPR, gimp_drawable_get_shadow_tiles (drawable), - x, y, width, height, TRUE); - - pixel_regions_process_parallel ((PixelProcessorFunc) gimp_lut_process, - lut, 2, &srcPR, &destPR); + gimp_drawable_process (drawable, progress, _("Levels"), + (PixelProcessorFunc) gimp_lut_process, lut); gimp_lut_free (lut); - - gimp_drawable_merge_shadow_tiles (drawable, TRUE, _("Levels")); - gimp_drawable_free_shadow_tiles (drawable); - - gimp_drawable_update (drawable, x, y, width, height); } }