summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
diff options
context:
space:
mode:
authorRuben Brunk <rubenbrunk@google.com>2012-10-08 13:48:46 -0700
committerRuben Brunk <rubenbrunk@google.com>2012-10-08 13:58:39 -0700
commitd922690a19edb8afbb103381f3a9c329ee2f9681 (patch)
tree786912684ee5dd522b8fda3df68ead81b62a3d7e /src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
parent98c69b734e8c1e2a3c3d8c180cfcfdc4bbac0182 (diff)
downloadandroid_packages_apps_Snap-d922690a19edb8afbb103381f3a9c329ee2f9681.tar.gz
android_packages_apps_Snap-d922690a19edb8afbb103381f3a9c329ee2f9681.tar.bz2
android_packages_apps_Snap-d922690a19edb8afbb103381f3a9c329ee2f9681.zip
Added stub for applying geometry flip.
Bug: 7224232 Bug: 7218935 Change-Id: Iaeea6a94f4fea44a8046f09a0fce72fe32ed7cc0
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
new file mode 100644
index 000000000..69a8f20d8
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java
@@ -0,0 +1,44 @@
+
+package com.android.gallery3d.filtershow.filters;
+
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Rect;
+
+import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
+import com.android.gallery3d.filtershow.imageshow.GeometryMetadata.FLIP;
+
+public class ImageFilterGeometry extends ImageFilter {
+ private final Bitmap.Config mConfig = Bitmap.Config.ARGB_8888;
+ private GeometryMetadata mGeometry = null;
+
+ public ImageFilterGeometry() {
+ mName = "Geometry";
+ }
+
+ @Override
+ public ImageFilter clone() throws CloneNotSupportedException {
+ ImageFilterGeometry filter = (ImageFilterGeometry) super.clone();
+ 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);
+
+ @Override
+ public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) {
+ if(mGeometry.getFlipType() == FLIP.NONE){
+ return bitmap;
+ }
+ Bitmap flipBitmap = bitmap.copy(mConfig, true);
+ nativeApplyFilterFlip(bitmap, bitmap.getWidth(), bitmap.getHeight(), flipBitmap,
+ flipBitmap.getWidth(), flipBitmap.getHeight(), 1);
+ return flipBitmap;
+ }
+
+}