# AugmentedImage

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

*** ** * ** ***


```
public final class AugmentedImage implements Trackable<@NonNull AugmentedImage.State>
```

<br />

*** ** * ** ***

Describes the system's current best knowledge of a real-world image

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage.State implements https://developer.android.com/reference/androidx/xr/arcore/Trackable.State` The representation of the current state of an `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage`. |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage.State>` | `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage#getState()()` The current state of the `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage` |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage>>` | `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage#subscribe(androidx.xr.runtime.Session)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session)` Emits tracked augmented images in the `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage.Companion#subscribe(androidx.xr.runtime.Session)`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage#toString()()` Returns a string representation of `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage` for debugging. |

## Public methods

### getState

```
public @NonNull StateFlow<@NonNull AugmentedImage.State> getState()
```

The current state of the `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage`

### subscribe

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

```
public static final @NonNull StateFlow<@NonNull Collection<@NonNull AugmentedImage>> subscribe(@NonNull Session session)
```

Emits tracked augmented images in the `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage.Companion#subscribe(androidx.xr.runtime.Session)`.

Only instances of `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage` that are `https://developer.android.com/reference/androidx/xr/arcore/TrackingState#TRACKING()` will be emitted in the `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-collection/index.html`. Instances of the same `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage` will remain between subsequent emits to the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html` as long as they remain tracking.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/Session session` | the `https://developer.android.com/reference/androidx/xr/runtime/Session` to subscribe to |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/Collection.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage>>` | a `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/-state-flow/index.html` that emits a collection of AugmentedImages |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-state-exception/index.html` | if the `https://developer.android.com/reference/androidx/xr/runtime/Config#augmentedImageDatabase()` is empty |

### toString

```
public @NonNull String toString()
```

Returns a string representation of `https://developer.android.com/reference/androidx/xr/arcore/AugmentedImage` for debugging.

Note: Not intended for production use.