OSDN Git Service

c0208765b83bb9fb64bba7d62bb8810aed01b8aa
[android-x86/packages-apps-Gallery2.git] / src / com / android / gallery3d / filtershow / filters / ImageFilterNegative.java
1 package com.android.gallery3d.filtershow.filters;
2
3 import android.graphics.Bitmap;
4
5 import com.android.gallery3d.R;
6
7 public class ImageFilterNegative extends ImageFilter {
8
9     public ImageFilterNegative() {
10         mName = "Negative";
11     }
12
13     public FilterRepresentation getDefaultRepresentation() {
14         FilterRepresentation representation = new FilterDirectRepresentation("Negative");
15         representation.setFilterClass(ImageFilterNegative.class);
16         representation.setTextId(R.string.negative);
17         representation.setButtonId(R.id.negativeButton);
18         representation.setShowEditingControls(false);
19         representation.setShowParameterValue(false);
20         return representation;
21     }
22
23     native protected void nativeApplyFilter(Bitmap bitmap, int w, int h);
24
25     @Override
26     public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
27         int w = bitmap.getWidth();
28         int h = bitmap.getHeight();
29         nativeApplyFilter(bitmap, w, h);
30         return bitmap;
31     }
32 }