diff options
author | ztenghui <ztenghui@google.com> | 2013-07-16 17:07:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-16 17:07:23 +0000 |
commit | dda606af6d6a18c31b1da3f8885e06b51982b601 (patch) | |
tree | 8d5cd1e34137ec1ec87982fa32b635e76bef9dfc /src/com/android/gallery3d/filtershow/filters | |
parent | ce8eff82eb694626e8c53049501b4af2297a6c48 (diff) | |
parent | b279681ff115205aee81eb52ee8793fd709f0908 (diff) | |
download | android_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.tar.gz android_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.tar.bz2 android_packages_apps_Gallery2-dda606af6d6a18c31b1da3f8885e06b51982b601.zip |
Merge "Add equality check into FilterCurveRep" into gb-ub-photos-carlsbad
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java index a71aa8863..569ead957 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterCurvesRepresentation.java @@ -58,6 +58,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { mSplines = spline; } + @Override public boolean isNil() { for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { if (getSpline(i) != null && !getSpline(i).isOriginal()) { @@ -67,6 +68,27 @@ public class FilterCurvesRepresentation extends FilterRepresentation { return true; } + @Override + public boolean equals(FilterRepresentation representation) { + if (!super.equals(representation)) { + return false; + } + + if (!(representation instanceof FilterCurvesRepresentation)) { + return false; + } else { + FilterCurvesRepresentation curve = + (FilterCurvesRepresentation) representation; + for (int i = 0; i < MAX_SPLINE_NUMBER; i++) { + if (!getSpline(i).sameValues(curve.getSpline(i))) { + return false; + } + } + } + // Every spline matches, therefore they are the same. + return true; + } + public void reset() { Spline spline = new Spline(); @@ -81,6 +103,7 @@ public class FilterCurvesRepresentation extends FilterRepresentation { public void setSpline(int splineIndex, Spline s) { mSplines[splineIndex] = s; } + public Spline getSpline(int splineIndex) { return mSplines[splineIndex]; } |