blob: 44fb37cff7b140ce32856a5dc84fe0067d12b1a4 [file] [log] [blame]
John Recke45b1fd2014-04-15 09:50:16 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef INTERPOLATOR_H
17#define INTERPOLATOR_H
18
John Reck315c3292014-05-09 19:21:04 -070019#include <stddef.h>
20
21#include <cutils/compiler.h>
22
John Recke45b1fd2014-04-15 09:50:16 -070023namespace android {
24namespace uirenderer {
25
26class Interpolator {
27public:
28 virtual ~Interpolator() {}
29
30 virtual float interpolate(float input) = 0;
31
32 static Interpolator* createDefaultInterpolator();
33
34protected:
35 Interpolator() {}
36};
37
John Reck315c3292014-05-09 19:21:04 -070038class ANDROID_API AccelerateDecelerateInterpolator : public Interpolator {
John Recke45b1fd2014-04-15 09:50:16 -070039public:
40 AccelerateDecelerateInterpolator() {}
41 virtual ~AccelerateDecelerateInterpolator() {}
42
43 virtual float interpolate(float input);
44};
45
John Reck315c3292014-05-09 19:21:04 -070046class ANDROID_API LUTInterpolator : public Interpolator {
47public:
48 LUTInterpolator(float* values, size_t size);
49 ~LUTInterpolator();
50
51 virtual float interpolate(float input);
52
53private:
54 float* mValues;
55 size_t mSize;
56};
57
John Recke45b1fd2014-04-15 09:50:16 -070058} /* namespace uirenderer */
59} /* namespace android */
60
61#endif /* INTERPOLATOR_H */