diff options
author | John Reck <jreck@google.com> | 2014-05-12 16:39:41 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2014-05-12 16:42:02 -0700 |
commit | c8ac775659fd252ce2cc9a61837c170ff70f0a1a (patch) | |
tree | 6c6d78c22810d76c5091b0e9ff6d618920c9c071 /libs/hwui/Interpolator.h | |
parent | 315c329544d7c593d1072b071cbb92d9afe74021 (diff) | |
download | frameworks_base-c8ac775659fd252ce2cc9a61837c170ff70f0a1a.zip frameworks_base-c8ac775659fd252ce2cc9a61837c170ff70f0a1a.tar.gz frameworks_base-c8ac775659fd252ce2cc9a61837c170ff70f0a1a.tar.bz2 |
More native interpolators
Gotta collect 'em all
Change-Id: I3ccc2b5c842b27b906c8a0470fbedc2bf285bc38
Diffstat (limited to 'libs/hwui/Interpolator.h')
-rw-r--r-- | libs/hwui/Interpolator.h | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/libs/hwui/Interpolator.h b/libs/hwui/Interpolator.h index 44fb37c..dfa0a85 100644 --- a/libs/hwui/Interpolator.h +++ b/libs/hwui/Interpolator.h @@ -37,10 +37,66 @@ protected: class ANDROID_API AccelerateDecelerateInterpolator : public Interpolator { public: - AccelerateDecelerateInterpolator() {} - virtual ~AccelerateDecelerateInterpolator() {} + virtual float interpolate(float input); +}; + +class ANDROID_API AccelerateInterpolator : public Interpolator { +public: + AccelerateInterpolator(float factor) : mFactor(factor), mDoubleFactor(factor*2) {} + virtual float interpolate(float input); +private: + const float mFactor; + const float mDoubleFactor; +}; + +class ANDROID_API AnticipateInterpolator : public Interpolator { +public: + AnticipateInterpolator(float tension) : mTension(tension) {} + virtual float interpolate(float input); +private: + const float mTension; +}; + +class ANDROID_API AnticipateOvershootInterpolator : public Interpolator { +public: + AnticipateOvershootInterpolator(float tension) : mTension(tension) {} + virtual float interpolate(float input); +private: + const float mTension; +}; + +class ANDROID_API BounceInterpolator : public Interpolator { +public: + virtual float interpolate(float input); +}; + +class ANDROID_API CycleInterpolator : public Interpolator { +public: + CycleInterpolator(float cycles) : mCycles(cycles) {} + virtual float interpolate(float input); +private: + const float mCycles; +}; + +class ANDROID_API DecelerateInterpolator : public Interpolator { +public: + DecelerateInterpolator(float factor) : mFactor(factor) {} + virtual float interpolate(float input); +private: + const float mFactor; +}; +class ANDROID_API LinearInterpolator : public Interpolator { +public: + virtual float interpolate(float input) { return input; } +}; + +class ANDROID_API OvershootInterpolator : public Interpolator { +public: + OvershootInterpolator(float tension) : mTension(tension) {} virtual float interpolate(float input); +private: + const float mTension; }; class ANDROID_API LUTInterpolator : public Interpolator { |