Exemple #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();
        }
 protected override void OnEffect(
     IImageProcessingContext <Rgba32> context)
 {
     context.GaussianBlur(10F);
 }
 protected override void Apply <TPixel>(IImageProcessingContext <TPixel> ctx, int value, Rectangle bounds) =>
 ctx.GaussianBlur(value, bounds);
 protected override void Apply <TPixel>(IImageProcessingContext <TPixel> ctx, int value) => ctx.GaussianBlur(value);
 public override void Process(IImageProcessingContext <Rgba32> context)
 {
     context.GaussianBlur(Config.sigma);
 }