Browse Source

Cleanup icc tests

pull/1567/head
Brian Popow 4 years ago
parent
commit
dcc8147977
  1. 2
      tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs
  2. 4
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataReader/IccDataReaderMatrixTests.cs
  3. 2
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataReader/IccDataReaderTagDataEntryTests.cs
  4. 10
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataWriter/IccDataWriterMatrixTests.cs
  5. 2
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataWriter/IccDataWriterTagDataEntryTests.cs
  6. 2
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccProfileTests.cs
  7. 15
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccReaderTests.cs
  8. 17
      tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccWriterTests.cs
  9. 132
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs
  10. 310
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs
  11. 194
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs
  12. 130
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs
  13. 74
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs
  14. 327
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs
  15. 398
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs
  16. 110
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs
  17. 740
      tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs

2
tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.Metadata.cs

@ -77,7 +77,7 @@ public partial class JpegEncoderTests
{
// arrange
using var input = new Image<Rgba32>(1, 1);
input.Metadata.IccProfile = new IccProfile(IccTestDataProfiles.Profile_Random_Array);
input.Metadata.IccProfile = new IccProfile(IccTestDataProfiles.ProfileRandomArray);
// act
using var memStream = new MemoryStream();

4
tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataReader/IccDataReaderMatrixTests.cs

@ -9,7 +9,7 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.ICC.DataReader;
public class IccDataReaderMatrixTests
{
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix2D_FloatArrayTestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix2DFloatArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void ReadMatrix2D(byte[] data, int xCount, int yCount, bool isSingle, float[,] expected)
{
IccDataReader reader = CreateReader(data);
@ -20,7 +20,7 @@ public class IccDataReaderMatrixTests
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix1D_ArrayTestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix1DArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void ReadMatrix1D(byte[] data, int yCount, bool isSingle, float[] expected)
{
IccDataReader reader = CreateReader(data);

2
tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataReader/IccDataReaderTagDataEntryTests.cs

@ -166,7 +166,7 @@ public class IccDataReaderTagDataEntryTests
[Theory]
[MemberData(
nameof(IccTestDataTagDataEntry.MultiLocalizedUnicodeTagDataEntryTestData_Read),
nameof(IccTestDataTagDataEntry.MultiLocalizedUnicodeTagDataEntryTestDataRead),
MemberType = typeof(IccTestDataTagDataEntry))]
internal void ReadMultiLocalizedUnicodeTagDataEntry(byte[] data, IccMultiLocalizedUnicodeTagDataEntry expected)
{

10
tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataWriter/IccDataWriterMatrixTests.cs

@ -10,7 +10,7 @@ namespace SixLabors.ImageSharp.Tests.Metadata.Profiles.ICC.DataWriter;
public class IccDataWriterMatrixTests
{
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix2D_FloatArrayTestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix2DFloatArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void WriteMatrix2D_Array(byte[] expected, int xCount, int yCount, bool isSingle, float[,] data)
{
using IccDataWriter writer = CreateWriter();
@ -22,7 +22,7 @@ public class IccDataWriterMatrixTests
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix2D_Matrix4x4TestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix2DMatrix4X4TestData), MemberType = typeof(IccTestDataMatrix))]
public void WriteMatrix2D_Matrix4x4(byte[] expected, int xCount, int yCount, bool isSingle, Matrix4x4 data)
{
using IccDataWriter writer = CreateWriter();
@ -34,7 +34,7 @@ public class IccDataWriterMatrixTests
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix2D_DenseMatrixTestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix2DDenseMatrixTestData), MemberType = typeof(IccTestDataMatrix))]
internal void WriteMatrix2D_DenseMatrix(byte[] expected, int xCount, int yCount, bool isSingle, in DenseMatrix<float> data)
{
using IccDataWriter writer = CreateWriter();
@ -46,7 +46,7 @@ public class IccDataWriterMatrixTests
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix1D_ArrayTestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix1DArrayTestData), MemberType = typeof(IccTestDataMatrix))]
public void WriteMatrix1D_Array(byte[] expected, int yCount, bool isSingle, float[] data)
{
using IccDataWriter writer = CreateWriter();
@ -58,7 +58,7 @@ public class IccDataWriterMatrixTests
}
[Theory]
[MemberData(nameof(IccTestDataMatrix.Matrix1D_Vector3TestData), MemberType = typeof(IccTestDataMatrix))]
[MemberData(nameof(IccTestDataMatrix.Matrix1DVector3TestData), MemberType = typeof(IccTestDataMatrix))]
public void WriteMatrix1D_Vector3(byte[] expected, int yCount, bool isSingle, Vector3 data)
{
using IccDataWriter writer = CreateWriter();

2
tests/ImageSharp.Tests/Metadata/Profiles/ICC/DataWriter/IccDataWriterTagDataEntryTests.cs

@ -153,7 +153,7 @@ public class IccDataWriterTagDataEntryTests
}
[Theory]
[MemberData(nameof(IccTestDataTagDataEntry.MultiLocalizedUnicodeTagDataEntryTestData_Write), MemberType = typeof(IccTestDataTagDataEntry))]
[MemberData(nameof(IccTestDataTagDataEntry.MultiLocalizedUnicodeTagDataEntryTestDataWrite), MemberType = typeof(IccTestDataTagDataEntry))]
internal void WriteMultiLocalizedUnicodeTagDataEntry(byte[] expected, IccMultiLocalizedUnicodeTagDataEntry data)
{
using IccDataWriter writer = CreateWriter();

2
tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccProfileTests.cs

@ -20,7 +20,7 @@ public class IccProfileTests
[Fact]
public void CalculateHash_WithByteArray_DoesNotModifyData()
{
byte[] data = IccTestDataProfiles.Profile_Random_Array;
byte[] data = IccTestDataProfiles.ProfileRandomArray;
var copy = new byte[data.Length];
Buffer.BlockCopy(data, 0, copy, 0, data.Length);

15
tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccReaderTests.cs

@ -11,15 +11,13 @@ public class IccReaderTests
[Fact]
public void ReadProfile_NoEntries()
{
IccReader reader = this.CreateReader();
IccProfile output = IccReader.Read(IccTestDataProfiles.Header_Random_Array);
IccProfile output = IccReader.Read(IccTestDataProfiles.HeaderRandomArray);
Assert.Equal(0, output.Entries.Length);
Assert.NotNull(output.Header);
IccProfileHeader header = output.Header;
IccProfileHeader expected = IccTestDataProfiles.Header_Random_Read;
IccProfileHeader expected = IccTestDataProfiles.HeaderRandomRead;
Assert.Equal(header.Class, expected.Class);
Assert.Equal(header.CmmType, expected.CmmType);
Assert.Equal(header.CreationDate, expected.CreationDate);
@ -42,16 +40,9 @@ public class IccReaderTests
[Fact]
public void ReadProfile_DuplicateEntry()
{
IccReader reader = this.CreateReader();
IccProfile output = IccReader.Read(IccTestDataProfiles.Profile_Random_Array);
IccProfile output = IccReader.Read(IccTestDataProfiles.ProfileRandomArray);
Assert.Equal(2, output.Entries.Length);
Assert.True(ReferenceEquals(output.Entries[0], output.Entries[1]));
}
private IccReader CreateReader()
{
return new IccReader();
}
}

17
tests/ImageSharp.Tests/Metadata/Profiles/ICC/IccWriterTests.cs

@ -11,29 +11,20 @@ public class IccWriterTests
[Fact]
public void WriteProfile_NoEntries()
{
IccWriter writer = this.CreateWriter();
var profile = new IccProfile
{
Header = IccTestDataProfiles.Header_Random_Write
Header = IccTestDataProfiles.HeaderRandomWrite
};
byte[] output = IccWriter.Write(profile);
Assert.Equal(IccTestDataProfiles.Header_Random_Array, output);
Assert.Equal(IccTestDataProfiles.HeaderRandomArray, output);
}
[Fact]
public void WriteProfile_DuplicateEntry()
{
IccWriter writer = this.CreateWriter();
byte[] output = IccWriter.Write(IccTestDataProfiles.Profile_Random_Val);
byte[] output = IccWriter.Write(IccTestDataProfiles.ProfileRandomVal);
Assert.Equal(IccTestDataProfiles.Profile_Random_Array, output);
}
private IccWriter CreateWriter()
{
return new IccWriter();
Assert.Equal(IccTestDataProfiles.ProfileRandomArray, output);
}
}

132
tests/ImageSharp.Tests/TestDataIcc/IccTestDataArray.cs

@ -12,98 +12,98 @@ internal static class IccTestDataArray
new object[] { UInt8, UInt8 }
};
public static readonly ushort[] UInt16_Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] UInt16_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt16_0,
IccTestDataPrimitives.UInt16_1,
IccTestDataPrimitives.UInt16_2,
IccTestDataPrimitives.UInt16_3,
IccTestDataPrimitives.UInt16_4,
IccTestDataPrimitives.UInt16_5,
IccTestDataPrimitives.UInt16_6,
IccTestDataPrimitives.UInt16_7,
IccTestDataPrimitives.UInt16_8,
IccTestDataPrimitives.UInt16_9);
public static readonly ushort[] UInt16Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] UInt16Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt160,
IccTestDataPrimitives.UInt161,
IccTestDataPrimitives.UInt162,
IccTestDataPrimitives.UInt163,
IccTestDataPrimitives.UInt164,
IccTestDataPrimitives.UInt165,
IccTestDataPrimitives.UInt166,
IccTestDataPrimitives.UInt167,
IccTestDataPrimitives.UInt168,
IccTestDataPrimitives.UInt169);
public static readonly object[][] UInt16TestData =
{
new object[] { UInt16_Arr, UInt16_Val }
new object[] { UInt16Arr, UInt16Val }
};
public static readonly short[] Int16_Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly short[] Int16Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] Int16_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.Int16_0,
IccTestDataPrimitives.Int16_1,
IccTestDataPrimitives.Int16_2,
IccTestDataPrimitives.Int16_3,
IccTestDataPrimitives.Int16_4,
IccTestDataPrimitives.Int16_5,
IccTestDataPrimitives.Int16_6,
IccTestDataPrimitives.Int16_7,
IccTestDataPrimitives.Int16_8,
IccTestDataPrimitives.Int16_9);
public static readonly byte[] Int16Arr = ArrayHelper.Concat(
IccTestDataPrimitives.Int160,
IccTestDataPrimitives.Int161,
IccTestDataPrimitives.Int162,
IccTestDataPrimitives.Int163,
IccTestDataPrimitives.Int164,
IccTestDataPrimitives.Int165,
IccTestDataPrimitives.Int166,
IccTestDataPrimitives.Int167,
IccTestDataPrimitives.Int168,
IccTestDataPrimitives.Int169);
public static readonly object[][] Int16TestData =
{
new object[] { Int16_Arr, Int16_Val }
new object[] { Int16Arr, Int16Val }
};
public static readonly uint[] UInt32_Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly uint[] UInt32Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] UInt32_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_0,
IccTestDataPrimitives.UInt32_1,
IccTestDataPrimitives.UInt32_2,
IccTestDataPrimitives.UInt32_3,
IccTestDataPrimitives.UInt32_4,
IccTestDataPrimitives.UInt32_5,
IccTestDataPrimitives.UInt32_6,
IccTestDataPrimitives.UInt32_7,
IccTestDataPrimitives.UInt32_8,
IccTestDataPrimitives.UInt32_9);
public static readonly byte[] UInt32Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt320,
IccTestDataPrimitives.UInt321,
IccTestDataPrimitives.UInt322,
IccTestDataPrimitives.UInt323,
IccTestDataPrimitives.UInt324,
IccTestDataPrimitives.UInt325,
IccTestDataPrimitives.UInt326,
IccTestDataPrimitives.UInt327,
IccTestDataPrimitives.UInt328,
IccTestDataPrimitives.UInt329);
public static readonly object[][] UInt32TestData =
{
new object[] { UInt32_Arr, UInt32_Val }
new object[] { UInt32Arr, UInt32Val }
};
public static readonly int[] Int32_Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly int[] Int32Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] Int32_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.Int32_0,
IccTestDataPrimitives.Int32_1,
IccTestDataPrimitives.Int32_2,
IccTestDataPrimitives.Int32_3,
IccTestDataPrimitives.Int32_4,
IccTestDataPrimitives.Int32_5,
IccTestDataPrimitives.Int32_6,
IccTestDataPrimitives.Int32_7,
IccTestDataPrimitives.Int32_8,
IccTestDataPrimitives.Int32_9);
public static readonly byte[] Int32Arr = ArrayHelper.Concat(
IccTestDataPrimitives.Int320,
IccTestDataPrimitives.Int321,
IccTestDataPrimitives.Int322,
IccTestDataPrimitives.Int323,
IccTestDataPrimitives.Int324,
IccTestDataPrimitives.Int325,
IccTestDataPrimitives.Int326,
IccTestDataPrimitives.Int327,
IccTestDataPrimitives.Int328,
IccTestDataPrimitives.Int329);
public static readonly object[][] Int32TestData =
{
new object[] { Int32_Arr, Int32_Val }
new object[] { Int32Arr, Int32Val }
};
public static readonly ulong[] UInt64_Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly ulong[] UInt64Val = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
public static readonly byte[] UInt64_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt64_0,
IccTestDataPrimitives.UInt64_1,
IccTestDataPrimitives.UInt64_2,
IccTestDataPrimitives.UInt64_3,
IccTestDataPrimitives.UInt64_4,
IccTestDataPrimitives.UInt64_5,
IccTestDataPrimitives.UInt64_6,
IccTestDataPrimitives.UInt64_7,
IccTestDataPrimitives.UInt64_8,
IccTestDataPrimitives.UInt64_9);
public static readonly byte[] UInt64Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt640,
IccTestDataPrimitives.UInt641,
IccTestDataPrimitives.UInt642,
IccTestDataPrimitives.UInt643,
IccTestDataPrimitives.UInt644,
IccTestDataPrimitives.UInt645,
IccTestDataPrimitives.UInt646,
IccTestDataPrimitives.UInt647,
IccTestDataPrimitives.UInt648,
IccTestDataPrimitives.UInt649);
public static readonly object[][] UInt64TestData =
{
new object[] { UInt64_Arr, UInt64_Val }
new object[] { UInt64Arr, UInt64Val }
};
}

310
tests/ImageSharp.Tests/TestDataIcc/IccTestDataCurves.cs

