DisplacementMapPrimitive Class
A primitive that moves the pixels of its input by the colors of a map: feDisplacementMap of SVG.
public sealed class DisplacementMapPrimitive : FilterPrimitiveRemarks
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
FilterPrimitiveDisplacementMapPrimitive
Constructors
| Name | Description |
|---|---|
| DisplacementMapPrimitive(double, FilterInput) | Initializes a new instance of the DisplacementMapPrimitive class. |
DisplacementMapPrimitive(double, FilterInput)
DisplacementMapPrimitive.csInitializes a new instance of the DisplacementMapPrimitive class.
public DisplacementMapPrimitive(double scale, FilterInput map)Parameters
scaledouble- How far a component of 0 or 1 moves a pixel, twice, in units of the drawing:
scale. mapFilterInput- The map:
in2.
Exceptions
ArgumentExceptionscaleis not a finite number.ArgumentOutOfRangeException- The magnitude of
scaleexceeds 16777216.
Properties
| Name | Description |
|---|---|
| Input | Gets the input: in. |
| Map | Gets the map: in2. |
| Scale | Gets how far a component of 0 or 1 moves a pixel, twice. |
| XChannel | Gets the component of the map that moves the pixels along x: xChannelSelector. Defaults to FilterChannel.Alpha. |
| YChannel | Gets the component of the map that moves the pixels along y: yChannelSelector. Defaults to FilterChannel.Alpha. |
XChannel
DisplacementMapPrimitive.csGets the component of the map that moves the pixels along x: xChannelSelector. Defaults to FilterChannel.Alpha.
public FilterChannel XChannel { get; init; }YChannel
DisplacementMapPrimitive.csGets the component of the map that moves the pixels along y: yChannelSelector. Defaults to FilterChannel.Alpha.
public FilterChannel YChannel { get; init; }