#include <customgui_gradient.h>
Gradient data type (CUSTOMDATATYPE_GRADIENT) for GradientCustomGui.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
◆ Gradient()
◆ ~Gradient()
◆ Alloc()
Allocates a gradient data. Destroy the allocated gradient data with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Returns
- The allocated gradient data, or nullptr if the allocation failed.
◆ Free()
Destructs gradient data allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- 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 the knots were successfully inverted, otherwise false.
◆ DoubleKnots()
Doubles the knots.
- Returns
- true if the knots were successfully doubled, otherwise false.
◆ DistributeKnots()
Distributes the knots evenly.
- Returns
- true if the knots were successfully distributed, otherwise false.
◆ FlushKnots()
◆ InitRender()
Initializes the gradient data for render.
- Note
- Call before CalcGradientPixel().
- Parameters
-
[in] | irs | A struct with information about the upcoming gradient calculation. |
- Returns
- true if successful, otherwise false.
◆ FreeRender()
Frees the gradient data from render.
- Note
- Call after gradient calculation is finished.
◆ CalcGradientPixel()
Calculates a gradient pixel.
- Parameters
-
- Returns
- The calculated gradient pixel.
◆ GetRenderKnot()
Gets a pointer to the knot at index between InitRender() and FreeRender().
- Parameters
-
- Returns
- The render knot at index. The gradient data owns the pointed knot.
◆ GetRenderKnotCount()
Int32 GetRenderKnotCount |
( |
| ) |
const |
Gets the number of knots for GetRenderKnot().
- Returns
- The render knot count.
◆ GetKnotCount()
Int32 GetKnotCount |
( |
| ) |
const |
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 the knot was successfully removed, otherwise false.
◆ GetKnot()
Gets the knot at index.
- Parameters
-
- Returns
- The knot.
◆ SetKnot()
Sets knot at index.
- Parameters
-
◆ GetData()
Gets data from the gradient container.
- Parameters
-
- Returns
- The data.
◆ SetData()
Sets data in the gradient container.
- Parameters
-
- Returns
- true if successful, otherwise false.
◆ GetAlphaGradient()
Gets the alpha gradient.
- Returns
- The alpha gradient. The gradient data owns the pointed alpha gradient.
◆ AllocAlphaGradient()
Allocates an alpha gradient.
- Returns
- The allocated alpha gradient, or nullptr if the allocation failed. The gradient data owns the pointed alpha gradient.
◆ 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 knots, colors and interpolation type.
- Returns
- The checksum.
◆ GetGradient()
void GetGradient |
( |
maxon::Gradient & |
gradient | ) |
const |
Gets the internal gradient.
◆ SetGradient()
void SetGradient |
( |
maxon::Gradient & |
gradient | ) |
|
Sets the internal gradient.