コード例 #1
0
        public void Convert_HunterLab_to_Cmyk(float l, float a, float b, float c, float m, float y, float k)
        {
            // Arrange
            var input    = new HunterLab(l, a, b);
            var expected = new Cmyk(c, m, y, k);

            Span <HunterLab> inputSpan = new HunterLab[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);
            }
        }
コード例 #2
0
        public void Convert_CieXyz_to_Cmyk(float x, float y2, float z, float c, float m, float y, float k)
        {
            // Arrange
            var input    = new CieXyz(x, y2, z);
            var expected = new Cmyk(c, m, y, k);

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

            inputSpan.Fill(input);

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

            // Act
            var actual = Converter.ToCmyk(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);
            }
        }
コード例 #3
0
        public void Convert_Hsv_to_Cmyk(float h, float s, float v, float c, float m, float y, float k)
        {
            // Arrange
            var input    = new Hsv(h, s, v);
            var expected = new Cmyk(c, m, y, k);

            Span <Hsv> inputSpan = new Hsv[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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        public void Convert_Rgb_To_Cmyk(float r, float g, float b, float c, float m, float y, float k)
        {
            // Arrange
            var input    = new Rgb(r, g, b);
            var expected = new Cmyk(c, m, y, k);

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

            inputSpan.Fill(input);

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

            // Act
            var actual = Converter.ToCmyk(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);
            }
        }
コード例 #6
0
        public void Convert_Rgb_To_Cmyk(float r, float g, float b, float c, float m, float y, float k)
        {
            // Arrange
            Rgb input = new Rgb(r, g, b);

            // Act
            Cmyk output = Converter.ToCmyk(input);

            // Assert
            Assert.Equal(c, output.C, FloatRoundingComparer);
            Assert.Equal(m, output.M, FloatRoundingComparer);
            Assert.Equal(y, output.Y, FloatRoundingComparer);
            Assert.Equal(k, output.K, FloatRoundingComparer);
        }