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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 /** Return the computed values given the specified time. Return whether | 107 /** Return the computed values given the specified time. Return whether |
108 those values are the result of pinning to either the first | 108 those values are the result of pinning to either the first |
109 (kFreezeStart) or last (kFreezeEnd), or from interpolated the two | 109 (kFreezeStart) or last (kFreezeEnd), or from interpolated the two |
110 nearest key values (kNormal). | 110 nearest key values (kNormal). |
111 @param time The time to sample (in milliseconds) | 111 @param time The time to sample (in milliseconds) |
112 @param (may be null) where to write the computed values. | 112 @param (may be null) where to write the computed values. |
113 */ | 113 */ |
114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const; | 114 Result timeToValues(SkMSec time, SkScalar values[] = NULL) const; |
115 | 115 |
116 SkDEBUGCODE(static void UnitTest();) | |
117 private: | 116 private: |
118 SkScalar* fValues; // pointer into fStorage | 117 SkScalar* fValues; // pointer into fStorage |
119 #ifdef SK_DEBUG | 118 #ifdef SK_DEBUG |
120 SkScalar(* fScalarsArray)[10]; | 119 SkScalar(* fScalarsArray)[10]; |
121 #endif | 120 #endif |
122 typedef SkInterpolatorBase INHERITED; | 121 typedef SkInterpolatorBase INHERITED; |
123 }; | 122 }; |
124 | 123 |
125 /** Given all the parameters are [0...1], apply the cubic specified by (0,0) | 124 /** Given all the parameters are [0...1], apply the cubic specified by (0,0) |
126 (bx,by) (cx,cy) (1,1) to value, returning the answer, also [0...1]. | 125 (bx,by) (cx,cy) (1,1) to value, returning the answer, also [0...1]. |
127 */ | 126 */ |
128 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by, | 127 SkScalar SkUnitCubicInterp(SkScalar value, SkScalar bx, SkScalar by, |
129 SkScalar cx, SkScalar cy); | 128 SkScalar cx, SkScalar cy); |
130 | 129 |
131 #endif | 130 #endif |
OLD | NEW |