blob: 6da43877c93f49596701fdeefb9f9ab1553937b2 [file] [log] [blame]
#ifndef _RIVE_CUBIC_INTERPOLATOR_HPP_
#define _RIVE_CUBIC_INTERPOLATOR_HPP_
#include "rive/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:
StatusCode onAddedDirty(CoreContext* context) override;
/// Convert a linear interpolation factor to an eased one.
float transform(float value) const;
StatusCode import(ImportStack& importStack) override;
};
} // namespace rive
#endif