Browse Source

Update tests

js/color-alpha-handling
James Jackson-South 5 years ago
parent
commit
20c598cb1f
  1. 309
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/PixelOperationsTests.Specialized.Generated.cs
  2. 12
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/_Common.ttinclude
  3. 103
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs

309
tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/PixelOperationsTests.Specialized.Generated.cs

@ -3,7 +3,6 @@
// <auto-generated />
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.PixelFormats;
using Xunit;
using Xunit.Abstractions;
@ -23,20 +22,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<A8.PixelOperations>(PixelOperations<A8>.Instance);
protected override PixelOperations<A8> Operations => A8.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = A8.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<A8>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<A8.PixelOperations>(PixelOperations<A8>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = A8.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -50,20 +44,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Argb32.PixelOperations>(PixelOperations<Argb32>.Instance);
protected override PixelOperations<Argb32> Operations => Argb32.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Argb32.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Argb32>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Argb32.PixelOperations>(PixelOperations<Argb32>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Argb32.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -77,20 +66,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Bgr24.PixelOperations>(PixelOperations<Bgr24>.Instance);
protected override PixelOperations<Bgr24> Operations => Bgr24.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Bgr24.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Bgr24>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Bgr24.PixelOperations>(PixelOperations<Bgr24>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Bgr24.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -104,20 +88,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Bgr565.PixelOperations>(PixelOperations<Bgr565>.Instance);
protected override PixelOperations<Bgr565> Operations => Bgr565.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Bgr565.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Bgr565>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Bgr565.PixelOperations>(PixelOperations<Bgr565>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Bgr565.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -131,20 +110,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Bgra32.PixelOperations>(PixelOperations<Bgra32>.Instance);
protected override PixelOperations<Bgra32> Operations => Bgra32.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Bgra32.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Bgra32>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Bgra32.PixelOperations>(PixelOperations<Bgra32>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Bgra32.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -158,20 +132,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Bgra4444.PixelOperations>(PixelOperations<Bgra4444>.Instance);
protected override PixelOperations<Bgra4444> Operations => Bgra4444.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Bgra4444.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Bgra4444>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Bgra4444.PixelOperations>(PixelOperations<Bgra4444>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Bgra4444.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -185,20 +154,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Bgra5551.PixelOperations>(PixelOperations<Bgra5551>.Instance);
protected override PixelOperations<Bgra5551> Operations => Bgra5551.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Bgra5551.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Bgra5551>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Bgra5551.PixelOperations>(PixelOperations<Bgra5551>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Bgra5551.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -212,20 +176,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Byte4.PixelOperations>(PixelOperations<Byte4>.Instance);
protected override PixelOperations<Byte4> Operations => Byte4.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Byte4.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Byte4>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Byte4.PixelOperations>(PixelOperations<Byte4>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Byte4.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -239,20 +198,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<HalfSingle.PixelOperations>(PixelOperations<HalfSingle>.Instance);
protected override PixelOperations<HalfSingle> Operations => HalfSingle.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = HalfSingle.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<HalfSingle>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<HalfSingle.PixelOperations>(PixelOperations<HalfSingle>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = HalfSingle.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -266,20 +220,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<HalfVector2.PixelOperations>(PixelOperations<HalfVector2>.Instance);
protected override PixelOperations<HalfVector2> Operations => HalfVector2.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = HalfVector2.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<HalfVector2>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<HalfVector2.PixelOperations>(PixelOperations<HalfVector2>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = HalfVector2.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -293,20 +242,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<HalfVector4.PixelOperations>(PixelOperations<HalfVector4>.Instance);
protected override PixelOperations<HalfVector4> Operations => HalfVector4.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = HalfVector4.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<HalfVector4>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<HalfVector4.PixelOperations>(PixelOperations<HalfVector4>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = HalfVector4.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -320,20 +264,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<L16.PixelOperations>(PixelOperations<L16>.Instance);
protected override PixelOperations<L16> Operations => L16.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = L16.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<L16>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<L16.PixelOperations>(PixelOperations<L16>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = L16.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -347,20 +286,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<L8.PixelOperations>(PixelOperations<L8>.Instance);
protected override PixelOperations<L8> Operations => L8.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = L8.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<L8>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<L8.PixelOperations>(PixelOperations<L8>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = L8.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -374,20 +308,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<La16.PixelOperations>(PixelOperations<La16>.Instance);
protected override PixelOperations<La16> Operations => La16.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = La16.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<La16>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<La16.PixelOperations>(PixelOperations<La16>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = La16.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -401,20 +330,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<La32.PixelOperations>(PixelOperations<La32>.Instance);
protected override PixelOperations<La32> Operations => La32.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = La32.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<La32>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<La32.PixelOperations>(PixelOperations<La32>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = La32.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -428,20 +352,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<NormalizedByte2.PixelOperations>(PixelOperations<NormalizedByte2>.Instance);
protected override PixelOperations<NormalizedByte2> Operations => NormalizedByte2.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = NormalizedByte2.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<NormalizedByte2>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<NormalizedByte2.PixelOperations>(PixelOperations<NormalizedByte2>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = NormalizedByte2.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -455,20 +374,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<NormalizedByte4.PixelOperations>(PixelOperations<NormalizedByte4>.Instance);
protected override PixelOperations<NormalizedByte4> Operations => NormalizedByte4.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = NormalizedByte4.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<NormalizedByte4>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<NormalizedByte4.PixelOperations>(PixelOperations<NormalizedByte4>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = NormalizedByte4.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -482,20 +396,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<NormalizedShort2.PixelOperations>(PixelOperations<NormalizedShort2>.Instance);
protected override PixelOperations<NormalizedShort2> Operations => NormalizedShort2.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = NormalizedShort2.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<NormalizedShort2>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<NormalizedShort2.PixelOperations>(PixelOperations<NormalizedShort2>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = NormalizedShort2.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -509,20 +418,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<NormalizedShort4.PixelOperations>(PixelOperations<NormalizedShort4>.Instance);
protected override PixelOperations<NormalizedShort4> Operations => NormalizedShort4.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = NormalizedShort4.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<NormalizedShort4>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<NormalizedShort4.PixelOperations>(PixelOperations<NormalizedShort4>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = NormalizedShort4.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -536,20 +440,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rg32.PixelOperations>(PixelOperations<Rg32>.Instance);
protected override PixelOperations<Rg32> Operations => Rg32.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rg32.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rg32>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rg32.PixelOperations>(PixelOperations<Rg32>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rg32.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -563,20 +462,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rgb24.PixelOperations>(PixelOperations<Rgb24>.Instance);
protected override PixelOperations<Rgb24> Operations => Rgb24.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rgb24.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rgb24>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rgb24.PixelOperations>(PixelOperations<Rgb24>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rgb24.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -590,20 +484,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rgb48.PixelOperations>(PixelOperations<Rgb48>.Instance);
protected override PixelOperations<Rgb48> Operations => Rgb48.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rgb48.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rgb48>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rgb48.PixelOperations>(PixelOperations<Rgb48>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rgb48.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -617,20 +506,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rgba1010102.PixelOperations>(PixelOperations<Rgba1010102>.Instance);
protected override PixelOperations<Rgba1010102> Operations => Rgba1010102.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rgba1010102.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rgba1010102>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rgba1010102.PixelOperations>(PixelOperations<Rgba1010102>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rgba1010102.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -644,20 +528,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rgba32.PixelOperations>(PixelOperations<Rgba32>.Instance);
protected override PixelOperations<Rgba32> Operations => Rgba32.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rgba32.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rgba32>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rgba32.PixelOperations>(PixelOperations<Rgba32>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rgba32.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -671,20 +550,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Rgba64.PixelOperations>(PixelOperations<Rgba64>.Instance);
protected override PixelOperations<Rgba64> Operations => Rgba64.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Rgba64.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Rgba64>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Rgba64.PixelOperations>(PixelOperations<Rgba64>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Rgba64.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -698,20 +572,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<RgbaVector.PixelOperations>(PixelOperations<RgbaVector>.Instance);
protected override PixelOperations<RgbaVector> Operations => RgbaVector.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = RgbaVector.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<RgbaVector>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<RgbaVector.PixelOperations>(PixelOperations<RgbaVector>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = RgbaVector.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}
@ -725,20 +594,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Short2.PixelOperations>(PixelOperations<Short2>.Instance);
protected override PixelOperations<Short2> Operations => Short2.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Short2.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Short2>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Short2.PixelOperations>(PixelOperations<Short2>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Short2.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.None, alphaRepresentation);
}
}
@ -752,20 +616,15 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<Short4.PixelOperations>(PixelOperations<Short4>.Instance);
protected override PixelOperations<Short4> Operations => Short4.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = Short4.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<Short4>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<Short4.PixelOperations>(PixelOperations<Short4>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = Short4.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(PixelAlphaRepresentation.Unassociated, alphaRepresentation);
}
}

12
tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/_Common.ttinclude

@ -8,7 +8,6 @@
// <auto-generated />
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.PixelFormats;
using Xunit;
using Xunit.Abstractions;
@ -79,20 +78,15 @@ using Xunit.Abstractions;
this.HasUnassociatedAlpha = alphaRepresentation == PixelAlphaRepresentation.Unassociated;
}
[Fact]
public void IsSpecialImplementation() => Assert.IsType<<#=pixelType#>.PixelOperations>(PixelOperations<<#=pixelType#>>.Instance);
protected override PixelOperations<<#=pixelType#>> Operations => <#=pixelType#>.PixelOperations.Instance;
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = <#=pixelType#>.PixelOperations.Instance.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<<#=pixelType#>>() * 8, bits);
}
public void IsSpecialImplementation() => Assert.IsType<<#=pixelType#>.PixelOperations>(PixelOperations<<#=pixelType#>>.Instance);
[Fact]
public void PixelTypeInfoHasCorrectAlphaRepresentation()
{
var alphaRepresentation = <#=pixelType#>.PixelOperations.Instance.GetPixelTypeInfo().AlphaRepresentation;
var alphaRepresentation = this.Operations.GetPixelTypeInfo().AlphaRepresentation;
Assert.Equal(<#=alpha#>, alphaRepresentation);
}
}

103
tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs

@ -73,7 +73,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
protected Configuration Configuration => Configuration.Default;
internal static PixelOperations<TPixel> Operations => PixelOperations<TPixel>.Instance;
protected virtual PixelOperations<TPixel> Operations => PixelOperations<TPixel>.Instance;
internal static TPixel[] CreateExpectedPixelData(Vector4[] source, RefAction<Vector4> vectorModifier = null)
{
@ -105,6 +105,33 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
return expected;
}
[Fact]
public void PixelTypeInfoHasCorrectBitsPerPixel()
{
var bits = this.Operations.GetPixelTypeInfo().BitsPerPixel;
Assert.Equal(Unsafe.SizeOf<TPixel>() * 8, bits);
}
[Fact]
public void PixelAlphaRepresentation_DefinesPresenceOfAlphaChannel()
{
// We use 0 - 255 as we have pixel formats that store
// the alpha component in less than 8 bits.
const byte Alpha = byte.MinValue;
const byte NoAlpha = byte.MaxValue;
TPixel pixel = default;
pixel.FromRgba32(new Rgba32(0, 0, 0, Alpha));
Rgba32 dest = default;
pixel.ToRgba32(ref dest);
bool hasAlpha = this.Operations.GetPixelTypeInfo().AlphaRepresentation != PixelAlphaRepresentation.None;
byte expectedAlpha = hasAlpha ? Alpha : NoAlpha;
Assert.Equal(expectedAlpha, dest.A);
}
[Theory]
[MemberData(nameof(ArraySizesData))]
public void FromVector4(int count)
@ -115,7 +142,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromVector4Destructive(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.FromVector4Destructive(this.Configuration, s, d.GetSpan()));
}
[Theory]
@ -131,7 +158,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
(s, d) =>
{
Span<TPixel> destPixels = d.GetSpan();
Operations.FromVector4Destructive(this.Configuration, (Span<Vector4>)s, destPixels, PixelConversionModifiers.Scale);
this.Operations.FromVector4Destructive(this.Configuration, (Span<Vector4>)s, destPixels, PixelConversionModifiers.Scale);
});
}
@ -155,7 +182,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromVector4Destructive(
(s, d) => this.Operations.FromVector4Destructive(
this.Configuration,
s,
d.GetSpan(),
@ -194,7 +221,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
? PixelConversionModifiers.Premultiply
: PixelConversionModifiers.None;
Operations.FromVector4Destructive(this.Configuration, s, d.GetSpan(), modifiers);
this.Operations.FromVector4Destructive(this.Configuration, s, d.GetSpan(), modifiers);
});
}
@ -230,7 +257,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
? PixelConversionModifiers.Premultiply
: PixelConversionModifiers.None;
Operations.FromVector4Destructive(
this.Operations.FromVector4Destructive(
this.Configuration,
s,
d.GetSpan(),
@ -274,7 +301,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
? PixelConversionModifiers.Premultiply
: PixelConversionModifiers.None;
Operations.FromVector4Destructive(
this.Operations.FromVector4Destructive(
this.Configuration,
s,
d.GetSpan(),
@ -292,7 +319,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToVector4(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.ToVector4(this.Configuration, s, d.GetSpan()));
}
public static readonly TheoryData<object> Generic_To_Data = new TheoryData<object>
@ -317,7 +344,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
PixelConverterTests.ReferenceImplementations.To<TPixel, TDestPixel>(this.Configuration, source, expected);
TestOperation(source, expected, (s, d) => Operations.To(this.Configuration, (ReadOnlySpan<TPixel>)s, d.GetSpan()));
TestOperation(source, expected, (s, d) => this.Operations.To(this.Configuration, (ReadOnlySpan<TPixel>)s, d.GetSpan()));
}
[Theory]
@ -333,7 +360,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
(s, d) =>
{
Span<Vector4> destVectors = d.GetSpan();
Operations.ToVector4(this.Configuration, (ReadOnlySpan<TPixel>)s, destVectors, PixelConversionModifiers.Scale);
this.Operations.ToVector4(this.Configuration, (ReadOnlySpan<TPixel>)s, destVectors, PixelConversionModifiers.Scale);
});
}
@ -357,7 +384,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToVector4(
(s, d) => this.Operations.ToVector4(
this.Configuration,
s,
d.GetSpan(),
@ -384,7 +411,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToVector4(this.Configuration, s, d.GetSpan(), PixelConversionModifiers.Premultiply));
(s, d) => this.Operations.ToVector4(this.Configuration, s, d.GetSpan(), PixelConversionModifiers.Premultiply));
}
[Theory]
@ -407,7 +434,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToVector4(
(s, d) => this.Operations.ToVector4(
this.Configuration,
s,
d.GetSpan(),
@ -436,7 +463,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToVector4(
(s, d) => this.Operations.ToVector4(
this.Configuration,
s,
d.GetSpan(),
@ -460,7 +487,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromArgb32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromArgb32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -485,7 +512,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToArgb32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToArgb32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -505,7 +532,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromBgr24Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromBgr24Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -528,7 +555,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToBgr24Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToBgr24Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -548,7 +575,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromBgra32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromBgra32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -572,7 +599,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToBgra32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToBgra32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -594,7 +621,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromBgra5551Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromBgra5551Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -618,7 +645,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToBgra5551Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToBgra5551Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -637,7 +664,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromL8(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.FromL8(this.Configuration, s, d.GetSpan()));
}
[Theory]
@ -655,7 +682,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToL8(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.ToL8(this.Configuration, s, d.GetSpan()));
}
[Theory]
@ -679,7 +706,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromL16(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.FromL16(this.Configuration, s, d.GetSpan()));
}
[Theory]
@ -697,7 +724,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToL16(this.Configuration, s, d.GetSpan()));
(s, d) => this.Operations.ToL16(this.Configuration, s, d.GetSpan()));
}
[Theory]
@ -719,7 +746,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromLa16Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromLa16Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -743,7 +770,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToLa16Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToLa16Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -765,7 +792,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromLa32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromLa32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -791,7 +818,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToLa32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToLa32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -811,7 +838,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromRgb24Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromRgb24Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -834,7 +861,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToRgb24Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToRgb24Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -854,7 +881,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromRgba32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromRgba32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -878,7 +905,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToRgba32Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToRgba32Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -898,7 +925,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromRgb48Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromRgb48Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -925,7 +952,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToRgb48Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToRgb48Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -945,7 +972,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.FromRgba64Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.FromRgba64Bytes(this.Configuration, s, d.GetSpan(), count));
}
[Theory]
@ -974,7 +1001,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations
TestOperation(
source,
expected,
(s, d) => Operations.ToRgba64Bytes(this.Configuration, s, d.GetSpan(), count));
(s, d) => this.Operations.ToRgba64Bytes(this.Configuration, s, d.GetSpan(), count));
}
public delegate void RefAction<T1>(ref T1 arg1);

Loading…
Cancel
Save