[gimp/goat-invasion: 85/325] app: remove multiply_alpha_region() and separate_alpha_region()



commit 21f0449b849748ff6d41515149e3fe2e68a14191
Author: Michael Natterer <mitch gimp org>
Date:   Fri Mar 16 19:01:11 2012 +0100

    app: remove multiply_alpha_region() and separate_alpha_region()

 app/paint-funcs/paint-funcs.c |   81 -----------------------------------------
 app/paint-funcs/paint-funcs.h |    5 ---
 2 files changed, 0 insertions(+), 86 deletions(-)
---
diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c
index eed7bdf..f9ae635 100644
--- a/app/paint-funcs/paint-funcs.c
+++ b/app/paint-funcs/paint-funcs.c
@@ -2138,87 +2138,6 @@ convolve_region (PixelRegion         *srcR,
 }
 
 
-/* Convert from separated alpha to premultiplied alpha. Only works on
-   non-tiled regions! */
-void
-multiply_alpha_region (PixelRegion *srcR)
-{
-  guchar  *src, *s;
-  gint     x, y;
-  gint     width, height;
-  gint     b, bytes;
-  gdouble  alpha_val;
-
-  width = srcR->w;
-  height = srcR->h;
-  bytes = srcR->bytes;
-
-  src = srcR->data;
-
-  for (y = 0; y < height; y++)
-    {
-      s = src;
-
-      for (x = 0; x < width; x++)
-        {
-          alpha_val = s[bytes - 1] * (1.0 / 255.0);
-
-          for (b = 0; b < bytes - 1; b++)
-            s[b] = 0.5 + s[b] * alpha_val;
-
-          s += bytes;
-        }
-
-      src += srcR->rowstride;
-    }
-}
-
-/* Convert from premultiplied alpha to separated alpha. Only works on
-   non-tiled regions! */
-void
-separate_alpha_region (PixelRegion *srcR)
-{
-  guchar  *src, *s;
-  gint     x, y;
-  gint     width, height;
-  gint     b, bytes;
-  gdouble  alpha_recip;
-  gint     new_val;
-
-  width = srcR->w;
-  height = srcR->h;
-  bytes = srcR->bytes;
-
-  src = srcR->data;
-
-  for (y = 0; y < height; y++)
-    {
-      s = src;
-
-      for (x = 0; x < width; x++)
-        {
-          /* predicate is equivalent to:
-             (((s[bytes - 1] - 1) & 255) + 2) & 256
-             */
-          if (s[bytes - 1] != 0 && s[bytes - 1] != 255)
-            {
-              alpha_recip = 255.0 / s[bytes - 1];
-
-              for (b = 0; b < bytes - 1; b++)
-                {
-                  new_val = 0.5 + s[b] * alpha_recip;
-                  new_val = MIN (new_val, 255);
-                  s[b] = new_val;
-                }
-            }
-
-          s += bytes;
-        }
-
-      src += srcR->rowstride;
-    }
-}
-
 static inline void
 rotate_pointers (guchar  **p,
                  guint32   n)
diff --git a/app/paint-funcs/paint-funcs.h b/app/paint-funcs/paint-funcs.h
index dc602b1..a182f38 100644
--- a/app/paint-funcs/paint-funcs.h
+++ b/app/paint-funcs/paint-funcs.h
@@ -364,11 +364,6 @@ void  convolve_region                     (PixelRegion         *srcR,
                                            GimpConvolutionType  mode,
                                            gboolean             alpha_weighting);
 
-
-void  multiply_alpha_region               (PixelRegion *srcR);
-
-void  separate_alpha_region               (PixelRegion *srcR);
-
 void  border_region                       (PixelRegion *src,
                                            gint16       xradius,
                                            gint16       yradius,



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