📷 A modern, cross-platform, 2D Graphics library for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

39 lines
1.2 KiB

// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using Xunit;
namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.ICC.DataReader
{
[Trait("Profile", "Icc")]
public class IccDataReaderMatrixTests
{
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix2D_FloatArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void ReadMatrix2D(byte[] data, int xCount, int yCount, bool isSingle, float[,] expected)
{
IccDataReader reader = this.CreateReader(data);
float[,] output = reader.ReadMatrix(xCount, yCount, isSingle);
Assert.Equal(expected, output);
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix1D_ArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void ReadMatrix1D(byte[] data, int yCount, bool isSingle, float[] expected)
{
IccDataReader reader = this.CreateReader(data);
float[] output = reader.ReadMatrix(yCount, isSingle);
Assert.Equal(expected, output);
}
private IccDataReader CreateReader(byte[] data)
{
return new IccDataReader(data);
}
}
}