BLGradient Class Referencefinal [¶]
Gradient [C++ API].
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.
This operation always succeeds and returns BL_SUCCESS. The return value is provided for convenience so reset()
can be used in tail calls in case other functions need to return BLResult.
Swaps this gradient with other
.
This operation always succeeds.
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
.
Adds a color stop described as a 32-bit color rgba32
at the given offset
.
The offset value must be in [0, 1]
range.
Adds a color stop described as a 64-bit color rgba64
at the given offset
.
The offset value must be in [0, 1]
range.
Removes stop at the given index
.
This function should be used together with index_of_stop()
, 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.
There are never 3 stops occupying the same offset
.
Removes all stops in the given range, which describes indexes in the stop array.
Removes all stops in the given interval [offset_min, offset_max]
, 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 remove_stop(index)
followed by add_stop(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 remove_stop(index)
followed by add_stop(offset, rgba64)
.
Returns the index of a color stop in stops[] array of the given offset
.
If there is no such offset, SIZE_MAX
is returned.
Tests whether the gradient equals other
.
The equality check returns true if both gradients are the same value-wise.
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).