[f-spot] Move Pinta code to namespace and remove some warnings



commit a4813818fc0625729da8d6831486b3efa69c98a6
Author: Tim Howard <timothy howard gmail com>
Date:   Thu Feb 17 21:22:47 2011 -0500

    Move Pinta code to namespace and remove some warnings

 .../MainApp/FSpot.Editors/SoftFocusEditor.cs       |    3 +-
 src/Clients/MainApp/FSpot.Editors/TiltEditor.cs    |    2 +
 src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs     |    2 +
 src/Clients/MainApp/MainApp.csproj                 |    8 +-
 src/Clients/MainApp/Makefile.am                    |    5 +-
 src/Clients/MainApp/{ => Pinta}/CairoExtensions.cs |    2 +-
 src/Clients/MainApp/{ => Pinta}/ColorBgra.cs       |    2 +-
 src/Clients/MainApp/Pinta/GaussianBlurEffect.cs    |  223 +++++++++++++++++++
 src/Clients/MainApp/PixbufUtils.cs                 |  230 +-------------------
 .../FSpot.Exporters.Gallery/GalleryAddAlbum.cs     |    2 -
 .../FSpot.Exporters.Gallery/GalleryExport.cs       |    2 -
 11 files changed, 242 insertions(+), 239 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs b/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
index e7b1065..3d0f995 100644
--- a/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
+++ b/src/Clients/MainApp/FSpot.Editors/SoftFocusEditor.cs
@@ -37,8 +37,7 @@ using Gtk;
 
 using FSpot.Widgets;
 
