diff options
author | Chih-Chung Chang <chihchung@google.com> | 2012-02-22 08:00:31 +0800 |
---|---|---|
committer | Chih-Chung Chang <chihchung@google.com> | 2012-02-23 09:15:21 +0800 |
commit | 23a22e3510d1ef95c67455b3f59025aa985b8542 (patch) | |
tree | b704dd4b033659c39939134a110d9737861fe4b8 /gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java | |
parent | d92874aa026e33a3011a30b6fcc17019f8b1c0be (diff) | |
download | android_packages_apps_Snap-23a22e3510d1ef95c67455b3f59025aa985b8542.tar.gz android_packages_apps_Snap-23a22e3510d1ef95c67455b3f59025aa985b8542.tar.bz2 android_packages_apps_Snap-23a22e3510d1ef95c67455b3f59025aa985b8542.zip |
Remove unused code.
Change-Id: I167596ab023671651df298ddb2b80b7c782f4223
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java')
-rw-r--r-- | gallerycommon/src/com/android/gallery3d/common/BitmapUtils.java | 25 |
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(); |