core-ktx / androidx.graphics / android.graphics.Region

Extensions for android.graphics.Region

and

infix fun Region.and(r: Rect): Region

Return the union of this region and the specified Rect as a new region.

infix fun Region.and(r: Region): Region

Return the union of this region and the specified region as a new region.

contains

operator fun Region.contains(p: Point): Boolean

Return true if the region contains the specified Point.

forEach

fun Region.forEach(action: (rect: Rect) -> Unit): Unit

Performs the given action on each rect in this region.

iterator

operator fun Region.iterator(): Iterator<Rect>

Returns an Iterator over the rects in this region.

minus

operator fun Region.minus(r: Rect): Region

Return the difference of this region and the specified Rect as a new region.

operator fun Region.minus(r: Region): Region

Return the difference of this region and the specified region as a new region.

not

operator fun Region.not(): Region

Returns the negation of this region as a new region.

or

infix fun Region.or(r: Rect): Region

Return the intersection of this region and the specified Rect as a new region.

infix fun Region.or(r: Region): Region

Return the intersection of this region and the specified region as a new region.

plus

operator fun Region.plus(r: Rect): Region

Return the union of this region and the specified Rect as a new region.

operator fun Region.plus(r: Region): Region

Return the union of this region and the specified region as a new region.

unaryMinus

operator fun Region.unaryMinus(): Region

Returns the negation of this region as a new region.

xor

infix fun Region.xor(r: Rect): Region

Return the union minus the intersection of this region and the specified Rect as a new region.

infix fun Region.xor(r: Region): Region

Return the union minus the intersection of this region and the specified region as a new region.