diff options
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java index 63f860171..569a6f276 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterExposure.java @@ -20,12 +20,19 @@ import com.android.gallery3d.R; import android.graphics.Bitmap; -public class ImageFilterExposure extends ImageFilter { +public class ImageFilterExposure extends SimpleImageFilter { public ImageFilterExposure() { mName = "Exposure"; } + public FilterRepresentation getDefaultRepresentation() { + FilterRepresentation representation = super.getDefaultRepresentation(); + representation.setName("Exposure"); + representation.setFilterClass(ImageFilterExposure.class); + return representation; + } + @Override public int getButtonId() { return R.id.exposureButton; @@ -40,10 +47,12 @@ public class ImageFilterExposure 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(); - int p = mParameter; - float value = p; + float value = getParameters().getValue(); nativeApplyFilter(bitmap, w, h, value); return bitmap; } |