Browse Source

Fixes after rebasing to latest master

pull/1886/head
Ynse Hoornenborg 5 years ago
parent
commit
296e412f3f
  1. 8
      .gitattributes
  2. 17
      tests/ImageSharp.Tests/Image/ImageCloneTests.cs

8
.gitattributes

@ -87,6 +87,7 @@
*.eot binary *.eot binary
*.exe binary *.exe binary
*.otf binary *.otf binary
*.pbm binary
*.pdf binary *.pdf binary
*.ppt binary *.ppt binary
*.pptx binary *.pptx binary
@ -94,6 +95,7 @@
*.snk binary *.snk binary
*.ttc binary *.ttc binary
*.ttf binary *.ttf binary
*.wbmp binary
*.woff binary *.woff binary
*.woff2 binary *.woff2 binary
*.xls binary *.xls binary
@ -124,9 +126,3 @@
*.dds filter=lfs diff=lfs merge=lfs -text *.dds filter=lfs diff=lfs merge=lfs -text
*.ktx filter=lfs diff=lfs merge=lfs -text *.ktx filter=lfs diff=lfs merge=lfs -text
*.ktx2 filter=lfs diff=lfs merge=lfs -text *.ktx2 filter=lfs diff=lfs merge=lfs -text
*.pam filter=lfs diff=lfs merge=lfs -text
*.pbm filter=lfs diff=lfs merge=lfs -text
*.pgm filter=lfs diff=lfs merge=lfs -text
*.ppm filter=lfs diff=lfs merge=lfs -text
*.pnm filter=lfs diff=lfs merge=lfs -text
*.wbmp filter=lfs diff=lfs merge=lfs -text

17
tests/ImageSharp.Tests/Image/ImageCloneTests.cs

@ -60,15 +60,17 @@ namespace SixLabors.ImageSharp.Tests
[WithTestPatternImages(9, 9, PixelTypes.Rgba32)] [WithTestPatternImages(9, 9, PixelTypes.Rgba32)]
public void CloneAs_ToAbgr32(TestImageProvider<Rgba32> provider) public void CloneAs_ToAbgr32(TestImageProvider<Rgba32> provider)
{ {
using (Image<Rgba32> image = provider.GetImage()) using Image<Rgba32> image = provider.GetImage();
using (Image<Abgr32> clone = image.CloneAs<Abgr32>()) using Image<Abgr32> clone = image.CloneAs<Abgr32>();
image.ProcessPixelRows(clone, static (imageAccessor, cloneAccessor) =>
{ {
for (int y = 0; y < image.Height; y++) for (int y = 0; y < imageAccessor.Height; y++)
{ {
Span<Rgba32> row = image.GetPixelRowSpan(y); Span<Rgba32> row = imageAccessor.GetRowSpan(y);
Span<Abgr32> rowClone = clone.GetPixelRowSpan(y); Span<Abgr32> rowClone = cloneAccessor.GetRowSpan(y);
for (int x = 0; x < image.Width; x++) for (int x = 0; x < cloneAccessor.Width; x++)
{ {
Rgba32 expected = row[x]; Rgba32 expected = row[x];
Abgr32 actual = rowClone[x]; Abgr32 actual = rowClone[x];
@ -76,10 +78,9 @@ namespace SixLabors.ImageSharp.Tests
Assert.Equal(expected.R, actual.R); Assert.Equal(expected.R, actual.R);
Assert.Equal(expected.G, actual.G); Assert.Equal(expected.G, actual.G);
Assert.Equal(expected.B, actual.B); Assert.Equal(expected.B, actual.B);
Assert.Equal(expected.A, actual.A);
} }
} }
} });
} }
[Theory] [Theory]

Loading…
Cancel
Save