DisplacementMapPrimitive Class

A primitive that moves the pixels of its input by the colors of a map: feDisplacementMap of SVG.

public sealed class DisplacementMapPrimitive : FilterPrimitive

Remarks

A pixel (x, y) of the result is the pixel of the input nearest to (x + scale (X - 1/2), y + scale (Y - 1/2)), with X and Y the components of the pixel of the map that DisplacementMapPrimitive.XChannel and DisplacementMapPrimitive.YChannel select, the colors without their alpha, in the colors of the primitive; the scale goes through the scale of each axis on the canvas. The input is read in its own colors, which the result keeps, as in SVG. What comes from beyond the subregion of the input is transparent.

Inheritance
FilterPrimitive DisplacementMapPrimitive

Constructors

NameDescription
DisplacementMapPrimitive(double, FilterInput)Initializes a new instance of the DisplacementMapPrimitive class.

DisplacementMapPrimitive(double, FilterInput)

DisplacementMapPrimitive.cs

Initializes a new instance of the DisplacementMapPrimitive class.

public DisplacementMapPrimitive(double scale, FilterInput map)

Parameters

scale double
How far a component of 0 or 1 moves a pixel, twice, in units of the drawing: scale.
map FilterInput
The map: in2.

Exceptions

ArgumentException
scale is not a finite number.
ArgumentOutOfRangeException
The magnitude of scale exceeds 16777216.

Properties

NameDescription
InputGets the input: in.
MapGets the map: in2.
ScaleGets how far a component of 0 or 1 moves a pixel, twice.
XChannelGets the component of the map that moves the pixels along x: xChannelSelector. Defaults to FilterChannel.Alpha.
YChannelGets the component of the map that moves the pixels along y: yChannelSelector. Defaults to FilterChannel.Alpha.

Gets the input: in.

public FilterInput Input { get; init; }

Property value

FilterInput

Gets the map: in2.

public FilterInput Map { get; }

Property value

FilterInput

Gets how far a component of 0 or 1 moves a pixel, twice.

public double Scale { get; }

Property value

double

Gets the component of the map that moves the pixels along x: xChannelSelector. Defaults to FilterChannel.Alpha.

public FilterChannel XChannel { get; init; }

Property value

FilterChannel

Exceptions

ArgumentOutOfRangeException
The value is not a defined FilterChannel.

Gets the component of the map that moves the pixels along y: yChannelSelector. Defaults to FilterChannel.Alpha.

public FilterChannel YChannel { get; init; }

Property value

FilterChannel

Exceptions

ArgumentOutOfRangeException
The value is not a defined FilterChannel.