# AugmentedImageDatabase

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

*** ** * ** ***


```
public final class AugmentedImageDatabase
```

<br />

*** ** * ** ***

Database of target images used by the tracker via `https://developer.android.com/reference/androidx/xr/runtime/Config#augmentedImageDatabase()`.

Supported runtimes:

- OpenXR

Required permissions:

- `https://developer.android.com/reference/androidx/xr/runtime/manifest/package-summary#SCENE_UNDERSTANDING_COARSE()`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#AugmentedImageDatabase()()` |

| ### Public methods |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#addAugmentedImageDatabaseEntry(androidx.xr.runtime.AugmentedImageDatabaseEntryMode,android.graphics.Bitmap,kotlin.Float)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabaseEntryMode mode, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html bitmap, float widthInMeters )` Adds a bitmap to the database as a tracking target. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#copy()()` Creates a copy of this `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase` |
| `boolean` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/util/List.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabaseEntry>` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#getEntries()()` the list of `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabaseEntry` objects currently in the database |
| `int` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase#toString()()` Returns a string representation of `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase` for debugging. |

## Public constructors

### AugmentedImageDatabase

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

```
public AugmentedImageDatabase()
```

## Public methods

### addAugmentedImageDatabaseEntry

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

```
public final int addAugmentedImageDatabaseEntry(
    @NonNull AugmentedImageDatabaseEntryMode mode,
    @NonNull Bitmap bitmap,
    float widthInMeters
)
```

Adds a bitmap to the database as a tracking target.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabaseEntryMode mode` | the mode used to detect the image |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/graphics/Bitmap.html bitmap` | the bitmap of the image in `https://developer.android.com/reference/android/graphics/Bitmap.Config.html#ARGB_8888` format |
| `float widthInMeters` | the physical width of the image in meters. If zero, the physical width will be estimated if the device supports it. If physical size estimation is not supported, configuring the `https://developer.android.com/reference/androidx/xr/runtime/Session` adding an entry with widthInMeters being 0f or lower will throw an `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` |

| Returns |
|---|---|
| `int` | the zero-based positional index of the image within the database |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if the bitmap format is different from `ARGB_8888` |

### copy

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

```
public final @NonNull AugmentedImageDatabase copy()
```

Creates a copy of this `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase`

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase` | a new `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabase` instance with the same entries |

### equals

```
public boolean equals(Object other)
```

### getEntries

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

```
public final @NonNull List<@NonNull AugmentedImageDatabaseEntry> getEntries()
```

the list of `https://developer.android.com/reference/androidx/xr/runtime/AugmentedImageDatabaseEntry` objects currently in the database

### hashCode

```
public int hashCode()
```

### toString

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

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

Note: Not intended for production use.