Browse Source

Minor optimisations

Former-commit-id: 732ec6eb4f12e9d029f60e7a8149ae353828e3c7
Former-commit-id: e5c071029115af00af8b7f61932de5acbb860bdc
Former-commit-id: c298b38efe3ddcfb3038c1177affa2e139a47149
pull/17/head
James Jackson-South 10 years ago
parent
commit
fd4cd4145b
  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