-
-
+using Pinta.Core;
 
 namespace FSpot.Editors
 {
diff --git a/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs b/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
index 5eee128..8d68283 100644
--- a/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
+++ b/src/Clients/MainApp/FSpot.Editors/TiltEditor.cs
@@ -38,6 +38,8 @@ using Cairo;
 
 using FSpot.Widgets;
 
+using Pinta.Core;
+
 namespace FSpot.Editors
 {
 	// TODO: there were keybindings (left/right) to adjust tilt, maybe they should be added back.
diff --git a/src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs b/src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs
index a2bb5de..613f13a 100644
--- a/src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/SoftFocus.cs
@@ -33,6 +33,8 @@ using Cairo;
 using System;
 using System.Runtime.InteropServices;
 
+using Pinta.Core;
+
 namespace FSpot.Widgets {
 
 	public class SoftFocus : IDisposable {
diff --git a/src/Clients/MainApp/MainApp.csproj b/src/Clients/MainApp/MainApp.csproj
index 4bc35e0..ef4b24f 100644
--- a/src/Clients/MainApp/MainApp.csproj
+++ b/src/Clients/MainApp/MainApp.csproj
@@ -205,8 +205,9 @@
     <Compile Include="FSpot.Widgets\SelectionCollectionGridView.cs" />
     <Compile Include="FSpot.Widgets\CollectionCellGridView.cs" />
     <Compile Include="FSpot.Widgets\BrowseablePointerGridView.cs" />
-    <Compile Include="ColorBgra.cs" />
-    <Compile Include="CairoExtensions.cs" />
+    <Compile Include="Pinta\ColorBgra.cs" />
+    <Compile Include="Pinta\CairoExtensions.cs" />
+    <Compile Include="Pinta\GaussianBlurEffect.cs" />
   </ItemGroup>
   <ItemGroup>
     <EmbeddedResource Include="..\..\..\COPYING">
@@ -307,7 +308,6 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\lib\unique-sharp\unique\unique-sharp.dll</HintPath>
     </Reference>
-    <Reference Include="Mono.Cairo" />
     <Reference Include="Mono.Addins, Version=0.4.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756">
       <Package>mono-addins</Package>
     </Reference>
@@ -335,6 +335,7 @@
       <Package>mono-nunit</Package>
     </Reference>
     <Reference Include="Mono.Simd" />
+    <Reference Include="Mono.Cairo, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\Core\FSpot.Core\FSpot.Core.csproj">
@@ -389,5 +390,6 @@
   <ItemGroup>
     <Folder Include="FSpot\" />
     <Folder Include="FSpot.Widgets\" />
+    <Folder Include="Pinta\" />
   </ItemGroup>
 </Project>
diff --git a/src/Clients/MainApp/Makefile.am b/src/Clients/MainApp/Makefile.am
index 7eb037c..4a80098 100644
--- a/src/Clients/MainApp/Makefile.am
+++ b/src/Clients/MainApp/Makefile.am
@@ -4,8 +4,6 @@ LINK = $(REF_FSPOT)
 ASSEMBLY_BUILD_FLAGS = -unsafe
 
 SOURCES =  \
-	CairoExtensions.cs \
-	ColorBgra.cs \
 	DependentListStore.cs \
 	FSpot.ColorAdjustment/Adjustment.cs \
 	FSpot.ColorAdjustment/AutoStretch.cs \
@@ -173,6 +171,9 @@ SOURCES =  \
 	PhotoTagMenu.cs \
 	PhotoVersionCommands.cs \
 	PhotoVersionMenu.cs \
+	Pinta/CairoExtensions.cs \
+	Pinta/ColorBgra.cs \
+	Pinta/GaussianBlurEffect.cs \
 	PixbufUtils.cs \
 	TagCommands.cs \
 	TagPopup.cs \
diff --git a/src/Clients/MainApp/CairoExtensions.cs b/src/Clients/MainApp/Pinta/CairoExtensions.cs
similarity index 99%
rename from src/Clients/MainApp/CairoExtensions.cs
rename to src/Clients/MainApp/Pinta/CairoExtensions.cs
index 56d5a07..2a663af 100644
--- a/src/Clients/MainApp/CairoExtensions.cs
+++ b/src/Clients/MainApp/Pinta/CairoExtensions.cs
@@ -37,7 +37,7 @@ using System;
 using Cairo;
 using System.Collections.Generic;
 
-namespace FSpot
+namespace Pinta.Core
 {
 	public static class CairoExtensions
 	{
diff --git a/src/Clients/MainApp/ColorBgra.cs b/src/Clients/MainApp/Pinta/ColorBgra.cs
similarity index 99%
rename from src/Clients/MainApp/ColorBgra.cs
rename to src/Clients/MainApp/Pinta/ColorBgra.cs
index 3e2f828..d07ec11 100644
--- a/src/Clients/MainApp/ColorBgra.cs
+++ b/src/Clients/MainApp/Pinta/ColorBgra.cs
@@ -11,7 +11,7 @@ using System.Collections.Generic;
 using System.Reflection;
 using System.Runtime.InteropServices;
 
-namespace FSpot
+namespace Pinta.Core
 {
     /// <summary>
     /// This is our pixel format that we will work with. It is always 32-bits / 4-bytes and is
diff --git a/src/Clients/MainApp/Pinta/GaussianBlurEffect.cs b/src/Clients/MainApp/Pinta/GaussianBlurEffect.cs
new file mode 100644
index 0000000..2009e6f
--- /dev/null
+++ b/src/Clients/MainApp/Pinta/GaussianBlurEffect.cs
@@ -0,0 +1,223 @@
+/////////////////////////////////////////////////////////////////////////////////
+// Paint.NET                                                                   //
+// Copyright (C) dotPDN LLC, Rick Brewster, Tom Jackson, and contributors.     //
+// Portions Copyright (C) Microsoft Corporation. All Rights Reserved.          //
+// See license-pdn.txt for full licensing and attribution details.             //
+//                                                                             //
+// Ported to Pinta by: Jonathan Pobst <monkey jpobst com>                      //
+/////////////////////////////////////////////////////////////////////////////////
+
+using System;
+using Cairo;
+using Pinta.Core;
+using Mono.Unix;
+
+namespace Pinta.Effects
+{
+    public class GaussianBlurEffect
+    {
+        public static int[] CreateGaussianBlurRow (int amount)
+        {
+            int size = 1 + (amount * 2);
+            int[] weights = new int[size];
+
+            for (int i = 0; i <= amount; ++i) {
+                // 1 + aa - aa + 2ai - ii
+                weights[i] = 16 * (i + 1);
+                weights[weights.Length - i - 1] = weights[i];
+            }
+
+            return weights;
+        }
+
+        unsafe public static void RenderBlurEffect (ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois, int radius)
+        {
+            int r = radius;
+            int[] w = CreateGaussianBlurRow (r);
+            int wlen = w.Length;
+    
+            int localStoreSize = wlen * 6 * sizeof (long);
+            byte* localStore = stackalloc byte[localStoreSize];
+            byte* p = localStore;
+    
+            long* waSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            long* wcSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            long* aSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            long* bSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            long* gSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            long* rSums = (long*)p;
+            p += wlen * sizeof (long);
+    
+            // Cache these for a massive performance boost
+            int src_width = src.Width;
+            int src_height = src.Height;
+            ColorBgra* src_data_ptr = (ColorBgra*)src.DataPtr;
+    
+            foreach (Gdk.Rectangle rect in rois) {
+                if (rect.Height >= 1 && rect.Width >= 1) {
+                    for (int y = rect.Top; y < rect.Bottom; ++y) {
+                        //Memory.SetToZero (localStore, (ulong)localStoreSize);
+    
+                        long waSum = 0;
+                        long wcSum = 0;
+                        long aSum = 0;
+                        long bSum = 0;
+                        long gSum = 0;
+                        long rSum = 0;
+    
+                        ColorBgra* dstPtr = dest.GetPointAddressUnchecked (rect.Left, y);
+    
+                        for (int wx = 0; wx < wlen; ++wx) {
+                            int srcX = rect.Left + wx - r;
+                            waSums[wx] = 0;
+                            wcSums[wx] = 0;
+                            aSums[wx] = 0;
+                            bSums[wx] = 0;
+                            gSums[wx] = 0;
+                            rSums[wx] = 0;
+    
+                            if (srcX >= 0 && srcX < src_width) {
+                                for (int wy = 0; wy < wlen; ++wy) {
+                                    int srcY = y + wy - r;
+    
+                                    if (srcY >= 0 && srcY < src_height) {
+                                        ColorBgra c = src.GetPointUnchecked (src_data_ptr, src_width, srcX, srcY);
+                                        int wp = w[wy];
+    
+                                        waSums[wx] += wp;
+                                        wp *= c.A + (c.A >> 7);
+                                        wcSums[wx] += wp;
+                                        wp >>= 8;
+    
+                                        aSums[wx] += wp * c.A;
+                                        bSums[wx] += wp * c.B;
+                                        gSums[wx] += wp * c.G;
+                                        rSums[wx] += wp * c.R;
+                                    }
+                                }
+    
+                                int wwx = w[wx];
+                                waSum += wwx * waSums[wx];
+                                wcSum += wwx * wcSums[wx];
+                                aSum += wwx * aSums[wx];
+                                bSum += wwx * bSums[wx];
+                                gSum += wwx * gSums[wx];
+                                rSum += wwx * rSums[wx];
+                            }
+                        }
+    
+                        wcSum >>= 8;
+    
+                        if (waSum == 0 || wcSum == 0) {
+                            dstPtr->Bgra = 0;
+                        } else {
+                            int alpha = (int)(aSum / waSum);
+                            int blue = (int)(bSum / wcSum);
+                            int green = (int)(gSum / wcSum);
+                            int red = (int)(rSum / wcSum);
+    
+                            dstPtr->Bgra = ColorBgra.BgraToUInt32 (blue, green, red, alpha);
+                        }
+    
+                        ++dstPtr;
+    
+                        for (int x = rect.Left + 1; x < rect.Right; ++x) {
+                            for (int i = 0; i < wlen - 1; ++i) {
+                                waSums[i] = waSums[i + 1];
+                                wcSums[i] = wcSums[i + 1];
+                                aSums[i] = aSums[i + 1];
+                                bSums[i] = bSums[i + 1];
+                                gSums[i] = gSums[i + 1];
+                                rSums[i] = rSums[i + 1];
+                            }
+    
+                            waSum = 0;
+                            wcSum = 0;
+                            aSum = 0;
+                            bSum = 0;
+                            gSum = 0;
+                            rSum = 0;
+    
+                            int wx;
+                            for (wx = 0; wx < wlen - 1; ++wx) {
+                                long wwx = (long)w[wx];
+                                waSum += wwx * waSums[wx];
+                                wcSum += wwx * wcSums[wx];
+                                aSum += wwx * aSums[wx];
+                                bSum += wwx * bSums[wx];
+                                gSum += wwx * gSums[wx];
+                                rSum += wwx * rSums[wx];
+                            }
+    
+                            wx = wlen - 1;
+    
+                            waSums[wx] = 0;
+                            wcSums[wx] = 0;
+                            aSums[wx] = 0;
+                            bSums[wx] = 0;
+                            gSums[wx] = 0;
+                            rSums[wx] = 0;
+    
+                            int srcX = x + wx - r;
+    
+                            if (srcX >= 0 && srcX < src_width) {
+                                for (int wy = 0; wy < wlen; ++wy) {
+                                    int srcY = y + wy - r;
+    
+                                    if (srcY >= 0 && srcY < src_height) {
+                                        ColorBgra c = src.GetPointUnchecked (src_data_ptr, src_width, srcX, srcY);
+                                        int wp = w[wy];
+    
+                                        waSums[wx] += wp;
+                                        wp *= c.A + (c.A >> 7);
+                                        wcSums[wx] += wp;
+                                        wp >>= 8;
+    
+                                        aSums[wx] += wp * (long)c.A;
+                                        bSums[wx] += wp * (long)c.B;
+                                        gSums[wx] += wp * (long)c.G;
+                                        rSums[wx] += wp * (long)c.R;
+                                    }
+                                }
+    
+                                int wr = w[wx];
+                                waSum += (long)wr * waSums[wx];
+                                wcSum += (long)wr * wcSums[wx];
+                                aSum += (long)wr * aSums[wx];
+                                bSum += (long)wr * bSums[wx];
+                                gSum += (long)wr * gSums[wx];
+                                rSum += (long)wr * rSums[wx];
+                            }
+    
+                            wcSum >>= 8;
+    
+                            if (waSum == 0 || wcSum == 0) {
+                                dstPtr->Bgra = 0;
+                            } else {
+                                int alpha = (int)(aSum / waSum);
+                                int blue = (int)(bSum / wcSum);
+                                int green = (int)(gSum / wcSum);
+                                int red = (int)(rSum / wcSum);
+    
+                                dstPtr->Bgra = ColorBgra.BgraToUInt32 (blue, green, red, alpha);
+                            }
+    
+                            ++dstPtr;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
diff --git a/src/Clients/MainApp/PixbufUtils.cs b/src/Clients/MainApp/PixbufUtils.cs
index eab77e9..d571d27 100644
--- a/src/Clients/MainApp/PixbufUtils.cs
+++ b/src/Clients/MainApp/PixbufUtils.cs
@@ -45,6 +45,9 @@ using TagLib.Image;
 using Cairo;
 using FSpot.UI.Dialog;
 
+using Pinta.Core;
+using Pinta.Effects;
+
 public static class PixbufUtils {
 	static Pixbuf error_pixbuf = null;
 	public static Pixbuf ErrorPixbuf {
@@ -294,7 +297,6 @@ public static class PixbufUtils {
         int sourceWidth = src.Width;
 
         int resultRowstride = result.Rowstride;
-        int resultHeight = result.Height;
         int resultWidth = result.Width;
         int resultChannels = result.NChannels;
 
@@ -347,7 +349,7 @@ public static class PixbufUtils {
         // here instead of going deeper to provide the feedback
         for (int i=0; i < src.Height; i++)
         {
-            RenderBlurEffect(sourceSurface, destinationSurface, new[] { new Gdk.Rectangle(0, i, src.Width, 1) }, radius);
+            GaussianBlurEffect.RenderBlurEffect(sourceSurface, destinationSurface, new[] { new Gdk.Rectangle(0, i, src.Width, 1) }, radius);
 
             if (dialog != null)
             {
@@ -360,25 +362,6 @@ public static class PixbufUtils {
         return destinationSurface.ToPixbuf();
 	}
 
-    unsafe public static Gdk.Pixbuf ToPixbuf (this Cairo.ImageSurface surfSource)
-    {
-        Cairo.ImageSurface surf = surfSource.Clone ();
-        surf.Flush ();
-        
-        ColorBgra* dstPtr = (ColorBgra*)surf.DataPtr;
-        int len = surf.Data.Length / 4;
-        
-        for (int i = 0; i < len; i++) {
-            if (dstPtr->A != 0)
-                *dstPtr = (ColorBgra.FromBgra (dstPtr->R, dstPtr->G, dstPtr->B, dstPtr->A));
-            dstPtr++;
-        }
-        
-        Gdk.Pixbuf pb = new Gdk.Pixbuf (surf.Data, true, 8, surf.Width, surf.Height, surf.Stride);
-        (surf as IDisposable).Dispose ();
-        return pb;
-    }
-
     public static ImageSurface Clone (this ImageSurface surf)
     {
         ImageSurface newsurf = new ImageSurface (surf.Format, surf.Width, surf.Height);
@@ -391,211 +374,6 @@ public static class PixbufUtils {
         return newsurf;
     }
 
-    public static int[] CreateGaussianBlurRow (int amount)
-    {
-        int size = 1 + (amount * 2);
-        int[] weights = new int[size];
-
-        for (int i = 0; i <= amount; ++i) {
-            // 1 + aa - aa + 2ai - ii
-            weights[i] = 16 * (i + 1);
-            weights[weights.Length - i - 1] = weights[i];
-        }
-
-        return weights;
-    }
-
-    unsafe public static void RenderBlurEffect (ImageSurface src, ImageSurface dest, Gdk.Rectangle[] rois, int radius)
-    {
-        int r = radius;
-        int[] w = CreateGaussianBlurRow (r);
-        int wlen = w.Length;
-
-        int localStoreSize = wlen * 6 * sizeof (long);
-        byte* localStore = stackalloc byte[localStoreSize];
-        byte* p = localStore;
-
-        long* waSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        long* wcSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        long* aSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        long* bSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        long* gSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        long* rSums = (long*)p;
-        p += wlen * sizeof (long);
-
-        ulong arraysLength = (ulong)(sizeof (long) * wlen);
-
-        // Cache these for a massive performance boost
-        int src_width = src.Width;
-        int src_height = src.Height;
-        ColorBgra* src_data_ptr = (ColorBgra*)src.DataPtr;
-
-        foreach (Gdk.Rectangle rect in rois) {
-            if (rect.Height >= 1 && rect.Width >= 1) {
-                for (int y = rect.Top; y < rect.Bottom; ++y) {
-                    //Memory.SetToZero (localStore, (ulong)localStoreSize);
-
-                    long waSum = 0;
-                    long wcSum = 0;
-                    long aSum = 0;
-                    long bSum = 0;
-                    long gSum = 0;
-                    long rSum = 0;
-
-                    ColorBgra* dstPtr = dest.GetPointAddressUnchecked (rect.Left, y);
-
-                    for (int wx = 0; wx < wlen; ++wx) {
-                        int srcX = rect.Left + wx - r;
-                        waSums[wx] = 0;
-                        wcSums[wx] = 0;
-                        aSums[wx] = 0;
-                        bSums[wx] = 0;
-                        gSums[wx] = 0;
-                        rSums[wx] = 0;
-
-                        if (srcX >= 0 && srcX < src_width) {
-                            for (int wy = 0; wy < wlen; ++wy) {
-                                int srcY = y + wy - r;
-
-                                if (srcY >= 0 && srcY < src_height) {
-                                    ColorBgra c = src.GetPointUnchecked (src_data_ptr, src_width, srcX, srcY);
-                                    int wp = w[wy];
-
-                                    waSums[wx] += wp;
-                                    wp *= c.A + (c.A >> 7);
-                                    wcSums[wx] += wp;
-                                    wp >>= 8;
-
-                                    aSums[wx] += wp * c.A;
-                                    bSums[wx] += wp * c.B;
-                                    gSums[wx] += wp * c.G;
-                                    rSums[wx] += wp * c.R;
-                                }
-                            }
-
-                            int wwx = w[wx];
-                            waSum += wwx * waSums[wx];
-                            wcSum += wwx * wcSums[wx];
-                            aSum += wwx * aSums[wx];
-                            bSum += wwx * bSums[wx];
-                            gSum += wwx * gSums[wx];
-                            rSum += wwx * rSums[wx];
-                        }
-                    }
-
-                    wcSum >>= 8;
-
-                    if (waSum == 0 || wcSum == 0) {
-                        dstPtr->Bgra = 0;
-                    } else {
-                        int alpha = (int)(aSum / waSum);
-                        int blue = (int)(bSum / wcSum);
-                        int green = (int)(gSum / wcSum);
-                        int red = (int)(rSum / wcSum);
-
-                        dstPtr->Bgra = ColorBgra.BgraToUInt32 (blue, green, red, alpha);
-                    }
-
-                    ++dstPtr;
-
-                    for (int x = rect.Left + 1; x < rect.Right; ++x) {
-                        for (int i = 0; i < wlen - 1; ++i) {
-                            waSums[i] = waSums[i + 1];
-                            wcSums[i] = wcSums[i + 1];
-                            aSums[i] = aSums[i + 1];
-                            bSums[i] = bSums[i + 1];
-                            gSums[i] = gSums[i + 1];
-                            rSums[i] = rSums[i + 1];
-                        }
-
-                        waSum = 0;
-                        wcSum = 0;
-                        aSum = 0;
-                        bSum = 0;
-                        gSum = 0;
-                        rSum = 0;
-
-                        int wx;
-                        for (wx = 0; wx < wlen - 1; ++wx) {
-                            long wwx = (long)w[wx];
-                            waSum += wwx * waSums[wx];
-                            wcSum += wwx * wcSums[wx];
-                            aSum += wwx * aSums[wx];
-                            bSum += wwx * bSums[wx];
-                            gSum += wwx * gSums[wx];
-                            rSum += wwx * rSums[wx];
-                        }
-
-                        wx = wlen - 1;
-
-                        waSums[wx] = 0;
-                        wcSums[wx] = 0;
-                        aSums[wx] = 0;
-                        bSums[wx] = 0;
-                        gSums[wx] = 0;
-                        rSums[wx] = 0;
-
-                        int srcX = x + wx - r;
-
-                        if (srcX >= 0 && srcX < src_width) {
-                            for (int wy = 0; wy < wlen; ++wy) {
-                                int srcY = y + wy - r;
-
-                                if (srcY >= 0 && srcY < src_height) {
-                                    ColorBgra c = src.GetPointUnchecked (src_data_ptr, src_width, srcX, srcY);
-                                    int wp = w[wy];
-
-                                    waSums[wx] += wp;
-                                    wp *= c.A + (c.A >> 7);
-                                    wcSums[wx] += wp;
-                                    wp >>= 8;
-
-                                    aSums[wx] += wp * (long)c.A;
-                                    bSums[wx] += wp * (long)c.B;
-                                    gSums[wx] += wp * (long)c.G;
-                                    rSums[wx] += wp * (long)c.R;
-                                }
-                            }
-
-                            int wr = w[wx];
-                            waSum += (long)wr * waSums[wx];
-                            wcSum += (long)wr * wcSums[wx];
-                            aSum += (long)wr * aSums[wx];
-                            bSum += (long)wr * bSums[wx];
-                            gSum += (long)wr * gSums[wx];
-                            rSum += (long)wr * rSums[wx];
-                        }
-
-                        wcSum >>= 8;
-
-                        if (waSum == 0 || wcSum == 0) {
-                            dstPtr->Bgra = 0;
-                        } else {
-                            int alpha = (int)(aSum / waSum);
-                            int blue = (int)(bSum / wcSum);
-                            int green = (int)(gSum / wcSum);
-                            int red = (int)(rSum / wcSum);
-
-                            dstPtr->Bgra = ColorBgra.BgraToUInt32 (blue, green, red, alpha);
-                        }
-
-                        ++dstPtr;
-                    }
-                }
-            }
-        }
-    }
-
 	public unsafe static Gdk.Pixbuf RemoveRedeye (Gdk.Pixbuf src, Gdk.Rectangle area)
 	{
 		return RemoveRedeye (src, area, -15);
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryAddAlbum.cs b/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryAddAlbum.cs
index e8a99e6..c86a647 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryAddAlbum.cs
+++ b/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryAddAlbum.cs
@@ -105,8 +105,6 @@ namespace FSpot.Exporters.Gallery
 				label_builder.Append (album.Title);
 
                 album_optionmenu.AppendText(label_builder.ToString());
-
-				AlbumPermission create_sub = album.Perms & AlbumPermission.CreateSubAlbum;
 			}
 
 			album_optionmenu.Sensitive = true;
diff --git a/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryExport.cs b/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryExport.cs
index 8b02abb..51c005c 100644
--- a/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryExport.cs
+++ b/src/Extensions/Exporters/FSpot.Exporters.Gallery/FSpot.Exporters.Gallery/GalleryExport.cs
@@ -367,8 +367,6 @@ namespace FSpot.Exporters.Gallery
 					label_builder.Append (album.Title);
 
                     album_optionmenu.AppendText(label_builder.ToString());
-
-				    AlbumPermission add_permission = album.Perms & AlbumPermission.Add;
 				}
 
 				export_button.Sensitive = items.Length > 0;



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