[gimp/goat-invasion: 506/608] app: remove blend_region()



commit 2887ee700c6f18c54651859aa6e5eada975a91f2
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 18 00:33:48 2012 +0200

    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, 0 insertions(+), 110 deletions(-)
---
diff --git a/app/paint-funcs/paint-funcs-generic.h b/app/paint-funcs/paint-funcs-generic.h
index a355247..0735cf9 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 738a765..2dab6c4 100644
--- a/app/paint-funcs/paint-funcs.c
+++ b/app/paint-funcs/paint-funcs.c
@@ -1645,35 +1645,6 @@ color_erase_inten_pixels (const guchar   *src1,
 /**************************************************/
 
 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,
                  const gfloat        *matrix,
diff --git a/app/paint-funcs/paint-funcs.h b/app/paint-funcs/paint-funcs.h
index 42eb042..7ff2bf5 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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]