Browse Source

Fix namespace add first LCH test

pull/2739/head
James Jackson-South 2 years ago
parent
commit
ba066f96b5
  1. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieLchuvConversionTests.cs
  2. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieLuvConversionTests.cs
  3. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieXyyConversionTests.cs
  4. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndCmykConversionTests.cs
  5. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndRgbConversionTests.cs
  6. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLabAndYCbCrConversionTests.cs
  7. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLchuvAndCieLchConversionTests.cs
  8. 2
      tests/ImageSharp.Tests/ColorProfiles/CieLchuvAndCieLuvConversionTests.cs
  9. 2
      tests/ImageSharp.Tests/ColorProfiles/CieXyyAndLmsConversionTests.cs
  10. 70
      tests/ImageSharp.Tests/ColorProfiles/CieXyzAndCieLchConversionTests.cs
  11. 2
      tests/ImageSharp.Tests/ColorProfiles/CieXyzAndCieXyyConversionTest.cs
  12. 2
      tests/ImageSharp.Tests/ColorProfiles/CmykAndYCbCrConversionTests.cs
  13. 2
      tests/ImageSharp.Tests/ColorProfiles/RgbAndCieXyzConversionTest.cs
  14. 2
      tests/ImageSharp.Tests/ColorProfiles/RgbAndCmykConversionTest.cs
  15. 2
      tests/ImageSharp.Tests/ColorProfiles/RgbAndYCbCrConversionTest.cs

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieLchuvConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="CieLchuv"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieLuvConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="CieLuv"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndCieXyyConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="CieXyy"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndCmykConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="Cmyk"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndRgbConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="Rgb"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLabAndYCbCrConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLab"/>-<see cref="YCbCr"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLchuvAndCieLchConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLchuv"/>-<see cref="CieLch"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieLchuvAndCieLuvConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieLuv"/>-<see cref="CieLchuv"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CieXyyAndLmsConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieXyy"/>-<see cref="Lms"/> conversions.

70
tests/ImageSharp.Tests/ColorProfiles/CieXyzAndCieLchConversionTests.cs

@ -0,0 +1,70 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieXyz"/>-<see cref="CieLch"/> conversions.
/// </summary>
public class CieXyzAndCieLchConversionTests
{
private static readonly ApproximateColorProfileComparer Comparer = new(.0002f);
[Theory]
[InlineData(0, 0, 0, 0, 0, 0)]
[InlineData(0.360555, 0.936901, 0.1001514, 97.50697, 161.235321, 143.157)]
public void Convert_CieXyz_to_CieLch(float x, float y, float yl, float l, float c, float h)
{
// Arrange
CieXyz input = new(x, y, yl);
CieLch expected = new(l, c, h);
ColorProfileConverter converter = new();
Span<CieXyz> inputSpan = new CieXyz[5];
inputSpan.Fill(input);
Span<CieLch> actualSpan = new CieLch[5];
// Act
CieLch actual = converter.Convert<CieXyz, CieLch>(input);
converter.Convert<CieXyz, CieLch>(inputSpan, actualSpan);
// Assert
Assert.Equal(expected, actual, Comparer);
for (int i = 0; i < actualSpan.Length; i++)
{
Assert.Equal(expected, actualSpan[i], Comparer);
}
}
[Theory]
[InlineData(0, 0, 0, 0, 0, 0)]
[InlineData(97.50697, 161.235321, 143.157, 0.3605551, 0.936901, 0.1001514)]
public void Convert_CieLch_to_CieXyz(float l, float c, float h, float x, float y, float yl)
{
// Arrange
CieLch input = new(l, c, h);
CieXyz expected = new(x, y, yl);
ColorProfileConverter converter = new();
Span<CieLch> inputSpan = new CieLch[5];
inputSpan.Fill(input);
Span<CieXyz> actualSpan = new CieXyz[5];
// Act
CieXyz actual = converter.Convert<CieLch, CieXyz>(input);
converter.Convert<CieLch, CieXyz>(inputSpan, actualSpan);
// Assert
Assert.Equal(expected, actual, Comparer);
for (int i = 0; i < actualSpan.Length; i++)
{
Assert.Equal(expected, actualSpan[i], Comparer);
}
}
}

2
tests/ImageSharp.Tests/ColorProfiles/CieXyzAndCieXyyConversionTest.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieXyz"/>-<see cref="CieXyy"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/CmykAndYCbCrConversionTests.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="Cmyk"/>-<see cref="YCbCr"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/RgbAndCieXyzConversionTest.cs

@ -4,7 +4,7 @@
using SixLabors.ColorProfiles;
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="CieXyz"/>-<see cref="Rgb"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/RgbAndCmykConversionTest.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="Rgb"/>-<see cref="Cmyk"/> conversions.

2
tests/ImageSharp.Tests/ColorProfiles/RgbAndYCbCrConversionTest.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.ColorProfiles;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Conversion;
namespace SixLabors.ImageSharp.Tests.ColorProfiles;
/// <summary>
/// Tests <see cref="Rgb"/>-<see cref="YCbCr"/> conversions.

Loading…
Cancel
Save