TransformationUtils

class TransformationUtils

A class with methods to efficiently resize Bitmaps.

Functions

Link copied to clipboard
open fun centerCrop(    pool: BitmapPool,     inBitmap: Bitmap,     width: Int,     height: Int): Bitmap
A potentially expensive operation to crop the given Bitmap so that it fills the given dimensions.
Link copied to clipboard
open fun centerInside(    pool: BitmapPool,     inBitmap: Bitmap,     width: Int,     height: Int): Bitmap
If the Bitmap is smaller or equal to the Target it returns the original size, if not then fitCenter is called instead.
Link copied to clipboard
open fun circleCrop(    pool: BitmapPool,     inBitmap: Bitmap,     destWidth: Int,     destHeight: Int): Bitmap
Crop the image to a circle and resize to the specified width/height.
Link copied to clipboard
open fun fitCenter(    pool: BitmapPool,     inBitmap: Bitmap,     width: Int,     height: Int): Bitmap
An expensive operation to resize the given Bitmap down so that it fits within the given dimensions maintain the original proportions.
Link copied to clipboard
open fun getBitmapDrawableLock(): Lock
Link copied to clipboard
open fun getExifOrientationDegrees(exifOrientation: Int): Int
Get the # of degrees an image must be rotated to match the given exif orientation.
Link copied to clipboard
open fun isExifOrientationRequired(exifOrientation: Int): Boolean
Returns true if the given exif orientation indicates that a transformation is necessary and false otherwise.
Link copied to clipboard
open fun rotateImage(imageToOrient: Bitmap, degreesToRotate: Int): Bitmap
This is an expensive operation that copies the image in place with the pixels rotated.
Link copied to clipboard
open fun rotateImageExif(    pool: BitmapPool,     inBitmap: Bitmap,     exifOrientation: Int): Bitmap
Rotate and/or flip the image to match the given exif orientation.
Link copied to clipboard
open fun roundedCorners(    pool: BitmapPool,     inBitmap: Bitmap,     roundingRadius: Int): Bitmap
open fun roundedCorners(    pool: BitmapPool,     inBitmap: Bitmap,     width: Int,     height: Int,     roundingRadius: Int): Bitmap
Creates a bitmap from a source bitmap and rounds the corners.
open fun roundedCorners(    pool: BitmapPool,     inBitmap: Bitmap,     topLeft: Float,     topRight: Float,     bottomRight: Float,     bottomLeft: Float): Bitmap
Creates a bitmap from a source bitmap and rounds the corners, applying a potentially different [X, Y] radius to each corner.
Link copied to clipboard
open fun setAlpha(inBitmap: Bitmap, outBitmap: Bitmap)
Sets the alpha of the Bitmap we're going to re-use to the alpha of the Bitmap we're going to transform.

Properties

Link copied to clipboard
val PAINT_FLAGS: Int