summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java
index 9eda64874..f5a0a69c1 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterEdge.java
@@ -20,11 +20,17 @@ import android.graphics.Bitmap;
import com.android.gallery3d.R;
-public class ImageFilterEdge extends ImageFilter {
+public class ImageFilterEdge extends SimpleImageFilter {
public ImageFilterEdge() {
mName = "Edge";
- mPreviewParameter = 0;
+ }
+
+ public FilterRepresentation getDefaultRepresentation() {
+ FilterRepresentation representation = super.getDefaultRepresentation();
+ representation.setName("Edge");
+ representation.setFilterClass(ImageFilterEdge.class);
+ return representation;
}
native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, float p);
@@ -40,15 +46,13 @@ public class ImageFilterEdge extends ImageFilter {
}
@Override
- public boolean isNil() {
- return false;
- }
-
- @Override
public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) {
+ if (getParameters() == null) {
+ return bitmap;
+ }
int w = bitmap.getWidth();
int h = bitmap.getHeight();
- float p = mParameter + 101;
+ float p = getParameters().getValue() + 101;
p = (float) p / 100;
nativeApplyFilter(bitmap, w, h, p);
return bitmap;