ImageUtils

object ImageUtils

Functions

Link copied to clipboard
fun computeCropRectFromAspectRatio(sourceSize: Size, aspectRatio: Rational): Rect?

Calculates crop rect with the specified aspect ratio on the given size. Assuming the rect is at the center of the source.

Link copied to clipboard

Crops byte array with given android.graphics.Rect.

Link copied to clipboard
fun isAspectRatioValid(aspectRatio: Rational?): Boolean

True if the given aspect ratio is meaningful.

fun isAspectRatioValid(sourceSize: Size, aspectRatio: Rational?): Boolean

True if the given aspect ratio is meaningful and has effect on the given size.

Link copied to clipboard