Permalink
Browse files

Add test suite for effects.

  • Loading branch information...
jpobst committed Dec 30, 2012
1 parent 0146ab3 commit 474683bb56907ce3f80c96206ffb17d04e693930
Showing with 2,321 additions and 0 deletions.
  1. +1 −0 Pinta.ImageManipulation.System.Drawing/Pinta.ImageManipulation.System.Drawing.csproj
  2. +77 −0 Pinta.ImageManipulation.UnitTests/BaseTest.cs
  3. +47 −0 Pinta.ImageManipulation.UnitTests/Effects/AutoLevelEffectTest.cs
  4. +47 −0 Pinta.ImageManipulation.UnitTests/Effects/BlackAndWhiteEffectTest.cs
  5. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/BrightnessContrastEffectTest.cs
  6. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/BulgeEffectTest.cs
  7. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/EdgeDetectEffectTest.cs
  8. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/EmbossEffectTest.cs
  9. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/FragmentEffectTest.cs
  10. +60 −0 Pinta.ImageManipulation.UnitTests/Effects/FrostedGlassEffectTest.cs
  11. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/GaussianBlurEffectTest.cs
  12. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/GlowEffectTest.cs
  13. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/HueSaturationEffectTest.cs
  14. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/InkSketchEffectTest.cs
  15. +47 −0 Pinta.ImageManipulation.UnitTests/Effects/InvertColorsEffectTest.cs
  16. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/JuliaFractalEffectTest.cs
  17. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/MandelbrotFractalEffectTest.cs
  18. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/MedianEffectTest.cs
  19. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/MotionBlurEffectTest.cs
  20. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/OilPaintingEffectTest.cs
  21. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/OutlineEffectTest.cs
  22. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/PencilSketchEffectTest.cs
  23. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/PixelateEffectTest.cs
  24. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/PolarInversionEffectTest.cs
  25. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/RadialBlurEffectTest.cs
  26. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/RedEyeRemoveEffectTest.cs
  27. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/ReduceNoiseEffectTest.cs
  28. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/ReliefEffectTest.cs
  29. +47 −0 Pinta.ImageManipulation.UnitTests/Effects/SepiaEffectTest.cs
  30. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/SharpenEffectTest.cs
  31. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/SoftenPortraitEffectTest.cs
  32. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/TileEffectTest.cs
  33. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/TwistEffectTest.cs
  34. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/UnfocusEffectTest.cs
  35. +58 −0 Pinta.ImageManipulation.UnitTests/Effects/ZoomBlurEffectTest.cs
  36. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/autolevel1.png
  37. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/blackandwhite1.png
  38. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/brightnesscontrast1.png
  39. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/brightnesscontrast2.png
  40. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/bulge1.png
  41. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/bulge2.png
  42. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/edgedetect1.png
  43. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/edgedetect2.png
  44. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/emboss1.png
  45. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/emboss2.png
  46. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/fragment1.png
  47. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/fragment2.png
  48. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/frostedglass1.png
  49. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/frostedglass2.png
  50. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/gaussianblur1.png
  51. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/gaussianblur2.png
  52. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/glow1.png
  53. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/glow2.png
  54. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/huesaturation1.png
  55. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/huesaturation2.png
  56. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/inksketch1.png
  57. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/inksketch2.png
  58. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/invertcolors.png
  59. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/juliafractal1.png
  60. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/juliafractal2.png
  61. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/mandelbrotfractal1.png
  62. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/mandelbrotfractal2.png
  63. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/median1.png
  64. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/median2.png
  65. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/motionblur1.png
  66. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/motionblur2.png
  67. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/oilpainting1.png
  68. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/oilpainting2.png
  69. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/outline1.png
  70. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/outline2.png
  71. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/pencilsketch1.png
  72. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/pencilsketch2.png
  73. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/pixelate1.png
  74. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/pixelate2.png
  75. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/polarinversion1.png
  76. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/polarinversion2.png
  77. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/radialblur1.png
  78. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/radialblur2.png
  79. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/redeyeremove1.png
  80. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/redeyeremove2.png
  81. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/reducenoise1.png
  82. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/reducenoise2.png
  83. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/relief1.png
  84. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/relief2.png
  85. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/sepia1.png
  86. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/sharpen1.png
  87. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/sharpen2.png
  88. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/softenportrait1.png
  89. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/softenportrait2.png
  90. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/tile1.png
  91. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/tile2.png
  92. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/twist1.png
  93. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/twist2.png
  94. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/unfocus1.png
  95. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/unfocus2.png
  96. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/zoomblur1.png
  97. BIN Pinta.ImageManipulation.UnitTests/ExpectedBitmaps/zoomblur2.png
  98. +323 −0 Pinta.ImageManipulation.UnitTests/Pinta.ImageManipulation.UnitTests.csproj
  99. +36 −0 Pinta.ImageManipulation.UnitTests/Properties/AssemblyInfo.cs
  100. BIN Pinta.ImageManipulation.UnitTests/SourceBitmaps/input.png
  101. +12 −0 Pinta.ImageManipulation.sln
