# TextureSampler

Artifact: [androidx.xr.scenecore:scenecore](https://developer.android.com/jetpack/androidx/releases/xr-scenecore) [View Source](https://cs.android.com/search?q=file:androidx/xr/scenecore/TextureSampler.kt+class:androidx.xr.scenecore.TextureSampler) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

*** ** * ** ***


```
public final class TextureSampler
```

<br />

*** ** * ** ***

Defines the sampling behavior for a texture.

The fields of this sampler are based on the public [Filament TextureSampler class](https://github.com/google/filament/blob/main/android/filament-android/src/main/java/com/google/android/filament/TextureSampler.java) but may diverge over time.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MagnificationFilter` Defines the constants for texture magnification filters. |
| `public final class https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MinificationFilter` Defines the constants for texture minification filters. |
| `public final class https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode` Defines the constants for texture wrap modes. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#TextureSampler(androidx.xr.scenecore.TextureSampler.MinificationFilter,androidx.xr.scenecore.TextureSampler.MagnificationFilter,androidx.xr.scenecore.TextureSampler.WrapMode,androidx.xr.scenecore.TextureSampler.WrapMode,androidx.xr.scenecore.TextureSampler.WrapMode)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MinificationFilter minificationFilter, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MagnificationFilter magnificationFilter, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeHorizontal, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeVertical, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeDepth )` Defines the sampling behavior for a texture. |

| ### Public methods |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MagnificationFilter` | `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#getMagnificationFilter()()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MinificationFilter` | `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#getMinificationFilter()()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#getWrapModeDepth()()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#getWrapModeHorizontal()()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode` | `https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler#getWrapModeVertical()()` an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis. |

## Public constructors

### TextureSampler

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public TextureSampler(
    @NonNull TextureSampler.MinificationFilter minificationFilter,
    @NonNull TextureSampler.MagnificationFilter magnificationFilter,
    @NonNull TextureSampler.WrapMode wrapModeHorizontal,
    @NonNull TextureSampler.WrapMode wrapModeVertical,
    @NonNull TextureSampler.WrapMode wrapModeDepth
)
```

Defines the sampling behavior for a texture.

The fields of this sampler are based on the public [Filament TextureSampler class](https://github.com/google/filament/blob/main/android/filament-android/src/main/java/com/google/android/filament/TextureSampler.java) but may diverge over time.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MinificationFilter minificationFilter` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.MagnificationFilter magnificationFilter` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeHorizontal` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeVertical` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/scenecore/TextureSampler.WrapMode wrapModeDepth` | an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis. |

## Public methods

### getMagnificationFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull TextureSampler.MagnificationFilter getMagnificationFilter()
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is larger than the texture.

### getMinificationFilter

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull TextureSampler.MinificationFilter getMinificationFilter()
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how neighboring texels are sampled when the rendered size is smaller than the texture.

### getWrapModeDepth

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull TextureSampler.WrapMode getWrapModeDepth()
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the depth axis.

### getWrapModeHorizontal

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull TextureSampler.WrapMode getWrapModeHorizontal()
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the horizontal axis.

### getWrapModeVertical

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/xr-scenecore#1.0.0)

```
public final @NonNull TextureSampler.WrapMode getWrapModeVertical()
```

an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` which describes how texture coordinates outside the 0-1 range are handled along the vertical axis.