summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java25
1 files changed, 0 insertions, 25 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
index 67aa6d77b..75ae25fc1 100644
--- a/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
+++ b/gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java
@@ -113,15 +113,6 @@ public class BitmapUtils {
: (initialSize + 7) / 8 * 8;
}
- public static Bitmap resizeDownToPixels(
- Bitmap bitmap, int targetPixels, boolean recycle) {
- int width = bitmap.getWidth();
- int height = bitmap.getHeight();
- float scale = FloatMath.sqrt((float) targetPixels / (width * height));
- if (scale >= 1.0f) return bitmap;
- return resizeBitmapByScale(bitmap, scale, recycle);
- }
-
public static Bitmap resizeBitmapByScale(
Bitmap bitmap, float scale, boolean recycle) {
int width = Math.round(bitmap.getWidth() * scale);
@@ -166,22 +157,6 @@ public class BitmapUtils {
return resizeBitmapByScale(bitmap, scale, recycle);
}
- // Crops a square from the center of the original image.
- public static Bitmap cropCenter(Bitmap bitmap, boolean recycle) {
- int width = bitmap.getWidth();
- int height = bitmap.getHeight();
- if (width == height) return bitmap;
- int size = Math.min(width, height);
-
- Bitmap target = Bitmap.createBitmap(size, size, getConfig(bitmap));
- Canvas canvas = new Canvas(target);
- canvas.translate((size - width) / 2, (size - height) / 2);
- Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG);
- canvas.drawBitmap(bitmap, 0, 0, paint);
- if (recycle) bitmap.recycle();
- return target;
- }
-
public static Bitmap resizeDownAndCropCenter(Bitmap bitmap, int size,
boolean recycle) {
int w = bitmap.getWidth();