blob: f44c6a1c6244eccf26efb8c51fd9bdcda2abc04e [file] [log] [blame]
nicolasroard0d7cdf82012-09-25 14:27:56 -07001
2package com.android.gallery3d.filtershow.filters;
3
4import android.graphics.Bitmap;
5
6public class ImageFilterSaturated extends ImageFilter {
7
8 public String name() {
9 return "Saturated";
10 }
11
12 public ImageFilter copy() {
13 return new ImageFilterSaturated();
14 }
15
16 native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, float saturation);
17
18 public void apply(Bitmap bitmap) {
19 int w = bitmap.getWidth();
20 int h = bitmap.getHeight();
John Hofordd42f6c62012-09-27 16:34:21 -070021 int p = mParameter;
22 float value = 1 + p / 100.0f;
nicolasroard0d7cdf82012-09-25 14:27:56 -070023 nativeApplyFilter(bitmap, w, h, value);
24 }
25}