@@ -39,6 +39,7 @@
<Reference Include="System.Drawing" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="BitmapExtensions.cs" />
<Compile Include="BitmapWrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -0,0 +1,77 @@
+//
+// BaseTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System;
+using System.Drawing;
+using System.IO;
+
+namespace Pinta.ImageManipulation.UnitTests
+{
+ public abstract class BaseTest
+ {
+ protected Bitmap GetSourceImage (string name)
+ {
+ var bitmap = new Bitmap (Path.Combine ("SourceBitmaps", name));
+
+ return bitmap;
+ }
+
+ protected Bitmap GetExpectedImage (string name)
+ {
+ var bitmap = new Bitmap (Path.Combine ("ExpectedBitmaps", name));
+
+ return bitmap;
+ }
+
+ protected unsafe void Compare (Bitmap actual, string expected)
+ {
+ if (!File.Exists (Path.Combine ("ExpectedBitmaps", expected))) {
+ actual.Save (Path.Combine (@"C:\Users\Jonathan\Desktop\Bitmaps", expected));
+ return;
+ }
+
+ var exp_img = GetExpectedImage (expected);
+
+ var act_data = actual.LockBits (new System.Drawing.Rectangle (0, 0, actual.Width, actual.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+ var exp_data = exp_img.LockBits (new System.Drawing.Rectangle (0, 0, actual.Width, actual.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
+
+ var act_ptr = (ColorBgra*)act_data.Scan0;
+ var exp_ptr = (ColorBgra*)exp_data.Scan0;
+
+ var diff = 0;
+
+ for (var i = 0; i < actual.Width * actual.Height; i++)
+ if (*(act_ptr++) != *(exp_ptr++))
+ diff++;
+
+ actual.UnlockBits (act_data);
+ exp_img.UnlockBits (exp_data);
+
+ Assert.AreEqual (0, diff);
+ }
+ }
+}
@@ -0,0 +1,47 @@
+//
+// AutoLevelEffectTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Pinta.ImageManipulation.Effects;
+
+namespace Pinta.ImageManipulation.UnitTests.Effects
+{
+ [TestClass]
+ public class AutoLevelEffectTest : BaseTest
+ {
+ [TestMethod]
+ public void AutoLevelEffect1 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new AutoLevelEffect ();
+ effect.Render (src);
+
+ Compare (src, "autolevel1.png");
+ }
+ }
+}
@@ -0,0 +1,47 @@
+//
+// BlackAndWhiteEffectTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Pinta.ImageManipulation.Effects;
+
+namespace Pinta.ImageManipulation.UnitTests.Effects
+{
+ [TestClass]
+ public class BlackAndWhiteEffectTest : BaseTest
+ {
+ [TestMethod]
+ public void BlackAndWhiteEffect1 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new BlackAndWhiteEffect ();
+ effect.Render (src);
+
+ Compare (src, "blackandwhite1.png");
+ }
+ }
+}
@@ -0,0 +1,58 @@
+//
+// BrightnessContrastEffectTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Pinta.ImageManipulation.Effects;
+
+namespace Pinta.ImageManipulation.UnitTests.Effects
+{
+ [TestClass]
+ public class BrightnessContrastEffectTest : BaseTest
+ {
+ [TestMethod]
+ public void BrightnessContrastEffect1 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new BrightnessContrastEffect ();
+ effect.Render (src);
+
+ Compare (src, "brightnesscontrast1.png");
+ }
+
+ [TestMethod]
+ public void BrightnessContrastEffect2 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new BrightnessContrastEffect (80, 20);
+ effect.Render (src);
+
+ Compare (src, "brightnesscontrast2.png");
+ }
+ }
+}
@@ -0,0 +1,58 @@
+//
+// BulgeEffectTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Pinta.ImageManipulation.Effects;
+
+namespace Pinta.ImageManipulation.UnitTests.Effects
+{
+ [TestClass]
+ public class BulgeEffectTest : BaseTest
+ {
+ [TestMethod]
+ public void BulgeEffect1 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new BulgeEffect ();
+ effect.Render (src);
+
+ Compare (src, "bulge1.png");
+ }
+
+ [TestMethod]
+ public void BulgeEffect2 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new BulgeEffect (12, new PointD (20, -20));
+ effect.Render (src);
+
+ Compare (src, "bulge2.png");
+ }
+ }
+}
@@ -0,0 +1,58 @@
+//
+// EdgeDetectEffectTest.cs
+//
+// Author:
+// Jonathan Pobst <monkey@jpobst.com>
+//
+// Copyright (c) 2012 Jonathan Pobst
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using System;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Pinta.ImageManipulation.Effects;
+
+namespace Pinta.ImageManipulation.UnitTests.Effects
+{
+ [TestClass]
+ public class EdgeDetectEffectTest : BaseTest
+ {
+ [TestMethod]
+ public void EdgeDetectEffect1 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new EdgeDetectEffect ();
+ effect.Render (src);
+
+ Compare (src, "edgedetect1.png");
+ }
+
+ [TestMethod]
+ public void EdgeDetectEffect2 ()
+ {
+ var src = GetSourceImage ("input.png");
+
+ var effect = new EdgeDetectEffect (90);
+ effect.Render (src);
+
+ Compare (src, "edgedetect2.png");
+ }
+ }
+}
Oops, something went wrong.

0 comments on commit 474683b

Please sign in to comment.