summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-02-13 15:52:31 -0800
committerJohn Hoford <hoford@google.com>2013-02-13 17:38:32 -0800
commit498d78073c24f25055a2dc4943cdd0a42f85702c (patch)
tree7b771875ad41e351d94487d3d9c7ffc767f3c1af /src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java
parent147af26e86b7fa8f2d195651e3786c0102346702 (diff)
downloadandroid_packages_apps_Snap-498d78073c24f25055a2dc4943cdd0a42f85702c.tar.gz
android_packages_apps_Snap-498d78073c24f25055a2dc4943cdd0a42f85702c.tar.bz2
android_packages_apps_Snap-498d78073c24f25055a2dc4943cdd0a42f85702c.zip
get redeye working again
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java
index 5f5314946..42587c06f 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java
@@ -17,10 +17,13 @@
package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
+import android.graphics.Canvas;
import android.graphics.Matrix;
+import android.graphics.Paint;
+import android.graphics.Rect;
import android.graphics.RectF;
+import android.util.Log;
-import com.android.gallery3d.R;
import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
import java.util.Vector;
@@ -62,12 +65,17 @@ public class ImageFilterRedEye extends ImageFilter {
native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, short[] matrix);
@Override
+ public void useRepresentation(FilterRepresentation representation) {
+ FilterRedEyeRepresentation parameters = (FilterRedEyeRepresentation) representation;
+ mParameters = parameters;
+ }
+
+ @Override
public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
short[] rect = new short[4];
int size = mParameters.getNumberOfCandidates();
-
for (int i = 0; i < size; i++) {
RectF r = new RectF(mParameters.getCandidate(i).mRect);
GeometryMetadata geo = getImagePreset().mGeoData;
@@ -100,13 +108,14 @@ public class ImageFilterRedEye extends ImageFilter {
if (r.bottom > h) {
r.bottom = h;
}
+
rect[0] = (short) r.left;
rect[1] = (short) r.top;
rect[2] = (short) r.width();
rect[3] = (short) r.height();
+
nativeApplyFilter(bitmap, w, h, rect);
}
-
return bitmap;
}
}