|
|
@ -84,13 +84,13 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs |
|
|
MemoryGroup<TPixel> framePixels = frame.PixelBuffer.FastMemoryGroup; |
|
|
MemoryGroup<TPixel> framePixels = frame.PixelBuffer.FastMemoryGroup; |
|
|
|
|
|
|
|
|
using IUnsafePixelCollection<ushort> pixels = magicFrame.GetPixelsUnsafe(); |
|
|
using IUnsafePixelCollection<ushort> pixels = magicFrame.GetPixelsUnsafe(); |
|
|
if (magicFrame.Depth == 8 || magicFrame.Depth == 6 || magicFrame.Depth == 4 || magicFrame.Depth == 2 || magicFrame.Depth == 1 || magicFrame.Depth == 10 || magicFrame.Depth == 12) |
|
|
if (magicFrame.Depth is 8 or 6 or 4 or 2 or 1 or 10 or 12) |
|
|
{ |
|
|
{ |
|
|
byte[] data = pixels.ToByteArray(PixelMapping.RGBA); |
|
|
byte[] data = pixels.ToByteArray(PixelMapping.RGBA); |
|
|
|
|
|
|
|
|
FromRgba32Bytes(configuration, data, framePixels); |
|
|
FromRgba32Bytes(configuration, data, framePixels); |
|
|
} |
|
|
} |
|
|
else if (magicFrame.Depth == 16 || magicFrame.Depth == 14) |
|
|
else if (magicFrame.Depth is 16 or 14) |
|
|
{ |
|
|
{ |
|
|
ushort[] data = pixels.ToShortArray(PixelMapping.RGBA); |
|
|
ushort[] data = pixels.ToShortArray(PixelMapping.RGBA); |
|
|
Span<byte> bytes = MemoryMarshal.Cast<ushort, byte>(data.AsSpan()); |
|
|
Span<byte> bytes = MemoryMarshal.Cast<ushort, byte>(data.AsSpan()); |
|
|
|