diff options
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java')
-rw-r--r-- | src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java index de8fcd5ea..e17823955 100644 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java +++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterShadows.java @@ -20,36 +20,36 @@ import com.android.gallery3d.R; import android.graphics.Bitmap; -public class ImageFilterShadows extends ImageFilter { +public class ImageFilterShadows extends SimpleImageFilter { public ImageFilterShadows() { mName = "Shadows"; } - @Override - public int getButtonId() { - return R.id.shadowRecoveryButton; - } - - @Override - public int getTextId() { - return R.string.shadow_recovery; - } - - @Override - public ImageFilter clone() throws CloneNotSupportedException { - ImageFilterShadows filter = (ImageFilterShadows) super.clone(); - return filter; + public FilterRepresentation getDefaultRepresentation() { + FilterBasicRepresentation representation = + (FilterBasicRepresentation) super.getDefaultRepresentation(); + representation.setName("Shadows"); + representation.setFilterClass(ImageFilterShadows.class); + representation.setTextId(R.string.shadow_recovery); + representation.setButtonId(R.id.shadowRecoveryButton); + representation.setMinimum(-100); + representation.setMaximum(100); + representation.setDefaultValue(0); + return representation; } native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, float factor); @Override - public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) { + public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) { + 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; |