nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 1 | |
| 2 | package com.android.gallery3d.filtershow.filters; |
| 3 | |
| 4 | import android.graphics.Bitmap; |
| 5 | |
| 6 | public 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 Hoford | d42f6c6 | 2012-09-27 16:34:21 -0700 | [diff] [blame^] | 21 | int p = mParameter; |
| 22 | float value = 1 + p / 100.0f; |
nicolasroard | 0d7cdf8 | 2012-09-25 14:27:56 -0700 | [diff] [blame] | 23 | nativeApplyFilter(bitmap, w, h, value); |
| 24 | } |
| 25 | } |