# 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)

*** ** * ** ***


```
class AugmentedImageDatabase
```

<br />

*** ** * ** ***

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

Supported runtimes:

- OpenXR

Required permissions:

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

## Summary

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#addAugmentedImageDatabaseEntry(androidx.xr.runtime.AugmentedImageDatabaseEntryMode,android.graphics.Bitmap,kotlin.Float)( mode: https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabaseEntryMode, bitmap: https://developer.android.com/reference/android/graphics/Bitmap.html, widthInMeters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` Adds a bitmap to the database as a tracking target. |
| `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#copy()()` Creates a copy of this `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase` |
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#hashCode()()` |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#toString()()` Returns a string representation of `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase` for debugging. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabaseEntry>` | `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabase#entries()` the list of `https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabaseEntry` objects currently in the database |

## Public constructors

### AugmentedImageDatabase

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

```
AugmentedImageDatabase()
```

## Public functions

### addAugmentedImageDatabaseEntry

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

```
fun addAugmentedImageDatabaseEntry(
    mode: AugmentedImageDatabaseEntryMode,
    bitmap: Bitmap,
    widthInMeters: Float = 0.0f
): Int
```

Adds a bitmap to the database as a tracking target.

| Parameters |
|---|---|
| `mode: https://developer.android.com/reference/kotlin/androidx/xr/runtime/AugmentedImageDatabaseEntryMode` | the mode used to detect the image |
| `bitmap: https://developer.android.com/reference/android/graphics/Bitmap.html` | the bitmap of the image in `https://developer.android.com/reference/android/graphics/Bitmap.Config.html#ARGB_8888` format |
| `widthInMeters: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = 0.0f` | 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/kotlin/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 |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | 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)

```
fun copy(): AugmentedImageDatabase
```

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

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

### equals

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

```
open fun hashCode(): Int
```

### toString

```
open fun toString(): String
```

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

Note: Not intended for production use.

## Public properties

### entries

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

```
val entries: List<AugmentedImageDatabaseEntry>
```

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