HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
v1::animator< T > Class Template Reference

#include <hikogui/algorithm/animator.hpp>

Public Types

using value_type = T
 

Public Member Functions

 animator (std::chrono::nanoseconds animation_duration) noexcept
 Constructor.
 
animator_state update (value_type new_value, utc_nanoseconds current_time) noexcept
 Update the value and time.
 
animator_state is_animating () const noexcept
 Check if the animation is currently running.
 
value_type current_value () const noexcept
 The interpolated value between start and end value.
 

Detailed Description

template<arithmetic T>
class v1::animator< T >

A type that gets animated between two values.

Constructor & Destructor Documentation

◆ animator()

template<arithmetic T>
v1::animator< T >::animator ( std::chrono::nanoseconds animation_duration)
inlinenoexcept

Constructor.

Parameters
animation_durationThe duration to animate from start to end value.

Member Function Documentation

◆ current_value()

template<arithmetic T>
value_type v1::animator< T >::current_value ( ) const
inlinenoexcept

The interpolated value between start and end value.

◆ is_animating()

template<arithmetic T>
animator_state v1::animator< T >::is_animating ( ) const
inlinenoexcept

Check if the animation is currently running.

Returns
current animation state (idle, running or end).

◆ update()

template<arithmetic T>
animator_state v1::animator< T >::update ( value_type new_value,
utc_nanoseconds current_time )
inlinenoexcept

Update the value and time.

Parameters
new_valueThe value to animate toward.
current_timeThe current time.
Returns
current animation state (idle, running or end).

The documentation for this class was generated from the following file: