diff options
author | John Hoford <hoford@google.com> | 2013-02-13 15:52:31 -0800 |
---|---|---|
committer | John Hoford <hoford@google.com> | 2013-02-13 17:38:32 -0800 |
commit | 4e6c07b71b269ee3fe7f6fa455bc540238df9ded (patch) | |
tree | 5932cc09ccf2d821c7beea48daef6b7f254b1d1c /src/com/android/gallery3d/filtershow/filters/ImageFilterRedEye.java | |
parent | 31ebfb400aa73c51980ef78e4c26fcc1a39fdd4d (diff) | |
download | android_packages_apps_Gallery2-4e6c07b71b269ee3fe7f6fa455bc540238df9ded.tar.gz android_packages_apps_Gallery2-4e6c07b71b269ee3fe7f6fa455bc540238df9ded.tar.bz2 android_packages_apps_Gallery2-4e6c07b71b269ee3fe7f6fa455bc540238df9ded.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.java | 15 |
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; } } |