|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bumptech.glide.load.resource.bitmap.TransformationUtils
public final class TransformationUtils
A class with methods to efficiently resize Bitmaps.
| Field Summary | |
|---|---|
static int |
PAINT_FLAGS
|
| Method Summary | |
|---|---|
static Bitmap |
centerCrop(Bitmap recycled,
Bitmap toCrop,
int width,
int height)
A potentially expensive operation to crop the given Bitmap so that it fills the given dimensions. |
static Bitmap |
fitCenter(Bitmap toFit,
BitmapPool pool,
int width,
int height)
An expensive operation to resize the given Bitmap down so that it fits within the given dimensions maintain the original proportions. |
static int |
getExifOrientationDegrees(int exifOrientation)
Get the # of degrees an image must be rotated to match the given exif orientation. |
static int |
getOrientation(String pathToOriginal)
Deprecated. No longer used by Glide, scheduled to be removed in Glide 4.0 |
static Bitmap |
orientImage(String pathToOriginal,
Bitmap imageToOrient)
Deprecated. No longer used by Glide, scheduled to be removed in Glide 4.0 |
static Bitmap |
rotateImage(Bitmap imageToOrient,
int degreesToRotate)
This is an expensive operation that copies the image in place with the pixels rotated. |
static Bitmap |
rotateImageExif(Bitmap toOrient,
BitmapPool pool,
int exifOrientation)
Rotate and/or flip the image to match the given exif orientation. |
static void |
setAlpha(Bitmap toTransform,
Bitmap outBitmap)
Sets the alpha of the Bitmap we're going to re-use to the alpha of the Bitmap we're going to transform. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PAINT_FLAGS
| Method Detail |
|---|
public static Bitmap centerCrop(Bitmap recycled,
Bitmap toCrop,
int width,
int height)
recycled - A mutable Bitmap with dimensions width and height that we can load the cropped portion of toCrop
into.toCrop - The Bitmap to resize.width - The width in pixels of the final Bitmap.height - The height in pixels of the final Bitmap.
public static Bitmap fitCenter(Bitmap toFit,
BitmapPool pool,
int width,
int height)
toFit - The Bitmap to shrink.pool - The BitmapPool to try to reuse a bitmap from.width - The width in pixels the final image will fit within.height - The height in pixels the final image will fit within.
public static void setAlpha(Bitmap toTransform,
Bitmap outBitmap)
Bitmap.hasAlpha()} consistent before and after the transformation for
transformations that don't add or remove transparent pixels.
toTransform - The Bitmap that will be transformed.outBitmap - The Bitmap that will be returned from the transformation.@Deprecated public static int getOrientation(String pathToOriginal)
pathToOriginal - Path to original image file that may have exif data.
@Deprecated
public static Bitmap orientImage(String pathToOriginal,
Bitmap imageToOrient)
pathToOriginal - Path to original image file that may have exif data.imageToOrient - Image Bitmap to orient.
public static Bitmap rotateImage(Bitmap imageToOrient,
int degreesToRotate)
imageToOrient - Image Bitmap to orient.degreesToRotate - number of degrees to rotate the image by. If zero the original image is returned
unmodified.
public static int getExifOrientationDegrees(int exifOrientation)
exifOrientation - The exif orientation [1-8]
public static Bitmap rotateImageExif(Bitmap toOrient,
BitmapPool pool,
int exifOrientation)
toOrient - The bitmap to rotate/flip.pool - A pool that may or may not contain an image of the necessary dimensions.exifOrientation - the exif orientation [1-8].
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||