|
|
@ -73,8 +73,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects |
|
|
ref Vector4 vectorSpanRef = ref MemoryMarshal.GetReference(vectorSpan); |
|
|
ref Vector4 vectorSpanRef = ref MemoryMarshal.GetReference(vectorSpan); |
|
|
|
|
|
|
|
|
// Rent the shared buffer only once per parallel item
|
|
|
// Rent the shared buffer only once per parallel item
|
|
|
IMemoryOwner<float> bins = configuration.MemoryAllocator.Allocate<float>(levels * 4); |
|
|
using (IMemoryOwner<float> bins = configuration.MemoryAllocator.Allocate<float>(levels * 4)) |
|
|
|
|
|
{ |
|
|
ref float binsRef = ref bins.GetReference(); |
|
|
ref float binsRef = ref bins.GetReference(); |
|
|
ref int intensityBinRef = ref Unsafe.As<float, int>(ref binsRef); |
|
|
ref int intensityBinRef = ref Unsafe.As<float, int>(ref binsRef); |
|
|
ref float redBinRef = ref Unsafe.Add(ref binsRef, levels); |
|
|
ref float redBinRef = ref Unsafe.Add(ref binsRef, levels); |
|
|
@ -141,6 +141,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects |
|
|
|
|
|
|
|
|
PixelOperations<TPixel>.Instance.FromVector4Destructive(configuration, vectorSpan, targetRowSpan); |
|
|
PixelOperations<TPixel>.Instance.FromVector4Destructive(configuration, vectorSpan, targetRowSpan); |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
Buffer2D<TPixel>.SwapOrCopyContent(source.PixelBuffer, targetPixels); |
|
|
Buffer2D<TPixel>.SwapOrCopyContent(source.PixelBuffer, targetPixels); |
|
|
|