Support for applying colour transformation effects.
Use ColourFX to perform colour transformations on an input source. A Mode must be selected and any required Values defined prior to rendering.
SVG requires that the calculations are performed on non-premultiplied colour values. If the input graphics consists of premultiplied colour values, those values are automatically converted into non-premultiplied colour values for this operation.
The ColourFX class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Mode | INT | Defines the algorithm that will process the input source. | |||||||||||||||||||||||
| |||||||||||||||||||||||||
Values | DOUBLE [] | A list of input values for the algorithm defined by Mode. | |||||||||||||||||||||||
The meaning of the input values is dependent on the selected Mode. Each mode documents the total number of values that must be defined for them to work properly. When values are not defined, they default to 0. | |||||||||||||||||||||||||
XMLDef | STRING | Returns an SVG compliant XML string that describes the effect. |
The following actions are currently supported:
Name | Comment | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Draw | Render the effect to the target bitmap. | |||||||||||
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
|
Colour modes for ColourFX.
Name | Description |
---|---|
CM::BRIGHTNESS | Adjust brightness using the first parameter to define the intensity. |
CM::COLOURISE | Colourise the input with the first 3 parameters used as RGB multipliers and the fourth parameter controlling intensity from 0 - 1.0. |
CM::CONTRAST | Adjust contrast using the first parameter to define the intensity from -1.0 to 1.0. |
CM::DESATURATE | Desaturate the input completely so that it is rendered in greyscale. |
CM::HUE | Adjust the hue by 0 - 360 degrees using the first parameter. |
CM::HUE_ROTATE | Rotate the hue by 0 - 360 degrees, controlled by the first parameter. |
CM::LUMINANCE_ALPHA | Converts each RGB value to greyscale, which then overrides the alpha channel. |
CM::MATRIX | Process the supplied 5x4 matrix values. |
CM::NONE | Do nothing. |
CM::SATURATE | Adjust colour saturation with the first parameter defining the multiplier. |
Class Info | |
---|---|
ID | ID_COLOURFX |
Category | Graphics |
Include | modules/colourfx.h |
Version | 1 |