summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/filtershow/filters/ImageFilterSaturated.java
blob: f44c6a1c6244eccf26efb8c51fd9bdcda2abc04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

package com.android.gallery3d.filtershow.filters;

import android.graphics.Bitmap;

public class ImageFilterSaturated extends ImageFilter {

    public String name() {
        return "Saturated";
    }

    public ImageFilter copy() {
        return new ImageFilterSaturated();
    }

    native protected void nativeApplyFilter(Bitmap bitmap, int w, int h, float saturation);

    public void apply(Bitmap bitmap) {
        int w = bitmap.getWidth();
        int h = bitmap.getHeight();
        int p = mParameter;
        float value = 1 +  p / 100.0f;
        nativeApplyFilter(bitmap, w, h, value);
    }
}