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

RemapFX Class

Provides pixel remapping; equivalent to feComponentTransfer in SVG.

The RemapFX class provides an implementation of the feComponentTransfer functionality in SVG.

Internally the pixel rendering process is implemented using pixel lookup tables. As such this particular effect carries minimal overhead compared to most other effect classes.

Structure

The RemapFX class consists of the following fields:

Access
NameTypeComment
  XMLDefSTRINGReturns an SVG compliant XML string that describes the filter.

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.

Methods

The following methods are currently supported:

SelectDiscreteApply the discrete function to a pixel component.
ERR rf::SelectDiscrete(OBJECTPTR Object, CMP Component, DOUBLE * Values, INT Size)
ParameterDescription
ComponentThe pixel component to which the discrete function must be applied.
ValuesA list of values for the discrete function.
SizeTotal number of elements in the Values list.

This method will apply the table function to a selected RGBA pixel component. A list of values is required with a minimum size of 1.

SelectGammaApply the gamma function to a pixel component.
ERR rf::SelectGamma(OBJECTPTR Object, CMP Component, DOUBLE Amplitude, DOUBLE Offset, DOUBLE Exponent)
ParameterDescription
ComponentThe pixel component to which the gamma function must be applied.
AmplitudeThe amplitude of the gamma function.
OffsetThe offset of the gamma function.
ExponentThe exponent of the gamma function.

This method will apply the gamma function to a selected RGBA pixel component. The gamma function is written as C' = Amplitude * pow(C, Exponent) + Offset.

SelectIdentityApply the identity function to a pixel component.
ERR rf::SelectIdentity(OBJECTPTR Object, CMP Component)
ParameterDescription
ComponentThe pixel component to which the identity function must be applied.

Selecting the identity function for a pixel component will render it as its original value. By default, all pixels will use this function if no other option is chosen.

SelectInvertApply the invert function to a pixel component.
ERR rf::SelectInvert(OBJECTPTR Object, CMP Component)
ParameterDescription
ComponentThe pixel component to which the function must be applied.

This method will apply the invert function to a selected RGBA pixel component. The function is written as C' = 1.0 - C.

This feature is not compatible with SVG.

SelectLinearApply the linear function to a pixel component.
ERR rf::SelectLinear(OBJECTPTR Object, CMP Component, DOUBLE Slope, DOUBLE Intercept)
ParameterDescription
ComponentThe pixel component to which the function must be applied.
SlopeThe slope of the linear function.
InterceptThe intercept of the linear function.

This method will apply the linear function to a selected RGBA pixel component. The function is written as C' = (Slope * C) + Intercept.

SelectMaskApply the mask function to a pixel component.
ERR rf::SelectMask(OBJECTPTR Object, CMP Component, INT Mask)
ParameterDescription
ComponentThe pixel component to which the function must be applied.
MaskThe bit mask to be AND'd with each value.

This method will apply the mask function to a selected RGBA pixel component. The function is written as C' = C & Mask. This algorithm is particularly useful for lowering the bit depth of colours, e.g. a value of 0xf0 will reduce 8 bit colours to 4 bit.

This feature is not compatible with SVG.

SelectTableApply the table function to a pixel component.
ERR rf::SelectTable(OBJECTPTR Object, CMP Component, DOUBLE * Values, INT Size)
ParameterDescription
ComponentThe pixel component to which the table function must be applied.
ValuesA list of values for the table function.
SizeTotal number of elements in the value list.

This method will apply the table function to a selected RGBA pixel component. A list of values is required with a minimum size of 1.

If a single table value is supplied then the component will be output as a constant with no interpolation applied.

RemapFX 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.
RemapFX module documentation © Paul Manias © 2010-2025