|
|
@ -11,7 +11,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public abstract partial class PixelConverterTests |
|
|
public abstract partial class PixelConverterTests |
|
|
{ |
|
|
{ |
|
|
public static readonly TheoryData<byte, byte, byte, byte> RgbaData = |
|
|
public static readonly TheoryData<byte, byte, byte, byte> RgbaData = |
|
|
new TheoryData<byte, byte, byte, byte> |
|
|
new() |
|
|
{ |
|
|
{ |
|
|
{ 0, 0, 0, 0 }, |
|
|
{ 0, 0, 0, 0 }, |
|
|
{ 0, 0, 0, 255 }, |
|
|
{ 0, 0, 0, 255 }, |
|
|
@ -34,7 +34,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToArgb32(byte r, byte g, byte b, byte a) |
|
|
public void ToArgb32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeRgba32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeRgba32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromRgba32.ToArgb32(source, actual); |
|
|
PixelConverter.FromRgba32.ToArgb32(source, actual); |
|
|
|
|
|
|
|
|
@ -48,7 +48,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToBgra32(byte r, byte g, byte b, byte a) |
|
|
public void ToBgra32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeRgba32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeRgba32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromRgba32.ToBgra32(source, actual); |
|
|
PixelConverter.FromRgba32.ToBgra32(source, actual); |
|
|
|
|
|
|
|
|
@ -65,7 +65,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToRgba32(byte r, byte g, byte b, byte a) |
|
|
public void ToRgba32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeArgb32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeArgb32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromArgb32.ToRgba32(source, actual); |
|
|
PixelConverter.FromArgb32.ToRgba32(source, actual); |
|
|
|
|
|
|
|
|
@ -79,7 +79,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToBgra32(byte r, byte g, byte b, byte a) |
|
|
public void ToBgra32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeArgb32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeArgb32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromArgb32.ToBgra32(source, actual); |
|
|
PixelConverter.FromArgb32.ToBgra32(source, actual); |
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToArgb32(byte r, byte g, byte b, byte a) |
|
|
public void ToArgb32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeBgra32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeBgra32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromBgra32.ToArgb32(source, actual); |
|
|
PixelConverter.FromBgra32.ToArgb32(source, actual); |
|
|
|
|
|
|
|
|
@ -110,7 +110,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats |
|
|
public void ToRgba32(byte r, byte g, byte b, byte a) |
|
|
public void ToRgba32(byte r, byte g, byte b, byte a) |
|
|
{ |
|
|
{ |
|
|
byte[] source = ReferenceImplementations.MakeBgra32ByteArray(r, g, b, a); |
|
|
byte[] source = ReferenceImplementations.MakeBgra32ByteArray(r, g, b, a); |
|
|
var actual = new byte[source.Length]; |
|
|
byte[] actual = new byte[source.Length]; |
|
|
|
|
|
|
|
|
PixelConverter.FromBgra32.ToRgba32(source, actual); |
|
|
PixelConverter.FromBgra32.ToRgba32(source, actual); |
|
|
|
|
|
|
|
|
|