Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

DisplacementFX Class

Applies the displacement map filter effect.

This filter effect uses the pixel values from the image from Mix to spatially displace the image from Input. This is the transformation to be performed:

P'(x,y) <- P(x + Scale * (XC(x,y) - 0.5), y + Scale * (YC(x,y) - 0.5))

where P(x,y) is the Input image, and P'(x,y) is the Target. XC(x,y) and YC(x,y) are the component values of the channel designated by the XChannel and YChannel. For example, to use the red component of Mix to control displacement in X and the green component to control displacement in Y, set XChannel to CMP::RED and YChannel to CMP::GREEN.

The displacement map defines the inverse of the mapping performed.

The Input image is to remain premultiplied for this filter effect. The calculations using the pixel values from Mix are performed using non-premultiplied color values. If the image from Mix consists of premultiplied color values, those values are automatically converted into non-premultiplied color values before performing this operation.

Structure

The DisplacementFX class consists of the following fields:

Access
NameTypeComment
  ScaleDOUBLEDisplacement scale factor.

The amount is expressed in the coordinate system established by VectorFilter⇒PrimitiveUnits on the parent VectorFilter. When the value of this field is 0, this operation has no effect on the source image.

  XChannelINTX axis channel selection.
NameDescription
CMP::ALLAll colour channels.
CMP::ALPHAThe alpha channel.
CMP::BLUEThe blue colour channel.
CMP::GREENThe green colour channel.
CMP::REDThe red colour channel.
  XMLDefSTRINGReturns an SVG compliant XML string that describes the effect.
  YChannelINTY axis channel selection.
NameDescription
CMP::ALLAll colour channels.
CMP::ALPHAThe alpha channel.
CMP::BLUEThe blue colour channel.
CMP::GREENThe green colour channel.
CMP::REDThe red colour channel.

Actions

The following actions are currently supported:

DrawRender the effect to the target bitmap.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.
DisplacementFX class documentation © Paul Manias © 2010-2025

CMP Type

Component selection for RemapFX methods.

NameDescription
CMP::ALLAll colour channels.
CMP::ALPHAThe alpha channel.
CMP::BLUEThe blue colour channel.
CMP::GREENThe green colour channel.
CMP::REDThe red colour channel.
DisplacementFX module documentation © Paul Manias © 2010-2025