mirror of
https://github.com/AssetRipper/AssetRipper.TextureDecoder.git
synced 2026-11-12 18:07:28 -10:00
25 lines
788 B
C#
25 lines
788 B
C#
using AssetRipper.TextureDecoder.Rgb.Formats;
|
|
using AssetRipper.TextureDecoder.Yuy2;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace AssetRipper.TextureDecoder.Tests
|
|
{
|
|
public sealed class Yuy2Tests
|
|
{
|
|
private const int TestImageWidth = 256;
|
|
private const int TestImageHeight = 256;
|
|
|
|
[Test]
|
|
public void DecompressYUY2Test()
|
|
{
|
|
byte[] input = File.ReadAllBytes(TestFileFolders.Yuy2TestFiles + "test.yuy2");
|
|
int bytesRead = Yuy2Decoder.DecompressYUY2<ColorBGRA<byte>, byte>(input, TestImageWidth, TestImageHeight, out byte[] decodedData);
|
|
using (Assert.EnterMultipleScope())
|
|
{
|
|
Assert.That(bytesRead, Is.EqualTo(input.Length));
|
|
Assert.That(decodedData, Has.Length.EqualTo(TestImageWidth * TestImageHeight * Unsafe.SizeOf<ColorBGRA<byte>>()));
|
|
}
|
|
}
|
|
}
|
|
}
|