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
Content copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
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
Link copied to clipboard
Get the # of degrees an image must be rotated to match the given exif orientation.
Link copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
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
Content copied to clipboard
Content copied to clipboard
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
Content copied to clipboard
Creates a bitmap from a source bitmap and rounds the corners, applying a potentially different [X, Y] radius to each corner.