ImageFilterNegative.java revision 6900cad45d240c9a54b92991538b6a33652e766c
1package com.android.gallery3d.filtershow.filters; 2 3import android.graphics.Bitmap; 4 5import com.android.gallery3d.R; 6 7public 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, boolean highQuality) { 27 int w = bitmap.getWidth(); 28 int h = bitmap.getHeight(); 29 nativeApplyFilter(bitmap, w, h); 30 return bitmap; 31 } 32} 33