Rect

data class Rect(val left: Double, val top: Double, val right: Double, val bottom: Double)

An axis-aligned rectangle in pixel coordinates.

Constructors

Link copied to clipboard
constructor(left: Double, top: Double, right: Double, bottom: Double)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val top: Double
Link copied to clipboard

Functions

Link copied to clipboard
fun clampTo(width: Int, height: Int): Rect

Returns this rectangle clamped to [0, width] x [0, height].

Link copied to clipboard
fun iou(other: Rect): Double

Intersection-over-union with other, in 0.0..1.0.