#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()
◆ PrepareRenderData() [1/2]
Initializes the gradient data for render.
- Parameters
-
[in] | irs | A struct with information about the upcoming gradient calculation. |
- Returns
- RenderData on success.
◆ PrepareRenderDataWithAlpha() [1/2]
Initializes the gradient and the alpha gradint data for render.
- Parameters
-
[in] | irs | A struct with information about the upcoming gradient calculation. |
- Returns
- RenderData on success.
◆ PrepareRenderData() [2/2]
maxon::Result<maxon::GradientRenderData> PrepareRenderData |
( |
| ) |
const |
Initializes the gradient data for render. No color transformation is applied.
- Returns
- RenderData on success.
◆ PrepareRenderDataWithAlpha() [2/2]
Initializes the gradient data for render. No color transformation is applied.
- Returns
- RenderData on success.
◆ 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() [1/2]
Gets the alpha gradient.
- Returns
- The alpha gradient. The gradient data owns the pointed alpha gradient.
◆ GetAlphaGradient() [2/2]
const Gradient* GetAlphaGradient |
( |
| ) |
const |
◆ 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.