diff --git a/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs b/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs index f1245ca51..d75d23a51 100644 --- a/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs +++ b/src/ImageSharp/Processing/Processors/Effects/PixelShaderProcessorBase.cs @@ -40,6 +40,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects { var interest = Rectangle.Intersect(this.SourceRectangle, source.Bounds()); int startX = interest.X; + Configuration configuration = this.Configuration; + PixelConversionModifiers modifiers = this.modifiers; ParallelHelper.IterateRowsWithTempBuffer( interest, @@ -51,12 +53,12 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects Span vectorSpan = vectorBuffer.Span; int length = vectorSpan.Length; Span rowSpan = source.GetPixelRowSpan(y).Slice(startX, length); - PixelOperations.Instance.ToVector4(this.Configuration, rowSpan, vectorSpan, this.modifiers); + PixelOperations.Instance.ToVector4(configuration, rowSpan, vectorSpan, modifiers); // Run the user defined pixel shader on the current row of pixels this.ApplyPixelShader(vectorSpan, y, startX); - PixelOperations.Instance.FromVector4Destructive(this.Configuration, vectorSpan, rowSpan, this.modifiers); + PixelOperations.Instance.FromVector4Destructive(configuration, vectorSpan, rowSpan, modifiers); } }); }