class new in Git master
#include <Magnum/Ui/TextLayerAnimator.h>
TextLayerStyleAnimator Text layer style animator.
Base classes
- class AbstractVisualLayerStyleAnimator new in Git master
- Base for AbstractVisualLayer style animators.
Constructors, destructors, conversion operators
- TextLayerStyleAnimator(AnimatorHandle handle) explicit
- Constructor.
- TextLayerStyleAnimator(const AbstractStyleAnimator&) deleted
- Copying is not allowed.
- TextLayerStyleAnimator(TextLayerStyleAnimator&&) noexcept
- Move constructor.
Public functions
- auto operator=(const TextLayerStyleAnimator&) -> TextLayerStyleAnimator& deleted
- Copying is not allowed.
- auto operator=(TextLayerStyleAnimator&&) -> TextLayerStyleAnimator& noexcept
- Move assignment.
- auto create(UnsignedInt sourceStyle, UnsignedInt targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, DataHandle data, UnsignedInt repeatCount = 1, AnimationFlags flags = {}) -> AnimationHandle
- Create an animation.
-
template<class StyleIndex>auto create(StyleIndex sourceStyle, StyleIndex targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, DataHandle data, UnsignedInt repeatCount = 1, AnimationFlags flags = {}) -> AnimationHandle
- Create an animation with a style index in a concrete enum type.
- auto create(UnsignedInt sourceStyle, UnsignedInt targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, DataHandle data, AnimationFlags flags) -> AnimationHandle
- Create an animation.
-
template<class StyleIndex>auto create(StyleIndex sourceStyle, StyleIndex targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, DataHandle data, AnimationFlags flags) -> AnimationHandle
- Create an animation with a style index in a concrete enum type.
- auto create(UnsignedInt sourceStyle, UnsignedInt targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, LayerDataHandle data, UnsignedInt repeatCount = 1, AnimationFlags flags = {}) -> AnimationHandle
- Create an animation assuming the data it's attached to belongs to the layer the animator is registered with.
-
template<class StyleIndex>auto create(StyleIndex sourceStyle, StyleIndex targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, LayerDataHandle data, UnsignedInt repeatCount = 1, AnimationFlags flags = {}) -> AnimationHandle
- Create an animation with a style index in a concrete enum type assuming the data it's attached to belongs to the layer the animator is registered with.
- auto create(UnsignedInt sourceStyle, UnsignedInt targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, LayerDataHandle data, AnimationFlags flags) -> AnimationHandle
- Create an animation assuming the data it's attached to belongs to the layer the animator is registered with.
-
template<class StyleIndex>auto create(StyleIndex sourceStyle, StyleIndex targetStyle, Float(*)(Float) easing, Nanoseconds played, Nanoseconds duration, LayerDataHandle data, AnimationFlags flags) -> AnimationHandle
- Create an animation with a style index in a concrete enum type assuming the data it's attached to belongs to the layer the animator is registered with.
- void remove(AnimationHandle handle)
- Remove an animation.
- void remove(AnimatorDataHandle handle)
- Remove an animation assuming it belongs to this animator.
- auto easing(AnimationHandle) -> auto
- Animation easing function.
- auto easing(AnimatorDataHandle) -> auto
- Animation easing function assuming it belongs to this animator.
-
auto uniforms(AnimationHandle handle) const -> Containers::
Pair<TextLayerStyleUniform, TextLayerStyleUniform> - Animation source and target uniforms.
-
auto uniforms(AnimatorDataHandle handle) const -> Containers::
Pair<TextLayerStyleUniform, TextLayerStyleUniform> - Animation source and target uniforms assuming it belongs to this animator.
-
auto paddings(AnimationHandle handle) const -> Containers::
Pair<Vector4, Vector4> - Animation source and target paddings.
-
auto paddings(AnimatorDataHandle handle) const -> Containers::
Pair<Vector4, Vector4> - Animation source and target paddings assuming it belongs to this animator.
-
auto cursorUniforms(AnimationHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> - Animation source and destination cursor uniforms.
-
auto cursorUniforms(AnimatorDataHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> - Animation source and destination cursor uniforms assuming it belongs to this animator.
-
auto cursorPaddings(AnimationHandle handle) const -> Containers::
Optional<Containers:: Pair<Vector4, Vector4>> - Animation source and destination cursor paddings.
-
auto cursorPaddings(AnimatorDataHandle handle) const -> Containers::
Optional<Containers:: Pair<Vector4, Vector4>> - Animation source and destination cursor paddings assuming it belongs to this animator.
-
auto selectionUniforms(AnimationHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> - Animation source and destination selection uniforms.
-
auto selectionUniforms(AnimatorDataHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> - Animation source and destination selection uniforms assuming it belongs to this animator.
-
auto selectionPaddings(AnimationHandle handle) const -> Containers::
Optional<Containers:: Pair<Vector4, Vector4>> - Animation source and destination selection paddings.
-
auto selectionPaddings(AnimatorDataHandle handle) const -> Containers::
Optional<Containers:: Pair<Vector4, Vector4>> - Animation source and destination selection paddings assuming it belongs to this animator.
-
auto selectionTextUniforms(AnimationHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform>> - Animation source and destination selection text uniforms.
-
auto selectionTextUniforms(AnimatorDataHandle handle) const -> Containers::
Optional<Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform>> - Animation source and destination selection text uniforms assuming it belongs to this animator.
-
auto advance(Containers::
BitArrayView active, const Containers:: StridedArrayView1D<const Float>& factors, Containers:: BitArrayView remove, Containers:: ArrayView<TextLayerStyleUniform> dynamicStyleUniforms, Containers:: MutableBitArrayView dynamicStyleCursorStyles, Containers:: MutableBitArrayView dynamicStyleSelectionStyles, const Containers:: StridedArrayView1D<Vector4>& dynamicStylePaddings, Containers:: ArrayView<TextLayerEditingStyleUniform> dynamicEditingStyleUniforms, const Containers:: StridedArrayView1D<Vector4>& dynamicEditingStylePaddings, const Containers:: StridedArrayView1D<UnsignedInt>& dataStyles) -> TextLayerStyleAnimations - Advance the animations.
Function documentation
Magnum:: Ui:: TextLayerStyleAnimator:: TextLayerStyleAnimator(AnimatorHandle handle) explicit
Constructor.
Parameters | |
---|---|
handle | Handle returned by AbstractUserInterface:: |
Magnum:: Ui:: TextLayerStyleAnimator:: TextLayerStyleAnimator(TextLayerStyleAnimator&&) noexcept
Move constructor.
Performs a destructive move, i.e. the original object isn't usable afterwards anymore.
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(UnsignedInt sourceStyle,
UnsignedInt targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
DataHandle data,
UnsignedInt repeatCount = 1,
AnimationFlags flags = {})
Create an animation.
Parameters | |
---|---|
sourceStyle | Style index to animate from |
targetStyle | Style index to animate to |
easing | Easing function between 0.0f and 1.0f , used for all style uniform values as well as the padding. Pick one from Animation:: |
played | Time at which the animation is played. Use Nanoseconds:: |
duration | Duration of a single play of the animation |
data | Data the animation is attached to. Use DataHandle:: |
repeatCount | Repeat count. Use 0 for an indefinitely repeating animation. |
flags | Flags |
Expects that TextLayer::sourceStyle
and targetStyle
are less than TextLayer::easing
is not nullptr
.
Delegates to AbstractAnimator::
The animation affects the TextLayerStyleUniform and the padding value, if it differs between the styles. The animated dynamic style is initialized from font, alignment and features from styleSrc
, if styleDst
has them different, they don't affect the animation in any way. If given style references a cursor or editing style, it affects also the corresponding TextLayerEditingStyleUniform, the editing padding value, if it differs between the editing styles, and the TextLayerStyleUniform override for selected portions of the text, if referenced.
template<class StyleIndex>
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(StyleIndex sourceStyle,
StyleIndex targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
DataHandle data,
UnsignedInt repeatCount = 1,
AnimationFlags flags = {})
Create an animation with a style index in a concrete enum type.
Casts sourceStyle
and targetStyle
to UnsignedInt and delegates to create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, DataHandle, UnsignedInt, AnimationFlags).
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(UnsignedInt sourceStyle,
UnsignedInt targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
DataHandle data,
AnimationFlags flags)
Create an animation.
Same as calling create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, DataHandle, UnsignedInt, AnimationFlags) with repeatCount
set to 1
.
template<class StyleIndex>
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(StyleIndex sourceStyle,
StyleIndex targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
DataHandle data,
AnimationFlags flags)
Create an animation with a style index in a concrete enum type.
Casts sourceStyle
and targetStyle
to UnsignedInt and delegates to create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, DataHandle, AnimationFlags).
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(UnsignedInt sourceStyle,
UnsignedInt targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
LayerDataHandle data,
UnsignedInt repeatCount = 1,
AnimationFlags flags = {})
Create an animation assuming the data it's attached to belongs to the layer the animator is registered with.
Compared to create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, DataHandle, UnsignedInt, AnimationFlags) delegates to AbstractAnimator::
template<class StyleIndex>
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(StyleIndex sourceStyle,
StyleIndex targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
LayerDataHandle data,
UnsignedInt repeatCount = 1,
AnimationFlags flags = {})
Create an animation with a style index in a concrete enum type assuming the data it's attached to belongs to the layer the animator is registered with.
Casts sourceStyle
and targetStyle
to UnsignedInt and delegates to create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, LayerDataHandle, UnsignedInt, AnimationFlags).
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(UnsignedInt sourceStyle,
UnsignedInt targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
LayerDataHandle data,
AnimationFlags flags)
Create an animation assuming the data it's attached to belongs to the layer the animator is registered with.
Same as calling create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, LayerDataHandle, UnsignedInt, AnimationFlags) with repeatCount
set to 1
.
template<class StyleIndex>
AnimationHandle Magnum:: Ui:: TextLayerStyleAnimator:: create(StyleIndex sourceStyle,
StyleIndex targetStyle,
Float(*)(Float) easing,
Nanoseconds played,
Nanoseconds duration,
LayerDataHandle data,
AnimationFlags flags)
Create an animation with a style index in a concrete enum type assuming the data it's attached to belongs to the layer the animator is registered with.
Casts sourceStyle
and targetStyle
to UnsignedInt and delegates to create(UnsignedInt, UnsignedInt, Float(*)(Float), Nanoseconds, Nanoseconds, LayerDataHandle, UnsignedInt, AnimationFlags).
void Magnum:: Ui:: TextLayerStyleAnimator:: remove(AnimationHandle handle)
Remove an animation.
Expects that handle
is valid. Recycles a dynamic style used by given animation with TextLayer::
void Magnum:: Ui:: TextLayerStyleAnimator:: remove(AnimatorDataHandle handle)
Remove an animation assuming it belongs to this animator.
Compared to remove(AnimationHandle) delegates to AbstractAnimator::
auto Magnum:: Ui:: TextLayerStyleAnimator:: easing(AnimationHandle)
Animation easing function.
Expects that handle
is valid. The returned pointer is never nullptr
.
auto Magnum:: Ui:: TextLayerStyleAnimator:: easing(AnimatorDataHandle)
Animation easing function assuming it belongs to this animator.
Like easing(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform> Magnum:: Ui:: TextLayerStyleAnimator:: uniforms(AnimationHandle handle) const
Animation source and target uniforms.
Expects that handle
is valid. The uniforms are queried from TextLayer::
Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform> Magnum:: Ui:: TextLayerStyleAnimator:: uniforms(AnimatorDataHandle handle) const
Animation source and target uniforms assuming it belongs to this animator.
Like uniforms(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Pair<Vector4, Vector4> Magnum:: Ui:: TextLayerStyleAnimator:: paddings(AnimationHandle handle) const
Animation source and target paddings.
Expects that handle
is valid. The paddings are queried from TextLayer::
Containers:: Pair<Vector4, Vector4> Magnum:: Ui:: TextLayerStyleAnimator:: paddings(AnimatorDataHandle handle) const
Animation source and target paddings assuming it belongs to this animator.
Like paddings(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: cursorUniforms(AnimationHandle handle) const
Animation source and destination cursor uniforms.
Expects that handle
is valid. The uniforms are queried from TextLayer::
Containers:: Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: cursorUniforms(AnimatorDataHandle handle) const
Animation source and destination cursor uniforms assuming it belongs to this animator.
Like cursorUniforms(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Optional<Containers:: Pair<Vector4, Vector4>> Magnum:: Ui:: TextLayerStyleAnimator:: cursorPaddings(AnimationHandle handle) const
Animation source and destination cursor paddings.
Expects that handle
is valid. The paddings are queried from TextLayer::
Containers:: Optional<Containers:: Pair<Vector4, Vector4>> Magnum:: Ui:: TextLayerStyleAnimator:: cursorPaddings(AnimatorDataHandle handle) const
Animation source and destination cursor paddings assuming it belongs to this animator.
Like cursorPaddings(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionUniforms(AnimationHandle handle) const
Animation source and destination selection uniforms.
Expects that handle
is valid. The uniforms are queried from TextLayer::
Containers:: Optional<Containers:: Pair<TextLayerEditingStyleUniform, TextLayerEditingStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionUniforms(AnimatorDataHandle handle) const
Animation source and destination selection uniforms assuming it belongs to this animator.
Like selectionUniforms(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Optional<Containers:: Pair<Vector4, Vector4>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionPaddings(AnimationHandle handle) const
Animation source and destination selection paddings.
Expects that handle
is valid. The paddings are queried from TextLayer::
Containers:: Optional<Containers:: Pair<Vector4, Vector4>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionPaddings(AnimatorDataHandle handle) const
Animation source and destination selection paddings assuming it belongs to this animator.
Like selectionPaddings(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
Containers:: Optional<Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionTextUniforms(AnimationHandle handle) const
Animation source and destination selection text uniforms.
Expects that handle
is valid. The uniforms are queried from TextLayer::
Containers:: Optional<Containers:: Pair<TextLayerStyleUniform, TextLayerStyleUniform>> Magnum:: Ui:: TextLayerStyleAnimator:: selectionTextUniforms(AnimatorDataHandle handle) const
Animation source and destination selection text uniforms assuming it belongs to this animator.
Like selectionTextUniforms(AnimationHandle) const but without checking that handle
indeed belongs to this animator. See its documentation for more information.
TextLayerStyleAnimations Magnum:: Ui:: TextLayerStyleAnimator:: advance(Containers:: BitArrayView active,
const Containers:: StridedArrayView1D<const Float>& factors,
Containers:: BitArrayView remove,
Containers:: ArrayView<TextLayerStyleUniform> dynamicStyleUniforms,
Containers:: MutableBitArrayView dynamicStyleCursorStyles,
Containers:: MutableBitArrayView dynamicStyleSelectionStyles,
const Containers:: StridedArrayView1D<Vector4>& dynamicStylePaddings,
Containers:: ArrayView<TextLayerEditingStyleUniform> dynamicEditingStyleUniforms,
const Containers:: StridedArrayView1D<Vector4>& dynamicEditingStylePaddings,
const Containers:: StridedArrayView1D<UnsignedInt>& dataStyles)
Advance the animations.
Parameters | |
---|---|
active in | Animation IDs that are active |
factors in | Interpolation factors indexed by animation ID |
remove in | Animation IDs to be removed |
dynamicStyleUniforms in/out | Uniforms to animate indexed by dynamic style ID or dynamic editing style text uniform ID |
dynamicStyleCursorStyles in/out | Cursor style association to animate indexed by dynamic style ID |
dynamicStyleSelectionStyles in/out | Selection style association to animate indexed by dynamic style ID |
dynamicStylePaddings in/out | Paddings to animate indexed by dynamic style ID |
dynamicEditingStyleUniforms in/out | Editing uniforms to animate indexed by dynamic editing style ID |
dynamicEditingStylePaddings in/out | Editing paddings to animate indexed by dynamic editing style ID |
dataStyles in/out | Style assignments of all layer data indexed by data ID |
Returns | Style properties that were affected by the animation |
Used internally from TextLayer::
Expects that size of active
, factors
and remove
matches capacity(), it's assumed that their contents were filled by update() before. Assuming the layer the animator is associated with doesn't contain editing styles, the dynamicStyleUniforms
, dynamicStyleCursorStyles
, dynamicStyleSelectionStyles
and dynamicStylePaddings
, are expected to all have the same size and should be large enough to contain any valid dynamic style ID, the dynamicEditingStyleUniforms
and dynamicEditingStylePaddings
views are then expected to be empty. Assuming the layer contains editing styles, the dynamicStyleUniforms
is expected to be three times as large as the others, and the dynamicEditingStyleUniforms
and dynamicEditingStylePaddings
views twice as large as the others instead. The dataStyles
view should be large enough to contain any valid layer data ID.