diff options
author | John Hoford <hoford@google.com> | 2013-02-27 08:41:19 -0800 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-02-27 17:32:01 -0800 |
commit | 63cc04c3b51d544598c8af5c8c16a29b1e902a26 (patch) | |
tree | 36a75fe6a9765e0c332f840a50d761511ce7b5c2 /src/com/android/gallery3d/filtershow/filters | |
parent | 7c3ff29f5d187a9f8c660f8571a43f5a91b46836 (diff) | |
download | android_packages_apps_Snap-63cc04c3b51d544598c8af5c8c16a29b1e902a26.tar.gz android_packages_apps_Snap-63cc04c3b51d544598c8af5c8c16a29b1e902a26.tar.bz2 android_packages_apps_Snap-63cc04c3b51d544598c8af5c8c16a29b1e902a26.zip |
refactor the geometry code
Change-Id: I5b0381ec5e127aabf37924af64fbeb490755bc9a
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters')
3 files changed, 20 insertions, 6 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java index 4dbf91a33..820bdbfea 100644 --- a/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java +++ b/src/com/android/gallery3d/filtershow/filters/BaseFiltersManager.java @@ -44,6 +44,8 @@ public abstract class BaseFiltersManager { filters.put(ImageFilterFx.class, new ImageFilterFx()); filters.put(ImageFilterBorder.class, new ImageFilterBorder()); filters.put(ImageFilterParametricBorder.class, new ImageFilterParametricBorder()); + filters.put(ImageFilterGeometry.class, new ImageFilterGeometry()); + } public ImageFilter getFilter(Class c) { diff --git a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java index 83f2a1b87..5dd72c9cd 100644 --- a/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java +++ b/src/com/android/gallery3d/filtershow/filters/FilterRepresentation.java @@ -30,6 +30,7 @@ public class FilterRepresentation implements Cloneable { private int mEditorId = BasicEditor.ID; private int mButtonId = 0; private int mOverlayId = 0; + private boolean mOverlayOnly = false; private boolean mShowEditingControls = true; private boolean mShowParameterValue = true; private boolean mShowUtilityPanel = true; @@ -58,6 +59,7 @@ public class FilterRepresentation implements Cloneable { representation.setEditorId(getEditorId()); representation.setButtonId(getButtonId()); representation.setOverlayId(getOverlayId()); + representation.setOverlayOnly(getOverlayOnly()); representation.setShowEditingControls(showEditingControls()); representation.setShowParameterValue(showParameterValue()); representation.setShowUtilityPanel(showUtilityPanel()); @@ -77,6 +79,7 @@ public class FilterRepresentation implements Cloneable { && representation.mEditorId == mEditorId && representation.mButtonId == mButtonId && representation.mOverlayId == mOverlayId + && representation.mOverlayOnly == mOverlayOnly && representation.mShowEditingControls == mShowEditingControls && representation.mShowParameterValue == mShowParameterValue && representation.mShowUtilityPanel == mShowUtilityPanel) { @@ -181,10 +184,23 @@ public class FilterRepresentation implements Cloneable { mOverlayId = overlayId; } - public int getEditorId() { + public boolean getOverlayOnly() { + return mOverlayOnly; + } + + public void setOverlayOnly(boolean value) { + mOverlayOnly = value; + } + + final public int getEditorId() { return mEditorId; } + public int[] getEditorIds() { + return new int[] { + mEditorId }; + } + public void setEditorId(int editorId) { mEditorId = editorId; } diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java index 329ca81b9..cbb443f75 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java @@ -50,10 +50,6 @@ public class ImageFilterGeometry extends ImageFilter { return filter; } - public void setGeometryMetadata(GeometryMetadata m) { - mGeometry = m; - } - native protected void nativeApplyFilterFlip(Bitmap src, int srcWidth, int srcHeight, Bitmap dst, int dstWidth, int dstHeight, int flip); @@ -68,7 +64,7 @@ public class ImageFilterGeometry extends ImageFilter { @Override public void useRepresentation(FilterRepresentation representation) { - + mGeometry = (GeometryMetadata) representation; } @Override |