use of com.android.gallery3d.filtershow.filters.ImageFilter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterEnvironment method applyRepresentation.
public void applyRepresentation(FilterRepresentation representation, Allocation in, Allocation out) {
ImageFilter filter = mFiltersManager.getFilterForRepresentation(representation);
filter.useRepresentation(representation);
filter.setEnvironment(this);
if (filter.supportsAllocationInput()) {
filter.apply(in, out);
}
filter.setGeneralParameters();
filter.setEnvironment(null);
}
use of com.android.gallery3d.filtershow.filters.ImageFilter in project android_packages_apps_Gallery2 by LineageOS.
the class FilterEnvironment method applyRepresentation.
public Bitmap applyRepresentation(FilterRepresentation representation, Bitmap bitmap) {
if (representation instanceof FilterUserPresetRepresentation) {
// applied directly they do not themselves need to do any kind of filtering.
return bitmap;
}
ImageFilter filter = mFiltersManager.getFilterForRepresentation(representation);
if (filter == null) {
Log.e(LOGTAG, "No ImageFilter for " + representation.getSerializationName());
return bitmap;
}
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;
}
use of com.android.gallery3d.filtershow.filters.ImageFilter in project android_packages_apps_Gallery2 by LineageOS.
the class ImagePreset method getUsedFilters.
public Vector<ImageFilter> getUsedFilters(BaseFiltersManager filtersManager) {
Vector<ImageFilter> usedFilters = new Vector<ImageFilter>();
for (int i = 0; i < mFilters.size(); i++) {
FilterRepresentation representation = mFilters.elementAt(i);
ImageFilter filter = filtersManager.getFilterForRepresentation(representation);
usedFilters.add(filter);
}
return usedFilters;
}
Aggregations