public void Convert_YCbCr_to_CieLch(float y, float cb, float cr, float l, float c, float h)
        {
            // Arrange
            var input    = new YCbCr(y, cb, cr);
            var expected = new CieLch(l, c, h);

            Span <YCbCr> inputSpan = new YCbCr[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);
            }
        }
Beispiel #2
0
        public void Convert_YCbCr_to_CieXyy(float y2, float cb, float cr, float x, float y, float yl)
        {
            // Arrange
            var input    = new YCbCr(y2, cb, cr);
            var expected = new CieXyy(x, y, yl);

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

            inputSpan.Fill(input);

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

            // Act
            CieXyy actual = Converter.ToCieXyy(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);
            }
        }
Beispiel #3
0
        public void Convert_YCbCr_To_Rgb(float y, float cb, float cr, float r, float g, float b)
        {
            // Arrange
            var input    = new YCbCr(y, cb, cr);
            var expected = new Rgb(r, g, b);

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

            inputSpan.Fill(input);

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

            // Act
            var actual = Converter.ToRgb(input);

            Converter.Convert(inputSpan, actualSpan);

            // Assert
            Assert.Equal(Rgb.DefaultWorkingSpace, actual.WorkingSpace, ColorSpaceComparer);
            Assert.Equal(expected, actual, ColorSpaceComparer);

            for (int i = 0; i < actualSpan.Length; i++)
            {
                Assert.Equal(expected, actualSpan[i], ColorSpaceComparer);
            }
        }
        public void Convert_YCbCr_to_Cmyk(float y2, float cb, float cr, float c, float m, float y, float k)
        {
            // Arrange
            var input    = new YCbCr(y2, cb, cr);
            var expected = new Cmyk(c, m, y, k);

            Span <YCbCr> inputSpan = new YCbCr[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);
            }
        }