1 #ifndef _RIVE_CUBIC_INTERPOLATOR_BASE_HPP_
2 #define _RIVE_CUBIC_INTERPOLATOR_BASE_HPP_
4 #include "core/field_types/core_double_type.hpp"
7 class CubicInterpolatorBase : public Core
13 static const uint16_t typeKey = 28;
15 /// Helper to quickly determine if a core object extends another without
17 bool isTypeOf(uint16_t typeKey) const override
21 case CubicInterpolatorBase::typeKey:
28 uint16_t coreType() const override { return typeKey; }
30 static const uint16_t x1PropertyKey = 63;
31 static const uint16_t y1PropertyKey = 64;
32 static const uint16_t x2PropertyKey = 65;
33 static const uint16_t y2PropertyKey = 66;
41 inline float x1() const { return m_X1; }
52 inline float y1() const { return m_Y1; }
63 inline float x2() const { return m_X2; }
74 inline float y2() const { return m_Y2; }
85 Core* clone() const override;
86 void copy(const CubicInterpolatorBase& object)
94 bool deserialize(uint16_t propertyKey, BinaryReader& reader) override
99 m_X1 = CoreDoubleType::deserialize(reader);
102 m_Y1 = CoreDoubleType::deserialize(reader);
105 m_X2 = CoreDoubleType::deserialize(reader);
108 m_Y2 = CoreDoubleType::deserialize(reader);
115 virtual void x1Changed() {}
116 virtual void y1Changed() {}
117 virtual void x2Changed() {}
118 virtual void y2Changed() {}