import android.graphics.Bitmap;
import com.android.gallery3d.app.Log;
+import com.android.gallery3d.filtershow.imageshow.MasterImage;
import com.android.gallery3d.filtershow.presets.ImagePreset;
public class RenderingRequest {
bitmap = Bitmap.createBitmap(source.getWidth(), source.getHeight(), mConfig);
}
request.setBitmap(bitmap);
- request.setImagePreset(new ImagePreset(preset));
+ ImagePreset passedPreset = new ImagePreset(preset);
+ passedPreset.setImageLoader(MasterImage.getImage().getImageLoader());
+ request.setImagePreset(passedPreset);
request.setType(type);
request.setCaller(caller);
request.post();
import android.graphics.PathMeasure;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.Rect;
import android.util.Log;
import com.android.gallery3d.R;
public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) {
int w = bitmap.getWidth();
int h = bitmap.getHeight();
- short[] rect = new short[4];
-
- Matrix m = new Matrix();
- m.setScale(scaleFactor, scaleFactor);
+ ImagePreset imgPreset = getImagePreset();
+ Rect bounds = imgPreset.getImageLoader().getOriginalBounds();
+ Matrix m = imgPreset.mGeoData.getOriginalToScreen(true,
+ bounds.width(),
+ bounds.height(), w, h);
drawData(new Canvas(bitmap), m, quality);
-
-
return bitmap;
}
}
ImageFilter filter = FiltersManager.getManager().getFilterForRepresentation(representation);
filter.useRepresentation(representation);
+ filter.setImagePreset(this);
bitmap = filter.apply(bitmap, mScaleFactor, mQuality);
}
}