@ -10,302 +10,302 @@ internal static class IccTestDataCurves
/// <summary>
/// Channels: 3
/// </summary>
public static readonly IccResponseCurve Response_ValGrad = new IccResponseCurve(
public static readonly IccResponseCurve ResponseValGrad = new(
IccCurveMeasurementEncodings.StatusA,
new[]
{
IccTestDataNonPrimitives.XyzNumber_ValVar1,
IccTestDataNonPrimitives.XyzNumber_ValVar2,
IccTestDataNonPrimitives.XyzNumber_ValVar3
IccTestDataNonPrimitives.XyzNumberValVar1,
IccTestDataNonPrimitives.XyzNumberValVar2,
IccTestDataNonPrimitives.XyzNumberValVar3
},
new IccResponseNumber[][]
new[]
{
new IccResponseNumber[] { IccTestDataNonPrimitives.ResponseNumber_Val1, IccTestDataNonPrimitives.ResponseNumber_Val2 },
new IccResponseNumber[] { IccTestDataNonPrimitives.ResponseNumber_Val3, IccTestDataNonPrimitives.ResponseNumber_Val4 },
new IccResponseNumber[] { IccTestDataNonPrimitives.ResponseNumber_Val5, IccTestDataNonPrimitives.ResponseNumber_Val6 },
new[] { IccTestDataNonPrimitives.ResponseNumberVal1, IccTestDataNonPrimitives.ResponseNumberVal2 },
new[] { IccTestDataNonPrimitives.ResponseNumberVal3, IccTestDataNonPrimitives.ResponseNumberVal4 },
new[] { IccTestDataNonPrimitives.ResponseNumberVal5, IccTestDataNonPrimitives.ResponseNumberVal6 },
});
/// <summary>
/// Channels: 3
/// </summary>
public static readonly byte[] Response_Grad = ArrayHelper.Concat(
public static readonly byte[] ResponseGrad = ArrayHelper.Concat(
new byte[] { 0x53, 0x74, 0x61, 0x41 },
IccTestDataPrimitives.UInt32_2,
IccTestDataPrimitives.UInt32_2,
IccTestDataPrimitives.UInt32_2,
IccTestDataNonPrimitives.XyzNumber_Var1,
IccTestDataNonPrimitives.XyzNumber_Var2,
IccTestDataNonPrimitives.XyzNumber_Var3,
IccTestDataNonPrimitives.ResponseNumber_1,
IccTestDataNonPrimitives.ResponseNumber_2,
IccTestDataNonPrimitives.ResponseNumber_3,
IccTestDataNonPrimitives.ResponseNumber_4,
IccTestDataNonPrimitives.ResponseNumber_5,
IccTestDataNonPrimitives.ResponseNumber_6);
IccTestDataPrimitives.UInt322,
IccTestDataPrimitives.UInt322,
IccTestDataPrimitives.UInt322,
IccTestDataNonPrimitives.XyzNumberVar1,
IccTestDataNonPrimitives.XyzNumberVar2,
IccTestDataNonPrimitives.XyzNumberVar3,
IccTestDataNonPrimitives.ResponseNumber1,
IccTestDataNonPrimitives.ResponseNumber2,
IccTestDataNonPrimitives.ResponseNumber3,
IccTestDataNonPrimitives.ResponseNumber4,
IccTestDataNonPrimitives.ResponseNumber5,
IccTestDataNonPrimitives.ResponseNumber6);
public static readonly object[][] ResponseCurveTestData =
{
new object[] { Response_Grad, Response_ValGrad, 3 },
new object[] { ResponseGrad, ResponseValGrad, 3 },
};
public static readonly IccParametricCurve Parametric_ValVar1 = new IccParametricCurve(1);
public static readonly IccParametricCurve Parametric_ValVar2 = new IccParametricCurve(1, 2, 3);
public static readonly IccParametricCurve Parametric_ValVar3 = new IccParametricCurve(1, 2, 3, 4);
public static readonly IccParametricCurve Parametric_ValVar4 = new IccParametricCurve(1, 2, 3, 4, 5);
public static readonly IccParametricCurve Parametric_ValVar5 = new IccParametricCurve(1, 2, 3, 4, 5, 6, 7);
public static readonly IccParametricCurve ParametricValVar1 = new(1);
public static readonly IccParametricCurve ParametricValVar2 = new(1, 2, 3);
public static readonly IccParametricCurve ParametricValVar3 = new(1, 2, 3, 4);
public static readonly IccParametricCurve ParametricValVar4 = new(1, 2, 3, 4, 5);
public static readonly IccParametricCurve ParametricValVar5 = new(1, 2, 3, 4, 5, 6, 7);
public static readonly byte[] Parametric_Var1 = ArrayHelper.Concat(
public static readonly byte[] ParametricVar1 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x00,
0x00, 0x00,
},
IccTestDataPrimitives.Fix16_1);
IccTestDataPrimitives.Fix161);
public static readonly byte[] Parametric_Var2 = ArrayHelper.Concat(
public static readonly byte[] ParametricVar2 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x01,
0x00, 0x00,
},
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_2,
IccTestDataPrimitives.Fix16_3);
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix162,
IccTestDataPrimitives.Fix163);
public static readonly byte[] Parametric_Var3 = ArrayHelper.Concat(
public static readonly byte[] ParametricVar3 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x02,
0x00, 0x00,
},
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_2,
IccTestDataPrimitives.Fix16_3,
IccTestDataPrimitives.Fix16_4);
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix162,
IccTestDataPrimitives.Fix163,
IccTestDataPrimitives.Fix164);
public static readonly byte[] Parametric_Var4 = ArrayHelper.Concat(
public static readonly byte[] ParametricVar4 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x03,
0x00, 0x00,
},
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_2,
IccTestDataPrimitives.Fix16_3,
IccTestDataPrimitives.Fix16_4,
IccTestDataPrimitives.Fix16_5);
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix162,
IccTestDataPrimitives.Fix163,
IccTestDataPrimitives.Fix164,
IccTestDataPrimitives.Fix165);
public static readonly byte[] Parametric_Var5 = ArrayHelper.Concat(
public static readonly byte[] ParametricVar5 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x04,
0x00, 0x00,
},
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_2,
IccTestDataPrimitives.Fix16_3,
IccTestDataPrimitives.Fix16_4,
IccTestDataPrimitives.Fix16_5,
IccTestDataPrimitives.Fix16_6,
IccTestDataPrimitives.Fix16_7);
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix162,
IccTestDataPrimitives.Fix163,
IccTestDataPrimitives.Fix164,
IccTestDataPrimitives.Fix165,
IccTestDataPrimitives.Fix166,
IccTestDataPrimitives.Fix167);
public static readonly object[][] ParametricCurveTestData =
{
new object[] { Parametric_Var1, Parametric_ValVar1 },
new object[] { Parametric_Var2, Parametric_ValVar2 },
new object[] { Parametric_Var3, Parametric_ValVar3 },
new object[] { Parametric_Var4, Parametric_ValVar4 },
new object[] { Parametric_Var5, Parametric_ValVar5 },
new object[] { ParametricVar1, ParametricValVar1 },
new object[] { ParametricVar2, ParametricValVar2 },
new object[] { ParametricVar3, ParametricValVar3 },
new object[] { ParametricVar4, ParametricValVar4 },
new object[] { ParametricVar5, ParametricValVar5 },
};
// Formula Segment
public static readonly IccFormulaCurveElement Formula_ValVar1 = new IccFormulaCurveElement(IccFormulaCurveType.Type1, 1, 2, 3, 4, 0, 0);
public static readonly IccFormulaCurveElement Formula_ValVar2 = new IccFormulaCurveElement(IccFormulaCurveType.Type2, 1, 2, 3, 4, 5, 0);
public static readonly IccFormulaCurveElement Formula_ValVar3 = new IccFormulaCurveElement(IccFormulaCurveType.Type3, 0, 2, 3, 4, 5, 6);
public static readonly IccFormulaCurveElement FormulaValVar1 = new(IccFormulaCurveType.Type1, 1, 2, 3, 4, 0, 0);
public static readonly IccFormulaCurveElement FormulaValVar2 = new(IccFormulaCurveType.Type2, 1, 2, 3, 4, 5, 0);
public static readonly IccFormulaCurveElement FormulaValVar3 = new(IccFormulaCurveType.Type3, 0, 2, 3, 4, 5, 6);
public static readonly byte[] Formula_Var1 = ArrayHelper.Concat(
public static readonly byte[] FormulaVar1 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x00,
0x00, 0x00,
},
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4);
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4);
public static readonly byte[] Formula_Var2 = ArrayHelper.Concat(
public static readonly byte[] FormulaVar2 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x01,
0x00, 0x00,
},
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5);
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5);
public static readonly byte[] Formula_Var3 = ArrayHelper.Concat(
public static readonly byte[] FormulaVar3 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x02,
0x00, 0x00,
},
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_6);
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single6);
public static readonly object[][] FormulaCurveSegmentTestData =
{
new object[] { Formula_Var1, Formula_ValVar1 },
new object[] { Formula_Var2, Formula_ValVar2 },
new object[] { Formula_Var3, Formula_ValVar3 },
new object[] { FormulaVar1, FormulaValVar1 },
new object[] { FormulaVar2, FormulaValVar2 },
new object[] { FormulaVar3, FormulaValVar3 },
};
// Sampled Segment
public static readonly IccSampledCurveElement Sampled_ValGrad1 = new IccSampledCurveElement(new float[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
public static readonly IccSampledCurveElement Sampled_ValGrad2 = new IccSampledCurveElement(new float[] { 9, 8, 7, 6, 5, 4, 3, 2, 1 });
public static readonly byte[] Sampled_Grad1 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_9,
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_9);
public static readonly byte[] Sampled_Grad2 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_9,
IccTestDataPrimitives.Single_9,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_1);
public static readonly IccSampledCurveElement SampledValGrad1 = new(new float[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
public static readonly IccSampledCurveElement SampledValGrad2 = new(new float[] { 9, 8, 7, 6, 5, 4, 3, 2, 1 });
public static readonly byte[] SampledGrad1 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt329,
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single9);
public static readonly byte[] SampledGrad2 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt329,
IccTestDataPrimitives.Single9,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single1);
public static readonly object[][] SampledCurveSegmentTestData =
{
new object[] { Sampled_Grad1, Sampled_ValGrad1 },
new object[] { Sampled_Grad2, Sampled_ValGrad2 },
new object[] { SampledGrad1, SampledValGrad1 },
new object[] { SampledGrad2, SampledValGrad2 },
};
public static readonly IccCurveSegment Segment_ValFormula1 = Formula_ValVar1;
public static readonly IccCurveSegment Segment_ValFormula2 = Formula_ValVar2;
public static readonly IccCurveSegment Segment_ValFormula3 = Formula_ValVar3;
public static readonly IccCurveSegment Segment_ValSampled1 = Sampled_ValGrad1;
public static readonly IccCurveSegment Segment_ValSampled2 = Sampled_ValGrad2;
public static readonly IccCurveSegment SegmentValFormula1 = FormulaValVar1;
public static readonly IccCurveSegment SegmentValFormula2 = FormulaValVar2;
public static readonly IccCurveSegment SegmentValFormula3 = FormulaValVar3;
public static readonly IccCurveSegment SegmentValSampled1 = SampledValGrad1;
public static readonly IccCurveSegment SegmentValSampled2 = SampledValGrad2;
public static readonly byte[] Segment_Formula1 = ArrayHelper.Concat(
public static readonly byte[] SegmentFormula1 = ArrayHelper.Concat(
new byte[]
{
0x70, 0x61, 0x72, 0x66,
0x00, 0x00, 0x00, 0x00,
},
Formula_Var1);
FormulaVar1);
public static readonly byte[] Segment_Formula2 = ArrayHelper.Concat(
public static readonly byte[] SegmentFormula2 = ArrayHelper.Concat(
new byte[]
{
0x70, 0x61, 0x72, 0x66,
0x00, 0x00, 0x00, 0x00,
},
Formula_Var2);
FormulaVar2);
public static readonly byte[] Segment_Formula3 = ArrayHelper.Concat(
public static readonly byte[] SegmentFormula3 = ArrayHelper.Concat(
new byte[]
{
0x70, 0x61, 0x72, 0x66,
0x00, 0x00, 0x00, 0x00,
},
Formula_Var3);
FormulaVar3);
public static readonly byte[] Segment_Sampled1 = ArrayHelper.Concat(
public static readonly byte[] SegmentSampled1 = ArrayHelper.Concat(
new byte[]
{
0x73, 0x61, 0x6D, 0x66,
0x00, 0x00, 0x00, 0x00,
},
Sampled_Grad1);
SampledGrad1);
public static readonly byte[] Segment_Sampled2 = ArrayHelper.Concat(
public static readonly byte[] SegmentSampled2 = ArrayHelper.Concat(
new byte[]
{
0x73, 0x61, 0x6D, 0x66,
0x00, 0x00, 0x00, 0x00,
},
Sampled_Grad2);
SampledGrad2);
public static readonly object[][] CurveSegmentTestData =
{
new object[] { Segment_Formula1, Segment_ValFormula1 },
new object[] { Segment_Formula2, Segment_ValFormula2 },
new object[] { Segment_Formula3, Segment_ValFormula3 },
new object[] { Segment_Sampled1, Segment_ValSampled1 },
new object[] { Segment_Sampled2, Segment_ValSampled2 },
new object[] { SegmentFormula1, SegmentValFormula1 },
new object[] { SegmentFormula2, SegmentValFormula2 },
new object[] { SegmentFormula3, SegmentValFormula3 },
new object[] { SegmentSampled1, SegmentValSampled1 },
new object[] { SegmentSampled2, SegmentValSampled2 },
};
public static readonly IccOneDimensionalCurve OneDimensional_ValFormula1 = new IccOneDimensionalCurve(
public static readonly IccOneDimensionalCurve OneDimensionalValFormula1 = new(
new float[] { 0, 1 },
new IccCurveSegment[] { Segment_ValFormula1, Segment_ValFormula2, Segment_ValFormula3 });
new[] { SegmentValFormula1, SegmentValFormula2, SegmentValFormula3 });
public static readonly IccOneDimensionalCurve OneDimensional_ValFormula2 = new IccOneDimensionalCurve(
public static readonly IccOneDimensionalCurve OneDimensionalValFormula2 = new(
new float[] { 0, 1 },
new IccCurveSegment[] { Segment_ValFormula3, Segment_ValFormula2, Segment_ValFormula1 });
new[] { SegmentValFormula3, SegmentValFormula2, SegmentValFormula1 });
public static readonly IccOneDimensionalCurve OneDimensional_ValSampled = new IccOneDimensionalCurve(
public static readonly IccOneDimensionalCurve OneDimensionalValSampled = new(
new float[] { 0, 1 },
new IccCurveSegment[] { Segment_ValSampled1, Segment_ValSampled2, Segment_ValSampled1 });
new[] { SegmentValSampled1, SegmentValSampled2, SegmentValSampled1 });
public static readonly byte[] OneDimensional_Formula1 = ArrayHelper.Concat(
public static readonly byte[] OneDimensionalFormula1 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x03,
0x00, 0x00,
},
IccTestDataPrimitives.Single_0,
IccTestDataPrimitives.Single_1,
Segment_Formula1,
Segment_Formula2,
Segment_Formula3);
IccTestDataPrimitives.Single0,
IccTestDataPrimitives.Single1,
SegmentFormula1,
SegmentFormula2,
SegmentFormula3);
public static readonly byte[] OneDimensional_Formula2 = ArrayHelper.Concat(
public static readonly byte[] OneDimensionalFormula2 = ArrayHelper.Concat(
new byte[]
{
0x00, 0x03,
0x00, 0x00,
},
IccTestDataPrimitives.Single_0,
IccTestDataPrimitives.Single_1,
Segment_Formula3,
Segment_Formula2,
Segment_Formula1);
IccTestDataPrimitives.Single0,
IccTestDataPrimitives.Single1,
SegmentFormula3,
SegmentFormula2,
SegmentFormula1);
public static readonly byte[] OneDimensional_Sampled = ArrayHelper.Concat(
public static readonly byte[] OneDimensionalSampled = ArrayHelper.Concat(
new byte[]
{
0x00, 0x03,
0x00, 0x00,
},
IccTestDataPrimitives.Single_0,
IccTestDataPrimitives.Single_1,
Segment_Sampled1,
Segment_Sampled2,
Segment_Sampled1);
IccTestDataPrimitives.Single0,
IccTestDataPrimitives.Single1,
SegmentSampled1,
SegmentSampled2,
SegmentSampled1);
public static readonly object[][] OneDimensionalCurveTestData =
{
new object[] { OneDimensional_Formula1, OneDimensional_ValFormula1 },
new object[] { OneDimensional_Formula2, OneDimensional_ValFormula2 },
new object[] { OneDimensional_Sampled, OneDimensional_ValSampled },
new object[] { OneDimensionalFormula1, OneDimensionalValFormula1 },
new object[] { OneDimensionalFormula2, OneDimensionalValFormula2 },
new object[] { OneDimensionalSampled, OneDimensionalValSampled },
};
}

194
tests/ImageSharp.Tests/TestDataIcc/IccTestDataLut.cs

