Skip to content

Commit 407fc07

Browse files
committed
Address review comments
1 parent f1a799e commit 407fc07

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/ImageSharp/Processing/Processors/Transforms/ISwizzler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface ISwizzler
1717
/// Applies the swizzle transformation to a given point.
1818
/// </summary>
1919
/// <param name="point">Point to transform.</param>
20-
/// <param name="newPoint">The transformed point.</param>
21-
void Transform(Point point, out Point newPoint);
20+
/// <returns>The transformed point.</returns>
21+
Point Transform(Point point);
2222
}
2323
}

src/ImageSharp/Processing/Processors/Transforms/SwizzleProcessor{TSwizzler,TPixel}.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ protected override void OnFrameApply(ImageFrame<TPixel> source, ImageFrame<TPixe
2929
Point newPoint;
3030
for (p.Y = 0; p.Y < source.Height; p.Y++)
3131
{
32+
Span<TPixel> rowSpan = source.GetPixelRowSpan(p.Y);
3233
for (p.X = 0; p.X < source.Width; p.X++)
3334
{
34-
this.swizzler.Transform(p, out newPoint);
35-
destination[newPoint.X, newPoint.Y] = source[p.X, p.Y];
35+
newPoint = this.swizzler.Transform(p);
36+
destination[newPoint.X, newPoint.Y] = rowSpan[p.X];
3637
}
3738
}
3839
}

0 commit comments

Comments
 (0)