diff options
| author | nicolasroard <nicolasroard@google.com> | 2012-11-28 17:23:04 -0800 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-28 17:23:04 -0800 |
| commit | 2b14b2be7bbc5dbcb616ca4c8c34022c761bf841 (patch) | |
| tree | ffbfcda3045811ed8c8a33765e9beaae5ef6cb5b /src | |
| parent | da9da43c19472280257e327e51d84b83bde834ae (diff) | |
| parent | 1bab51a0e46a70ff98cb9f761bebc148e393b5e6 (diff) | |
| download | android_packages_apps_Snap-2b14b2be7bbc5dbcb616ca4c8c34022c761bf841.tar.gz android_packages_apps_Snap-2b14b2be7bbc5dbcb616ca4c8c34022c761bf841.tar.bz2 android_packages_apps_Snap-2b14b2be7bbc5dbcb616ca4c8c34022c761bf841.zip | |
am 987bc8aa: Fix wrong colors in Curves
* commit '987bc8aaafa55c45451937b27d94c1d602de4d68':
Fix wrong colors in Curves
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/filtershow/ui/Spline.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/ui/Spline.java b/src/com/android/gallery3d/filtershow/ui/Spline.java index dd9aac1be..cb0d00f47 100644 --- a/src/com/android/gallery3d/filtershow/ui/Spline.java +++ b/src/com/android/gallery3d/filtershow/ui/Spline.java @@ -121,13 +121,20 @@ public class Spline { } double[] derivatives = solveSystem(points); int start = 0; + int end = 256; if (points[0].x != 0) { start = (int) (points[0].x * 256); } + if (points[points.length - 1].x != 1) { + end = (int) (points[points.length - 1].x * 256); + } for (int i = 0; i < start; i++) { curve[i] = 1.0f - points[0].y; } - for (int i = start; i < 256; i++) { + for (int i = end; i < 256; i++) { + curve[i] = 1.0f - points[points.length - 1].y; + } + for (int i = start; i < end; i++) { ControlPoint cur = null; ControlPoint next = null; double x = i / 256.0; |
