コード例 #1
0
        public void FillOffCanvas()
        {
            var bounds    = new Rectangle(-100, -10, 10, 10);
            var brush     = new Mock <IBrush>();
            var options   = new GraphicsOptions(true);
            var processor = new FillRegionProcessor(brush.Object, new MockRegion1(), options);
            var img       = new Image <Rgba32>(10, 10);

            processor.Execute(img, bounds);
        }
コード例 #2
0
        public void FillOffCanvas()
        {
            var bounds  = new Rectangle(-100, -10, 10, 10);
            var brush   = new Mock <IBrush>();
            var options = new GraphicsOptions {
                Antialias = true
            };
            var processor = new FillRegionProcessor(options, brush.Object, new MockRegion1());
            var img       = new Image <Rgba32>(10, 10);

            processor.Execute(img.GetConfiguration(), img, bounds);
        }
コード例 #3
0
        [InlineData(false, 16, 4)] // we always do 4 sub=pixels when antialiasing is off.
        public void MinimumAntialiasSubpixelDepth(bool antialias, int antialiasSubpixelDepth, int expectedAntialiasSubpixelDepth)
        {
            var bounds = new Rectangle(0, 0, 1, 1);

            var brush  = new Mock <IBrush>();
            var region = new MockRegion2(bounds);

            var options = new GraphicsOptions(antialias)
            {
                AntialiasSubpixelDepth = 1
            };
            var processor = new FillRegionProcessor(brush.Object, region, options);
            var img       = new Image <Rgba32>(1, 1);

            processor.Execute(img, bounds);

            Assert.Equal(4, region.ScanInvocationCounter);
        }