|
2 | 2 | // Licensed under the Apache License, Version 2.0. |
3 | 3 |
|
4 | 4 | using SixLabors.ImageSharp.PixelFormats; |
| 5 | +using SixLabors.ImageSharp.Processing; |
5 | 6 | using SixLabors.ImageSharp.Processing.Extensions.Transforms; |
6 | 7 | using SixLabors.ImageSharp.Processing.Processors.Transforms; |
| 8 | +using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison; |
7 | 9 | using Xunit; |
8 | 10 |
|
9 | 11 | namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms |
@@ -31,11 +33,26 @@ public void Transform(Point point, out Point newPoint) |
31 | 33 | public void InvertXAndYSwizzle<TPixel>(TestImageProvider<TPixel> provider) |
32 | 34 | where TPixel : unmanaged, IPixel<TPixel> |
33 | 35 | { |
34 | | - Image<TPixel> image = provider.GetImage(); |
35 | | - provider.RunValidatingProcessorTest( |
36 | | - ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height))), |
37 | | - testOutputDetails: nameof(InvertXAndYSwizzler), |
38 | | - appendPixelTypeToFileName: false); |
| 36 | + using Image<TPixel> expectedImage = provider.GetImage(); |
| 37 | + using Image<TPixel> image = provider.GetImage(); |
| 38 | + |
| 39 | + image.Mutate(ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height)))); |
| 40 | + |
| 41 | + image.DebugSave( |
| 42 | + provider, |
| 43 | + nameof(InvertXAndYSwizzler), |
| 44 | + appendPixelTypeToFileName: false, |
| 45 | + appendSourceFileOrDescription: true); |
| 46 | + |
| 47 | + image.Mutate(ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height)))); |
| 48 | + |
| 49 | + image.DebugSave( |
| 50 | + provider, |
| 51 | + "Unswizzle", |
| 52 | + appendPixelTypeToFileName: false, |
| 53 | + appendSourceFileOrDescription: true); |
| 54 | + |
| 55 | + ImageComparer.Exact.VerifySimilarity(expectedImage, image); |
39 | 56 | } |
40 | 57 | } |
41 | 58 | } |
0 commit comments