AugmentedImageDatabase


public final 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 methods

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

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

final @NonNull AugmentedImageDatabase

Creates a copy of this AugmentedImageDatabase

boolean
equals(Object other)
final @NonNull List<@NonNull AugmentedImageDatabaseEntry>

The list of AugmentedImageDatabaseEntry objects currently in the database

int

Public constructors

AugmentedImageDatabase

Added in 1.0.0-alpha14
public AugmentedImageDatabase()

Public methods

addAugmentedImageDatabaseEntry

Added in 1.0.0-alpha14
public final int addAugmentedImageDatabaseEntry(
    @NonNull AugmentedImageDatabaseEntryMode mode,
    @NonNull Bitmap bitmap,
    float widthInMeters
)

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

Parameters
@NonNull AugmentedImageDatabaseEntryMode mode

The mode used to detect the image

@NonNull Bitmap bitmap

The bitmap of the image in android.graphics.Bitmap.Config.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 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
public final @NonNull AugmentedImageDatabase copy()

Creates a copy of this AugmentedImageDatabase

Returns
@NonNull AugmentedImageDatabase

A new AugmentedImageDatabase instance with the same entries

equals

public boolean equals(Object other)

getEntries

Added in 1.0.0-alpha14
public final @NonNull List<@NonNull AugmentedImageDatabaseEntrygetEntries()

The list of AugmentedImageDatabaseEntry objects currently in the database

hashCode

public int hashCode()