private static void PaintWhite(Buffer2DRegion <L8> region)
        {
            var white = new L8(255);

            for (int y = 0; y < region.Height; y++)
            {
                region.GetRowSpan(y).Fill(white);
            }
        }
Пример #2
0
        public void GetRowSpan(int bufferCapacity, int rx, int ry, int y, int w, int h)
        {
            this.memoryAllocator.BufferCapacityInBytes = sizeof(int) * bufferCapacity;

            using Buffer2D <int> buffer = this.CreateTestBuffer(20, 30);
            var r = new Rectangle(rx, ry, w, h);

            Buffer2DRegion <int> region = buffer.GetRegion(r);

            Span <int> span = region.GetRowSpan(y);

            Assert.Equal(w, span.Length);

            for (int i = 0; i < w; i++)
            {
                int expected = ((ry + y) * 100) + rx + i;
                int value    = span[i];

                Assert.Equal(expected, value);
            }
        }