#include <gradient.h>
This is the interface for the Gradient data type. The data is reference-counted and a copy will automatically be created if a non-const function is called. Alpha Gradients ONLY set Brightness, Color is always 1.0 Regular Gradients can set Brightness & Color
Public Member Functions | |
MAXON_METHOD Result< Gradient * > | AllocAlphaGradient () |
MAXON_METHOD Gradient * | GetAlphaGradient () |
MAXON_METHOD void | SetIsAlphaGradient (Bool alphaGradient) |
MAXON_METHOD Bool | IsAlphaGradient () const |
MAXON_METHOD COMPARERESULT | Compare (const GradientInterface *arg2) const |
MAXON_METHOD HashInt | GetHashCode () const |
MAXON_METHOD Result< GradientRenderData > | InitRender (const TransformColorDelegate &transformColorDelegate) const |
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL (GradientInterface, MAXON_REFERENCE_COPY_ON_WRITE, "net.maxon.interface.gradient") | |
Knots | |
MAXON_METHOD Int | GetKnotCount () const |
MAXON_METHOD Result< Int > | InsertKnot (const GradientKnot &knot, Bool keepId=false) |
MAXON_METHOD Result< void > | RemoveKnot (Int index) |
MAXON_METHOD GradientKnot | GetKnot (Int index) const |
MAXON_METHOD Result< void > | SetKnot (Int index, const GradientKnot &k) |
MAXON_METHOD void | ConvertToAlphaGradient () |
MAXON_METHOD void | SortKnots () |
MAXON_METHOD Result< Bool > | InvertKnots () |
MAXON_METHOD Result< Bool > | DoubleKnots () |
MAXON_METHOD Bool | DistributeKnots () |
MAXON_METHOD void | Flush () |
|
private |
MAXON_METHOD Result<Gradient*> AllocAlphaGradient | ( | ) |
Allocates an alpha gradient.
MAXON_METHOD Gradient* GetAlphaGradient | ( | ) |
Returns the internal alpha gradient.
MAXON_METHOD Int GetKnotCount | ( | ) | const |
Gets the number of knots.
MAXON_METHOD Result<Int> InsertKnot | ( | const GradientKnot & | knot, |
Bool | keepId = false |
||
) |
Inserts a knot.
[in] | knot | The knot to insert. |
[in] | keepId | Specifies if the knot ID should be taken from knot or if a new one should be generated. |
MAXON_METHOD Result<void> RemoveKnot | ( | Int | index | ) |
Removes a knot.
[in] | index | The knot index. 0 <= index < GetKnotCount() |
MAXON_METHOD GradientKnot GetKnot | ( | Int | index | ) | const |
Gets the knot at index.
[in] | index | The knot index. 0 <= index < GetKnotCount() |
MAXON_METHOD Result<void> SetKnot | ( | Int | index, |
const GradientKnot & | k | ||
) |
Sets knot at index.
[in] | index | The knot index. 0 <= index < GetKnotCount() |
[in] | k | The knot. |
MAXON_METHOD void ConvertToAlphaGradient | ( | ) |
Converts the current gradient to an alpha gradient.
MAXON_METHOD void SortKnots | ( | ) |
Sorts the knots according to their position.
MAXON_METHOD Result<Bool> InvertKnots | ( | ) |
Inverts the knots.
MAXON_METHOD Result<Bool> DoubleKnots | ( | ) |
Doubles the knots.
MAXON_METHOD Bool DistributeKnots | ( | ) |
Distributes the knots evenly.
MAXON_METHOD void Flush | ( | ) |
Flushes all the knots.
MAXON_METHOD void SetIsAlphaGradient | ( | Bool | alphaGradient | ) |
Sets the alpha mode.
[in] | alphaGradient | The gradient alpha type. |
MAXON_METHOD Bool IsAlphaGradient | ( | ) | const |
Checks if this is an alpha gradient.
MAXON_METHOD COMPARERESULT Compare | ( | const GradientInterface * | arg2 | ) | const |
Compares this with another gradient.
[in] | arg2 | The other gradient to compare with. |
MAXON_METHOD HashInt GetHashCode | ( | ) | const |
Gets the hash code for the gradient.
MAXON_METHOD Result<GradientRenderData> InitRender | ( | const TransformColorDelegate & | transformColorDelegate | ) | const |
Initializes the gradient for rendering.
[in] | transformColorDelegate | A delegate to transform the color of a gradient knot. |