Skip to content

Commit 6b1e603

Browse files
Merge branch 'master' into js/clamp-utils
2 parents bb74f5f + 9b7df13 commit 6b1e603

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,4 @@ artifacts/
221221
# Tests
222222
**/Images/ActualOutput
223223
**/Images/ReferenceOutput
224+
.DS_Store

src/ImageSharp/PixelFormats/PixelImplementations/PixelOperations/RgbaVector.PixelOperations.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ internal class PixelOperations : PixelOperations<RgbaVector>
2626
/// <inheritdoc />
2727
public override PixelTypeInfo GetPixelTypeInfo() => LazyInfo.Value;
2828

29+
/// <inheritdoc />
30+
public override void From<TSourcePixel>(
31+
Configuration configuration,
32+
ReadOnlySpan<TSourcePixel> sourcePixels,
33+
Span<RgbaVector> destinationPixels)
34+
{
35+
Span<Vector4> destinationVectors = MemoryMarshal.Cast<RgbaVector, Vector4>(destinationPixels);
36+
37+
PixelOperations<TSourcePixel>.Instance.ToVector4(configuration, sourcePixels, destinationVectors);
38+
}
39+
2940
/// <inheritdoc />
3041
public override void FromVector4Destructive(
3142
Configuration configuration,

tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ public class ResizeTests
3535
nameof(KnownResamplers.Lanczos5),
3636
};
3737

38-
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.07F);
38+
private static readonly ImageComparer ValidatorComparer =
39+
ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);
3940

4041
[Fact]
4142
public void Resize_PixelAgnostic()
@@ -355,7 +356,6 @@ public void Resize_WorksWithAllResamplers<TPixel>(
355356
}
356357

357358
[Theory]
358-
[PlatformSpecific(~TestPlatforms.OSX)]
359359
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
360360
public void ResizeFromSourceRectangle<TPixel>(TestImageProvider<TPixel> provider)
361361
where TPixel : unmanaged, IPixel<TPixel>
@@ -438,7 +438,6 @@ public void ResizeWidthCannotKeepAspectKeepsOnePixel<TPixel>(TestImageProvider<T
438438
}
439439

440440
[Theory]
441-
[PlatformSpecific(~TestPlatforms.OSX)]
442441
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
443442
public void ResizeWithBoxPadMode<TPixel>(TestImageProvider<TPixel> provider)
444443
where TPixel : unmanaged, IPixel<TPixel>
@@ -549,7 +548,6 @@ public void ResizeWithMinMode<TPixel>(TestImageProvider<TPixel> provider)
549548
}
550549

551550
[Theory]
552-
[PlatformSpecific(~TestPlatforms.OSX)]
553551
[WithFileCollection(nameof(CommonTestImages), DefaultPixelType)]
554552
public void ResizeWithPadMode<TPixel>(TestImageProvider<TPixel> provider)
555553
where TPixel : unmanaged, IPixel<TPixel>

tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ internal static string GetReferenceOutputFileName(string actualOutputFileName) =
108108

109109
internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);
110110

111+
internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
112+
111113
internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194
112114

113115
internal static bool IsWindows => RuntimeInformation.IsOSPlatform(OSPlatform.Windows);

0 commit comments

Comments
 (0)