public void Convert_CieLch_to_CieLchuv(float l2, float c2, float h2, float l, float c, float h) { // Arrange var input = new CieLch(l2, c2, h2); var expected = new CieLchuv(l, c, h); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <CieLchuv> actualSpan = new CieLchuv[5]; // Act var actual = Converter.ToCieLchuv(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_YCbCr(float l, float c, float h, float y, float cb, float cr) { // Arrange var input = new CieLch(l, c, h); var expected = new YCbCr(y, cb, cr); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <YCbCr> actualSpan = new YCbCr[5]; // Act var actual = Converter.ToYCbCr(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_CieXyz(float l, float c, float h, float x, float y, float yl) { // Arrange var input = new CieLch(l, c, h); var expected = new CieXyz(x, y, yl); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <CieXyz> actualSpan = new CieXyz[5]; // Act CieXyz actual = Converter.ToCieXyz(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_HunterLab(float l, float c, float h, float l2, float a, float b) { // Arrange var input = new CieLch(l, c, h); var expected = new HunterLab(l2, a, b); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <HunterLab> actualSpan = new HunterLab[5]; // Act var actual = Converter.ToHunterLab(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_LinearRgb(float l, float c, float h, float r, float g, float b) { // Arrange var input = new CieLch(l, c, h); var expected = new LinearRgb(r, g, b); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <LinearRgb> actualSpan = new LinearRgb[5]; // Act var actual = Converter.ToLinearRgb(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_Cmyk(float l, float c2, float h, float c, float m, float y, float k) { // Arrange var input = new CieLch(l, c2, h); var expected = new Cmyk(c, m, y, k); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <Cmyk> actualSpan = new Cmyk[5]; // Act var actual = Converter.ToCmyk(input); Converter.Convert(inputSpan, actualSpan); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }
public void Convert_CieLch_to_Lms(float l, float c, float h, float l2, float m, float s) { // Arrange var input = new CieLch(l, c, h); var expected = new Lms(l2, m, s); Span <CieLch> inputSpan = new CieLch[5]; inputSpan.Fill(input); Span <Lms> actualSpan = new Lms[5]; // Act var actual = Converter.ToLms(input); Converter.Convert(inputSpan, actualSpan, actualSpan.Length); // Assert Assert.Equal(expected, actual, ColorSpaceComparer); for (int i = 0; i < actualSpan.Length; i++) { Assert.Equal(expected, actualSpan[i], ColorSpaceComparer); } }