Browse Source

Remove multiplication

Former-commit-id: 144ecfc26979bbd2bc589ce36ba7188339f1f746
Former-commit-id: 6829fb5a79b7f46df17bacbbc4df662a4012c634
Former-commit-id: 96dc08f0b0b8a16cf9e55eb3c3f1e274479e36a8
af/merge-core
James Jackson-South 11 years ago
parent
commit
53675ef9a6
  1. 5
      src/ImageProcessor/Samplers/Resize.cs
  2. 14
      tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs
  3. 24
      tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs
  4. 1
      tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id

5
src/ImageProcessor/Samplers/Resize.cs

@ -17,7 +17,7 @@ namespace ImageProcessor.Samplers
/// <summary>
/// The epsilon for comparing floating point numbers.
/// </summary>
private const float Epsilon = 0.0001f;
private const float Epsilon = 0.0000001f;
/// <summary>
/// The horizontal weights.
@ -163,8 +163,7 @@ namespace ImageProcessor.Samplers
for (int a = startU; a <= endU; a++)
{
// TODO: CHeck multiplier here
float w = 255f * sampler.GetValue((a - fu) / scale);
float w = sampler.GetValue((a - fu) / scale);
if (Math.Abs(w) > Epsilon)
{

14
tests/ImageProcessor.Tests/Processors/ProcessorTestBase.cs

@ -19,19 +19,17 @@ namespace ImageProcessor.Tests
/// </summary>
public static readonly List<string> Files = new List<string>
{
"../../TestImages/Formats/Jpg/Backdrop.jpg",
//"../../TestImages/Formats/Jpg/Backdrop.jpg",
//"../../TestImages/Formats/Jpg/Calliphora.jpg",
"../../TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg",
"../../TestImages/Formats/Jpg/greyscale.jpg",
//"../../TestImages/Formats/Jpg/gamma_dalai_lama_gray.jpg",
//"../../TestImages/Formats/Jpg/greyscale.jpg",
//"../../TestImages/Formats/Bmp/Car.bmp",
//"../../TestImages/Formats/Png/cmyk.png",
//"../../TestImages/Formats/Png/gamma-1.0-or-2.2.png",
//"../../TestImages/Formats/Gif/leaf.gif",
//"../../TestImages/Formats/Gif/rings.gif"
// { "../../TestImages/Formats/Gif/ani.gif" },
// { "../../TestImages/Formats/Gif/ani2.gif" },
// { "../../TestImages/Formats/Gif/giphy.gif" },
//"../../TestImages/Formats/Gif/rings.gif",
//"../../TestImages/Formats/Gif/ani2.gif" ,
"../../TestImages/Formats/Gif/giphy.gif"
};
}
}

24
tests/ImageProcessor.Tests/Processors/Samplers/SamplerTests.cs

@ -15,18 +15,18 @@ namespace ImageProcessor.Tests
new TheoryData<string, IResampler>
{
{ "Bicubic", new BicubicResampler() },
//{ "Triangle", new TriangleResampler() },
//{ "Box", new BoxResampler() },
//{ "Lanczos3", new Lanczos3Resampler() },
//{ "Lanczos5", new Lanczos5Resampler() },
//{ "Lanczos8", new Lanczos8Resampler() },
//{ "MitchellNetravali", new MitchellNetravaliResampler() },
//{ "Hermite", new HermiteResampler() },
//{ "Spline", new SplineResampler() },
//{ "Robidoux", new RobidouxResampler() },
//{ "RobidouxSharp", new RobidouxSharpResampler() },
//{ "RobidouxSoft", new RobidouxSoftResampler() },
//{ "Welch", new WelchResampler() }
{ "Triangle", new TriangleResampler() },
{ "Box", new BoxResampler() },
{ "Lanczos3", new Lanczos3Resampler() },
{ "Lanczos5", new Lanczos5Resampler() },
{ "Lanczos8", new Lanczos8Resampler() },
{ "MitchellNetravali", new MitchellNetravaliResampler() },
{ "Hermite", new HermiteResampler() },
{ "Spline", new SplineResampler() },
{ "Robidoux", new RobidouxResampler() },
{ "RobidouxSharp", new RobidouxSharpResampler() },
{ "RobidouxSoft", new RobidouxSoftResampler() },
{ "Welch", new WelchResampler() }
};
[Theory]

1
tests/ImageProcessor.Tests/TestImages/Formats/Gif/ani.gif.REMOVED.git-id

@ -1 +0,0 @@
a0cc93222effb5feec0d1a1dc45efd0c5af77450
Loading…
Cancel
Save