mirror of https://github.com/SixLabors/ImageSharp
32 changed files with 393 additions and 416 deletions
@ -1,163 +0,0 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Numerics; |
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Colorspaces.Icc |
|||
{ |
|||
public class IccConversionDataClut |
|||
{ |
|||
internal static IccClut Clut3x2 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0.1f, 0.1f }, |
|||
new float[] { 0.2f, 0.2f }, |
|||
new float[] { 0.3f, 0.3f }, |
|||
|
|||
new float[] { 0.11f, 0.11f }, |
|||
new float[] { 0.21f, 0.21f }, |
|||
new float[] { 0.31f, 0.31f }, |
|||
|
|||
new float[] { 0.12f, 0.12f }, |
|||
new float[] { 0.22f, 0.22f }, |
|||
new float[] { 0.32f, 0.32f }, |
|||
|
|||
new float[] { 0.13f, 0.13f }, |
|||
new float[] { 0.23f, 0.23f }, |
|||
new float[] { 0.33f, 0.33f }, |
|||
|
|||
new float[] { 0.14f, 0.14f }, |
|||
new float[] { 0.24f, 0.24f }, |
|||
new float[] { 0.34f, 0.34f }, |
|||
|
|||
new float[] { 0.15f, 0.15f }, |
|||
new float[] { 0.25f, 0.25f }, |
|||
new float[] { 0.35f, 0.35f }, |
|||
|
|||
new float[] { 0.16f, 0.16f }, |
|||
new float[] { 0.26f, 0.26f }, |
|||
new float[] { 0.36f, 0.36f }, |
|||
|
|||
new float[] { 0.17f, 0.17f }, |
|||
new float[] { 0.27f, 0.27f }, |
|||
new float[] { 0.37f, 0.37f }, |
|||
|
|||
new float[] { 0.18f, 0.18f }, |
|||
new float[] { 0.28f, 0.28f }, |
|||
new float[] { 0.38f, 0.38f }, |
|||
}, |
|||
new byte[] { 3, 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut3x1 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0.10f }, |
|||
new float[] { 0.20f }, |
|||
new float[] { 0.30f }, |
|||
|
|||
new float[] { 0.11f }, |
|||
new float[] { 0.21f }, |
|||
new float[] { 0.31f }, |
|||
|
|||
new float[] { 0.12f }, |
|||
new float[] { 0.22f }, |
|||
new float[] { 0.32f }, |
|||
|
|||
new float[] { 0.13f }, |
|||
new float[] { 0.23f }, |
|||
new float[] { 0.33f }, |
|||
|
|||
new float[] { 0.14f }, |
|||
new float[] { 0.24f }, |
|||
new float[] { 0.34f }, |
|||
|
|||
new float[] { 0.15f }, |
|||
new float[] { 0.25f }, |
|||
new float[] { 0.35f }, |
|||
|
|||
new float[] { 0.16f }, |
|||
new float[] { 0.26f }, |
|||
new float[] { 0.36f }, |
|||
|
|||
new float[] { 0.17f }, |
|||
new float[] { 0.27f }, |
|||
new float[] { 0.37f }, |
|||
|
|||
new float[] { 0.18f }, |
|||
new float[] { 0.28f }, |
|||
new float[] { 0.38f }, |
|||
}, |
|||
new byte[] { 3, 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut2x2 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0.1f, 0.9f }, |
|||
new float[] { 0.2f, 0.8f }, |
|||
new float[] { 0.3f, 0.7f }, |
|||
|
|||
new float[] { 0.4f, 0.6f }, |
|||
new float[] { 0.5f, 0.5f }, |
|||
new float[] { 0.6f, 0.4f }, |
|||
|
|||
new float[] { 0.7f, 0.3f }, |
|||
new float[] { 0.8f, 0.2f }, |
|||
new float[] { 0.9f, 0.1f }, |
|||
}, |
|||
new byte[] { 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut2x1 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0.1f }, |
|||
new float[] { 0.2f }, |
|||
new float[] { 0.3f }, |
|||
|
|||
new float[] { 0.4f }, |
|||
new float[] { 0.5f }, |
|||
new float[] { 0.6f }, |
|||
|
|||
new float[] { 0.7f }, |
|||
new float[] { 0.8f }, |
|||
new float[] { 0.9f }, |
|||
}, |
|||
new byte[] { 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut1x2 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0f, 0.5f }, |
|||
new float[] { 0.25f, 0.75f, }, |
|||
new float[] { 0.5f, 1f }, |
|||
}, |
|||
new byte[] { 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut1x1 = new IccClut( |
|||
new float[][] |
|||
{ |
|||
new float[] { 0f }, |
|||
new float[] { 0.5f }, |
|||
new float[] { 1f }, |
|||
}, |
|||
new byte[] { 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
public static object[][] ClutConversionTestData = |
|||
{ |
|||
new object[] { Clut3x2, new Vector4(0.75f, 0.75f, 0.75f, 0), new Vector4(0.31f, 0.31f, 0, 0) }, |
|||
new object[] { Clut3x1, new Vector4(0.2f, 0.6f, 0.8f, 0), new Vector4(0.276f, 0, 0, 0) }, |
|||
new object[] { Clut3x1, new Vector4(0.75f, 0.75f, 0.75f, 0), new Vector4(0.31f, 0, 0, 0) }, |
|||
new object[] { Clut2x2, new Vector4(0.2f, 0.6f, 0, 0), new Vector4(0.46f, 0.54f, 0, 0) }, |
|||
new object[] { Clut2x2, new Vector4(0.25f, 0.75f, 0, 0), new Vector4(0.4f, 0.6f, 0, 0) }, |
|||
new object[] { Clut2x1, new Vector4(0.25f, 0.75f, 0, 0), new Vector4(0.4f, 0, 0, 0) }, |
|||
new object[] { Clut1x2, new Vector4(0.25f, 0, 0, 0), new Vector4(0.125f, 0.625f, 0, 0) }, |
|||
new object[] { Clut1x1, new Vector4(0.25f, 0, 0, 0), new Vector4(0.25f, 0, 0, 0) }, |
|||
}; |
|||
} |
|||
} |
|||
@ -1,76 +0,0 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Colorspaces.Icc |
|||
{ |
|||
public class IccConversionDataMultiProcessElement |
|||
{ |
|||
private static IccMatrixProcessElement Matrix = new IccMatrixProcessElement(new float[,] |
|||
{ |
|||
{ 2, 4, 6 }, |
|||
{ 3, 5, 7 }, |
|||
}, new float[] { 3, 4, 5 }); |
|||
|
|||
private static IccClut Clut = new IccClut(new float[][] |
|||
{ |
|||
new float[] { 0.2f, 0.3f }, |
|||
new float[] { 0.4f, 0.5f }, |
|||
|
|||
new float[] { 0.21f, 0.31f }, |
|||
new float[] { 0.41f, 0.51f }, |
|||
|
|||
new float[] { 0.22f, 0.32f }, |
|||
new float[] { 0.42f, 0.52f }, |
|||
|
|||
new float[] { 0.23f, 0.33f }, |
|||
new float[] { 0.43f, 0.53f }, |
|||
}, new byte[] { 2, 2, 2 }, IccClutDataType.Float); |
|||
|
|||
private static IccFormulaCurveElement FormulaCurveElement1 = new IccFormulaCurveElement(IccFormulaCurveType.Type1, 2.2f, 0.7f, 0.2f, 0.3f, 0, 0); |
|||
private static IccFormulaCurveElement FormulaCurveElement2 = new IccFormulaCurveElement(IccFormulaCurveType.Type2, 2.2f, 0.9f, 0.9f, 0.02f, 0.1f, 0); |
|||
private static IccFormulaCurveElement FormulaCurveElement3 = new IccFormulaCurveElement(IccFormulaCurveType.Type3, 0, 0.9f, 0.9f, 1.02f, 0.1f, 0.02f); |
|||
|
|||
private static IccCurveSetProcessElement CurveSet1DFormula1 = Create1DSingleCurveSet(FormulaCurveElement1); |
|||
private static IccCurveSetProcessElement CurveSet1DFormula2 = Create1DSingleCurveSet(FormulaCurveElement2); |
|||
private static IccCurveSetProcessElement CurveSet1DFormula3 = Create1DSingleCurveSet(FormulaCurveElement3); |
|||
|
|||
private static IccCurveSetProcessElement CurveSet1DFormula1And2 = Create1DMultiCurveSet(new float[] { 0.5f }, FormulaCurveElement1, FormulaCurveElement2); |
|||
|
|||
private static IccClutProcessElement ClutElement = new IccClutProcessElement(Clut); |
|||
|
|||
private static IccCurveSetProcessElement Create1DSingleCurveSet(IccCurveSegment segment) |
|||
{ |
|||
var curve = new IccOneDimensionalCurve(new float[0], new IccCurveSegment[] { segment }); |
|||
return new IccCurveSetProcessElement(new IccOneDimensionalCurve[] { curve }); |
|||
} |
|||
|
|||
private static IccCurveSetProcessElement Create1DMultiCurveSet(float[] breakPoints, params IccCurveSegment[] segments) |
|||
{ |
|||
var curve = new IccOneDimensionalCurve(breakPoints, segments); |
|||
return new IccCurveSetProcessElement(new IccOneDimensionalCurve[] { curve }); |
|||
} |
|||
|
|||
|
|||
public static object[][] MpeCurveConversionTestData = |
|||
{ |
|||
new object[] { CurveSet1DFormula1, new float[] { 0.51f }, new float[] { 0.575982451f } }, |
|||
new object[] { CurveSet1DFormula2, new float[] { 0.52f }, new float[] { -0.4684991f } }, |
|||
new object[] { CurveSet1DFormula3, new float[] { 0.53f }, new float[] { 0.86126f } }, |
|||
|
|||
new object[] { CurveSet1DFormula1And2, new float[] { 0.31f }, new float[] { 0.445982f } }, |
|||
new object[] { CurveSet1DFormula1And2, new float[] { 0.61f }, new float[] { -0.341274023f } }, |
|||
}; |
|||
|
|||
public static object[][] MpeMatrixConversionTestData = |
|||
{ |
|||
new object[] { Matrix, new float[] { 2, 4 }, new float[] { 19, 32, 45 } } |
|||
}; |
|||
|
|||
public static object[][] MpeClutConversionTestData = |
|||
{ |
|||
new object[] { ClutElement, new float[] { 0.5f, 0.5f, 0.5f }, new float[] { 0.5f, 0.5f } } |
|||
}; |
|||
} |
|||
} |
|||
@ -0,0 +1,163 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Numerics; |
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.TestDataIcc.Conversion |
|||
{ |
|||
public class IccConversionDataClut |
|||
{ |
|||
internal static IccClut Clut3x2 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0.1f, 0.1f }, |
|||
new[] { 0.2f, 0.2f }, |
|||
new[] { 0.3f, 0.3f }, |
|||
|
|||
new[] { 0.11f, 0.11f }, |
|||
new[] { 0.21f, 0.21f }, |
|||
new[] { 0.31f, 0.31f }, |
|||
|
|||
new[] { 0.12f, 0.12f }, |
|||
new[] { 0.22f, 0.22f }, |
|||
new[] { 0.32f, 0.32f }, |
|||
|
|||
new[] { 0.13f, 0.13f }, |
|||
new[] { 0.23f, 0.23f }, |
|||
new[] { 0.33f, 0.33f }, |
|||
|
|||
new[] { 0.14f, 0.14f }, |
|||
new[] { 0.24f, 0.24f }, |
|||
new[] { 0.34f, 0.34f }, |
|||
|
|||
new[] { 0.15f, 0.15f }, |
|||
new[] { 0.25f, 0.25f }, |
|||
new[] { 0.35f, 0.35f }, |
|||
|
|||
new[] { 0.16f, 0.16f }, |
|||
new[] { 0.26f, 0.26f }, |
|||
new[] { 0.36f, 0.36f }, |
|||
|
|||
new[] { 0.17f, 0.17f }, |
|||
new[] { 0.27f, 0.27f }, |
|||
new[] { 0.37f, 0.37f }, |
|||
|
|||
new[] { 0.18f, 0.18f }, |
|||
new[] { 0.28f, 0.28f }, |
|||
new[] { 0.38f, 0.38f }, |
|||
}, |
|||
new byte[] { 3, 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut3x1 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0.10f }, |
|||
new[] { 0.20f }, |
|||
new[] { 0.30f }, |
|||
|
|||
new[] { 0.11f }, |
|||
new[] { 0.21f }, |
|||
new[] { 0.31f }, |
|||
|
|||
new[] { 0.12f }, |
|||
new[] { 0.22f }, |
|||
new[] { 0.32f }, |
|||
|
|||
new[] { 0.13f }, |
|||
new[] { 0.23f }, |
|||
new[] { 0.33f }, |
|||
|
|||
new[] { 0.14f }, |
|||
new[] { 0.24f }, |
|||
new[] { 0.34f }, |
|||
|
|||
new[] { 0.15f }, |
|||
new[] { 0.25f }, |
|||
new[] { 0.35f }, |
|||
|
|||
new[] { 0.16f }, |
|||
new[] { 0.26f }, |
|||
new[] { 0.36f }, |
|||
|
|||
new[] { 0.17f }, |
|||
new[] { 0.27f }, |
|||
new[] { 0.37f }, |
|||
|
|||
new[] { 0.18f }, |
|||
new[] { 0.28f }, |
|||
new[] { 0.38f }, |
|||
}, |
|||
new byte[] { 3, 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut2x2 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0.1f, 0.9f }, |
|||
new[] { 0.2f, 0.8f }, |
|||
new[] { 0.3f, 0.7f }, |
|||
|
|||
new[] { 0.4f, 0.6f }, |
|||
new[] { 0.5f, 0.5f }, |
|||
new[] { 0.6f, 0.4f }, |
|||
|
|||
new[] { 0.7f, 0.3f }, |
|||
new[] { 0.8f, 0.2f }, |
|||
new[] { 0.9f, 0.1f }, |
|||
}, |
|||
new byte[] { 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut2x1 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0.1f }, |
|||
new[] { 0.2f }, |
|||
new[] { 0.3f }, |
|||
|
|||
new[] { 0.4f }, |
|||
new[] { 0.5f }, |
|||
new[] { 0.6f }, |
|||
|
|||
new[] { 0.7f }, |
|||
new[] { 0.8f }, |
|||
new[] { 0.9f }, |
|||
}, |
|||
new byte[] { 3, 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut1x2 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0f, 0.5f }, |
|||
new[] { 0.25f, 0.75f, }, |
|||
new[] { 0.5f, 1f }, |
|||
}, |
|||
new byte[] { 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
internal static IccClut Clut1x1 = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0f }, |
|||
new[] { 0.5f }, |
|||
new[] { 1f }, |
|||
}, |
|||
new byte[] { 3 }, |
|||
IccClutDataType.Float); |
|||
|
|||
public static object[][] ClutConversionTestData = |
|||
{ |
|||
new object[] { Clut3x2, new Vector4(0.75f, 0.75f, 0.75f, 0), new Vector4(0.31f, 0.31f, 0, 0) }, |
|||
new object[] { Clut3x1, new Vector4(0.2f, 0.6f, 0.8f, 0), new Vector4(0.276f, 0, 0, 0) }, |
|||
new object[] { Clut3x1, new Vector4(0.75f, 0.75f, 0.75f, 0), new Vector4(0.31f, 0, 0, 0) }, |
|||
new object[] { Clut2x2, new Vector4(0.2f, 0.6f, 0, 0), new Vector4(0.46f, 0.54f, 0, 0) }, |
|||
new object[] { Clut2x2, new Vector4(0.25f, 0.75f, 0, 0), new Vector4(0.4f, 0.6f, 0, 0) }, |
|||
new object[] { Clut2x1, new Vector4(0.25f, 0.75f, 0, 0), new Vector4(0.4f, 0, 0, 0) }, |
|||
new object[] { Clut1x2, new Vector4(0.25f, 0, 0, 0), new Vector4(0.125f, 0.625f, 0, 0) }, |
|||
new object[] { Clut1x1, new Vector4(0.25f, 0, 0, 0), new Vector4(0.25f, 0, 0, 0) }, |
|||
}; |
|||
} |
|||
} |
|||
@ -1,12 +1,13 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Colorspaces.Icc |
|||
namespace SixLabors.ImageSharp.Tests.TestDataIcc.Conversion |
|||
{ |
|||
public class IccConversionDataLut |
|||
{ |
|||
private static float[] LutEven = { 0, 0.5f, 1 }; |
|||
private static float[] LutUneven = { 0, 0.7f, 1 }; |
|||
private static readonly float[] LutEven = { 0, 0.5f, 1 }; |
|||
|
|||
private static readonly float[] LutUneven = { 0, 0.7f, 1 }; |
|||
|
|||
public static object[][] LutConversionTestData = |
|||
{ |
|||
@ -1,44 +1,51 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Numerics; |
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Colorspaces.Icc |
|||
namespace SixLabors.ImageSharp.Tests.TestDataIcc.Conversion |
|||
{ |
|||
public class IccConversionDataLutAB |
|||
{ |
|||
private static IccLutAToBTagDataEntry lutAtoB_SingleCurve = new IccLutAToBTagDataEntry( |
|||
private static readonly IccLutAToBTagDataEntry LutAtoBSingleCurve = new IccLutAToBTagDataEntry( |
|||
new IccTagDataEntry[] |
|||
{ |
|||
IccConversionDataTrc.IdentityCurve, |
|||
IccConversionDataTrc.IdentityCurve, |
|||
IccConversionDataTrc.IdentityCurve |
|||
}, |
|||
null, null, null, null, null); |
|||
null, |
|||
null, |
|||
null, |
|||
null, |
|||
null); |
|||
|
|||
// also need:
|
|||
// # CurveM + matrix
|
|||
// # CurveA + CLUT + CurveB
|
|||
// # CurveA + CLUT + CurveM + Matrix + CurveB
|
|||
|
|||
private static IccLutBToATagDataEntry lutBtoA_SingleCurve = new IccLutBToATagDataEntry( |
|||
private static readonly IccLutBToATagDataEntry LutBtoASingleCurve = new IccLutBToATagDataEntry( |
|||
new IccTagDataEntry[] |
|||
{ |
|||
IccConversionDataTrc.IdentityCurve, |
|||
IccConversionDataTrc.IdentityCurve, |
|||
IccConversionDataTrc.IdentityCurve |
|||
}, |
|||
null, null, null, null, null); |
|||
null, |
|||
null, |
|||
null, |
|||
null, |
|||
null); |
|||
|
|||
public static object[][] LutAToBConversionTestData = |
|||
{ |
|||
new object[] { lutAtoB_SingleCurve, new Vector4(0.2f, 0.3f, 0.4f, 0), new Vector4(0.2f, 0.3f, 0.4f, 0) }, |
|||
new object[] { LutAtoBSingleCurve, new Vector4(0.2f, 0.3f, 0.4f, 0), new Vector4(0.2f, 0.3f, 0.4f, 0) }, |
|||
}; |
|||
|
|||
public static object[][] LutBToAConversionTestData = |
|||
{ |
|||
new object[] { lutBtoA_SingleCurve, new Vector4(0.2f, 0.3f, 0.4f, 0), new Vector4(0.2f, 0.3f, 0.4f, 0) }, |
|||
new object[] { LutBtoASingleCurve, new Vector4(0.2f, 0.3f, 0.4f, 0), new Vector4(0.2f, 0.3f, 0.4f, 0) }, |
|||
}; |
|||
} |
|||
} |
|||
@ -0,0 +1,78 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.TestDataIcc.Conversion |
|||
{ |
|||
public class IccConversionDataMultiProcessElement |
|||
{ |
|||
private static readonly IccMatrixProcessElement Matrix = new IccMatrixProcessElement( |
|||
new float[,] |
|||
{ |
|||
{ 2, 4, 6 }, |
|||
{ 3, 5, 7 }, |
|||
}, new float[] { 3, 4, 5 }); |
|||
|
|||
private static readonly IccClut Clut = new IccClut( |
|||
new[] |
|||
{ |
|||
new[] { 0.2f, 0.3f }, |
|||
new[] { 0.4f, 0.5f }, |
|||
|
|||
new[] { 0.21f, 0.31f }, |
|||
new[] { 0.41f, 0.51f }, |
|||
|
|||
new[] { 0.22f, 0.32f }, |
|||
new[] { 0.42f, 0.52f }, |
|||
|
|||
new[] { 0.23f, 0.33f }, |
|||
new[] { 0.43f, 0.53f }, |
|||
}, new byte[] { 2, 2, 2 }, |
|||
IccClutDataType.Float); |
|||
|
|||
private static readonly IccFormulaCurveElement FormulaCurveElement1 = new IccFormulaCurveElement(IccFormulaCurveType.Type1, 2.2f, 0.7f, 0.2f, 0.3f, 0, 0); |
|||
private static readonly IccFormulaCurveElement FormulaCurveElement2 = new IccFormulaCurveElement(IccFormulaCurveType.Type2, 2.2f, 0.9f, 0.9f, 0.02f, 0.1f, 0); |
|||
private static readonly IccFormulaCurveElement FormulaCurveElement3 = new IccFormulaCurveElement(IccFormulaCurveType.Type3, 0, 0.9f, 0.9f, 1.02f, 0.1f, 0.02f); |
|||
|
|||
private static readonly IccCurveSetProcessElement CurveSet1DFormula1 = Create1DSingleCurveSet(FormulaCurveElement1); |
|||
private static readonly IccCurveSetProcessElement CurveSet1DFormula2 = Create1DSingleCurveSet(FormulaCurveElement2); |
|||
private static readonly IccCurveSetProcessElement CurveSet1DFormula3 = Create1DSingleCurveSet(FormulaCurveElement3); |
|||
|
|||
private static readonly IccCurveSetProcessElement CurveSet1DFormula1And2 = Create1DMultiCurveSet(new[] { 0.5f }, FormulaCurveElement1, FormulaCurveElement2); |
|||
|
|||
private static readonly IccClutProcessElement ClutElement = new IccClutProcessElement(Clut); |
|||
|
|||
private static IccCurveSetProcessElement Create1DSingleCurveSet(IccCurveSegment segment) |
|||
{ |
|||
var curve = new IccOneDimensionalCurve(new float[0], new[] { segment }); |
|||
return new IccCurveSetProcessElement(new[] { curve }); |
|||
} |
|||
|
|||
private static IccCurveSetProcessElement Create1DMultiCurveSet(float[] breakPoints, params IccCurveSegment[] segments) |
|||
{ |
|||
var curve = new IccOneDimensionalCurve(breakPoints, segments); |
|||
return new IccCurveSetProcessElement(new[] { curve }); |
|||
} |
|||
|
|||
public static object[][] MpeCurveConversionTestData = |
|||
{ |
|||
new object[] { CurveSet1DFormula1, new[] { 0.51f }, new[] { 0.575982451f } }, |
|||
new object[] { CurveSet1DFormula2, new[] { 0.52f }, new[] { -0.4684991f } }, |
|||
new object[] { CurveSet1DFormula3, new[] { 0.53f }, new[] { 0.86126f } }, |
|||
|
|||
new object[] { CurveSet1DFormula1And2, new[] { 0.31f }, new[] { 0.445982f } }, |
|||
new object[] { CurveSet1DFormula1And2, new[] { 0.61f }, new[] { -0.341274023f } }, |
|||
}; |
|||
|
|||
public static object[][] MpeMatrixConversionTestData = |
|||
{ |
|||
new object[] { Matrix, new float[] { 2, 4 }, new float[] { 19, 32, 45 } } |
|||
}; |
|||
|
|||
public static object[][] MpeClutConversionTestData = |
|||
{ |
|||
new object[] { ClutElement, new[] { 0.5f, 0.5f, 0.5f }, new[] { 0.5f, 0.5f } } |
|||
}; |
|||
} |
|||
} |
|||
@ -1,10 +1,10 @@ |
|||
// Copyright (c) Six Labors.
|
|||
// Copyright (c) Six Labors.
|
|||
// Licensed under the Apache License, Version 2.0.
|
|||
|
|||
using System.Numerics; |
|||
using SixLabors.ImageSharp.Metadata.Profiles.Icc; |
|||
|
|||
namespace SixLabors.ImageSharp.Tests.Colorspaces.Icc |
|||
namespace SixLabors.ImageSharp.Tests.TestDataIcc.Conversion |
|||
{ |
|||
public class IccConversionDataTrc |
|||
{ |
|||
Loading…
Reference in new issue