import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
+import com.android.gallery3d.app.Log;
import com.android.gallery3d.filtershow.cache.BitmapCache;
import com.android.gallery3d.filtershow.filters.FilterRepresentation;
import com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation;
mBitmapCache.cache(bitmap);
}
- public Bitmap getBitmap(int w, int h) {
- return mBitmapCache.getBitmap(w, h);
+ public Bitmap getBitmap(int w, int h, int type) {
+ return mBitmapCache.getBitmap(w, h, type);
}
- public Bitmap getBitmapCopy(Bitmap source) {
- return mBitmapCache.getBitmapCopy(source);
+ public Bitmap getBitmapCopy(Bitmap source, int type) {
+ return mBitmapCache.getBitmapCopy(source, type);
}
public void setImagePreset(ImagePreset imagePreset) {
return bitmap;
}
ImageFilter filter = mFiltersManager.getFilterForRepresentation(representation);
+ if (filter == null){
+ Log.e(LOGTAG,"No ImageFilter for "+representation.getSerializationName());
+ }
filter.useRepresentation(representation);
filter.setEnvironment(this);
Bitmap ret = filter.apply(bitmap, mScaleFactor, mQuality);
+ if (bitmap != ret) {
+ cache(bitmap);
+ }
filter.setGeneralParameters();
filter.setEnvironment(null);
return ret;
generalParameters.put(id, value);
}
+ public BitmapCache getBimapCache() {
+ return mBitmapCache;
+ }
}