summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-04-24 13:52:45 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-24 13:52:45 -0700
commit9828e58d1b6209c37fa2d4008678082bea1917d1 (patch)
treeed2b23bb4f8e8233dc0d23fd4f6caff52c5cb17a /src/com/android/gallery3d
parent70db3b4facf3dafb68c54c41b952dc64739b1bcc (diff)
parentac1e8231b96042b3fdfef504dd03ba04c71c5fd0 (diff)
downloadandroid_packages_apps_Snap-9828e58d1b6209c37fa2d4008678082bea1917d1.tar.gz
android_packages_apps_Snap-9828e58d1b6209c37fa2d4008678082bea1917d1.tar.bz2
android_packages_apps_Snap-9828e58d1b6209c37fa2d4008678082bea1917d1.zip
am cc7bcd07: Merge "Fix Curves" into gb-ub-photos-bryce
* commit 'cc7bcd0721735723c683b2f27267a52a76ff4244': Fix Curves
Diffstat (limited to 'src/com/android/gallery3d')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
index 56d75178e..a32068aeb 100644
--- a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
+++ b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java
@@ -1,5 +1,7 @@
package com.android.gallery3d.filtershow.filters;
+import android.util.Log;
+
import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.ui.Spline;
@@ -7,6 +9,8 @@ import com.android.gallery3d.filtershow.ui.Spline;
* TODO: Insert description here. (generated by hoford)
*/
public class FilterCurvesRepresentation extends FilterRepresentation {
+ private static final String LOGTAG = "FilterCurvesRepresentation";
+
private Spline[] mSplines = new Spline[4];
public FilterCurvesRepresentation() {
@@ -21,10 +25,33 @@ public class FilterCurvesRepresentation extends FilterRepresentation {
setShowParameterValue(false);
setShowUtilityPanel(true);
setSupportsPartialRendering(true);
- for (int i = 0; i < mSplines.length; i++) {
- mSplines[i] = new Spline();
- mSplines[i].reset();
+ reset();
+ }
+
+ @Override
+ public FilterRepresentation clone() throws CloneNotSupportedException {
+ FilterCurvesRepresentation rep = new FilterCurvesRepresentation();
+ rep.useParametersFrom(this);
+ return rep;
+ }
+
+ @Override
+ public void useParametersFrom(FilterRepresentation a) {
+ if (!(a instanceof FilterCurvesRepresentation)) {
+ Log.v(LOGTAG, "cannot use parameters from " + a);
+ return;
+ }
+ FilterCurvesRepresentation representation = (FilterCurvesRepresentation) a;
+ Spline[] spline = new Spline[4];
+ for (int i = 0; i < spline.length; i++) {
+ Spline sp = representation.mSplines[i];
+ if (sp != null) {
+ spline[i] = new Spline(sp);
+ } else {
+ spline[i] = new Spline();
+ }
}
+ mSplines = spline;
}
public boolean isNil() {