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.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
new file mode 100644
index 000000000..04fd1e42e
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterNegative.java
@@ -0,0 +1,47 @@
+package com.android.gallery3d.filtershow.filters;
+
+import android.graphics.Bitmap;
+
+import com.android.gallery3d.R;
+
+public class ImageFilterNegative extends ImageFilter {
+
+ public ImageFilterNegative() {
+ mName = "Negative";
+ }
+
+ @Override
+ public int getButtonId() {
+ return R.id.negativeButton;
+ }
+
+ @Override
+ public int getTextId() {
+ return R.string.negative;
+ }
+
+ @Override
+ public boolean isNil() {
+ return false;
+ }
+
+ @Override
+ public boolean showEditingControls() {
+ return false;
+ }
+
+ @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) {
+ int w = bitmap.getWidth();
+ int h = bitmap.getHeight();
+ nativeApplyFilter(bitmap, w, h);
+ return bitmap;
+ }
+}