diff options
author | nicolasroard <nicolasroard@google.com> | 2012-11-28 17:09:59 -0800 |
---|---|---|
committer | nicolasroard <nicolasroard@google.com> | 2012-11-28 17:17:54 -0800 |
commit | 1bab51a0e46a70ff98cb9f761bebc148e393b5e6 (patch) | |
tree | e3256ff299ac4e520b2502a7f585d6eacc64632a /src/com/android/gallery3d/filtershow/ui | |
parent | 91287749301c41b8ae8a827350b040384b9c0217 (diff) | |
download | android_packages_apps_Snap-1bab51a0e46a70ff98cb9f761bebc148e393b5e6.tar.gz android_packages_apps_Snap-1bab51a0e46a70ff98cb9f761bebc148e393b5e6.tar.bz2 android_packages_apps_Snap-1bab51a0e46a70ff98cb9f761bebc148e393b5e6.zip |
Fix wrong colors in Curves
bug:7633765
Change-Id: Ie6d0c175af6a1ade8f225107408ad03e73a289d3
Diffstat (limited to 'src/com/android/gallery3d/filtershow/ui')
-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; |