8#ifndef SkottieKeyframeAnimator_DEFINED
9#define SkottieKeyframeAnimator_DEFINED
29class ExpressionManager;
34class AnimationBuilder;
77 return fKFs.size() == 1;
82 : fKFs(
std::move(kfs))
83 , fCMs(
std::move(cms)) {}
103 return kf0 && kf0->
t <= t && t < kf1->
t;
108 KFSegment find_segment(
float t)
const;
111 float compute_weight(
const KFSegment& seg,
float t)
const;
113 const std::vector<Keyframe> fKFs;
114 const std::vector<SkCubicMap> fCMs;
115 mutable KFSegment fCurrentSegment = {
nullptr,
nullptr };
131 : keyframe_type(ty) {}
virtual ~AnimatorBuilder()
virtual sk_sp< Animator > makeFromExpression(ExpressionManager &, const char *)=0
virtual bool parseValue(const AnimationBuilder &, const skjson::Value &) const =0
std::vector< SkCubicMap > fCMs
AnimatorBuilder(Keyframe::Value::Type ty)
bool parseKeyframes(const AnimationBuilder &, const skjson::ArrayValue &)
std::vector< Keyframe > fKFs
virtual bool parseKFValue(const AnimationBuilder &, const skjson::ObjectValue &, const skjson::Value &, Keyframe::Value *)=0
virtual sk_sp< KeyframeAnimator > makeFromKeyframes(const AnimationBuilder &, const skjson::ArrayValue &)=0
~KeyframeAnimator() override
LERPInfo getLERPInfo(float t) const
KeyframeAnimator(std::vector< Keyframe > kfs, std::vector< SkCubicMap > cms)
T Lerp(const T &a, const T &b, float t)
constexpr bool contains(std::string_view str, std::string_view needle)
bool equals(const Value &other, Type ty) const
static constexpr uint32_t kConstantMapping
static constexpr uint32_t kCubicIndexOffset
static constexpr uint32_t kLinearMapping