OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkInterpolator_DEFINED | 10 #ifndef SkInterpolator_DEFINED |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const; | 114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const; |
115 | 115 |
116 private: | 116 private: |
117 SkScalar* fValues; // pointer into fStorage | 117 SkScalar* fValues; // pointer into fStorage |
118 #ifdef SK_DEBUG | 118 #ifdef SK_DEBUG |
119 SkScalar(* fScalarsArray)[10]; | 119 SkScalar(* fScalarsArray)[10]; |
120 #endif | 120 #endif |
121 typedef SkInterpolatorBase INHERITED; | 121 typedef SkInterpolatorBase INHERITED; |
122 }; | 122 }; |
123 | 123 |
124 /** Given all the parameters are [0...1], apply the cubic specified by (0,0) | 124 /** Interpolate a cubic curve, typically to provide an ease-in ease-out transiti
on. |
125 (bx,by) (cx,cy) (1,1) to value, returning the answer, also [0...1]. | 125 All the parameters are in the range of [0...1]. |
| 126 The input value is treated as the x-coordinate of the cubic. |
| 127 The output value is the y-coordinate on the cubic at the x-coordinate. |
| 128 |
| 129 @param value The x-coordinate pinned between [0..1]. |
| 130 @param bx,by,cx,cy The cubic control points where the cubic is specified |
| 131 as (0,0) (bx,by) (cx,cy) (1,1) |
| 132 @return the corresponding y-coordinate value, from [0..1]. |
126 */ | 133 */ |
127 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by, | 134 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by, |
128 SkScalar cx, SkScalar cy); | 135 SkScalar cx, SkScalar cy); |
129 | 136 |
130 #endif | 137 #endif |
OLD | NEW |