# RegionKt

Added in 1.1.0

*** ** * ** ***


```
public final class RegionKt
```

<br />

*** ** * ** ***

## Summary

| ### Public methods |
|---|---|
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).and(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Return the intersection of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).and(android.graphics.Region)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html r)` Return the intersection of this region and the specified region as a new region. |
| `static final boolean` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).contains(android.graphics.Point)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Point.html p)` Return true if the region contains the specified `https://developer.android.com/reference/android/graphics/Point.html`. |
| `static final void` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).forEach(kotlin.Function1)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull Function1<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html, https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html> action )` Performs the given action on each rect in this region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Iterator.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html>` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).iterator()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver)` Returns an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterator/index.html` over the rects in this region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).minus(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Return the difference of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).minus(android.graphics.Region)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html r)` Return the difference of this region and the specified region as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).not()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver)` Returns the negation of this region as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).or(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Return the union of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).or(android.graphics.Region)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html r)` Return the union of this region and the specified region as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).plus(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Return the union of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).plus(android.graphics.Region)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html r)` Return the union of this region and the specified region as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).unaryMinus()(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver)` Returns the negation of this region as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).xor(android.graphics.Rect)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Rect.html r)` Return the union minus the intersection of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/graphics/RegionKt#(android.graphics.Region).xor(android.graphics.Region)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Region.html r)` Return the union minus the intersection of this region and the specified region as a new region. |

## Public methods

### and

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:and) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region and(@NonNull Region receiver, @NonNull Rect r)
```

Return the intersection of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region.

### and

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:and) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region and(@NonNull Region receiver, @NonNull Region r)
```

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

### contains

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:contains) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final boolean contains(@NonNull Region receiver, @NonNull Point p)
```

Return true if the region contains the specified `https://developer.android.com/reference/android/graphics/Point.html`.

### forEach

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:forEach) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final void forEach(
    @NonNull Region receiver,
    @NonNull Function1<@NonNull Rect, Unit> action
)
```

Performs the given action on each rect in this region.

### iterator

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:iterator) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Iterator<@NonNull Rect> iterator(@NonNull Region receiver)
```

Returns an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-iterator/index.html` over the rects in this region.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region minus(@NonNull Region receiver, @NonNull Rect r)
```

Return the difference of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region.

### minus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:minus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region minus(@NonNull Region receiver, @NonNull Region r)
```

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

### not

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:not) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region not(@NonNull Region receiver)
```

Returns the negation of this region as a new region.

### or

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:or) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region or(@NonNull Region receiver, @NonNull Rect r)
```

Return the union of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region.

### or

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:or) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region or(@NonNull Region receiver, @NonNull Region r)
```

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

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region plus(@NonNull Region receiver, @NonNull Rect r)
```

Return the union of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region.

### plus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:plus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region plus(@NonNull Region receiver, @NonNull Region r)
```

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

### unaryMinus

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:unaryMinus) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region unaryMinus(@NonNull Region receiver)
```

Returns the negation of this region as a new region.

### xor

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:xor) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region xor(@NonNull Region receiver, @NonNull Rect r)
```

Return the union minus the intersection of this region and the specified `https://developer.android.com/reference/android/graphics/Rect.html` as a new region.

### xor

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/graphics/Region.kt+function:xor) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

```
public static final @NonNull Region xor(@NonNull Region receiver, @NonNull Region r)
```

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