Пример #1
0
        public static IImageProcessingContext <TPixel> Blur <TPixel>(this IImageProcessingContext <TPixel> source, Rectangle sourceRectangle, BlurMode mode, float radius) where TPixel : struct, IPixel <TPixel>
        {
            if (mode == BlurMode.Box)
            {
                return(source.BoxBlur((int)radius, sourceRectangle));
            }
            if (mode == BlurMode.Gaussian)
            {
                return(source.GaussianBlur(radius, sourceRectangle));
            }

            throw new NotImplementedException();
        }
Пример #2
0
 protected override void Apply(IImageProcessingContext ctx, int value, Rectangle bounds) =>
 ctx.BoxBlur(value, bounds);
Пример #3
0
 protected override void Apply(IImageProcessingContext ctx, int value) => ctx.BoxBlur(value);