diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2013-07-18 16:37:30 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2013-08-01 09:46:44 -0700 |
commit | 203eb404a7cd6a80397535e63d22b3772939f03d (patch) | |
tree | c6cc970ad5bf9fc710cb3a8a2a667729b2439623 /src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java | |
parent | 3a5bc6b23096365e1a814f8999937028bc12b401 (diff) | |
download | android_packages_apps_Snap-203eb404a7cd6a80397535e63d22b3772939f03d.tar.gz android_packages_apps_Snap-203eb404a7cd6a80397535e63d22b3772939f03d.tar.bz2 android_packages_apps_Snap-203eb404a7cd6a80397535e63d22b3772939f03d.zip |
Refactoring Geometry handling.
Bug: 9170644
Bug: 9366654
Bug: 9366263
- Consolidates all the geometry transforms in GeometryMathUtils and
significantly reduces complexity.
- Removes GeometryMetadata object and dependent code.
- Removes ImageGeometry and geometry update callbacks.
Change-Id: I59add51907459593244c9ebaadef585efc7486d5
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java index d5f3a5b40..eb89de036 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterRotateRepresentation.java @@ -30,7 +30,7 @@ public class FilterRotateRepresentation extends FilterRepresentation { public static final String SERIALIZATION_ROTATE_VALUE = "value"; private static final String TAG = FilterRotateRepresentation.class.getSimpleName(); - Rotation mRotation = Rotation.ZERO; + Rotation mRotation; public enum Rotation { ZERO(0), NINETY(90), ONE_EIGHTY(180), TWO_SEVENTY(270); @@ -76,13 +76,30 @@ public class FilterRotateRepresentation extends FilterRepresentation { } public FilterRotateRepresentation() { - this(Rotation.ZERO); + this(getNil()); } public Rotation getRotation() { return mRotation; } + public void rotateCW() { + switch(mRotation) { + case ZERO: + mRotation = Rotation.NINETY; + break; + case NINETY: + mRotation = Rotation.ONE_EIGHTY; + break; + case ONE_EIGHTY: + mRotation = Rotation.TWO_SEVENTY; + break; + case TWO_SEVENTY: + mRotation = Rotation.ZERO; + break; + } + } + public void set(FilterRotateRepresentation r) { mRotation = r.mRotation; } @@ -123,7 +140,11 @@ public class FilterRotateRepresentation extends FilterRepresentation { @Override public boolean isNil() { - return mRotation == Rotation.ZERO; + return mRotation == getNil(); + } + + public static Rotation getNil() { + return Rotation.ZERO; } @Override |