AugmentedImageDatabase


class AugmentedImageDatabase


Defines an augmented image database that is going to be used by the image tracker to detect images by setting it through the androidx.xr.runtime.Config.augmentedImageDatabase parameter

Summary

Public constructors

Public functions

Int
addAugmentedImageDatabaseEntry(
    mode: AugmentedImageDatabaseEntryMode,
    bitmap: Bitmap,
    widthInMeters: Float
)

Creates a new augmented image database entry from a bitmap and adds it to the augmented image database

AugmentedImageDatabase

Creates a copy of this AugmentedImageDatabase

open operator Boolean
equals(other: Any?)
open Int

Public properties

List<AugmentedImageDatabaseEntry>

The list of AugmentedImageDatabaseEntry objects currently in the database

Public constructors

AugmentedImageDatabase

Added in 1.0.0-alpha14
AugmentedImageDatabase()

Public functions

addAugmentedImageDatabaseEntry

Added in 1.0.0-alpha14
fun addAugmentedImageDatabaseEntry(
    mode: AugmentedImageDatabaseEntryMode,
    bitmap: Bitmap,
    widthInMeters: Float = 0.0f
): Int

Creates a new augmented image database entry from a bitmap and adds it to the augmented image database

Parameters
mode: AugmentedImageDatabaseEntryMode

The mode used to detect the image

bitmap: Bitmap

The bitmap of the image in android.graphics.Bitmap.Config.ARGB_8888 format

widthInMeters: Float = 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 Session adding an entry with widthInMeters being 0f or lower will throw an IllegalArgumentException

Returns
Int

The zero-based positional index of the image within the database

Throws
IllegalArgumentException

if the bitmap format is different from ARGB_8888

copy

Added in 1.0.0-alpha14
fun copy(): AugmentedImageDatabase

Creates a copy of this AugmentedImageDatabase

Returns
AugmentedImageDatabase

A new AugmentedImageDatabase instance with the same entries

equals

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

hashCode

open fun hashCode(): Int

Public properties

entries

Added in 1.0.0-alpha14
val entriesList<AugmentedImageDatabaseEntry>

The list of AugmentedImageDatabaseEntry objects currently in the database