1 package com.android.gallery3d.filtershow.filters;
3 import android.graphics.Bitmap;
5 import com.android.gallery3d.R;
7 public class ImageFilterNegative extends ImageFilter {
9 public ImageFilterNegative() {
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;
23 native protected void nativeApplyFilter(Bitmap bitmap, int w, int h);
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);