From 30bf9bcdc9fbd2d6fe619717fd7ff50eadfecf50 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 18 Apr 2012 00:33:48 +0200 Subject: [PATCH] app: remove blend_region() --- app/paint-funcs/paint-funcs-generic.h | 67 --------------------------- app/paint-funcs/paint-funcs.c | 29 ------------ app/paint-funcs/paint-funcs.h | 14 ------ 3 files changed, 110 deletions(-) diff --git a/app/paint-funcs/paint-funcs-generic.h b/app/paint-funcs/paint-funcs-generic.h index a3552471fa..0735cf9c0c 100644 --- a/app/paint-funcs/paint-funcs-generic.h +++ b/app/paint-funcs/paint-funcs-generic.h @@ -24,73 +24,6 @@ #define __PAINT_FUNCS_GENERIC_H__ -/* - * blend_pixels patched 8-24-05 to fix bug #163721. Note that this change - * causes the function to treat src1 and src2 asymmetrically. This gives the - * right behavior for the smudge tool, which is the only user of this function - * at the time of patching. If you want to use the function for something - * else, caveat emptor. - */ -inline void -blend_pixels (const guchar *src1, - const guchar *src2, - guchar *dest, - guchar blend, - guint w, - guint bytes) -{ - if (HAS_ALPHA (bytes)) - { - const guint blend1 = 255 - blend; - const guint blend2 = blend + 1; - const guint c = bytes - 1; - - while (w--) - { - const gint a1 = blend1 * src1[c]; - const gint a2 = blend2 * src2[c]; - const gint a = a1 + a2; - guint b; - - if (!a) - { - for (b = 0; b < bytes; b++) - dest[b] = 0; - } - else - { - for (b = 0; b < c; b++) - dest[b] = - src1[b] + (src1[b] * a1 + src2[b] * a2 - a * src1[b]) / a; - - dest[c] = a >> 8; - } - - src1 += bytes; - src2 += bytes; - dest += bytes; - } - } - else - { - const guchar blend1 = 255 - blend; - - while (w--) - { - guint b; - - for (b = 0; b < bytes; b++) - dest[b] = - src1[b] + (src1[b] * blend1 + src2[b] * blend - src1[b] * 255) / 255; - - src1 += bytes; - src2 += bytes; - dest += bytes; - } - } -} - - static inline void replace_pixels (const guchar *src1, const guchar *src2, diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index 738a7658c6..2dab6c4ff7 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -1644,35 +1644,6 @@ color_erase_inten_pixels (const guchar *src1, /* REGION FUNCTIONS */ /**************************************************/ -void -blend_region (PixelRegion *src1, - PixelRegion *src2, - PixelRegion *dest, - guchar blend) -{ - gpointer pr; - - for (pr = pixel_regions_register (3, src1, src2, dest); - pr != NULL; - pr = pixel_regions_process (pr)) - { - const guchar *s1 = src1->data; - const guchar *s2 = src2->data; - guchar *d = dest->data; - gint h = src1->h; - - while (h --) - { - blend_pixels (s1, s2, d, blend, src1->w, src1->bytes); - - s1 += src1->rowstride; - s2 += src2->rowstride; - d += dest->rowstride; - } - } -} - - void convolve_region (PixelRegion *srcR, PixelRegion *destR, diff --git a/app/paint-funcs/paint-funcs.h b/app/paint-funcs/paint-funcs.h index 42eb0429a5..7ff2bf54c4 100644 --- a/app/paint-funcs/paint-funcs.h +++ b/app/paint-funcs/paint-funcs.h @@ -19,15 +19,6 @@ #define __PAINT_FUNCS_H__ -/* Paint functions */ - -void blend_pixels (const guchar *src1, - const guchar *src2, - guchar *dest, - guchar blend, - guint w, - guint bytes); - /* apply the mask data to the alpha channel of the pixel data */ void apply_mask_to_alpha_channel (guchar *src, const guchar *mask, @@ -243,11 +234,6 @@ void paint_funcs_color_erase_helper (GimpRGB *src, /* Region functions */ -void blend_region (PixelRegion *src1, - PixelRegion *src2, - PixelRegion *dest, - guchar blend); - void convolve_region (PixelRegion *srcR, PixelRegion *destR, const gfloat *matrix,