@ -7,10 +7,10 @@ namespace SixLabors.ImageSharp.Tests;
internal static class IccTestDataLut
{
public static readonly IccLut LUT8_ValGrad = CreateLUT8Val();
public static readonly byte[] LUT8_Grad = CreateLUT8();
public static readonly IccLut Lut8ValGrad = CreateLut8Val();
public static readonly byte[] Lut8Grad = CreateLut8();
private static IccLut CreateLUT8Val()
private static IccLut CreateLut8Val()
{
float[] result = new float[256];
for (int i = 0; i < 256; i++)
@ -21,7 +21,7 @@ internal static class IccTestDataLut
return new IccLut(result);
}
private static byte[] CreateLUT8()
private static byte[] CreateLut8()
{
byte[] result = new byte[256];
for (int i = 0; i < 256; i++)
@ -34,10 +34,10 @@ internal static class IccTestDataLut
public static readonly object[][] Lut8TestData =
{
new object[] { LUT8_Grad, LUT8_ValGrad },
new object[] { Lut8Grad, Lut8ValGrad },
};
public static readonly IccLut LUT16_ValGrad = new IccLut(new float[]
public static readonly IccLut Lut16ValGrad = new(new[]
{
1f / ushort.MaxValue,
2f / ushort.MaxValue,
@ -52,38 +52,38 @@ internal static class IccTestDataLut
1f
});
public static readonly byte[] LUT16_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.UInt16_1,
IccTestDataPrimitives.UInt16_2,
IccTestDataPrimitives.UInt16_3,
IccTestDataPrimitives.UInt16_4,
IccTestDataPrimitives.UInt16_5,
IccTestDataPrimitives.UInt16_6,
IccTestDataPrimitives.UInt16_7,
IccTestDataPrimitives.UInt16_8,
IccTestDataPrimitives.UInt16_9,
IccTestDataPrimitives.UInt16_32768,
IccTestDataPrimitives.UInt16_Max);
public static readonly byte[] Lut16Grad = ArrayHelper.Concat(
IccTestDataPrimitives.UInt161,
IccTestDataPrimitives.UInt162,
IccTestDataPrimitives.UInt163,
IccTestDataPrimitives.UInt164,
IccTestDataPrimitives.UInt165,
IccTestDataPrimitives.UInt166,
IccTestDataPrimitives.UInt167,
IccTestDataPrimitives.UInt168,
IccTestDataPrimitives.UInt169,
IccTestDataPrimitives.UInt1632768,
IccTestDataPrimitives.UInt16Max);
public static readonly object[][] Lut16TestData =
{
new object[] { LUT16_Grad, LUT16_ValGrad, 11 },
new object[] { Lut16Grad, Lut16ValGrad, 11 },
};
public static readonly IccClut CLUT8_ValGrad = new IccClut(
new float[][]
public static readonly IccClut Clut8ValGrad = new(
new[]
{
new float[] { 1f / byte.MaxValue, 2f / byte.MaxValue, 3f / byte.MaxValue },
new float[] { 4f / byte.MaxValue, 5f / byte.MaxValue, 6f / byte.MaxValue },
new float[] { 7f / byte.MaxValue, 8f / byte.MaxValue, 9f / byte.MaxValue },
new[] { 1f / byte.MaxValue, 2f / byte.MaxValue, 3f / byte.MaxValue },
new[] { 4f / byte.MaxValue, 5f / byte.MaxValue, 6f / byte.MaxValue },
new[] { 7f / byte.MaxValue, 8f / byte.MaxValue, 9f / byte.MaxValue },
new float[] { 10f / byte.MaxValue, 11f / byte.MaxValue, 12f / byte.MaxValue },
new float[] { 13f / byte.MaxValue, 14f / byte.MaxValue, 15f / byte.MaxValue },
new float[] { 16f / byte.MaxValue, 17f / byte.MaxValue, 18f / byte.MaxValue },
new[] { 10f / byte.MaxValue, 11f / byte.MaxValue, 12f / byte.MaxValue },
new[] { 13f / byte.MaxValue, 14f / byte.MaxValue, 15f / byte.MaxValue },
new[] { 16f / byte.MaxValue, 17f / byte.MaxValue, 18f / byte.MaxValue },
new float[] { 19f / byte.MaxValue, 20f / byte.MaxValue, 21f / byte.MaxValue },
new float[] { 22f / byte.MaxValue, 23f / byte.MaxValue, 24f / byte.MaxValue },
new float[] { 25f / byte.MaxValue, 26f / byte.MaxValue, 27f / byte.MaxValue },
new[] { 19f / byte.MaxValue, 20f / byte.MaxValue, 21f / byte.MaxValue },
new[] { 22f / byte.MaxValue, 23f / byte.MaxValue, 24f / byte.MaxValue },
new[] { 25f / byte.MaxValue, 26f / byte.MaxValue, 27f / byte.MaxValue },
},
new byte[] { 3, 3 },
IccClutDataType.UInt8);
@ -93,7 +93,7 @@ internal static class IccTestDataLut
/// <para>Output Channel Count: 3</para>
/// <para>Grid-point Count: { 3, 3 }</para>
/// </summary>
public static readonly byte[] CLUT8_Grad =
public static readonly byte[] Clut8Grad =
{
0x01, 0x02, 0x03,
0x04, 0x05, 0x06,
@ -110,23 +110,23 @@ internal static class IccTestDataLut
public static readonly object[][] Clut8TestData =
{
new object[] { CLUT8_Grad, CLUT8_ValGrad, 2, 3, new byte[] { 3, 3 } },
new object[] { Clut8Grad, Clut8ValGrad, 2, 3, new byte[] { 3, 3 } },
};
public static readonly IccClut CLUT16_ValGrad = new IccClut(
new float[][]
public static readonly IccClut Clut16ValGrad = new(
new[]
{
new float[] { 1f / ushort.MaxValue, 2f / ushort.MaxValue, 3f / ushort.MaxValue },
new float[] { 4f / ushort.MaxValue, 5f / ushort.MaxValue, 6f / ushort.MaxValue },
new float[] { 7f / ushort.MaxValue, 8f / ushort.MaxValue, 9f / ushort.MaxValue },
new[] { 1f / ushort.MaxValue, 2f / ushort.MaxValue, 3f / ushort.MaxValue },
new[] { 4f / ushort.MaxValue, 5f / ushort.MaxValue, 6f / ushort.MaxValue },
new[] { 7f / ushort.MaxValue, 8f / ushort.MaxValue, 9f / ushort.MaxValue },
new float[] { 10f / ushort.MaxValue, 11f / ushort.MaxValue, 12f / ushort.MaxValue },
new float[] { 13f / ushort.MaxValue, 14f / ushort.MaxValue, 15f / ushort.MaxValue },
new float[] { 16f / ushort.MaxValue, 17f / ushort.MaxValue, 18f / ushort.MaxValue },
new[] { 10f / ushort.MaxValue, 11f / ushort.MaxValue, 12f / ushort.MaxValue },
new[] { 13f / ushort.MaxValue, 14f / ushort.MaxValue, 15f / ushort.MaxValue },
new[] { 16f / ushort.MaxValue, 17f / ushort.MaxValue, 18f / ushort.MaxValue },
new float[] { 19f / ushort.MaxValue, 20f / ushort.MaxValue, 21f / ushort.MaxValue },
new float[] { 22f / ushort.MaxValue, 23f / ushort.MaxValue, 24f / ushort.MaxValue },
new float[] { 25f / ushort.MaxValue, 26f / ushort.MaxValue, 27f / ushort.MaxValue },
new[] { 19f / ushort.MaxValue, 20f / ushort.MaxValue, 21f / ushort.MaxValue },
new[] { 22f / ushort.MaxValue, 23f / ushort.MaxValue, 24f / ushort.MaxValue },
new[] { 25f / ushort.MaxValue, 26f / ushort.MaxValue, 27f / ushort.MaxValue },
},
new byte[] { 3, 3 },
IccClutDataType.UInt16);
@ -136,7 +136,7 @@ internal static class IccTestDataLut
/// <para>Output Channel Count: 3</para>
/// <para>Grid-point Count: { 3, 3 }</para>
/// </summary>
public static readonly byte[] CLUT16_Grad =
public static readonly byte[] Clut16Grad =
{
0x00, 0x01, 0x00, 0x02, 0x00, 0x03,
0x00, 0x04, 0x00, 0x05, 0x00, 0x06,
@ -153,23 +153,23 @@ internal static class IccTestDataLut
public static readonly object[][] Clut16TestData =
{
new object[] { CLUT16_Grad, CLUT16_ValGrad, 2, 3, new byte[] { 3, 3 } },
new object[] { Clut16Grad, Clut16ValGrad, 2, 3, new byte[] { 3, 3 } },
};
public static readonly IccClut CLUTf32_ValGrad = new IccClut(
new float[][]
public static readonly IccClut CluTf32ValGrad = new(
new[]
{
new float[] { 1f, 2f, 3f },
new float[] { 4f, 5f, 6f },
new float[] { 7f, 8f, 9f },
new[] { 1f, 2f, 3f },
new[] { 4f, 5f, 6f },
new[] { 7f, 8f, 9f },
new float[] { 1f, 2f, 3f },
new float[] { 4f, 5f, 6f },
new float[] { 7f, 8f, 9f },
new[] { 1f, 2f, 3f },
new[] { 4f, 5f, 6f },
new[] { 7f, 8f, 9f },
new float[] { 1f, 2f, 3f },
new float[] { 4f, 5f, 6f },
new float[] { 7f, 8f, 9f },
new[] { 1f, 2f, 3f },
new[] { 4f, 5f, 6f },
new[] { 7f, 8f, 9f },
},
new byte[] { 3, 3 },
IccClutDataType.Float);
@ -179,62 +179,62 @@ internal static class IccTestDataLut
/// <para>Output Channel Count: 3</para>
/// <para>Grid-point Count: { 3, 3 }</para>
/// </summary>
public static readonly byte[] CLUTf32_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_9,
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_9,
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_9);
public static readonly byte[] CluTf32Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single9,
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single9,
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single9);
public static readonly object[][] ClutF32TestData =
{
new object[] { CLUTf32_Grad, CLUTf32_ValGrad, 2, 3, new byte[] { 3, 3 } },
new object[] { CluTf32Grad, CluTf32ValGrad, 2, 3, new byte[] { 3, 3 } },
};
public static readonly IccClut CLUT_Val8 = CLUT8_ValGrad;
public static readonly IccClut CLUT_Val16 = CLUT16_ValGrad;
public static readonly IccClut CLUT_Valf32 = CLUTf32_ValGrad;
public static readonly IccClut ClutVal8 = Clut8ValGrad;
public static readonly IccClut ClutVal16 = Clut16ValGrad;
public static readonly IccClut ClutValf32 = CluTf32ValGrad;
public static readonly byte[] CLUT_8 = ArrayHelper.Concat(
public static readonly byte[] Clut8 = ArrayHelper.Concat(
new byte[16] { 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[4] { 0x01, 0x00, 0x00, 0x00 },
CLUT8_Grad);
Clut8Grad);
public static readonly byte[] CLUT_16 = ArrayHelper.Concat(
public static readonly byte[] Clut16 = ArrayHelper.Concat(
new byte[16] { 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
new byte[4] { 0x02, 0x00, 0x00, 0x00 },
CLUT16_Grad);
Clut16Grad);
public static readonly byte[] CLUT_f32 = ArrayHelper.Concat(
public static readonly byte[] ClutF32 = ArrayHelper.Concat(
new byte[16] { 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
CLUTf32_Grad);
CluTf32Grad);
public static readonly object[][] ClutTestData =
{
new object[] { CLUT_8, CLUT_Val8, 2, 3, false },
new object[] { CLUT_16, CLUT_Val16, 2, 3, false },
new object[] { CLUT_f32, CLUT_Valf32, 2, 3, true },
new object[] { Clut8, ClutVal8, 2, 3, false },
new object[] { Clut16, ClutVal16, 2, 3, false },
new object[] { ClutF32, ClutValf32, 2, 3, true },
};
}

130
tests/ImageSharp.Tests/TestDataIcc/IccTestDataMatrix.cs

@ -12,7 +12,7 @@ internal static class IccTestDataMatrix
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly float[,] Single_2DArray_ValGrad =
public static readonly float[,] Single2DArrayValGrad =
{
{ 1, 2, 3 },
{ 4, 5, 6 },
@ -22,7 +22,7 @@ internal static class IccTestDataMatrix
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly float[,] Single_2DArray_ValIdentity =
public static readonly float[,] Single2DArrayValIdentity =
{
{ 1, 0, 0 },
{ 0, 1, 0 },
@ -32,121 +32,121 @@ internal static class IccTestDataMatrix
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly Matrix4x4 Single_Matrix4x4_ValGrad = new Matrix4x4(1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 1);
public static readonly Matrix4x4 SingleMatrix4X4ValGrad = new(1, 2, 3, 0, 4, 5, 6, 0, 7, 8, 9, 0, 0, 0, 0, 1);
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly Matrix4x4 Single_Matrix4x4_ValIdentity = Matrix4x4.Identity;
public static readonly Matrix4x4 SingleMatrix4X4ValIdentity = Matrix4x4.Identity;
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly DenseMatrix<float> Single_DenseMatrix_ValGrad = new DenseMatrix<float>(Single_2DArray_ValGrad);
public static readonly DenseMatrix<float> SingleDenseMatrixValGrad = new(Single2DArrayValGrad);
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly DenseMatrix<float> Single_DenseMatrix_ValIdentity = new DenseMatrix<float>(Single_2DArray_ValIdentity);
public static readonly DenseMatrix<float> SingleDenseMatrixValIdentity = new(Single2DArrayValIdentity);
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly byte[] Fix16_2D_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_4,
IccTestDataPrimitives.Fix16_7,
IccTestDataPrimitives.Fix16_2,
IccTestDataPrimitives.Fix16_5,
IccTestDataPrimitives.Fix16_8,
IccTestDataPrimitives.Fix16_3,
IccTestDataPrimitives.Fix16_6,
IccTestDataPrimitives.Fix16_9);
public static readonly byte[] Fix162DGrad = ArrayHelper.Concat(
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix164,
IccTestDataPrimitives.Fix167,
IccTestDataPrimitives.Fix162,
IccTestDataPrimitives.Fix165,
IccTestDataPrimitives.Fix168,
IccTestDataPrimitives.Fix163,
IccTestDataPrimitives.Fix166,
IccTestDataPrimitives.Fix169);
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly byte[] Fix16_2D_Identity = ArrayHelper.Concat(
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_0,
IccTestDataPrimitives.Fix16_1);
public static readonly byte[] Fix162DIdentity = ArrayHelper.Concat(
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix160,
IccTestDataPrimitives.Fix161);
/// <summary>
/// 3x3 Matrix
/// </summary>
public static readonly byte[] Single_2D_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_7,
IccTestDataPrimitives.Single_2,
IccTestDataPrimitives.Single_5,
IccTestDataPrimitives.Single_8,
IccTestDataPrimitives.Single_3,
IccTestDataPrimitives.Single_6,
IccTestDataPrimitives.Single_9);
public static readonly object[][] Matrix2D_FloatArrayTestData =
public static readonly byte[] Single2DGrad = ArrayHelper.Concat(
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single7,
IccTestDataPrimitives.Single2,
IccTestDataPrimitives.Single5,
IccTestDataPrimitives.Single8,
IccTestDataPrimitives.Single3,
IccTestDataPrimitives.Single6,
IccTestDataPrimitives.Single9);
public static readonly object[][] Matrix2DFloatArrayTestData =
{
new object[] { Fix16_2D_Grad, 3, 3, false, Single_2DArray_ValGrad },
new object[] { Fix16_2D_Identity, 3, 3, false, Single_2DArray_ValIdentity },
new object[] { Single_2D_Grad, 3, 3, true, Single_2DArray_ValGrad },
new object[] { Fix162DGrad, 3, 3, false, Single2DArrayValGrad },
new object[] { Fix162DIdentity, 3, 3, false, Single2DArrayValIdentity },
new object[] { Single2DGrad, 3, 3, true, Single2DArrayValGrad },
};
public static readonly object[][] Matrix2D_DenseMatrixTestData =
public static readonly object[][] Matrix2DDenseMatrixTestData =
{
new object[] { Fix16_2D_Grad, 3, 3, false, Single_DenseMatrix_ValGrad },
new object[] { Fix16_2D_Identity, 3, 3, false, Single_DenseMatrix_ValIdentity },
new object[] { Single_2D_Grad, 3, 3, true, Single_DenseMatrix_ValGrad },
new object[] { Fix162DGrad, 3, 3, false, SingleDenseMatrixValGrad },
new object[] { Fix162DIdentity, 3, 3, false, SingleDenseMatrixValIdentity },
new object[] { Single2DGrad, 3, 3, true, SingleDenseMatrixValGrad },
};
public static readonly object[][] Matrix2D_Matrix4x4TestData =
public static readonly object[][] Matrix2DMatrix4X4TestData =
{
new object[] { Fix16_2D_Grad, 3, 3, false, Single_Matrix4x4_ValGrad },
new object[] { Fix16_2D_Identity, 3, 3, false, Single_Matrix4x4_ValIdentity },
new object[] { Single_2D_Grad, 3, 3, true, Single_Matrix4x4_ValGrad },
new object[] { Fix162DGrad, 3, 3, false, SingleMatrix4X4ValGrad },
new object[] { Fix162DIdentity, 3, 3, false, SingleMatrix4X4ValIdentity },
new object[] { Single2DGrad, 3, 3, true, SingleMatrix4X4ValGrad },
};
/// <summary>
/// 3x1 Matrix
/// </summary>
public static readonly float[] Single_1DArray_ValGrad = { 1, 4, 7 };
public static readonly float[] Single1DArrayValGrad = { 1, 4, 7 };
/// <summary>
/// 3x1 Matrix
/// </summary>
public static readonly Vector3 Single_Vector3_ValGrad = new Vector3(1, 4, 7);
public static readonly Vector3 SingleVector3ValGrad = new(1, 4, 7);
/// <summary>
/// 3x1 Matrix
/// </summary>
public static readonly byte[] Fix16_1D_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Fix16_1,
IccTestDataPrimitives.Fix16_4,
IccTestDataPrimitives.Fix16_7);
public static readonly byte[] Fix161DGrad = ArrayHelper.Concat(
IccTestDataPrimitives.Fix161,
IccTestDataPrimitives.Fix164,
IccTestDataPrimitives.Fix167);
/// <summary>
/// 3x1 Matrix
/// </summary>
public static readonly byte[] Single_1D_Grad = ArrayHelper.Concat(
IccTestDataPrimitives.Single_1,
IccTestDataPrimitives.Single_4,
IccTestDataPrimitives.Single_7);
public static readonly byte[] Single1DGrad = ArrayHelper.Concat(
IccTestDataPrimitives.Single1,
IccTestDataPrimitives.Single4,
IccTestDataPrimitives.Single7);
public static readonly object[][] Matrix1D_ArrayTestData =
public static readonly object[][] Matrix1DArrayTestData =
{
new object[] { Fix16_1D_Grad, 3, false, Single_1DArray_ValGrad },
new object[] { Single_1D_Grad, 3, true, Single_1DArray_ValGrad },
new object[] { Fix161DGrad, 3, false, Single1DArrayValGrad },
new object[] { Single1DGrad, 3, true, Single1DArrayValGrad },
};
public static readonly object[][] Matrix1D_Vector3TestData =
public static readonly object[][] Matrix1DVector3TestData =
{
new object[] { Fix16_1D_Grad, 3, false, Single_Vector3_ValGrad },
new object[] { Single_1D_Grad, 3, true, Single_Vector3_ValGrad },
new object[] { Fix161DGrad, 3, false, SingleVector3ValGrad },
new object[] { Single1DGrad, 3, true, SingleVector3ValGrad },
};
}

74
tests/ImageSharp.Tests/TestDataIcc/IccTestDataMultiProcessElements.cs

@ -11,99 +11,99 @@ internal static class IccTestDataMultiProcessElements
/// <para>Input Channel Count: 3</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly IccCurveSetProcessElement CurvePE_ValGrad = new IccCurveSetProcessElement(new IccOneDimensionalCurve[]
public static readonly IccCurveSetProcessElement CurvePeValGrad = new(new[]
{
IccTestDataCurves.OneDimensional_ValFormula1,
IccTestDataCurves.OneDimensional_ValFormula2,
IccTestDataCurves.OneDimensional_ValFormula1
IccTestDataCurves.OneDimensionalValFormula1,
IccTestDataCurves.OneDimensionalValFormula2,
IccTestDataCurves.OneDimensionalValFormula1
});
/// <summary>
/// <para>Input Channel Count: 3</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly byte[] CurvePE_Grad = ArrayHelper.Concat(
IccTestDataCurves.OneDimensional_Formula1,
IccTestDataCurves.OneDimensional_Formula2,
IccTestDataCurves.OneDimensional_Formula1);
public static readonly byte[] CurvePeGrad = ArrayHelper.Concat(
IccTestDataCurves.OneDimensionalFormula1,
IccTestDataCurves.OneDimensionalFormula2,
IccTestDataCurves.OneDimensionalFormula1);
public static readonly object[][] CurveSetTestData =
{
new object[] { CurvePE_Grad, CurvePE_ValGrad, 3, 3 },
new object[] { CurvePeGrad, CurvePeValGrad, 3, 3 },
};
/// <summary>
/// <para>Input Channel Count: 3</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly IccMatrixProcessElement MatrixPE_ValGrad = new IccMatrixProcessElement(
IccTestDataMatrix.Single_2DArray_ValGrad,
IccTestDataMatrix.Single_1DArray_ValGrad);
public static readonly IccMatrixProcessElement MatrixPeValGrad = new(
IccTestDataMatrix.Single2DArrayValGrad,
IccTestDataMatrix.Single1DArrayValGrad);
/// <summary>
/// <para>Input Channel Count: 3</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly byte[] MatrixPE_Grad = ArrayHelper.Concat(
IccTestDataMatrix.Single_2D_Grad,
IccTestDataMatrix.Single_1D_Grad);
public static readonly byte[] MatrixPeGrad = ArrayHelper.Concat(
IccTestDataMatrix.Single2DGrad,
IccTestDataMatrix.Single1DGrad);
public static readonly object[][] MatrixTestData =
{
new object[] { MatrixPE_Grad, MatrixPE_ValGrad, 3, 3 },
new object[] { MatrixPeGrad, MatrixPeValGrad, 3, 3 },
};
/// <summary>
/// <para>Input Channel Count: 2</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly IccClutProcessElement CLUTPE_ValGrad = new IccClutProcessElement(IccTestDataLut.CLUT_Valf32);
public static readonly IccClutProcessElement ClutpeValGrad = new(IccTestDataLut.ClutValf32);
/// <summary>
/// <para>Input Channel Count: 2</para>
/// <para>Output Channel Count: 3</para>
/// </summary>
public static readonly byte[] CLUTPE_Grad = IccTestDataLut.CLUT_f32;
public static readonly byte[] ClutpeGrad = IccTestDataLut.ClutF32;
public static readonly object[][] ClutTestData =
{
new object[] { CLUTPE_Grad, CLUTPE_ValGrad, 2, 3 },
new object[] { ClutpeGrad, ClutpeValGrad, 2, 3 },
};
public static readonly IccMultiProcessElement MPE_ValMatrix = MatrixPE_ValGrad;
public static readonly IccMultiProcessElement MPE_ValCLUT = CLUTPE_ValGrad;
public static readonly IccMultiProcessElement MPE_ValCurve = CurvePE_ValGrad;
public static readonly IccMultiProcessElement MPE_ValbACS = new IccBAcsProcessElement(3, 3);
public static readonly IccMultiProcessElement MPE_ValeACS = new IccEAcsProcessElement(3, 3);
public static readonly IccMultiProcessElement MpeValMatrix = MatrixPeValGrad;
public static readonly IccMultiProcessElement MpeValClut = ClutpeValGrad;
public static readonly IccMultiProcessElement MpeValCurve = CurvePeValGrad;
public static readonly IccMultiProcessElement MpeValbAcs = new IccBAcsProcessElement(3, 3);
public static readonly IccMultiProcessElement MpeValeAcs = new IccEAcsProcessElement(3, 3);
public static readonly byte[] MPE_Matrix = ArrayHelper.Concat(
public static readonly byte[] MpeMatrix = ArrayHelper.Concat(
new byte[]
{
0x6D, 0x61, 0x74, 0x66,
0x00, 0x03,
0x00, 0x03,
},
MatrixPE_Grad);
MatrixPeGrad);
public static readonly byte[] MPE_CLUT = ArrayHelper.Concat(
public static readonly byte[] MpeClut = ArrayHelper.Concat(
new byte[]
{
0x63, 0x6C, 0x75, 0x74,
0x00, 0x02,
0x00, 0x03,
},
CLUTPE_Grad);
ClutpeGrad);
public static readonly byte[] MPE_Curve = ArrayHelper.Concat(
public static readonly byte[] MpeCurve = ArrayHelper.Concat(
new byte[]
{
0x6D, 0x66, 0x6C, 0x74,
0x00, 0x03,
0x00, 0x03,
},
CurvePE_Grad);
CurvePeGrad);
public static readonly byte[] MPE_bACS =
public static readonly byte[] MpeBAcs =
{
0x62, 0x41, 0x43, 0x53,
0x00, 0x03,
@ -111,7 +111,7 @@ internal static class IccTestDataMultiProcessElements
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
public static readonly byte[] MPE_eACS =
public static readonly byte[] MpeEAcs =
{
0x65, 0x41, 0x43, 0x53,
0x00, 0x03,
@ -121,10 +121,10 @@ internal static class IccTestDataMultiProcessElements
public static readonly object[][] MultiProcessElementTestData =
{
new object[] { MPE_Matrix, MPE_ValMatrix },
new object[] { MPE_CLUT, MPE_ValCLUT },
new object[] { MPE_Curve, MPE_ValCurve },
new object[] { MPE_bACS, MPE_ValbACS },
new object[] { MPE_eACS, MPE_ValeACS },
new object[] { MpeMatrix, MpeValMatrix },
new object[] { MpeClut, MpeValClut },
new object[] { MpeCurve, MpeValCurve },
new object[] { MpeBAcs, MpeValbAcs },
new object[] { MpeEAcs, MpeValeAcs },
};
}

327
tests/ImageSharp.Tests/TestDataIcc/IccTestDataNonPrimitives.cs

@ -9,11 +9,11 @@ namespace SixLabors.ImageSharp.Tests;
internal static class IccTestDataNonPrimitives
{
public static readonly DateTime DateTime_ValMin = new DateTime(1, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static readonly DateTime DateTime_ValMax = new DateTime(9999, 12, 31, 23, 59, 59, DateTimeKind.Utc);
public static readonly DateTime DateTime_ValRand1 = new DateTime(1990, 11, 26, 3, 19, 47, DateTimeKind.Utc);
public static readonly DateTime DateTimeValMin = new(1, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static readonly DateTime DateTimeValMax = new(9999, 12, 31, 23, 59, 59, DateTimeKind.Utc);
public static readonly DateTime DateTimeValRand1 = new(1990, 11, 26, 3, 19, 47, DateTimeKind.Utc);
public static readonly byte[] DateTime_Min =
public static readonly byte[] DateTimeMin =
{
0x00, 0x01, // Year 1
0x00, 0x01, // Month 1
@ -23,7 +23,7 @@ internal static class IccTestDataNonPrimitives
0x00, 0x00, // Second 0
};
public static readonly byte[] DateTime_Max =
public static readonly byte[] DateTimeMax =
{
0x27, 0x0F, // Year 9999
0x00, 0x0C, // Month 12
@ -33,7 +33,7 @@ internal static class IccTestDataNonPrimitives
0x00, 0x3B, // Second 59
};
public static readonly byte[] DateTime_Invalid =
public static readonly byte[] DateTimeInvalid =
{
0xFF, 0xFF, // Year 65535
0x00, 0x0E, // Month 14
@ -43,7 +43,7 @@ internal static class IccTestDataNonPrimitives
0x00, 0x3D, // Second 61
};
public static readonly byte[] DateTime_Rand1 =
public static readonly byte[] DateTimeRand1 =
{
0x07, 0xC6, // Year 1990
0x00, 0x0B, // Month 11
@ -55,135 +55,135 @@ internal static class IccTestDataNonPrimitives
public static readonly object[][] DateTimeTestData =
{
new object[] { DateTime_Min, DateTime_ValMin },
new object[] { DateTime_Max, DateTime_ValMax },
new object[] { DateTime_Rand1, DateTime_ValRand1 },
new object[] { DateTimeMin, DateTimeValMin },
new object[] { DateTimeMax, DateTimeValMax },
new object[] { DateTimeRand1, DateTimeValRand1 },
};
public static readonly IccVersion VersionNumber_ValMin = new IccVersion(0, 0, 0);
public static readonly IccVersion VersionNumber_Val211 = new IccVersion(2, 1, 1);
public static readonly IccVersion VersionNumber_Val430 = new IccVersion(4, 3, 0);
public static readonly IccVersion VersionNumber_ValMax = new IccVersion(255, 15, 15);
public static readonly IccVersion VersionNumberValMin = new(0, 0, 0);
public static readonly IccVersion VersionNumberVal211 = new(2, 1, 1);
public static readonly IccVersion VersionNumberVal430 = new(4, 3, 0);
public static readonly IccVersion VersionNumberValMax = new(255, 15, 15);
public static readonly byte[] VersionNumber_Min = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] VersionNumber_211 = { 0x02, 0x11, 0x00, 0x00 };
public static readonly byte[] VersionNumber_430 = { 0x04, 0x30, 0x00, 0x00 };
public static readonly byte[] VersionNumber_Max = { 0xFF, 0xFF, 0x00, 0x00 };
public static readonly byte[] VersionNumberMin = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] VersionNumber211 = { 0x02, 0x11, 0x00, 0x00 };
public static readonly byte[] VersionNumber430 = { 0x04, 0x30, 0x00, 0x00 };
public static readonly byte[] VersionNumberMax = { 0xFF, 0xFF, 0x00, 0x00 };
public static readonly object[][] VersionNumberTestData =
{
new object[] { VersionNumber_Min, VersionNumber_ValMin },
new object[] { VersionNumber_211, VersionNumber_Val211 },
new object[] { VersionNumber_430, VersionNumber_Val430 },
new object[] { VersionNumber_Max, VersionNumber_ValMax },
new object[] { VersionNumberMin, VersionNumberValMin },
new object[] { VersionNumber211, VersionNumberVal211 },
new object[] { VersionNumber430, VersionNumberVal430 },
new object[] { VersionNumberMax, VersionNumberValMax },
};
public static readonly Vector3 XyzNumber_ValMin = new Vector3(IccTestDataPrimitives.Fix16_ValMin, IccTestDataPrimitives.Fix16_ValMin, IccTestDataPrimitives.Fix16_ValMin);
public static readonly Vector3 XyzNumber_Val0 = new Vector3(0, 0, 0);
public static readonly Vector3 XyzNumber_Val1 = new Vector3(1, 1, 1);
public static readonly Vector3 XyzNumber_ValVar1 = new Vector3(1, 2, 3);
public static readonly Vector3 XyzNumber_ValVar2 = new Vector3(4, 5, 6);
public static readonly Vector3 XyzNumber_ValVar3 = new Vector3(7, 8, 9);
public static readonly Vector3 XyzNumber_ValMax = new Vector3(IccTestDataPrimitives.Fix16_ValMax, IccTestDataPrimitives.Fix16_ValMax, IccTestDataPrimitives.Fix16_ValMax);
public static readonly byte[] XyzNumber_Min = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_Min, IccTestDataPrimitives.Fix16_Min, IccTestDataPrimitives.Fix16_Min);
public static readonly byte[] XyzNumber_0 = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_0, IccTestDataPrimitives.Fix16_0, IccTestDataPrimitives.Fix16_0);
public static readonly byte[] XyzNumber_1 = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_1, IccTestDataPrimitives.Fix16_1, IccTestDataPrimitives.Fix16_1);
public static readonly byte[] XyzNumber_Var1 = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_1, IccTestDataPrimitives.Fix16_2, IccTestDataPrimitives.Fix16_3);
public static readonly byte[] XyzNumber_Var2 = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_4, IccTestDataPrimitives.Fix16_5, IccTestDataPrimitives.Fix16_6);
public static readonly byte[] XyzNumber_Var3 = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_7, IccTestDataPrimitives.Fix16_8, IccTestDataPrimitives.Fix16_9);
public static readonly byte[] XyzNumber_Max = ArrayHelper.Concat(IccTestDataPrimitives.Fix16_Max, IccTestDataPrimitives.Fix16_Max, IccTestDataPrimitives.Fix16_Max);
public static readonly Vector3 XyzNumberValMin = new(IccTestDataPrimitives.Fix16ValMin, IccTestDataPrimitives.Fix16ValMin, IccTestDataPrimitives.Fix16ValMin);
public static readonly Vector3 XyzNumberVal0 = new(0, 0, 0);
public static readonly Vector3 XyzNumberVal1 = new(1, 1, 1);
public static readonly Vector3 XyzNumberValVar1 = new(1, 2, 3);
public static readonly Vector3 XyzNumberValVar2 = new(4, 5, 6);
public static readonly Vector3 XyzNumberValVar3 = new(7, 8, 9);
public static readonly Vector3 XyzNumberValMax = new(IccTestDataPrimitives.Fix16ValMax, IccTestDataPrimitives.Fix16ValMax, IccTestDataPrimitives.Fix16ValMax);
public static readonly byte[] XyzNumberMin = ArrayHelper.Concat(IccTestDataPrimitives.Fix16Min, IccTestDataPrimitives.Fix16Min, IccTestDataPrimitives.Fix16Min);
public static readonly byte[] XyzNumber0 = ArrayHelper.Concat(IccTestDataPrimitives.Fix160, IccTestDataPrimitives.Fix160, IccTestDataPrimitives.Fix160);
public static readonly byte[] XyzNumber1 = ArrayHelper.Concat(IccTestDataPrimitives.Fix161, IccTestDataPrimitives.Fix161, IccTestDataPrimitives.Fix161);
public static readonly byte[] XyzNumberVar1 = ArrayHelper.Concat(IccTestDataPrimitives.Fix161, IccTestDataPrimitives.Fix162, IccTestDataPrimitives.Fix163);
public static readonly byte[] XyzNumberVar2 = ArrayHelper.Concat(IccTestDataPrimitives.Fix164, IccTestDataPrimitives.Fix165, IccTestDataPrimitives.Fix166);
public static readonly byte[] XyzNumberVar3 = ArrayHelper.Concat(IccTestDataPrimitives.Fix167, IccTestDataPrimitives.Fix168, IccTestDataPrimitives.Fix169);
public static readonly byte[] XyzNumberMax = ArrayHelper.Concat(IccTestDataPrimitives.Fix16Max, IccTestDataPrimitives.Fix16Max, IccTestDataPrimitives.Fix16Max);
public static readonly object[][] XyzNumberTestData =
{
new object[] { XyzNumber_Min, XyzNumber_ValMin },
new object[] { XyzNumber_0, XyzNumber_Val0 },
new object[] { XyzNumber_Var1, XyzNumber_ValVar1 },
new object[] { XyzNumber_Max, XyzNumber_ValMax },
new object[] { XyzNumberMin, XyzNumberValMin },
new object[] { XyzNumber0, XyzNumberVal0 },
new object[] { XyzNumberVar1, XyzNumberValVar1 },
new object[] { XyzNumberMax, XyzNumberValMax },
};
public static readonly IccProfileId ProfileId_ValMin = new IccProfileId(0, 0, 0, 0);
public static readonly IccProfileId ProfileId_ValRand = new IccProfileId(IccTestDataPrimitives.UInt32_ValRand1, IccTestDataPrimitives.UInt32_ValRand2, IccTestDataPrimitives.UInt32_ValRand3, IccTestDataPrimitives.UInt32_ValRand4);
public static readonly IccProfileId ProfileId_ValMax = new IccProfileId(uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue);
public static readonly IccProfileId ProfileIdValMin = new(0, 0, 0, 0);
public static readonly IccProfileId ProfileIdValRand = new(IccTestDataPrimitives.UInt32ValRand1, IccTestDataPrimitives.UInt32ValRand2, IccTestDataPrimitives.UInt32ValRand3, IccTestDataPrimitives.UInt32ValRand4);
public static readonly IccProfileId ProfileIdValMax = new(uint.MaxValue, uint.MaxValue, uint.MaxValue, uint.MaxValue);
public static readonly byte[] ProfileId_Min = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_0, IccTestDataPrimitives.UInt32_0, IccTestDataPrimitives.UInt32_0, IccTestDataPrimitives.UInt32_0);
public static readonly byte[] ProfileId_Rand = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_Rand1, IccTestDataPrimitives.UInt32_Rand2, IccTestDataPrimitives.UInt32_Rand3, IccTestDataPrimitives.UInt32_Rand4);
public static readonly byte[] ProfileId_Max = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_Max, IccTestDataPrimitives.UInt32_Max, IccTestDataPrimitives.UInt32_Max, IccTestDataPrimitives.UInt32_Max);
public static readonly byte[] ProfileIdMin = ArrayHelper.Concat(IccTestDataPrimitives.UInt320, IccTestDataPrimitives.UInt320, IccTestDataPrimitives.UInt320, IccTestDataPrimitives.UInt320);
public static readonly byte[] ProfileIdRand = ArrayHelper.Concat(IccTestDataPrimitives.UInt32Rand1, IccTestDataPrimitives.UInt32Rand2, IccTestDataPrimitives.UInt32Rand3, IccTestDataPrimitives.UInt32Rand4);
public static readonly byte[] ProfileIdMax = ArrayHelper.Concat(IccTestDataPrimitives.UInt32Max, IccTestDataPrimitives.UInt32Max, IccTestDataPrimitives.UInt32Max, IccTestDataPrimitives.UInt32Max);
public static readonly object[][] ProfileIdTestData =
{
new object[] { ProfileId_Min, ProfileId_ValMin },
new object[] { ProfileId_Rand, ProfileId_ValRand },
new object[] { ProfileId_Max, ProfileId_ValMax },
new object[] { ProfileIdMin, ProfileIdValMin },
new object[] { ProfileIdRand, ProfileIdValRand },
new object[] { ProfileIdMax, ProfileIdValMax },
};
public static readonly IccPositionNumber PositionNumber_ValMin = new IccPositionNumber(0, 0);
public static readonly IccPositionNumber PositionNumber_ValRand = new IccPositionNumber(IccTestDataPrimitives.UInt32_ValRand1, IccTestDataPrimitives.UInt32_ValRand2);
public static readonly IccPositionNumber PositionNumber_ValMax = new IccPositionNumber(uint.MaxValue, uint.MaxValue);
public static readonly IccPositionNumber PositionNumberValMin = new(0, 0);
public static readonly IccPositionNumber PositionNumberValRand = new(IccTestDataPrimitives.UInt32ValRand1, IccTestDataPrimitives.UInt32ValRand2);
public static readonly IccPositionNumber PositionNumberValMax = new(uint.MaxValue, uint.MaxValue);
public static readonly byte[] PositionNumber_Min = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_0, IccTestDataPrimitives.UInt32_0);
public static readonly byte[] PositionNumber_Rand = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_Rand1, IccTestDataPrimitives.UInt32_Rand2);
public static readonly byte[] PositionNumber_Max = ArrayHelper.Concat(IccTestDataPrimitives.UInt32_Max, IccTestDataPrimitives.UInt32_Max);
public static readonly byte[] PositionNumberMin = ArrayHelper.Concat(IccTestDataPrimitives.UInt320, IccTestDataPrimitives.UInt320);
public static readonly byte[] PositionNumberRand = ArrayHelper.Concat(IccTestDataPrimitives.UInt32Rand1, IccTestDataPrimitives.UInt32Rand2);
public static readonly byte[] PositionNumberMax = ArrayHelper.Concat(IccTestDataPrimitives.UInt32Max, IccTestDataPrimitives.UInt32Max);
public static readonly object[][] PositionNumberTestData =
{
new object[] { PositionNumber_Min, PositionNumber_ValMin },
new object[] { PositionNumber_Rand, PositionNumber_ValRand },
new object[] { PositionNumber_Max, PositionNumber_ValMax },
new object[] { PositionNumberMin, PositionNumberValMin },
new object[] { PositionNumberRand, PositionNumberValRand },
new object[] { PositionNumberMax, PositionNumberValMax },
};
public static readonly IccResponseNumber ResponseNumber_ValMin = new IccResponseNumber(0, IccTestDataPrimitives.Fix16_ValMin);
public static readonly IccResponseNumber ResponseNumber_Val1 = new IccResponseNumber(1, 1);
public static readonly IccResponseNumber ResponseNumber_Val2 = new IccResponseNumber(2, 2);
public static readonly IccResponseNumber ResponseNumber_Val3 = new IccResponseNumber(3, 3);
public static readonly IccResponseNumber ResponseNumber_Val4 = new IccResponseNumber(4, 4);
public static readonly IccResponseNumber ResponseNumber_Val5 = new IccResponseNumber(5, 5);
public static readonly IccResponseNumber ResponseNumber_Val6 = new IccResponseNumber(6, 6);
public static readonly IccResponseNumber ResponseNumber_Val7 = new IccResponseNumber(7, 7);
public static readonly IccResponseNumber ResponseNumber_Val8 = new IccResponseNumber(8, 8);
public static readonly IccResponseNumber ResponseNumber_Val9 = new IccResponseNumber(9, 9);
public static readonly IccResponseNumber ResponseNumber_ValMax = new IccResponseNumber(ushort.MaxValue, IccTestDataPrimitives.Fix16_ValMax);
public static readonly byte[] ResponseNumber_Min = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_0, IccTestDataPrimitives.Fix16_Min);
public static readonly byte[] ResponseNumber_1 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_1, IccTestDataPrimitives.Fix16_1);
public static readonly byte[] ResponseNumber_2 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_2, IccTestDataPrimitives.Fix16_2);
public static readonly byte[] ResponseNumber_3 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_3, IccTestDataPrimitives.Fix16_3);
public static readonly byte[] ResponseNumber_4 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_4, IccTestDataPrimitives.Fix16_4);
public static readonly byte[] ResponseNumber_5 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_5, IccTestDataPrimitives.Fix16_5);
public static readonly byte[] ResponseNumber_6 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_6, IccTestDataPrimitives.Fix16_6);
public static readonly byte[] ResponseNumber_7 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_7, IccTestDataPrimitives.Fix16_7);
public static readonly byte[] ResponseNumber_8 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_8, IccTestDataPrimitives.Fix16_8);
public static readonly byte[] ResponseNumber_9 = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_9, IccTestDataPrimitives.Fix16_9);
public static readonly byte[] ResponseNumber_Max = ArrayHelper.Concat(IccTestDataPrimitives.UInt16_Max, IccTestDataPrimitives.Fix16_Max);
public static readonly IccResponseNumber ResponseNumberValMin = new(0, IccTestDataPrimitives.Fix16ValMin);
public static readonly IccResponseNumber ResponseNumberVal1 = new(1, 1);
public static readonly IccResponseNumber ResponseNumberVal2 = new(2, 2);
public static readonly IccResponseNumber ResponseNumberVal3 = new(3, 3);
public static readonly IccResponseNumber ResponseNumberVal4 = new(4, 4);
public static readonly IccResponseNumber ResponseNumberVal5 = new(5, 5);
public static readonly IccResponseNumber ResponseNumberVal6 = new(6, 6);
public static readonly IccResponseNumber ResponseNumberVal7 = new(7, 7);
public static readonly IccResponseNumber ResponseNumberVal8 = new(8, 8);
public static readonly IccResponseNumber ResponseNumberVal9 = new(9, 9);
public static readonly IccResponseNumber ResponseNumberValMax = new(ushort.MaxValue, IccTestDataPrimitives.Fix16ValMax);
public static readonly byte[] ResponseNumberMin = ArrayHelper.Concat(IccTestDataPrimitives.UInt160, IccTestDataPrimitives.Fix16Min);
public static readonly byte[] ResponseNumber1 = ArrayHelper.Concat(IccTestDataPrimitives.UInt161, IccTestDataPrimitives.Fix161);
public static readonly byte[] ResponseNumber2 = ArrayHelper.Concat(IccTestDataPrimitives.UInt162, IccTestDataPrimitives.Fix162);
public static readonly byte[] ResponseNumber3 = ArrayHelper.Concat(IccTestDataPrimitives.UInt163, IccTestDataPrimitives.Fix163);
public static readonly byte[] ResponseNumber4 = ArrayHelper.Concat(IccTestDataPrimitives.UInt164, IccTestDataPrimitives.Fix164);
public static readonly byte[] ResponseNumber5 = ArrayHelper.Concat(IccTestDataPrimitives.UInt165, IccTestDataPrimitives.Fix165);
public static readonly byte[] ResponseNumber6 = ArrayHelper.Concat(IccTestDataPrimitives.UInt166, IccTestDataPrimitives.Fix166);
public static readonly byte[] ResponseNumber7 = ArrayHelper.Concat(IccTestDataPrimitives.UInt167, IccTestDataPrimitives.Fix167);
public static readonly byte[] ResponseNumber8 = ArrayHelper.Concat(IccTestDataPrimitives.UInt168, IccTestDataPrimitives.Fix168);
public static readonly byte[] ResponseNumber9 = ArrayHelper.Concat(IccTestDataPrimitives.UInt169, IccTestDataPrimitives.Fix169);
public static readonly byte[] ResponseNumberMax = ArrayHelper.Concat(IccTestDataPrimitives.UInt16Max, IccTestDataPrimitives.Fix16Max);
public static readonly object[][] ResponseNumberTestData =
{
new object[] { ResponseNumber_Min, ResponseNumber_ValMin },
new object[] { ResponseNumber_1, ResponseNumber_Val1 },
new object[] { ResponseNumber_4, ResponseNumber_Val4 },
new object[] { ResponseNumber_Max, ResponseNumber_ValMax },
new object[] { ResponseNumberMin, ResponseNumberValMin },
new object[] { ResponseNumber1, ResponseNumberVal1 },
new object[] { ResponseNumber4, ResponseNumberVal4 },
new object[] { ResponseNumberMax, ResponseNumberValMax },
};
public static readonly IccNamedColor NamedColor_ValMin = new IccNamedColor(
public static readonly IccNamedColor NamedColorValMin = new(
ArrayHelper.Fill('A', 31),
new ushort[] { 0, 0, 0 },
new ushort[] { 0, 0, 0 });
public static readonly IccNamedColor NamedColor_ValRand = new IccNamedColor(
public static readonly IccNamedColor NamedColorValRand = new(
ArrayHelper.Fill('5', 31),
new ushort[] { 10794, 10794, 10794 },
new ushort[] { 17219, 17219, 17219, 17219, 17219 });
public static readonly IccNamedColor NamedColor_ValMax = new IccNamedColor(
public static readonly IccNamedColor NamedColorValMax = new(
ArrayHelper.Fill('4', 31),
new ushort[] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue },
new ushort[] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue });
new[] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue },
new[] { ushort.MaxValue, ushort.MaxValue, ushort.MaxValue, ushort.MaxValue });
public static readonly byte[] NamedColor_Min = CreateNamedColor(3, 0x41, 0x00, 0x00);
public static readonly byte[] NamedColor_Rand = CreateNamedColor(5, 0x35, 42, 67);
public static readonly byte[] NamedColor_Max = CreateNamedColor(4, 0x34, 0xFF, 0xFF);
public static readonly byte[] NamedColorMin = CreateNamedColor(3, 0x41, 0x00, 0x00);
public static readonly byte[] NamedColorRand = CreateNamedColor(5, 0x35, 42, 67);
public static readonly byte[] NamedColorMax = CreateNamedColor(4, 0x34, 0xFF, 0xFF);
private static byte[] CreateNamedColor(int devCoordCount, byte name, byte pCS, byte device)
private static byte[] CreateNamedColor(int devCoordCount, byte name, byte pCs, byte device)
{
byte[] data = new byte[32 + 6 + (devCoordCount * 2)];
for (int i = 0; i < data.Length; i++)
@ -198,7 +198,7 @@ internal static class IccTestDataNonPrimitives
}
else if (i < 32 + 6)
{
data[i] = pCS; // PCS Coordinates
data[i] = pCs; // PCS Coordinates
}
else
{
@ -211,145 +211,144 @@ internal static class IccTestDataNonPrimitives
public static readonly object[][] NamedColorTestData =
{
new object[] { NamedColor_Min, NamedColor_ValMin, 3u },
new object[] { NamedColor_Rand, NamedColor_ValRand, 5u },
new object[] { NamedColor_Max, NamedColor_ValMax, 4u },
new object[] { NamedColorMin, NamedColorValMin, 3u },
new object[] { NamedColorRand, NamedColorValRand, 5u },
new object[] { NamedColorMax, NamedColorValMax, 4u },
};
private static readonly CultureInfo CultureEnUs = new CultureInfo("en-US");
private static readonly CultureInfo CultureDeAT = new CultureInfo("de-AT");
private static readonly CultureInfo CultureEnUs = new("en-US");
private static readonly CultureInfo CultureDeAt = new("de-AT");
private static readonly IccLocalizedString LocalizedString_Rand1 = new IccLocalizedString(CultureEnUs, IccTestDataPrimitives.Unicode_ValRand2);
private static readonly IccLocalizedString LocalizedString_Rand2 = new IccLocalizedString(CultureDeAT, IccTestDataPrimitives.Unicode_ValRand3);
private static readonly IccLocalizedString LocalizedStringRand1 = new(CultureEnUs, IccTestDataPrimitives.UnicodeValRand2);
private static readonly IccLocalizedString LocalizedStringRand2 = new(CultureDeAt, IccTestDataPrimitives.UnicodeValRand3);
private static readonly IccLocalizedString[] LocalizedString_RandArr1 = new IccLocalizedString[]
{
LocalizedString_Rand1,
LocalizedString_Rand2,
private static readonly IccLocalizedString[] LocalizedStringRandArr1 = {
LocalizedStringRand1,
LocalizedStringRand2,
};
private static readonly IccMultiLocalizedUnicodeTagDataEntry MultiLocalizedUnicode_Val = new IccMultiLocalizedUnicodeTagDataEntry(LocalizedString_RandArr1);
private static readonly byte[] MultiLocalizedUnicode_Arr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_2,
private static readonly IccMultiLocalizedUnicodeTagDataEntry MultiLocalizedUnicodeVal = new(LocalizedStringRandArr1);
private static readonly byte[] MultiLocalizedUnicodeArr = ArrayHelper.Concat(
IccTestDataPrimitives.UInt322,
new byte[] { 0x00, 0x00, 0x00, 0x0C }, // 12
new byte[] { (byte)'e', (byte)'n', (byte)'U', (byte)'S' },
new[] { (byte)'e', (byte)'n', (byte)'U', (byte)'S' },
new byte[] { 0x00, 0x00, 0x00, 0x0C }, // 12
new byte[] { 0x00, 0x00, 0x00, 0x28 }, // 40
new byte[] { (byte)'d', (byte)'e', (byte)'A', (byte)'T' },
new[] { (byte)'d', (byte)'e', (byte)'A', (byte)'T' },
new byte[] { 0x00, 0x00, 0x00, 0x0E }, // 14
new byte[] { 0x00, 0x00, 0x00, 0x34 }, // 52
IccTestDataPrimitives.Unicode_Rand2,
IccTestDataPrimitives.Unicode_Rand3);
IccTestDataPrimitives.UnicodeRand2,
IccTestDataPrimitives.UnicodeRand3);
public static readonly IccTextDescriptionTagDataEntry TextDescription_Val1 = new IccTextDescriptionTagDataEntry(
IccTestDataPrimitives.Ascii_ValRand,
IccTestDataPrimitives.Unicode_ValRand1,
public static readonly IccTextDescriptionTagDataEntry TextDescriptionVal1 = new(
IccTestDataPrimitives.AsciiValRand,
IccTestDataPrimitives.UnicodeValRand1,
ArrayHelper.Fill('A', 66),
1701729619,
2);
public static readonly byte[] TextDescription_Arr1 = ArrayHelper.Concat(
public static readonly byte[] TextDescriptionArr1 = ArrayHelper.Concat(
new byte[] { 0x00, 0x00, 0x00, 0x0B }, // 11
IccTestDataPrimitives.Ascii_Rand,
IccTestDataPrimitives.AsciiRand,
new byte[] { 0x00 }, // Null terminator
new byte[] { (byte)'e', (byte)'n', (byte)'U', (byte)'S' },
new[] { (byte)'e', (byte)'n', (byte)'U', (byte)'S' },
new byte[] { 0x00, 0x00, 0x00, 0x07 }, // 7
IccTestDataPrimitives.Unicode_Rand2,
IccTestDataPrimitives.UnicodeRand2,
new byte[] { 0x00, 0x00 }, // Null terminator
new byte[] { 0x00, 0x02, 0x43 }, // 2, 67
ArrayHelper.Fill((byte)0x41, 66),
new byte[] { 0x00 }); // Null terminator
public static readonly IccProfileDescription ProfileDescription_ValRand1 = new IccProfileDescription(
public static readonly IccProfileDescription ProfileDescriptionValRand1 = new(
1,
2,
IccDeviceAttribute.ChromaBlackWhite | IccDeviceAttribute.ReflectivityMatte,
IccProfileTag.ProfileDescription,
MultiLocalizedUnicode_Val.Texts,
MultiLocalizedUnicode_Val.Texts);
MultiLocalizedUnicodeVal.Texts,
MultiLocalizedUnicodeVal.Texts);
public static readonly IccProfileDescription ProfileDescription_ValRand2 = new IccProfileDescription(
public static readonly IccProfileDescription ProfileDescriptionValRand2 = new(
1,
2,
IccDeviceAttribute.ChromaBlackWhite | IccDeviceAttribute.ReflectivityMatte,
IccProfileTag.ProfileDescription,
new IccLocalizedString[] { LocalizedString_Rand1 },
new IccLocalizedString[] { LocalizedString_Rand1 });
new[] { LocalizedStringRand1 },
new[] { LocalizedStringRand1 });
public static readonly byte[] ProfileDescription_Rand1 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_1,
IccTestDataPrimitives.UInt32_2,
public static readonly byte[] ProfileDescriptionRand1 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt321,
IccTestDataPrimitives.UInt322,
new byte[] { 0, 0, 0, 0, 0, 0, 0, 10 },
new byte[] { 0x64, 0x65, 0x73, 0x63 },
new byte[] { 0x6D, 0x6C, 0x75, 0x63 },
new byte[] { 0x00, 0x00, 0x00, 0x00 },
MultiLocalizedUnicode_Arr,
MultiLocalizedUnicodeArr,
new byte[] { 0x6D, 0x6C, 0x75, 0x63 },
new byte[] { 0x00, 0x00, 0x00, 0x00 },
MultiLocalizedUnicode_Arr);
MultiLocalizedUnicodeArr);
public static readonly byte[] ProfileDescription_Rand2 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt32_1,
IccTestDataPrimitives.UInt32_2,
public static readonly byte[] ProfileDescriptionRand2 = ArrayHelper.Concat(
IccTestDataPrimitives.UInt321,
IccTestDataPrimitives.UInt322,
new byte[] { 0, 0, 0, 0, 0, 0, 0, 10 },
new byte[] { 0x64, 0x65, 0x73, 0x63 },
new byte[] { 0x64, 0x65, 0x73, 0x63 },
new byte[] { 0x00, 0x00, 0x00, 0x00 },
TextDescription_Arr1,
TextDescriptionArr1,
new byte[] { 0x64, 0x65, 0x73, 0x63 },
new byte[] { 0x00, 0x00, 0x00, 0x00 },
TextDescription_Arr1);
TextDescriptionArr1);
public static readonly object[][] ProfileDescriptionReadTestData =
{
new object[] { ProfileDescription_Rand1, ProfileDescription_ValRand1 },
new object[] { ProfileDescription_Rand2, ProfileDescription_ValRand2 },
new object[] { ProfileDescriptionRand1, ProfileDescriptionValRand1 },
new object[] { ProfileDescriptionRand2, ProfileDescriptionValRand2 },
};
public static readonly object[][] ProfileDescriptionWriteTestData =
{
new object[] { ProfileDescription_Rand1, ProfileDescription_ValRand1 },
new object[] { ProfileDescriptionRand1, ProfileDescriptionValRand1 },
};
public static readonly IccColorantTableEntry ColorantTableEntry_ValRand1 = new IccColorantTableEntry(ArrayHelper.Fill('A', 31), 1, 2, 3);
public static readonly IccColorantTableEntry ColorantTableEntry_ValRand2 = new IccColorantTableEntry(ArrayHelper.Fill('4', 31), 4, 5, 6);
public static readonly IccColorantTableEntry ColorantTableEntryValRand1 = new(ArrayHelper.Fill('A', 31), 1, 2, 3);
public static readonly IccColorantTableEntry ColorantTableEntryValRand2 = new(ArrayHelper.Fill('4', 31), 4, 5, 6);
public static readonly byte[] ColorantTableEntry_Rand1 = ArrayHelper.Concat(
public static readonly byte[] ColorantTableEntryRand1 = ArrayHelper.Concat(
ArrayHelper.Fill((byte)0x41, 31),
new byte[1], // null terminator
IccTestDataPrimitives.UInt16_1,
IccTestDataPrimitives.UInt16_2,
IccTestDataPrimitives.UInt16_3);
IccTestDataPrimitives.UInt161,
IccTestDataPrimitives.UInt162,
IccTestDataPrimitives.UInt163);
public static readonly byte[] ColorantTableEntry_Rand2 = ArrayHelper.Concat(
public static readonly byte[] ColorantTableEntryRand2 = ArrayHelper.Concat(
ArrayHelper.Fill((byte)0x34, 31),
new byte[1], // null terminator
IccTestDataPrimitives.UInt16_4,
IccTestDataPrimitives.UInt16_5,
IccTestDataPrimitives.UInt16_6);
IccTestDataPrimitives.UInt164,
IccTestDataPrimitives.UInt165,
IccTestDataPrimitives.UInt166);
public static readonly object[][] ColorantTableEntryTestData =
{
new object[] { ColorantTableEntry_Rand1, ColorantTableEntry_ValRand1 },
new object[] { ColorantTableEntry_Rand2, ColorantTableEntry_ValRand2 },
new object[] { ColorantTableEntryRand1, ColorantTableEntryValRand1 },
new object[] { ColorantTableEntryRand2, ColorantTableEntryValRand2 },
};
public static readonly IccScreeningChannel ScreeningChannel_ValRand1 = new IccScreeningChannel(4, 6, IccScreeningSpotType.Cross);
public static readonly IccScreeningChannel ScreeningChannel_ValRand2 = new IccScreeningChannel(8, 5, IccScreeningSpotType.Diamond);
public static readonly IccScreeningChannel ScreeningChannelValRand1 = new(4, 6, IccScreeningSpotType.Cross);
public static readonly IccScreeningChannel ScreeningChannelValRand2 = new(8, 5, IccScreeningSpotType.Diamond);
public static readonly byte[] ScreeningChannel_Rand1 = ArrayHelper.Concat(
IccTestDataPrimitives.Fix16_4,
IccTestDataPrimitives.Fix16_6,
IccTestDataPrimitives.Int32_7);
public static readonly byte[] ScreeningChannelRand1 = ArrayHelper.Concat(
IccTestDataPrimitives.Fix164,
IccTestDataPrimitives.Fix166,
IccTestDataPrimitives.Int327);
public static readonly byte[] ScreeningChannel_Rand2 = ArrayHelper.Concat(
IccTestDataPrimitives.Fix16_8,
IccTestDataPrimitives.Fix16_5,
IccTestDataPrimitives.Int32_3);
public static readonly byte[] ScreeningChannelRand2 = ArrayHelper.Concat(
IccTestDataPrimitives.Fix168,
IccTestDataPrimitives.Fix165,
IccTestDataPrimitives.Int323);
public static readonly object[][] ScreeningChannelTestData =
{
new object[] { ScreeningChannel_Rand1, ScreeningChannel_ValRand1 },
new object[] { ScreeningChannel_Rand2, ScreeningChannel_ValRand2 },
new object[] { ScreeningChannelRand1, ScreeningChannelValRand1 },
new object[] { ScreeningChannelRand2, ScreeningChannelValRand2 },
};
}

