Config

public class Config

Holds settings that are used to configure the session.

Nested Classes

enum Config.CloudAnchorMode The cloud anchor mode in Config
enum Config.LightEstimationMode Select the behavior of the lighting estimation subsystem. 
enum Config.PlaneFindingMode Select the behavior of the plane detection subsystem. 
enum Config.UpdateMode Selects the behavior of update()

Public Constructors

Config(Session session)
Constructs a sensible default configuration.

Protected Constructors

Config()
(FOR TESTING) Constructs a new instance for use as a mock.

Public Methods

AugmentedImageDatabase
getAugmentedImageDatabase()
Returns the currently configured AugmentedImageDatabase.
Config.CloudAnchorMode
getCloudAnchorMode()
Returns the currently configured cloud anchor mode.
Config.LightEstimationMode
getLightEstimationMode()
Returns the currently configured lighting estimation mode.
Config.PlaneFindingMode
getPlaneFindingMode()
Returns the currently configured plane finding mode.
Config.UpdateMode
getUpdateMode()
Returns the currently configured behavior of update().
void
setAugmentedImageDatabase(AugmentedImageDatabase augmentedImageDatabase)
Sets the AugmentedImageDatabase that should be used.
void
setCloudAnchorMode(Config.CloudAnchorMode cloudAnchorMode)
Sets the cloud anchor mode of the Session.
void
setLightEstimationMode(Config.LightEstimationMode lightEstimationMode)
Sets the lighting estimation mode that should be used.
void
setPlaneFindingMode(Config.PlaneFindingMode planeFindingMode)
Sets the plane finding mode that should be used.
void
setUpdateMode(Config.UpdateMode updateMode)
Sets the behavior of update().

Inherited Methods

Public Constructors

public Config (Session session)

Constructs a sensible default configuration. Plane detection and lighting estimation are enabled, and blocking update is selected. This configuration is guaranteed to be supported on all devices that support ARCore.

Parameters
session

Protected Constructors

protected Config ()

(FOR TESTING) Constructs a new instance for use as a mock. Calling any base method implementation on this instance may return unexpected results, throw an exception, or even crash.

To create a Config normally, use Config(Session).

Public Methods

public AugmentedImageDatabase getAugmentedImageDatabase ()

Returns the currently configured AugmentedImageDatabase.

This returns a copy of the internally stored database, so any changes to the copy will not affect the current configuration or session.

Returns

public Config.CloudAnchorMode getCloudAnchorMode ()

Returns the currently configured cloud anchor mode.

public Config.LightEstimationMode getLightEstimationMode ()

Returns the currently configured lighting estimation mode.

public Config.PlaneFindingMode getPlaneFindingMode ()

Returns the currently configured plane finding mode.

public Config.UpdateMode getUpdateMode ()

Returns the currently configured behavior of update().

public void setAugmentedImageDatabase (AugmentedImageDatabase augmentedImageDatabase)

Sets the AugmentedImageDatabase that should be used.

Overrides the existing AugmentedImageDatabase in the configuration, if any. Any images in the currently active image database that have a TRACKING/PAUSED state will immediately be set to the STOPPED state if a different or null image database is set.

This makes a copy of the database, so any changes to the database after calling this method will not be reflected in the current configuration or session.

Parameters
augmentedImageDatabase The AugmentedImageDatabase to be used, or null to disable augmented images.

public void setCloudAnchorMode (Config.CloudAnchorMode cloudAnchorMode)

Sets the cloud anchor mode of the Session.

Parameters
cloudAnchorMode The cloud anchor mode.

public void setLightEstimationMode (Config.LightEstimationMode lightEstimationMode)

Sets the lighting estimation mode that should be used. See the Config.LightEstimationMode enum for available options.

Parameters
lightEstimationMode The lighting estimation mode to select.

public void setPlaneFindingMode (Config.PlaneFindingMode planeFindingMode)

Sets the plane finding mode that should be used. See the Config.PlaneFindingMode enum for available options.

Parameters
planeFindingMode The plane finding mode to select.

public void setUpdateMode (Config.UpdateMode updateMode)

Sets the behavior of update(). See the Config.UpdateMode enum for available options.

Parameters
updateMode The behavior to select.

Send feedback about...