BlurFilter Class

A Gaussian blur, of one standard deviation or of one per axis: blur() of CSS, feGaussianBlur of SVG.

public sealed class BlurFilter : Filter

Remarks

Below a deviation of 2 pixels, the weights are those of ImageProcessingExtensions.GaussianBlur (three standard deviations on each side); from 2 pixels, the blur is three successive box blurs of d = floor(3 sqrt(2 pi) s / 4 + 1/2) pixels, as "Filter Effects Module Level 1" defines it and browsers draw it, whose cost does not grow with the deviation. The rows are blurred, then the columns. What is read beyond the edges of what is filtered is given by BlurFilter.EdgeMode; a deviation of zero leaves its axis as it is.

Inheritance
Filter BlurFilter

Constructors

NameDescription
BlurFilter(double)Initializes a new instance of the BlurFilter class with the same standard deviation along both axes.
BlurFilter(double, double)Initializes a new instance of the BlurFilter class with a standard deviation per axis.

BlurFilter overloads

BlurFilter(double)

BlurFilter.cs

Initializes a new instance of the BlurFilter class with the same standard deviation along both axes.

public BlurFilter(double sigma)
Parameters
sigma double
The standard deviation, in units of the drawing. Must be between 0 and 10000.
Exceptions
ArgumentException
sigma is not a finite number.
ArgumentOutOfRangeException
sigma is negative or exceeds 10000.

BlurFilter(double, double)

BlurFilter.cs

Initializes a new instance of the BlurFilter class with a standard deviation per axis.

public BlurFilter(double sigmaX, double sigmaY)
Parameters
sigmaX double
The standard deviation along x, in units of the drawing. Must be between 0 and 10000.
sigmaY double
The standard deviation along y, in units of the drawing. Must be between 0 and 10000.
Exceptions
ArgumentException
A standard deviation is not a finite number.
ArgumentOutOfRangeException
A standard deviation is negative or exceeds 10000.

Properties

NameDescription
EdgeModeGets what the blur reads beyond the edges of what it filters: the edges of the canvas for a drawing, the edges of the rectangle for a backdrop (which is always mirrored). Defaults to FilterEdgeMode.Transparent.
SigmaXGets the standard deviation along x.
SigmaYGets the standard deviation along y.

Gets what the blur reads beyond the edges of what it filters: the edges of the canvas for a drawing, the edges of the rectangle for a backdrop (which is always mirrored). Defaults to FilterEdgeMode.Transparent.

public FilterEdgeMode EdgeMode { get; init; }

Property value

FilterEdgeMode

Exceptions

ArgumentOutOfRangeException
The value is not a defined FilterEdgeMode.

Gets the standard deviation along x.

public double SigmaX { get; }

Property value

double

Gets the standard deviation along y.

public double SigmaY { get; }

Property value

double