import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Matrix;
-import android.support.v8.renderscript.Allocation;
+import android.renderscript.Allocation;
import android.widget.Toast;
-import com.android.gallery3d.filtershow.imageshow.GeometryMetadata;
-import com.android.gallery3d.filtershow.presets.FilterEnvironment;
-import com.android.gallery3d.filtershow.presets.ImagePreset;
+import com.android.gallery3d.filtershow.imageshow.GeometryMathUtils;
+import com.android.gallery3d.filtershow.imageshow.MasterImage;
+import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
public abstract class ImageFilter implements Cloneable {
private FilterEnvironment mEnvironment = null;
}
protected Matrix getOriginalToScreenMatrix(int w, int h) {
- ImagePreset preset = getEnvironment().getImagePreset();
- GeometryMetadata geo = getEnvironment().getImagePreset().mGeoData;
- Matrix originalToScreen = geo.getOriginalToScreen(true,
- preset.getImageLoader().getOriginalBounds().width(),
- preset.getImageLoader().getOriginalBounds().height(),
- w, h);
- return originalToScreen;
+ return GeometryMathUtils.getImageToScreenMatrix(getEnvironment().getImagePreset()
+ .getGeometryFilters(), true, MasterImage.getImage().getOriginalBounds(), w, h);
}
public void setEnvironment(FilterEnvironment environment) {