HypernovaDesktop Components · docs
Binarymission
WPFShaders Library › ChromaticSplitEffect

ChromaticSplitEffect

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Shaders.Library.CustomEffects

A pixel shader effect that separates the red and blue channels of its input radially, leaving green in place - the colour fringing a cheap lens leaves at the corners of a photograph.

public class ChromaticSplitEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

The separation grows with the distance from CenterXY, so the middle of the picture stays sharp and the corners fringe. Animating Displacement over a small range reads as a focus pull; over a large one, as a glitch.

Members at a glance

ChromaticSplitEffectInitializes a new instance of the ChromaticSplitEffect class.
CenterXYThe point the separation radiates from, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right.
DisplacementHow far the red and blue channels are pushed apart at the edge of the element. Zero leaves the input untouched; a useful range is about 0.005 to 0.08.
InputThe image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
CenterXYPropertyIdentifies the CenterXY dependency property.
DisplacementPropertyIdentifies the Displacement dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

ChromaticSplitEffect

public ChromaticSplitEffect()

Initializes a new instance of the ChromaticSplitEffect class.

Properties

CenterXY

public Point CenterXY

The point the separation radiates from, in texture coordinates, where (0,0) is the top left of the element and (1,1) the bottom right.

Displacement

public double Displacement

How far the red and blue channels are pushed apart at the edge of the element. Zero leaves the input untouched; a useful range is about 0.005 to 0.08.

Input

public Brush Input

The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.

Fields

CenterXYProperty

public static readonly DependencyProperty CenterXYProperty

Identifies the CenterXY dependency property.

DisplacementProperty

public static readonly DependencyProperty DisplacementProperty

Identifies the Displacement dependency property.

InputProperty

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.