summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java')
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java
new file mode 100644
index 000000000..154ae2941
--- /dev/null
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterHue.java
@@ -0,0 +1,29 @@
+
+package com.android.gallery3d.filtershow.filters;
+
+import android.graphics.Bitmap;
+
+public class ImageFilterHue extends ImageFilter {
+ private ColorSpaceMatrix cmatrix = new ColorSpaceMatrix();
+
+ public String name() {
+ return "Hue";
+ }
+
+ public ImageFilter copy() {
+ return new ImageFilterHue();
+ }
+
+ native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, float []matrix);
+
+ public void apply(Bitmap bitmap) {
+ int w = bitmap.getWidth();
+ int h = bitmap.getHeight();
+ float p = mParameter;
+ float value = p;
+ cmatrix.identity();
+ cmatrix.setHue(value);
+
+ nativeApplyFilter(bitmap, w, h, cmatrix.getMatrix());
+ }
+}