Ejemplo n.º 1
0
        public void ReadWriteImage()
        {
            var dt = new DitherTestClass();

            const int xsize= 100;
            const int ysize = 100;

            var b1 = new Bitmap(xsize, ysize);
            var b2 = dt.Process(b1);

            for (int x = 0; x < xsize; x++)
            {
                for (int y = 0; y < ysize; y++)
                {
                    Color col = b2.GetPixel(x, y);

                    if ((x + y) % 2 == 0)
                    {
                        Assert.AreEqual(255, col.R);
                        Assert.AreEqual(255, col.G);
                        Assert.AreEqual(255, col.B);
                    }
                    else
                    {
                        Assert.AreEqual(0, col.R);
                        Assert.AreEqual(0, col.G);
                        Assert.AreEqual(0, col.B);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void ReadWriteImage()
        {
            var dt = new DitherTestClass();

            const int WIDTH  = 100;
            const int HEIGHT = 100;

            var b1 = new Bitmap(WIDTH, HEIGHT);
            var b2 = dt.Process(b1);

            for (int x = 0; x < WIDTH; x++)
            {
                for (int y = 0; y < HEIGHT; y++)
                {
                    Color col = b2.GetPixel(x, y);

                    if ((x + y) % 2 == 0)
                    {
                        col.R.Should().Be(255);
                        col.G.Should().Be(255);
                        col.B.Should().Be(255);
                    }
                    else
                    {
                        col.R.Should().Be(0);
                        col.G.Should().Be(0);
                        col.B.Should().Be(0);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void ReadWriteImage()
        {
            var dt = new DitherTestClass();

            const int XSIZE = 100;
            const int YSIZE = 100;

            var b1 = new Bitmap(XSIZE, YSIZE);
            var b2 = dt.Process(b1);

            for (int x = 0; x < XSIZE; x++)
            {
                for (int y = 0; y < YSIZE; y++)
                {
                    Color col = b2.GetPixel(x, y);

                    if ((x + y) % 2 == 0)
                    {
                        col.R.Should().Be(255);
                        col.G.Should().Be(255);
                        col.B.Should().Be(255);
                    }
                    else
                    {
                        col.R.Should().Be(0);
                        col.G.Should().Be(0);
                        col.B.Should().Be(0);
                    }
                }
            }
        }