mirror of
https://github.com/rive-app/rive-cpp.git
synced 2026-01-18 13:11:19 +01:00
23 lines
652 B
C++
23 lines
652 B
C++
#ifndef _RIVE_CUBIC_INTERPOLATOR_HPP_
|
|
#define _RIVE_CUBIC_INTERPOLATOR_HPP_
|
|
#include "generated/animation/cubic_interpolator_base.hpp"
|
|
namespace rive
|
|
{
|
|
class CubicInterpolator : public CubicInterpolatorBase
|
|
{
|
|
private:
|
|
static constexpr int SplineTableSize = 11;
|
|
static constexpr float SampleStepSize = 1.0f / (SplineTableSize - 1.0f);
|
|
float m_Values[SplineTableSize];
|
|
|
|
float getT(float x) const;
|
|
public:
|
|
void onAddedClean(CoreContext* context) override {}
|
|
void onAddedDirty(CoreContext* context) override;
|
|
|
|
/// Convert a linear interpolation factor to an eased one.
|
|
float transform(float value) const;
|
|
};
|
|
} // namespace rive
|
|
|
|
#endif |