PixelRect

data class PixelRect(val x: Int, val y: Int, val width: Int, val height: Int)

A pixel rectangle within a source image.

Constructors

Link copied to clipboard
constructor(x: Int, y: Int, width: Int, height: Int)

Properties

Link copied to clipboard
val height: Int
Link copied to clipboard
val width: Int
Link copied to clipboard
val x: Int
Link copied to clipboard
val y: Int

Functions

Link copied to clipboard
fun PixelRect.clampedTo(sourceWidth: Int, sourceHeight: Int): PixelRect?

Clamps this rectangle to lie within a sourceWidth x sourceHeight image, or null if it doesn't overlap the image at all (degenerate). Keeps the platform crop codecs from throwing on an off-image or oversized rect produced by gesture rounding.