8#include <QtCore/qglobal.h>
12#include <QtCore/qcompare.h>
13#include <QtCore/qlist.h>
14#include <QtCore/qobjectdefs.h>
18class QEasingCurvePrivate;
26 InQuad, OutQuad, InOutQuad, OutInQuad,
27 InCubic, OutCubic, InOutCubic, OutInCubic,
28 InQuart, OutQuart, InOutQuart, OutInQuart,
29 InQuint, OutQuint, InOutQuint, OutInQuint,
30 InSine, OutSine, InOutSine, OutInSine,
31 InExpo, OutExpo, InOutExpo, OutInExpo,
32 InCirc, OutCirc, InOutCirc, OutInCirc,
33 InElastic, OutElastic, InOutElastic, OutInElastic,
34 InBack, OutBack, InOutBack, OutInBack,
35 InBounce, OutBounce, InOutBounce, OutInBounce,
36 InCurve, OutCurve, SineCurve, CosineCurve,
37 BezierSpline, TCBSpline, Custom, NCurveTypes
41 QEasingCurve(Type type = Linear);
42 QEasingCurve(
const QEasingCurve &other);
45 QEasingCurve &operator=(
const QEasingCurve &other)
46 {
if (
this != &other ) { QEasingCurve copy(other); swap(copy); }
return *
this; }
47 QEasingCurve(QEasingCurve &&other)
noexcept : d_ptr(other.d_ptr) { other.d_ptr =
nullptr; }
48 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QEasingCurve)
50 void swap(QEasingCurve &other)
noexcept { qt_ptr_swap(d_ptr, other.d_ptr); }
52#if QT_CORE_REMOVED_SINCE(6
, 8
)
53 bool operator==(
const QEasingCurve &other)
const;
54 inline bool operator!=(
const QEasingCurve &other)
const
55 {
return !(
this->operator==(other)); }
58 qreal amplitude()
const;
59 void setAmplitude(qreal amplitude);
62 void setPeriod(qreal period);
64 qreal overshoot()
const;
65 void setOvershoot(qreal overshoot);
67 void addCubicBezierSegment(
const QPointF &c1,
const QPointF &c2,
const QPointF &endPoint);
68 void addTCBSegment(
const QPointF &nextPoint, qreal t, qreal c, qreal b);
69 QList<QPointF> toCubicSpline()
const;
72 void setType(Type type);
73 typedef qreal (*EasingFunction)(qreal progress);
74 void setCustomType(EasingFunction func);
75 EasingFunction customType()
const;
77 qreal valueForProgress(qreal progress)
const;
80 QEasingCurvePrivate *d_ptr;
81#ifndef QT_NO_DEBUG_STREAM
82 friend Q_CORE_EXPORT QDebug operator<<(QDebug debug,
const QEasingCurve &item);
84#ifndef QT_NO_DATASTREAM
85 friend Q_CORE_EXPORT QDataStream &operator<<(QDataStream &,
const QEasingCurve &);
86 friend Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QEasingCurve &);
88 friend Q_CORE_EXPORT
bool
89 comparesEqual(
const QEasingCurve &lhs,
const QEasingCurve &rhs);
90#if !QT_CORE_REMOVED_SINCE(6
, 8
)
91 Q_DECLARE_EQUALITY_COMPARABLE_NON_NOEXCEPT(QEasingCurve)
96#ifndef QT_NO_DEBUG_STREAM
97Q_CORE_EXPORT
QDebug operator<<(QDebug debug,
const QEasingCurve &item);
100#ifndef QT_NO_DATASTREAM
101Q_CORE_EXPORT
QDataStream &operator<<(QDataStream &,
const QEasingCurve &);
102Q_CORE_EXPORT
QDataStream &operator>>(QDataStream &, QEasingCurve &);
\inmodule QtCore\reentrant
virtual ~QEasingCurveFunction()
QEasingCurveFunction(QEasingCurve::Type type, qreal period=0.3, qreal amplitude=1.0, qreal overshoot=1.70158)
virtual qreal value(qreal t)
QList< QPointF > _bezierCurves
bool fuzzyCompare(const QEasingCurveFunction &other) const noexcept
QEasingCurveFunction(const QEasingCurveFunction &)=default
virtual QEasingCurveFunction * clone() const
\inmodule QtCore\reentrant
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
static QList< QPointF > tcbToBezier(const TCBPoints &tcbPoints)
static QEasingCurve::EasingFunction curveToFunc(QEasingCurve::Type curve)
Q_DECLARE_TYPEINFO(TCBPoint, Q_PRIMITIVE_TYPE)
static QT_BEGIN_NAMESPACE constexpr bool isConfigFunction(QEasingCurve::Type type)
QDataStream & operator<<(QDataStream &stream, QEasingCurveFunction *func)
QList< TCBPoint > TCBPoints
QDataStream & operator>>(QDataStream &stream, QEasingCurveFunction *func)
QDataStream & operator>>(QDataStream &stream, TCBPoint &point)
static QEasingCurveFunction * curveToFunctionObject(QEasingCurve::Type type)
QDataStream & operator<<(QDataStream &stream, const TCBPoint &point)
QT_REQUIRE_CONFIG(easingcurve)
QDebug operator<<(QDebug dbg, const QFileInfo &fi)
bool comparesEqual(const QFileInfo &lhs, const QFileInfo &rhs)
QDataStream & operator<<(QDataStream &stream, const QImage &image)
[0]
QDataStream & operator>>(QDataStream &stream, QImage &image)
qreal value(qreal t) override
BackEase * clone() const override
BackEase(QEasingCurve::Type type)
static float _fast_cbrt(float x)
static qreal evaluateDerivateForX(const SingleCubicBezier &singleCubicBezier, qreal t)
static qreal evaluateForX(const SingleCubicBezier &singleCubicBezier, qreal t)
static qreal _acos(qreal x)
static void cosacos(qreal x, qreal &s1, qreal &s2, qreal &s3)
static qreal _cos(qreal x)
static qreal _cbrt(qreal d)
static qreal newtonIteration(const SingleCubicBezier &singleCubicBezier, qreal t, qreal x)
static qreal evaluateSegmentForY(const SingleCubicBezier &singleCubicBezier, qreal t)
QList< SingleCubicBezier > _curves
static qreal singleRealSolutionForCubic(qreal a, qreal b, qreal c)
qreal value(qreal x) override
void getBezierSegment(SingleCubicBezier *&singleCubicBezier, qreal x)
static qreal findTForX(const SingleCubicBezier &singleCubicBezier, qreal x)
BezierEase(QEasingCurve::Type type=QEasingCurve::BezierSpline)
BezierEase * clone() const override
QList< qreal > _intervals
static double _fast_cbrt(double d)
static bool inRange(qreal f)
static bool almostZero(qreal value)
BounceEase(QEasingCurve::Type type)
BounceEase * clone() const override
qreal value(qreal t) override
ElasticEase * clone() const override
qreal value(qreal t) override
ElasticEase(QEasingCurve::Type type)
TCBEase * clone() const override
qreal value(qreal x) override
friend bool operator==(const TCBPoint &lhs, const TCBPoint &rhs) noexcept