398
tests/ImageSharp.Tests/TestDataIcc/IccTestDataPrimitives.cs

@ -5,238 +5,238 @@ namespace SixLabors.ImageSharp.Tests;
internal static class IccTestDataPrimitives
{
public static readonly byte[] UInt16_0 = { 0x00, 0x00 };
public static readonly byte[] UInt16_1 = { 0x00, 0x01 };
public static readonly byte[] UInt16_2 = { 0x00, 0x02 };
public static readonly byte[] UInt16_3 = { 0x00, 0x03 };
public static readonly byte[] UInt16_4 = { 0x00, 0x04 };
public static readonly byte[] UInt16_5 = { 0x00, 0x05 };
public static readonly byte[] UInt16_6 = { 0x00, 0x06 };
public static readonly byte[] UInt16_7 = { 0x00, 0x07 };
public static readonly byte[] UInt16_8 = { 0x00, 0x08 };
public static readonly byte[] UInt16_9 = { 0x00, 0x09 };
public static readonly byte[] UInt16_32768 = { 0x80, 0x00 };
public static readonly byte[] UInt16_Max = { 0xFF, 0xFF };
public static readonly byte[] Int16_Min = { 0x80, 0x00 };
public static readonly byte[] Int16_0 = { 0x00, 0x00 };
public static readonly byte[] Int16_1 = { 0x00, 0x01 };
public static readonly byte[] Int16_2 = { 0x00, 0x02 };
public static readonly byte[] Int16_3 = { 0x00, 0x03 };
public static readonly byte[] Int16_4 = { 0x00, 0x04 };
public static readonly byte[] Int16_5 = { 0x00, 0x05 };
public static readonly byte[] Int16_6 = { 0x00, 0x06 };
public static readonly byte[] Int16_7 = { 0x00, 0x07 };
public static readonly byte[] Int16_8 = { 0x00, 0x08 };
public static readonly byte[] Int16_9 = { 0x00, 0x09 };
public static readonly byte[] Int16_Max = { 0x7F, 0xFF };
public static readonly byte[] UInt32_0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UInt32_1 = { 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] UInt32_2 = { 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] UInt32_3 = { 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] UInt32_4 = { 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] UInt32_5 = { 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] UInt32_6 = { 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] UInt32_7 = { 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] UInt32_8 = { 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] UInt32_9 = { 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] UInt32_Max = { 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly uint UInt32_ValRand1 = 1749014123;
public static readonly uint UInt32_ValRand2 = 3870560989;
public static readonly uint UInt32_ValRand3 = 1050090334;
public static readonly uint UInt32_ValRand4 = 3550252874;
public static readonly byte[] UInt32_Rand1 = { 0x68, 0x3F, 0xD6, 0x6B };
public static readonly byte[] UInt32_Rand2 = { 0xE6, 0xB4, 0x12, 0xDD };
public static readonly byte[] UInt32_Rand3 = { 0x3E, 0x97, 0x1B, 0x5E };
public static readonly byte[] UInt32_Rand4 = { 0xD3, 0x9C, 0x8F, 0x4A };
public static readonly byte[] Int32_Min = { 0x80, 0x00, 0x00, 0x00 };
public static readonly byte[] Int32_0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int32_1 = { 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] Int32_2 = { 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] Int32_3 = { 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] Int32_4 = { 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] Int32_5 = { 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] Int32_6 = { 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] Int32_7 = { 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] Int32_8 = { 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] Int32_9 = { 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] Int32_Max = { 0x7F, 0xFF, 0xFF, 0xFF };
public static readonly byte[] UInt64_0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UInt64_1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] UInt64_2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] UInt64_3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] UInt64_4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] UInt64_5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] UInt64_6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] UInt64_7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] UInt64_8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] UInt64_9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] UInt64_Max = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] Int64_Min = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int64_0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int64_1 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] Int64_2 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] Int64_3 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] Int64_4 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] Int64_5 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] Int64_6 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] Int64_7 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] Int64_8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] Int64_9 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] Int64_Max = { 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] Single_Min = { 0xFF, 0x7F, 0xFF, 0xFF };
public static readonly byte[] Single_0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Single_1 = { 0x3F, 0x80, 0x00, 0x00 };
public static readonly byte[] Single_2 = { 0x40, 0x00, 0x00, 0x00 };
public static readonly byte[] Single_3 = { 0x40, 0x40, 0x00, 0x00 };
public static readonly byte[] Single_4 = { 0x40, 0x80, 0x00, 0x00 };
public static readonly byte[] Single_5 = { 0x40, 0xA0, 0x00, 0x00 };
public static readonly byte[] Single_6 = { 0x40, 0xC0, 0x00, 0x00 };
public static readonly byte[] Single_7 = { 0x40, 0xE0, 0x00, 0x00 };
public static readonly byte[] Single_8 = { 0x41, 0x00, 0x00, 0x00 };
public static readonly byte[] Single_9 = { 0x41, 0x10, 0x00, 0x00 };
public static readonly byte[] Single_Max = { 0x7F, 0x7F, 0xFF, 0xFF };
public static readonly byte[] Double_Min = { 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] Double_0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Double_1 = { 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Double_Max = { 0x7F, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public const float Fix16_ValMin = short.MinValue;
public const float Fix16_ValMax = short.MaxValue + (65535f / 65536f);
public static readonly byte[] Fix16_Min = { 0x80, 0x00, 0x00, 0x00 };
public static readonly byte[] Fix16_0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Fix16_1 = { 0x00, 0x01, 0x00, 0x00 };
public static readonly byte[] Fix16_2 = { 0x00, 0x02, 0x00, 0x00 };
public static readonly byte[] Fix16_3 = { 0x00, 0x03, 0x00, 0x00 };
public static readonly byte[] Fix16_4 = { 0x00, 0x04, 0x00, 0x00 };
public static readonly byte[] Fix16_5 = { 0x00, 0x05, 0x00, 0x00 };
public static readonly byte[] Fix16_6 = { 0x00, 0x06, 0x00, 0x00 };
public static readonly byte[] Fix16_7 = { 0x00, 0x07, 0x00, 0x00 };
public static readonly byte[] Fix16_8 = { 0x00, 0x08, 0x00, 0x00 };
public static readonly byte[] Fix16_9 = { 0x00, 0x09, 0x00, 0x00 };
public static readonly byte[] Fix16_Max = { 0x7F, 0xFF, 0xFF, 0xFF };
public static readonly byte[] UInt160 = { 0x00, 0x00 };
public static readonly byte[] UInt161 = { 0x00, 0x01 };
public static readonly byte[] UInt162 = { 0x00, 0x02 };
public static readonly byte[] UInt163 = { 0x00, 0x03 };
public static readonly byte[] UInt164 = { 0x00, 0x04 };
public static readonly byte[] UInt165 = { 0x00, 0x05 };
public static readonly byte[] UInt166 = { 0x00, 0x06 };
public static readonly byte[] UInt167 = { 0x00, 0x07 };
public static readonly byte[] UInt168 = { 0x00, 0x08 };
public static readonly byte[] UInt169 = { 0x00, 0x09 };
public static readonly byte[] UInt1632768 = { 0x80, 0x00 };
public static readonly byte[] UInt16Max = { 0xFF, 0xFF };
public static readonly byte[] Int16Min = { 0x80, 0x00 };
public static readonly byte[] Int160 = { 0x00, 0x00 };
public static readonly byte[] Int161 = { 0x00, 0x01 };
public static readonly byte[] Int162 = { 0x00, 0x02 };
public static readonly byte[] Int163 = { 0x00, 0x03 };
public static readonly byte[] Int164 = { 0x00, 0x04 };
public static readonly byte[] Int165 = { 0x00, 0x05 };
public static readonly byte[] Int166 = { 0x00, 0x06 };
public static readonly byte[] Int167 = { 0x00, 0x07 };
public static readonly byte[] Int168 = { 0x00, 0x08 };
public static readonly byte[] Int169 = { 0x00, 0x09 };
public static readonly byte[] Int16Max = { 0x7F, 0xFF };
public static readonly byte[] UInt320 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UInt321 = { 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] UInt322 = { 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] UInt323 = { 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] UInt324 = { 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] UInt325 = { 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] UInt326 = { 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] UInt327 = { 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] UInt328 = { 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] UInt329 = { 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] UInt32Max = { 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly uint UInt32ValRand1 = 1749014123;
public static readonly uint UInt32ValRand2 = 3870560989;
public static readonly uint UInt32ValRand3 = 1050090334;
public static readonly uint UInt32ValRand4 = 3550252874;
public static readonly byte[] UInt32Rand1 = { 0x68, 0x3F, 0xD6, 0x6B };
public static readonly byte[] UInt32Rand2 = { 0xE6, 0xB4, 0x12, 0xDD };
public static readonly byte[] UInt32Rand3 = { 0x3E, 0x97, 0x1B, 0x5E };
public static readonly byte[] UInt32Rand4 = { 0xD3, 0x9C, 0x8F, 0x4A };
public static readonly byte[] Int32Min = { 0x80, 0x00, 0x00, 0x00 };
public static readonly byte[] Int320 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int321 = { 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] Int322 = { 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] Int323 = { 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] Int324 = { 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] Int325 = { 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] Int326 = { 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] Int327 = { 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] Int328 = { 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] Int329 = { 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] Int32Max = { 0x7F, 0xFF, 0xFF, 0xFF };
public static readonly byte[] UInt640 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UInt641 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] UInt642 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] UInt643 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] UInt644 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] UInt645 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] UInt646 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] UInt647 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] UInt648 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] UInt649 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] UInt64Max = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] Int64Min = { 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int640 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Int641 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 };
public static readonly byte[] Int642 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 };
public static readonly byte[] Int643 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
public static readonly byte[] Int644 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04 };
public static readonly byte[] Int645 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05 };
public static readonly byte[] Int646 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06 };
public static readonly byte[] Int647 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07 };
public static readonly byte[] Int648 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08 };
public static readonly byte[] Int649 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09 };
public static readonly byte[] Int64Max = { 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] SingleMin = { 0xFF, 0x7F, 0xFF, 0xFF };
public static readonly byte[] Single0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Single1 = { 0x3F, 0x80, 0x00, 0x00 };
public static readonly byte[] Single2 = { 0x40, 0x00, 0x00, 0x00 };
public static readonly byte[] Single3 = { 0x40, 0x40, 0x00, 0x00 };
public static readonly byte[] Single4 = { 0x40, 0x80, 0x00, 0x00 };
public static readonly byte[] Single5 = { 0x40, 0xA0, 0x00, 0x00 };
public static readonly byte[] Single6 = { 0x40, 0xC0, 0x00, 0x00 };
public static readonly byte[] Single7 = { 0x40, 0xE0, 0x00, 0x00 };
public static readonly byte[] Single8 = { 0x41, 0x00, 0x00, 0x00 };
public static readonly byte[] Single9 = { 0x41, 0x10, 0x00, 0x00 };
public static readonly byte[] SingleMax = { 0x7F, 0x7F, 0xFF, 0xFF };
public static readonly byte[] DoubleMin = { 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly byte[] Double0 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Double1 = { 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] DoubleMax = { 0x7F, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
public const float Fix16ValMin = short.MinValue;
public const float Fix16ValMax = short.MaxValue + (65535f / 65536f);
public static readonly byte[] Fix16Min = { 0x80, 0x00, 0x00, 0x00 };
public static readonly byte[] Fix160 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] Fix161 = { 0x00, 0x01, 0x00, 0x00 };
public static readonly byte[] Fix162 = { 0x00, 0x02, 0x00, 0x00 };
public static readonly byte[] Fix163 = { 0x00, 0x03, 0x00, 0x00 };
public static readonly byte[] Fix164 = { 0x00, 0x04, 0x00, 0x00 };
public static readonly byte[] Fix165 = { 0x00, 0x05, 0x00, 0x00 };
public static readonly byte[] Fix166 = { 0x00, 0x06, 0x00, 0x00 };
public static readonly byte[] Fix167 = { 0x00, 0x07, 0x00, 0x00 };
public static readonly byte[] Fix168 = { 0x00, 0x08, 0x00, 0x00 };
public static readonly byte[] Fix169 = { 0x00, 0x09, 0x00, 0x00 };
public static readonly byte[] Fix16Max = { 0x7F, 0xFF, 0xFF, 0xFF };
public static readonly object[][] Fix16TestData =
{
new object[] { Fix16_Min, Fix16_ValMin },
new object[] { Fix16_0, 0 },
new object[] { Fix16_4, 4 },
new object[] { Fix16_Max, Fix16_ValMax },
new object[] { Fix16Min, Fix16ValMin },
new object[] { Fix160, 0 },
new object[] { Fix164, 4 },
new object[] { Fix16Max, Fix16ValMax },
};
public const float UFix16_ValMin = 0;
public const float UFix16_ValMax = ushort.MaxValue + (65535f / 65536f);
public static readonly byte[] UFix16_0 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UFix16_1 = { 0x00, 0x01, 0x00, 0x00 };
public static readonly byte[] UFix16_2 = { 0x00, 0x02, 0x00, 0x00 };
public static readonly byte[] UFix16_3 = { 0x00, 0x03, 0x00, 0x00 };
public static readonly byte[] UFix16_4 = { 0x00, 0x04, 0x00, 0x00 };
public static readonly byte[] UFix16_5 = { 0x00, 0x05, 0x00, 0x00 };
public static readonly byte[] UFix16_6 = { 0x00, 0x06, 0x00, 0x00 };
public static readonly byte[] UFix16_7 = { 0x00, 0x07, 0x00, 0x00 };
public static readonly byte[] UFix16_8 = { 0x00, 0x08, 0x00, 0x00 };
public static readonly byte[] UFix16_9 = { 0x00, 0x09, 0x00, 0x00 };
public static readonly byte[] UFix16_Max = { 0xFF, 0xFF, 0xFF, 0xFF };
public const float UFix16ValMin = 0;
public const float UFix16ValMax = ushort.MaxValue + (65535f / 65536f);
public static readonly byte[] UFix160 = { 0x00, 0x00, 0x00, 0x00 };
public static readonly byte[] UFix161 = { 0x00, 0x01, 0x00, 0x00 };
public static readonly byte[] UFix162 = { 0x00, 0x02, 0x00, 0x00 };
public static readonly byte[] UFix163 = { 0x00, 0x03, 0x00, 0x00 };
public static readonly byte[] UFix164 = { 0x00, 0x04, 0x00, 0x00 };
public static readonly byte[] UFix165 = { 0x00, 0x05, 0x00, 0x00 };
public static readonly byte[] UFix166 = { 0x00, 0x06, 0x00, 0x00 };
public static readonly byte[] UFix167 = { 0x00, 0x07, 0x00, 0x00 };
public static readonly byte[] UFix168 = { 0x00, 0x08, 0x00, 0x00 };
public static readonly byte[] UFix169 = { 0x00, 0x09, 0x00, 0x00 };
public static readonly byte[] UFix16Max = { 0xFF, 0xFF, 0xFF, 0xFF };
public static readonly object[][] UFix16TestData =
{
new object[] { UFix16_0, 0 },
new object[] { UFix16_4, 4 },
new object[] { UFix16_Max, UFix16_ValMax },
new object[] { UFix160, 0 },
new object[] { UFix164, 4 },
new object[] { UFix16Max, UFix16ValMax },
};
public const float U1Fix15_ValMin = 0;
public const float U1Fix15_ValMax = 1f + (32767f / 32768f);
public const float U1Fix15ValMin = 0;
public const float U1Fix15ValMax = 1f + (32767f / 32768f);
public static readonly byte[] U1Fix15_0 = { 0x00, 0x00 };
public static readonly byte[] U1Fix15_1 = { 0x80, 0x00 };
public static readonly byte[] U1Fix15_Max = { 0xFF, 0xFF };
public static readonly byte[] U1Fix150 = { 0x00, 0x00 };
public static readonly byte[] U1Fix151 = { 0x80, 0x00 };
public static readonly byte[] U1Fix15Max = { 0xFF, 0xFF };
public static readonly object[][] U1Fix15TestData =
{
new object[] { U1Fix15_0, 0 },
new object[] { U1Fix15_1, 1 },
new object[] { U1Fix15_Max, U1Fix15_ValMax },
new object[] { U1Fix150, 0 },
new object[] { U1Fix151, 1 },
new object[] { U1Fix15Max, U1Fix15ValMax },
};
public const float UFix8_ValMin = 0;
public const float UFix8_ValMax = byte.MaxValue + (255f / 256f);
public static readonly byte[] UFix8_0 = { 0x00, 0x00 };
public static readonly byte[] UFix8_1 = { 0x01, 0x00 };
public static readonly byte[] UFix8_2 = { 0x02, 0x00 };
public static readonly byte[] UFix8_3 = { 0x03, 0x00 };
public static readonly byte[] UFix8_4 = { 0x04, 0x00 };
public static readonly byte[] UFix8_5 = { 0x05, 0x00 };
public static readonly byte[] UFix8_6 = { 0x06, 0x00 };
public static readonly byte[] UFix8_7 = { 0x07, 0x00 };
public static readonly byte[] UFix8_8 = { 0x08, 0x00 };
public static readonly byte[] UFix8_9 = { 0x09, 0x00 };
public static readonly byte[] UFix8_Max = { 0xFF, 0xFF };
public const float UFix8ValMin = 0;
public const float UFix8ValMax = byte.MaxValue + (255f / 256f);
public static readonly byte[] UFix80 = { 0x00, 0x00 };
public static readonly byte[] UFix81 = { 0x01, 0x00 };
public static readonly byte[] UFix82 = { 0x02, 0x00 };
public static readonly byte[] UFix83 = { 0x03, 0x00 };
public static readonly byte[] UFix84 = { 0x04, 0x00 };
public static readonly byte[] UFix85 = { 0x05, 0x00 };
public static readonly byte[] UFix86 = { 0x06, 0x00 };
public static readonly byte[] UFix87 = { 0x07, 0x00 };
public static readonly byte[] UFix88 = { 0x08, 0x00 };
public static readonly byte[] UFix89 = { 0x09, 0x00 };
public static readonly byte[] UFix8Max = { 0xFF, 0xFF };
public static readonly object[][] UFix8TestData =
{
new object[] { UFix8_0, 0 },
new object[] { UFix8_4, 4 },
new object[] { UFix8_Max, UFix8_ValMax },
new object[] { UFix80, 0 },
new object[] { UFix84, 4 },
new object[] { UFix8Max, UFix8ValMax },
};
public const string Ascii_ValRand = "aBcdEf1234";
public const string Ascii_ValRand1 = "Ecf3a";
public const string Ascii_ValRand2 = "2Bd4c";
public const string Ascii_ValRand3 = "cad14";
public const string Ascii_ValRand4 = "fd4E1";
public const string Ascii_ValRandLength4 = "aBcd";
public const string Ascii_ValNullRand = "aBcd\0Ef\0123";
public static readonly byte[] Ascii_Rand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52 };
public static readonly byte[] Ascii_Rand1 = { 69, 99, 102, 51, 97 };
public static readonly byte[] Ascii_Rand2 = { 50, 66, 100, 52, 99 };
public static readonly byte[] Ascii_Rand3 = { 99, 97, 100, 49, 52 };
public static readonly byte[] Ascii_Rand4 = { 102, 100, 52, 69, 49 };
public static readonly byte[] Ascii_RandLength4 = { 97, 66, 99, 100 };
public static readonly byte[] Ascii_PaddedRand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52, 0, 0, 0, 0 };
public static readonly byte[] Ascii_NullRand = { 97, 66, 99, 100, 0, 69, 102, 0, 49, 50, 51 };
public const int Ascii_Rand_Length = 10;
public const int Ascii_PaddedRand_Length = 14;
public const int Ascii_NullRand_Length = 11;
public const int Ascii_NullRand_LengthNoNull = 4;
public const string AsciiValRand = "aBcdEf1234";
public const string AsciiValRand1 = "Ecf3a";
public const string AsciiValRand2 = "2Bd4c";
public const string AsciiValRand3 = "cad14";
public const string AsciiValRand4 = "fd4E1";
public const string AsciiValRandLength4 = "aBcd";
public const string AsciiValNullRand = "aBcd\0Ef\0123";
public static readonly byte[] AsciiRand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52 };
public static readonly byte[] AsciiRand1 = { 69, 99, 102, 51, 97 };
public static readonly byte[] AsciiRand2 = { 50, 66, 100, 52, 99 };
public static readonly byte[] AsciiRand3 = { 99, 97, 100, 49, 52 };
public static readonly byte[] AsciiRand4 = { 102, 100, 52, 69, 49 };
public static readonly byte[] AsciiRandLength4 = { 97, 66, 99, 100 };
public static readonly byte[] AsciiPaddedRand = { 97, 66, 99, 100, 69, 102, 49, 50, 51, 52, 0, 0, 0, 0 };
public static readonly byte[] AsciiNullRand = { 97, 66, 99, 100, 0, 69, 102, 0, 49, 50, 51 };
public const int AsciiRandLength = 10;
public const int AsciiPaddedRandLength = 14;
public const int AsciiNullRandLength = 11;
public const int AsciiNullRandLengthNoNull = 4;
public static readonly object[][] AsciiTestData =
{
new object[] { Ascii_Rand, Ascii_Rand_Length, Ascii_ValRand },
new object[] { Ascii_Rand, 4, Ascii_ValRandLength4 },
new object[] { Ascii_NullRand, Ascii_NullRand_LengthNoNull, Ascii_ValRandLength4 },
new object[] { AsciiRand, AsciiRandLength, AsciiValRand },
new object[] { AsciiRand, 4, AsciiValRandLength4 },
new object[] { AsciiNullRand, AsciiNullRandLengthNoNull, AsciiValRandLength4 },
};
public static readonly object[][] AsciiWriteTestData =
{
new object[] { Ascii_Rand, Ascii_ValRand },
new object[] { Ascii_NullRand, Ascii_ValNullRand },
new object[] { AsciiRand, AsciiValRand },
new object[] { AsciiNullRand, AsciiValNullRand },
};
public static readonly object[][] AsciiPaddingTestData =
{
new object[] { Ascii_PaddedRand, Ascii_PaddedRand_Length, Ascii_ValRand, true },
new object[] { Ascii_RandLength4, 4, Ascii_ValRand, false },
new object[] { AsciiPaddedRand, AsciiPaddedRandLength, AsciiValRand, true },
new object[] { AsciiRandLength4, 4, AsciiValRand, false },
};
public const string Unicode_ValRand1 = ".6Abäñ$€β𐐷𤭢";
public const string Unicode_ValRand2 = ".6Abäñ";
public const string Unicode_ValRand3 = "$€β𐐷𤭢";
public const string UnicodeValRand1 = ".6Abäñ$€β𐐷𤭢";
public const string UnicodeValRand2 = ".6Abäñ";
public const string UnicodeValRand3 = "$€β𐐷𤭢";
public static readonly byte[] Unicode_Rand1 =
public static readonly byte[] UnicodeRand1 =
{
0x00, 0x2e, // .
0x00, 0x36, // 6
@ -251,7 +251,7 @@ internal static class IccTestDataPrimitives
0xD8, 0x52, 0xDF, 0x62, // 𤭢
};
public static readonly byte[] Unicode_Rand2 =
public static readonly byte[] UnicodeRand2 =
{
0x00, 0x2e, // .
0x00, 0x36, // 6
@ -261,7 +261,7 @@ internal static class IccTestDataPrimitives
0x00, 0xf1, // ñ
};
public static readonly byte[] Unicode_Rand3 =
public static readonly byte[] UnicodeRand3 =
{
0x00, 0x24, // $
0x20, 0xAC, // €

110
tests/ImageSharp.Tests/TestDataIcc/IccTestDataProfiles.cs

@ -8,55 +8,50 @@ namespace SixLabors.ImageSharp.Tests;
internal static class IccTestDataProfiles
{
public static readonly IccProfileId Header_Random_Id_Value = new IccProfileId(0x84A8D460, 0xC716B6F3, 0x9B0E4C3D, 0xAB95F838);
public static readonly IccProfileId Profile_Random_Id_Value = new IccProfileId(0x917D6DE6, 0x84C958D1, 0x3BB0F5BB, 0xADD1134F);
public static readonly IccProfileId HeaderRandomIdValue = new(0x84A8D460, 0xC716B6F3, 0x9B0E4C3D, 0xAB95F838);
public static readonly IccProfileId ProfileRandomIdValue = new(0x917D6DE6, 0x84C958D1, 0x3BB0F5BB, 0xADD1134F);
public static readonly byte[] Header_Random_Id_Array =
public static readonly byte[] HeaderRandomIdArray =
{
0x84, 0xA8, 0xD4, 0x60, 0xC7, 0x16, 0xB6, 0xF3, 0x9B, 0x0E, 0x4C, 0x3D, 0xAB, 0x95, 0xF8, 0x38,
};
public static readonly byte[] Profile_Random_Id_Array =
public static readonly byte[] ProfileRandomIdArray =
{
0x91, 0x7D, 0x6D, 0xE6, 0x84, 0xC9, 0x58, 0xD1, 0x3B, 0xB0, 0xF5, 0xBB, 0xAD, 0xD1, 0x13, 0x4F,
};
public static readonly IccProfileHeader Header_Random_Write = CreateHeaderRandomValue(
public static readonly IccProfileHeader HeaderRandomWrite = CreateHeaderRandomValue(
562, // should be overwritten
new IccProfileId(1, 2, 3, 4), // should be overwritten
"ijkl"); // should be overwritten to "acsp"
public static readonly IccProfileHeader Header_Random_Read = CreateHeaderRandomValue(132, Header_Random_Id_Value, "acsp");
public static readonly IccProfileHeader HeaderRandomRead = CreateHeaderRandomValue(132, HeaderRandomIdValue, "acsp");
public static readonly byte[] Header_Random_Array = CreateHeaderRandomArray(132, 0, Header_Random_Id_Array);
public static readonly byte[] HeaderRandomArray = CreateHeaderRandomArray(132, 0, HeaderRandomIdArray);
public static IccProfileHeader CreateHeaderRandomValue(uint size, IccProfileId id, string fileSignature)
public static IccProfileHeader CreateHeaderRandomValue(uint size, IccProfileId id, string fileSignature) => new()
{
return new IccProfileHeader
{
Class = IccProfileClass.DisplayDevice,
CmmType = "abcd",
CreationDate = new DateTime(1990, 11, 26, 7, 21, 42),
CreatorSignature = "dcba",
DataColorSpace = IccColorSpaceType.Rgb,
DeviceAttributes = IccDeviceAttribute.ChromaBlackWhite | IccDeviceAttribute.OpacityTransparent,
DeviceManufacturer = 123456789u,
DeviceModel = 987654321u,
FileSignature = "acsp",
Flags = IccProfileFlag.Embedded | IccProfileFlag.Independent,
Id = id,
PcsIlluminant = new Vector3(4, 5, 6),
PrimaryPlatformSignature = IccPrimaryPlatformType.MicrosoftCorporation,
ProfileConnectionSpace = IccColorSpaceType.CieXyz,
RenderingIntent = IccRenderingIntent.AbsoluteColorimetric,
Size = size,
Version = new IccVersion(4, 3, 0),
};
}
public static byte[] CreateHeaderRandomArray(uint size, uint nrOfEntries, byte[] profileId)
{
return ArrayHelper.Concat(
Class = IccProfileClass.DisplayDevice,
CmmType = "abcd",
CreationDate = new DateTime(1990, 11, 26, 7, 21, 42),
CreatorSignature = "dcba",
DataColorSpace = IccColorSpaceType.Rgb,
DeviceAttributes = IccDeviceAttribute.ChromaBlackWhite | IccDeviceAttribute.OpacityTransparent,
DeviceManufacturer = 123456789u,
DeviceModel = 987654321u,
FileSignature = "acsp",
Flags = IccProfileFlag.Embedded | IccProfileFlag.Independent,
Id = id,
PcsIlluminant = new Vector3(4, 5, 6),
PrimaryPlatformSignature = IccPrimaryPlatformType.MicrosoftCorporation,
ProfileConnectionSpace = IccColorSpaceType.CieXyz,
RenderingIntent = IccRenderingIntent.AbsoluteColorimetric,
Size = size,
Version = new IccVersion(4, 3, 0),
};
public static byte[] CreateHeaderRandomArray(uint size, uint nrOfEntries, byte[] profileId) => ArrayHelper.Concat(
new byte[]
{
(byte)(size >> 24), (byte)(size >> 16), (byte)(size >> 8), (byte)size, // Size
@ -91,10 +86,9 @@ internal static class IccTestDataProfiles
(byte)(nrOfEntries >> 8),
(byte)nrOfEntries
});
}
public static readonly byte[] Profile_Random_Array = ArrayHelper.Concat(
CreateHeaderRandomArray(168, 2, Profile_Random_Id_Array),
public static readonly byte[] ProfileRandomArray = ArrayHelper.Concat(
CreateHeaderRandomArray(168, 2, ProfileRandomIdArray),
new byte[]
{
0x00, 0x00, 0x00, 0x00, // tag signature (Unknown)
@ -104,17 +98,17 @@ internal static class IccTestDataProfiles
0x00, 0x00, 0x00, 0x9C, // tag offset (156)
0x00, 0x00, 0x00, 0x0C, // tag size (12)
},
IccTestDataTagDataEntry.TagDataEntryHeader_UnknownArr,
IccTestDataTagDataEntry.Unknown_Arr);
IccTestDataTagDataEntry.TagDataEntryHeaderUnknownArr,
IccTestDataTagDataEntry.UnknownArr);
public static readonly IccProfile Profile_Random_Val = new IccProfile(
public static readonly IccProfile ProfileRandomVal = new(
CreateHeaderRandomValue(
168,
Profile_Random_Id_Value,
ProfileRandomIdValue,
"acsp"),
new IccTagDataEntry[] { IccTestDataTagDataEntry.Unknown_Val, IccTestDataTagDataEntry.Unknown_Val });
new IccTagDataEntry[] { IccTestDataTagDataEntry.UnknownVal, IccTestDataTagDataEntry.UnknownVal });
public static readonly byte[] Header_CorruptDataColorSpace_Array =
public static readonly byte[] HeaderCorruptDataColorSpaceArray =
{
0x00, 0x00, 0x00, 0x80, // Size
0x61, 0x62, 0x63, 0x64, // CmmType
@ -143,7 +137,7 @@ internal static class IccTestDataProfiles
0x00, 0x00, 0x00, 0x00,
};
public static readonly byte[] Header_CorruptProfileConnectionSpace_Array =
public static readonly byte[] HeaderCorruptProfileConnectionSpaceArray =
{
0x00, 0x00, 0x00, 0x80, // Size
0x62, 0x63, 0x64, 0x65, // CmmType
@ -172,7 +166,7 @@ internal static class IccTestDataProfiles
0x00, 0x00, 0x00, 0x00,
};
public static readonly byte[] Header_CorruptRenderingIntent_Array =
public static readonly byte[] HeaderCorruptRenderingIntentArray =
{
0x00, 0x00, 0x00, 0x80, // Size
0x63, 0x64, 0x65, 0x66, // CmmType
@ -201,29 +195,29 @@ internal static class IccTestDataProfiles
0x00, 0x00, 0x00, 0x00,
};
public static readonly byte[] Header_DataTooSmall_Array = new byte[127];
public static readonly byte[] HeaderDataTooSmallArray = new byte[127];
public static readonly byte[] Header_InvalidSizeSmall_Array = CreateHeaderRandomArray(127, 0, Header_Random_Id_Array);
public static readonly byte[] HeaderInvalidSizeSmallArray = CreateHeaderRandomArray(127, 0, HeaderRandomIdArray);
public static readonly byte[] Header_InvalidSizeBig_Array = CreateHeaderRandomArray(50_000_000, 0, Header_Random_Id_Array);
public static readonly byte[] HeaderInvalidSizeBigArray = CreateHeaderRandomArray(50_000_000, 0, HeaderRandomIdArray);
public static readonly byte[] Header_SizeBiggerThanData_Array = CreateHeaderRandomArray(160, 0, Header_Random_Id_Array);
public static readonly byte[] HeaderSizeBiggerThanDataArray = CreateHeaderRandomArray(160, 0, HeaderRandomIdArray);
public static readonly object[][] ProfileIdTestData =
{
new object[] { Header_Random_Array, Header_Random_Id_Value },
new object[] { Profile_Random_Array, Profile_Random_Id_Value },
new object[] { HeaderRandomArray, HeaderRandomIdValue },
new object[] { ProfileRandomArray, ProfileRandomIdValue },
};
public static readonly object[][] ProfileValidityTestData =
{
new object[] { Header_CorruptDataColorSpace_Array, false },
new object[] { Header_CorruptProfileConnectionSpace_Array, false },
new object[] { Header_CorruptRenderingIntent_Array, false },
new object[] { Header_DataTooSmall_Array, false },
new object[] { Header_InvalidSizeSmall_Array, false },
new object[] { Header_InvalidSizeBig_Array, false },
new object[] { Header_SizeBiggerThanData_Array, false },
new object[] { Header_Random_Array, true },
new object[] { HeaderCorruptDataColorSpaceArray, false },
new object[] { HeaderCorruptProfileConnectionSpaceArray, false },
new object[] { HeaderCorruptRenderingIntentArray, false },
new object[] { HeaderDataTooSmallArray, false },
new object[] { HeaderInvalidSizeSmallArray, false },
new object[] { HeaderInvalidSizeBigArray, false },
new object[] { HeaderSizeBiggerThanDataArray, false },
new object[] { HeaderRandomArray, true },
};
}

740
tests/ImageSharp.Tests/TestDataIcc/IccTestDataTagDataEntry.cs

File diff suppressed because it is too large
Loading…
Cancel
Save