コード例 #1
0
        public void Convert_CieLab_to_Lms(float l, float a, float b, float l2, float m, float s)
        {
            // Arrange
            var input    = new CieLab(l, a, b);
            var expected = new Lms(l2, m, s);

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

            inputSpan.Fill(input);

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

            // Act
            var actual = Converter.ToLms(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);
            }
        }
コード例 #2
0
        public void Convert_CieXyz_to_Lms(float x, float y, float z, float l, float m, float s)
        {
            // Arrange
            var input     = new CieXyz(x, y, z);
            var converter = new ColorSpaceConverter();
            var expected  = new Lms(l, m, s);

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

            inputSpan.Fill(input);

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

            // Act
            var actual = converter.ToLms(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);
            }
        }
コード例 #3
0
        public void Convert_CieXyz_to_Lms(float x, float y, float z, float l, float m, float s)
        {
            // Arrange
            CieXyz input = new CieXyz(x, y, z);
            ColorSpaceConverter converter = new ColorSpaceConverter();

            // Act
            Lms output = converter.ToLms(input);

            // Assert
            Assert.Equal(l, output.L, FloatRoundingComparer);
            Assert.Equal(m, output.M, FloatRoundingComparer);
            Assert.Equal(s, output.S, FloatRoundingComparer);
        }
コード例 #4
0
 public float ColorSpaceConvert()
 {
     return(ColorSpaceConverter.ToLms(CieXyz).L);
 }