Loading src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java +4 −4 Original line number Diff line number Diff line Loading @@ -84,9 +84,9 @@ public class ImageFilterGeometry extends ImageFilter { // canvas to do a simple implementation... // TODO: and be more memory efficient! (do it in native?) Rect cropBounds = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); RectF c = mGeometry.getCropBounds(); if(c != null && c.width() > 0 && c.height() > 0) c.roundOut(cropBounds); RectF crop = mGeometry.getCropBounds(bitmap); if(crop.width() > 0 && crop.height() > 0) crop.roundOut(cropBounds); Bitmap temp = null; if (mGeometry.hasSwitchedWidthHeight()) { temp = Bitmap.createBitmap(cropBounds.height(), cropBounds.width(), mConfig); Loading @@ -94,7 +94,7 @@ public class ImageFilterGeometry extends ImageFilter { temp = Bitmap.createBitmap(cropBounds.width(), cropBounds.height(), mConfig); } Matrix drawMatrix = buildMatrix(c); Matrix drawMatrix = buildMatrix(crop); Canvas canvas = new Canvas(temp); canvas.drawBitmap(bitmap, drawMatrix, new Paint()); return temp; Loading src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java +10 −1 Original line number Diff line number Diff line Loading @@ -74,10 +74,19 @@ public class GeometryMetadata { return mStraightenRotation; } public RectF getCropBounds() { public RectF getPreviewCropBounds() { return new RectF(mCropBounds); } public RectF getCropBounds(Bitmap bitmap) { float scale = 1.0f; if (mPhotoBounds.width() > 0) { scale = bitmap.getWidth() / mPhotoBounds.width(); } return new RectF(mCropBounds.left * scale, mCropBounds.top * scale, mCropBounds.right * scale, mCropBounds.bottom * scale); } public FLIP getFlipType() { return mFlip; } Loading src/com/android/gallery3d/filtershow/imageshow/ImageGeometry.java +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ public abstract class ImageGeometry extends ImageSlave { } protected RectF getLocalCropBounds() { return mLocalGeometry.getCropBounds(); return mLocalGeometry.getPreviewCropBounds(); } protected RectF getLocalDisplayBounds() { Loading Loading
src/com/android/gallery3d/filtershow/filters/ImageFilterGeometry.java +4 −4 Original line number Diff line number Diff line Loading @@ -84,9 +84,9 @@ public class ImageFilterGeometry extends ImageFilter { // canvas to do a simple implementation... // TODO: and be more memory efficient! (do it in native?) Rect cropBounds = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight()); RectF c = mGeometry.getCropBounds(); if(c != null && c.width() > 0 && c.height() > 0) c.roundOut(cropBounds); RectF crop = mGeometry.getCropBounds(bitmap); if(crop.width() > 0 && crop.height() > 0) crop.roundOut(cropBounds); Bitmap temp = null; if (mGeometry.hasSwitchedWidthHeight()) { temp = Bitmap.createBitmap(cropBounds.height(), cropBounds.width(), mConfig); Loading @@ -94,7 +94,7 @@ public class ImageFilterGeometry extends ImageFilter { temp = Bitmap.createBitmap(cropBounds.width(), cropBounds.height(), mConfig); } Matrix drawMatrix = buildMatrix(c); Matrix drawMatrix = buildMatrix(crop); Canvas canvas = new Canvas(temp); canvas.drawBitmap(bitmap, drawMatrix, new Paint()); return temp; Loading
src/com/android/gallery3d/filtershow/imageshow/GeometryMetadata.java +10 −1 Original line number Diff line number Diff line Loading @@ -74,10 +74,19 @@ public class GeometryMetadata { return mStraightenRotation; } public RectF getCropBounds() { public RectF getPreviewCropBounds() { return new RectF(mCropBounds); } public RectF getCropBounds(Bitmap bitmap) { float scale = 1.0f; if (mPhotoBounds.width() > 0) { scale = bitmap.getWidth() / mPhotoBounds.width(); } return new RectF(mCropBounds.left * scale, mCropBounds.top * scale, mCropBounds.right * scale, mCropBounds.bottom * scale); } public FLIP getFlipType() { return mFlip; } Loading
src/com/android/gallery3d/filtershow/imageshow/ImageGeometry.java +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ public abstract class ImageGeometry extends ImageSlave { } protected RectF getLocalCropBounds() { return mLocalGeometry.getCropBounds(); return mLocalGeometry.getPreviewCropBounds(); } protected RectF getLocalDisplayBounds() { Loading