Exemple #1
0
        public void Convert_LinearRgb_to_CieLab(float r, float g, float b2, float l, float a, float b)
        {
            // Arrange
            var input    = new LinearRgb(r, g, b2);
            var expected = new CieLab(l, a, b);

            Span <LinearRgb> inputSpan = new LinearRgb[5];

            inputSpan.Fill(input);

            Span <CieLab> actualSpan = new CieLab[5];

            // Act
            var actual = Converter.ToCieLab(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_LinearRgb_to_CieXyy(float r, float g, float b, float x, float y, float yl)
        {
            // Arrange
            var input    = new LinearRgb(r, g, b);
            var expected = new CieXyy(x, y, yl);

            Span <LinearRgb> inputSpan = new LinearRgb[5];

            inputSpan.Fill(input);

            Span <CieXyy> actualSpan = new CieXyy[5];

            // Act
            var actual = Converter.ToCieXyy(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);
            }
        }