public void Convert_CieXyy_to_Rgb(float x, float y, float yl, float r, float g, float b) { // Arrange var input = new CieXyy(x, y, yl); var expected = new Rgb(r, g, b); Span <CieXyy> inputSpan = new CieXyy[5]; inputSpan.Fill(input); Span <Rgb> actualSpan = new Rgb[5]; // Act var actual = Converter.ToRgb(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_CieXyy_to_YCbCr(float x, float y, float yl, float y2, float cb, float cr) { // Arrange var input = new CieXyy(x, y, yl); var expected = new YCbCr(y2, cb, cr); Span <CieXyy> inputSpan = new CieXyy[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_CieXyy_to_CieLch(float x, float y, float yl, float l, float c, float h) { // Arrange var input = new CieXyy(x, y, yl); var expected = new CieLch(l, c, h); Span <CieXyy> inputSpan = new CieXyy[5]; inputSpan.Fill(input); Span <CieLch> actualSpan = new CieLch[5]; // Act var actual = Converter.ToCieLch(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_CieXyy_to_Hsv(float x, float y, float yl, float h, float s, float v) { // Arrange var input = new CieXyy(x, y, yl); var expected = new Hsv(h, s, v); Span <CieXyy> inputSpan = new CieXyy[5]; inputSpan.Fill(input); Span <Hsv> actualSpan = new Hsv[5]; // Act var actual = Converter.ToHsv(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_CieXyy_to_Cmyk(float x, float y2, float yl, float c, float m, float y, float k) { // Arrange var input = new CieXyy(x, y2, yl); var expected = new Cmyk(c, m, y, k); Span <CieXyy> inputSpan = new CieXyy[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_xyY_to_XYZ(float xyzX, float xyzY, float xyzZ, float x, float y, float yl) { var input = new CieXyy(x, y, yl); var expected = new CieXyz(xyzX, xyzY, xyzZ); Span <CieXyy> inputSpan = new CieXyy[5]; inputSpan.Fill(input); Span <CieXyz> actualSpan = new CieXyz[5]; // Act var 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); } }