summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
index 04fd1e42e..841c5c913 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
@@ -3,6 +3,7 @@ package com.android.gallery3d.filtershow.filters;
import android.graphics.Bitmap;
import com.android.gallery3d.R;
+import com.android.gallery3d.filtershow.editors.ImageOnlyEditor;
public class ImageFilterNegative extends ImageFilter {
@@ -10,35 +11,26 @@ public class ImageFilterNegative extends ImageFilter {
mName = "Negative";
}
- @Override
- public int getButtonId() {
- return R.id.negativeButton;
- }
-
- @Override
- public int getTextId() {
- return R.string.negative;
+ public FilterRepresentation getDefaultRepresentation() {
+ FilterRepresentation representation = new FilterDirectRepresentation("Negative");
+ representation.setFilterClass(ImageFilterNegative.class);
+ representation.setTextId(R.string.negative);
+ representation.setButtonId(R.id.negativeButton);
+ representation.setShowEditingControls(false);
+ representation.setShowParameterValue(false);
+ representation.setEditorId(ImageOnlyEditor.ID);
+ return representation;
}
- @Override
- public boolean isNil() {
- return false;
- }
+ native protected void nativeApplyFilter(Bitmap bitmap, int w, int h);
@Override
- public boolean showEditingControls() {
- return false;
- }
+ public void useRepresentation(FilterRepresentation representation) {
- @Override
- public boolean showParameterValue() {
- return false;
}
- native protected void nativeApplyFilter(Bitmap bitmap, int w, int h);
-
@Override
- public Bitmap apply(Bitmap bitmap, float scaleFactor, boolean highQuality) {
+ public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
nativeApplyFilter(bitmap, w, h);