#include <customgui_gradient.h>
Gradient data type (CUSTOMDATATYPE_GRADIENT).
- Note
- Has to be created with Alloc() and destroyed with Free().
◆ Gradient()
◆ ~Gradient()
◆ Alloc()
Allocates a gradient data. Destroy the allocated gradient data with Free().
- Returns
- The allocated gradient data, or nullptr if the allocation failed.
◆ Free()
Destructs gradient data allocated with Alloc().
- Parameters
-
[in,out] | grad | The gradient data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ InvertKnots()
Inverts the knots.
- Returns
- true if knots were successfully inverted, otherwise false.
◆ DoubleKnots()
Doubles the knots.
- Returns
- true if knots were successfully doubled, otherwise false.
◆ FlushKnots()
◆ GetKnotCount()
Gets the number of knots.
- Returns
- The knot count.
◆ InsertKnot()
Inserts a knot.
- Parameters
-
[in] | knot | The knot to insert. |
- Returns
- The index of the inserted knot. GetKnotCount() - 1
◆ RemoveKnot()
Removes a knot.
- Parameters
-
- Returns
- true if knot was successfully removed, otherwise false.
◆ GetKnot()
Gets the knot at index.
- Parameters
-
- Returns
- The knot data.
◆ SetKnot()
Sets the data for a knot at index.
- Parameters
-
[in] | index | The knot index. 0 <= index < GetKnotCount() |
[in] | k | The knot information. |
◆ InitRender()
Initializes the gradient data for renderer.
- Returns
- true if the gradient data was successfully initialized for renderer, otherwise false.
◆ FreeRender()
Frees the gradient data from render.
- Note
- Call after gradient calculation is finished.
◆ GetRenderKnot()
Gets a pointer to the knot at index between InitRender() and FreeRender().
- Parameters
-
- Returns
- The knot at index. The gradient owns the pointed knot.
◆ GetRenderKnotCount()
Int32 GetRenderKnotCount |
( |
| ) |
|
Gets the number of knots for GetRenderKnot().
- Returns
- The render knot count.
◆ CalcGradientPixel()
Calculates a gradient pixel.
- Parameters
-
- Returns
- The calculated gradient pixel.
◆ GetData()
Gets data from the gradient container.
- Parameters
-
- Returns
- The data.
◆ SetData()
Sets data in the gradient container.
- Parameters
-
- Returns
- true if the gradient data was successfully set, otherwise false.
◆ GetAlphaGradient()
Gets the alpha gradient.
- Returns
- Alpha gradient. The gradient owns the pointed knot.
◆ AllocAlphaGradient()
Allocates an alpha gradient.
- Returns
- The allocated alpha gradient, or nullptr if the allocation failed.
◆ ConvertToAlphaGradient() [1/2]
void ConvertToAlphaGradient |
( |
| ) |
|
Converts this gradient to an alpha gradient.
◆ CopyFrom()
Copies all gradient data from the source gradient.
- Since
- R19
- Parameters
-
[in] | src | The source gradient. |
- Returns
- true if successful, otherwise false.
◆ ConvertToAlphaGradient() [2/2]
Converts a gradient within a container into an alpha gradient.
- Parameters
-
[in] | bc | The container holding the gradient. The caller owns the pointed container. |
[in] | id | The ID of the gradient within the container. |
◆ GetChecksum()
Gets a checksum of the whole gradient state, including the needles, colors and interpolation type.
- Returns
- The checksum.