7#include <PhosphorAnimation/phosphoranimation_export.h>
40 std::unique_ptr<Curve>
clone()
const override;
53 static constexpr qreal MaxElasticPeak = 2.0;
55 static constexpr qreal MinElasticPeriod = 0.1;
56 static constexpr qreal MaxElasticPeriod = 1.0;
61 static constexpr int ElasticSolveIterations = 24;
88 Type type = Type::CubicBezier;
109 qreal amplitude = 1.0;
119 return !(*
this == other);
126 static qreal solveElasticGain(qreal peak, qreal period);
128 static qreal evaluateElasticOut(qreal t, qreal peak, qreal per);
129 static qreal evaluateBounceOut(qreal t, qreal amp,
int n);
Polymorphic base for all animation curves.
Definition Curve.h:45
Parametric easing curve: cubic bezier, elastic, or bounce.
Definition Easing.h:18
Easing(Easing &&)=default
bool equals(const Curve &other) const override
Same typeId + same parameters.
static Easing fromString(const QString &str)
Parse from config string. Returns default OutCubic on failure.
qreal evaluate(qreal x) const override
Evaluate at normalized time t in [0,1]. May overshoot by design.
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,...
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
Type
Definition Easing.h:20
bool operator!=(const Easing &other) const
Definition Easing.h:117
Easing & operator=(Easing &&)=default
Easing & operator=(const Easing &)=default
Easing(const Easing &)=default
static qreal clampAmplitude(Type t, qreal amp, qreal period)
Clamp amp to the range the given curve type actually honours.
Definition AnimatedValue.h:32