コード例 #1
0
ファイル: OilPaintTest.cs プロジェクト: zxshinxz/ImageSharp
        public void ImageShouldApplyOilPaintFilterInBox <TPixel>(TestImageProvider <TPixel> provider, int levels, int brushSize)
            where TPixel : struct, IPixel <TPixel>
        {
            using (Image <TPixel> source = provider.GetImage())
                using (var image = new Image <TPixel>(source))
                {
                    var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);

                    image.OilPaint(levels, brushSize, bounds)
                    .DebugSave(provider, string.Join("-", levels, brushSize), Extensions.Bmp);

                    ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds, 0.001F);
                }
        }
コード例 #2
0
        public void ImageShouldApplyLomographFilterInBox <TPixel>(TestImageProvider <TPixel> provider)
            where TPixel : struct, IPixel <TPixel>
        {
            using (Image <TPixel> source = provider.GetImage())
                using (var image = new Image <TPixel>(source))
                {
                    var bounds = new Rectangle(10, 10, image.Width / 2, image.Height / 2);

                    image.Lomograph(bounds)
                    .DebugSave(provider, null, Extensions.Bmp);

                    ImageComparer.EnsureProcessorChangesAreConstrained(source, image, bounds);
                }
        }