◆
~Gradient()
成员函数文档编制
◆
Alloc()
Allocates a gradient data. Destroy the allocated gradient data with
Free()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
返回
-
The allocated gradient data, or
nullptr
if the allocation failed.
◆
Free()
static void Free
|
(
|
渐变
*&
|
grad
|
)
|
|
|
static
|
Destructs gradient data allocated with
Alloc()
。使用
AutoAlloc
to automate the allocation and destruction based on scope.
-
参数
-
[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.
-
返回
-
true
if the knots were successfully inverted, otherwise
false
.
◆
DoubleKnots()
Doubles the knots.
-
返回
-
true
if the knots were successfully doubled, otherwise
false
.
◆
DistributeKnots()
Distributes the knots evenly.
-
返回
-
true
if the knots were successfully distributed, otherwise
false
.
◆
FlushKnots()
Flushes all the knots.
◆
InitRender()
Initializes the gradient data for render.
-
注意
-
Call before
CalcGradientPixel()
.
-
参数
-
[in]
|
irs
|
A struct with information about the upcoming gradient calculation.
|
-
返回
-
true
if successful, otherwise
false
.
◆
FreeRender()
Frees the gradient data from render.
-
注意
-
Call after gradient calculation is finished.
◆
CalcGradientPixel()
向量
CalcGradientPixel
|
(
|
Float
|
pos
|
)
|
const
|
Calculates a gradient pixel.
-
参数
-
-
返回
-
The calculated gradient pixel.
◆
GetRenderKnot()
Gets a pointer to the knot at
index
between
InitRender()
and
FreeRender()
.
-
参数
-
-
返回
-
The render knot at
index
. The gradient data owns the pointed knot.
◆
GetRenderKnotCount()
Int32
GetRenderKnotCount
|
(
|
|
)
|
const
|
Gets the number of knots for
GetRenderKnot()
.
-
返回
-
The render knot count.
◆
GetKnotCount()
Int32
GetKnotCount
|
(
|
|
)
|
const
|
Gets the number of knots.
-
返回
-
The knot count.
◆
InsertKnot()
Inserts a knot.
-
参数
-
[in]
|
knot
|
The knot to insert.
|
-
返回
-
The index of the inserted knot:
GetKnotCount()
-
1
◆
RemoveKnot()
Removes a knot.
-
参数
-
-
返回
-
true
if the knot was successfully removed, otherwise
false
.
◆
GetKnot()
Gets the knot at
index
.
-
参数
-
-
返回
-
The knot.
◆
SetKnot()
Sets knot at
index
.
-
参数
-
[in]
|
index
|
The knot index.
0
<=
index
<
GetKnotCount()
|
[in]
|
k
|
The knot.
|
◆
GetData()
Gets data from the gradient container.
-
参数
-
-
返回
-
The data.
◆
SetData()
Sets data in the gradient container.
-
参数
-
-
返回
-
true
if successful, otherwise
false
.
◆
GetAlphaGradient()
渐变
* GetAlphaGradient
|
(
|
|
)
|
|
Gets the alpha gradient.
-
返回
-
The alpha gradient. The gradient data owns the pointed alpha gradient.
◆
AllocAlphaGradient()
渐变
* AllocAlphaGradient
|
(
|
|
)
|
|
Allocates an alpha gradient.
-
返回
-
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()
Bool
CopyFrom
|
(
|
const
渐变
*
|
src
|
)
|
|
Copies all gradient data from the source gradient.
-
由于
-
R19
-
参数
-
[in]
|
src
|
The source gradient.
|
-
返回
-
true
if successful, otherwise
false
.
◆
ConvertToAlphaGradient()
[2/2]
Converts a gradient within a container into an alpha gradient.
-
参数
-
[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.
-
返回
-
The checksum.
◆
GetGradient()
void GetGradient
|
(
|
maxon::Gradient &
|
gradient
|
)
|
const
|
Gets the internal gradient.
◆
SetGradient()
void SetGradient
|
(
|
maxon::Gradient &
|
gradient
|
)
|
|
Sets the internal gradient.