Simon Cropp
7 years ago
No known key found for this signature in database
GPG Key ID: C75A8447313A3D69
1 changed files with
2 additions and
4 deletions
-
src/ImageSharp/Processing/Processors/Transforms/TransformKernelMap.cs
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
// Copyright (c) Six Labors and contributors.
|
|
|
|
// Copyright (c) Six Labors and contributors.
|
|
|
|
// Licensed under the Apache License, Version 2.0.
|
|
|
|
|
|
|
|
using System; |
|
|
|
@ -130,11 +130,9 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms |
|
|
|
[MethodImpl(InliningOptions.ShortMethod)] |
|
|
|
private void CalculateWeights(int min, int max, float point, ref float weightsRef) |
|
|
|
{ |
|
|
|
float sum = 0; |
|
|
|
for (int x = 0, i = min; i <= max; i++, x++) |
|
|
|
{ |
|
|
|
float weight = this.sampler.GetValue(i - point); |
|
|
|
sum += weight; |
|
|
|
Unsafe.Add(ref weightsRef, x) = weight; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -158,4 +156,4 @@ namespace SixLabors.ImageSharp.Processing.Processors.Transforms |
|
|
|
this.xBuffer?.Dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|