diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2012-10-08 13:48:46 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2012-10-08 13:58:39 -0700 |
commit | 7bd602506fee36f3ef0a68bfa1ba5dd1e74ca5dd (patch) | |
tree | 1bac045fd6092a540eb54779f793da78f8f987ff /src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java | |
parent | 8e7b50948261570ec1d75ba451236b971dc5dc0f (diff) | |
download | android_packages_apps_Gallery2-7bd602506fee36f3ef0a68bfa1ba5dd1e74ca5dd.tar.gz android_packages_apps_Gallery2-7bd602506fee36f3ef0a68bfa1ba5dd1e74ca5dd.tar.bz2 android_packages_apps_Gallery2-7bd602506fee36f3ef0a68bfa1ba5dd1e74ca5dd.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.java | 44 |
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; + } + +} |