Blend2D
2D Vector Graphics Engine
Creates a default constructed gradient.
A default constructed gradient has BL_GRADIENT_TYPE_LINEAR type, all values set to zero, and has no color stops.
Move constructor.
The other
gradient is reset to its construction state after the move.
Copy constructor creates a weak copy of other
.
Move assignment operator, does the same as assign(other)
.
Copy assignment operator, does the same as assign(other)
.
Equality operator, performs the same operation as equals(other)
.
Inequality operator, performs the same operation as !equals(other)
.
Resets the gradient to its construction state.
reset()
can be used in tail calls in case other functions need to return BLResult. Swaps this gradient with other
.
Returns the type of the gradient.
Sets the type of the gradient.
Returns the gradient extend mode, see BLExtendMode.
Set the gradient extend mode, see BLExtendMode.
Resets the gradient extend mode to BL_EXTEND_MODE_PAD.
Tests whether the gradient is empty.
Empty gradient is considered any gradient that has no stops.
Returns the number of stops the gradient has.
Returns the gradient capacity [in stops].
Reserves the capacity of gradient for at least n
stops.
Shrinks the capacity of gradient stops to fit the current use.
Returns the gradient stop data.
Returns a gradient stop at i
.
Returns gradient stops and their count as BLArrayView<BLGradientStop>.
Move assignment of other
gradient to this gradient.
This function resets other
to its initialization state.
Copy assignment of other
gradient to this gradient.
This function creates a weak copy of other
gradient by increasing its reference count if other
is reference counted.
Resets all stops of the gradient.
After the operation the gradient will have no color stops.
Assigns colors stops of the gradient to stops
of size n
.
Assigns colors stops of the gradient to stops
.
Adds a color stop described as a 32-bit color rgba32
at the given offset
.
[0, 1]
range. Adds a color stop described as a 64-bit color rgba64
at the given offset
.
[0, 1]
range. Removes stop at the given index
.
indexOfStop()
, which returns index to the stop array. Removes stop at the given offset
, which should be in [0, 1]
range.
The all
parameter specifies whether all stops at the given offset should be removed as there are cases in which two stops can occupy the same offset to create sharp transitions. If all
is false and there is a sharp transition only the first stop would be removed. If all
is true both stops will be removed.
offset
. Removes all stops in the given range, which describes indexes in the stop array.
Removes all stops in the given interval [offsetMin, offsetMax]
, which specifies stop offsets, which are between [0, 1].
Replaces stop at the given index
with a new color stop described by offset
and rgba32
.
The operation leads to the same result as removeStop(index)
followed by addStop(offset, rgba32)
.
Replaces stop at the given index
with a new color stop described by offset
and rgba64
.
The operation leads to the same result as removeStop(index)
followed by addStop(offset, rgba64)
.
Returns the index of a color stop in stops[] array of the given offset
.
SIZE_MAX
is returned. Tests whether the gradient equals other
.
Returns the transformation matrix applied to the gradient.
Returns the type of the transformation matrix returned by transform()
.
Tests whether the gradient has a non-identity transformation matrix.
Applies a matrix operation to the current transformation matrix (internal).