Browse Source

Minor optimisations

Former-commit-id: 29042a39cda4cf3e8b50d66292c877db2fda8c2d
Former-commit-id: b133abc88402677d2b65df54be481f9d8197c32c
Former-commit-id: 7edec27867e0850ccd5bd8d3537c6479b694ada4
pull/17/head
James Jackson-South 10 years ago
parent
commit
aa522d496c
  1. 4
      src/ImageProcessor/Samplers/Resampler.cs

4
src/ImageProcessor/Samplers/Resampler.cs

@ -277,7 +277,7 @@ namespace ImageProcessor.Samplers
Weight[] horizontalValues = this.horizontalWeights[x].Values;
// Destination color components
Color destination = new Color(0, 0, 0, 0);
Color destination = new Color();
foreach (Weight yw in verticalValues)
{
@ -371,7 +371,7 @@ namespace ImageProcessor.Samplers
}
// Normalise the values
if (Math.Abs(sum) > 0.00001f)
if (sum > 0 || sum < 0)
{
builder.ForEach(w => w.Value /= sum);
}

Loading…
Cancel
Save