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.MasterImage;
+import com.android.gallery3d.filtershow.pipeline.FilterEnvironment;
+import com.android.gallery3d.filtershow.pipeline.ImagePreset;
public abstract class ImageFilter implements Cloneable {
private FilterEnvironment mEnvironment = null;
public boolean supportsAllocationInput() { return false; }
public void apply(Allocation in, Allocation out) {
+ setGeneralParameters();
}
public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
// do nothing here, subclasses will implement filtering here
+ setGeneralParameters();
return bitmap;
}
protected Matrix getOriginalToScreenMatrix(int w, int h) {
ImagePreset preset = getEnvironment().getImagePreset();
- GeometryMetadata geo = getEnvironment().getImagePreset().mGeoData;
+ GeometryMetadata geo = getEnvironment().getImagePreset().getGeometry();
Matrix originalToScreen = geo.getOriginalToScreen(true,
- preset.getImageLoader().getOriginalBounds().width(),
- preset.getImageLoader().getOriginalBounds().height(),
+ MasterImage.getImage().getOriginalBounds().width(),
+ MasterImage.getImage().getOriginalBounds().height(),
w, h);
return originalToScreen;
}
public FilterEnvironment getEnvironment() {
return mEnvironment;
}
+
+ public void setGeneralParameters() {
+ // should implement in subclass which like to transport
+ // some information to other filters. (like the style setting from RetroLux
+ // and Film to FixedFrame)
+ mEnvironment.clearGeneralParameters();
+ }
}