summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java
index de8fcd5ea..27e5342c9 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java
@@ -20,13 +20,20 @@ import com.android.gallery3d.R;
import android.graphics.Bitmap;
-public class ImageFilterShadows extends ImageFilter {
+public class ImageFilterShadows extends SimpleImageFilter {
public ImageFilterShadows() {
mName = "Shadows";
}
+ public FilterRepresentation getDefaultRepresentation() {
+ FilterRepresentation representation = super.getDefaultRepresentation();
+ representation.setName("Shadows");
+ representation.setFilterClass(ImageFilterShadows.class);
+ return representation;
+ }
+
@Override
public int getButtonId() {
return R.id.shadowRecoveryButton;
@@ -47,9 +54,12 @@ public class ImageFilterShadows extends ImageFilter {
@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;
+ float p = getParameters().getValue();
nativeApplyFilter(bitmap, w, h, p);
return bitmap;