7#include <PhosphorAnimation/phosphoranimation_export.h>
42 std::unique_ptr<Curve>
clone()
const override;
49 static std::optional<Easing>
tryParse(
const QString& str);
125 return !(*
this == other);
132 static qreal solveElasticGain(qreal peak, qreal period);
134 static qreal evaluateElasticOut(qreal t, qreal peak, qreal per);
135 static qreal evaluateBounceOut(qreal t, qreal amp,
int n);
Easing(Easing &&)=default
qreal y1
Definition Easing.h:98
bool equals(const Curve &other) const override
Same typeId + same parameters.
static constexpr qreal MinElasticPeriod
Definition Easing.h:61
static constexpr qreal MaxElasticPeak
Highest peak an elastic curve may reach.
Definition Easing.h:59
static std::optional< Easing > tryParse(const QString &str)
Parse from config string.
static Easing fromString(const QString &str)
tryParse, or the default OutCubic when str is malformed.
qreal evaluate(qreal x) const override
Evaluate at normalized time t in [0,1]. May overshoot by design.
static constexpr qreal MaxElasticPeriod
Definition Easing.h:62
bool overshoots() const override
True if this curve may evaluate outside [0,1] during progression.
std::unique_ptr< Curve > clone() const override
Deep copy with identical parameters.
static qreal minElasticPeak(qreal period)
The gentlest bounce elastic can make at period — the low end of the overshoot range,...
int bounces
Bounce count. [1, 8].
Definition Easing.h:120
qreal x1
Bezier control points (P1, P2). x clamped [0,1]; y clamped [-1,2].
Definition Easing.h:97
qreal amplitude
Elastic: the PEAK VALUE the curve reaches, so 1.5 means it travels 50% past its target before settlin...
Definition Easing.h:115
QString toString() const override
Serialize to "typeId:params" or bare "x1,y1,x2,y2" for cubic-bezier.
QString typeId() const override
Stable identifier for this curve subclass (e.g. "bezier", "spring").
bool operator==(const Easing &other) const
qreal period
Elastic oscillation period: how FAST it wiggles.
Definition Easing.h:118
qreal y2
Definition Easing.h:100
Type
Definition Easing.h:22
@ CubicBezier
Definition Easing.h:23
Type type
Definition Easing.h:94
static constexpr int ElasticSolveIterations
Bisection steps used to invert the peak into an internal gain.
Definition Easing.h:67
bool operator!=(const Easing &other) const
Definition Easing.h:123
Easing & operator=(Easing &&)=default
Easing & operator=(const Easing &)=default
Easing(const Easing &)=default
qreal x2
Definition Easing.h:99
static qreal clampAmplitude(Type t, qreal amp, qreal period)
Clamp amp to the range the given curve type actually honours.
Definition AnimatedValue.h:32