Config

public class Config

Holds settings that are used to configure the session. To apply a configuration, use configure(Config).

Nested Classes

enum Config.AugmentedFaceMode Selects the behaviour of Augmented Faces subsystem. 
enum Config.CloudAnchorMode The cloud anchor mode in Config
enum Config.FocusMode Selects the desired behavior of the camera focus subsystem. 
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

Config.AugmentedFaceMode
getAugmentedFaceMode()
Returns the currently configured Augmented Faces mode.
AugmentedImageDatabase
getAugmentedImageDatabase()
Returns the currently configured AugmentedImageDatabase.
Config.CloudAnchorMode
getCloudAnchorMode()
Returns the currently configured cloud anchor mode.
Config.FocusMode
getFocusMode()
Returns the currently configured focus 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().
Config
setAugmentedFaceMode(Config.AugmentedFaceMode augmentedFaceMode)
Sets the desired Augmented Faces mode.
Config
setAugmentedImageDatabase(AugmentedImageDatabase augmentedImageDatabase)
Sets the currently active AugmentedImageDatabase.
Config
setCloudAnchorMode(Config.CloudAnchorMode cloudAnchorMode)
Sets the cloud anchor mode of the Session.
Config
setFocusMode(Config.FocusMode focusMode)
Sets the desired focus mode.
Config
setLightEstimationMode(Config.LightEstimationMode lightEstimationMode)
Sets the desired lighting estimation mode.
Config
setPlaneFindingMode(Config.PlaneFindingMode planeFindingMode)
Sets the desired plane finding mode.
Config
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 Config.AugmentedFaceMode getAugmentedFaceMode ()

Returns the currently configured Augmented Faces mode.

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.FocusMode getFocusMode ()

Returns the currently configured focus 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 Config setAugmentedFaceMode (Config.AugmentedFaceMode augmentedFaceMode)

Sets the desired Augmented Faces mode. See Config.AugmentedFaceMode for available options. Augmented Faces is currently only supported when using the front-facing (selfie) camera. See FRONT_CAMERA for details and restrictions.

Parameters
augmentedFaceMode The Augmented Face mode to select.

public Config setAugmentedImageDatabase (AugmentedImageDatabase augmentedImageDatabase)

Sets the currently active AugmentedImageDatabase.

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 Config setCloudAnchorMode (Config.CloudAnchorMode cloudAnchorMode)

Sets the cloud anchor mode of the Session.

Parameters
cloudAnchorMode The cloud anchor mode.

public Config setFocusMode (Config.FocusMode focusMode)

Sets the desired focus mode. See Config.FocusMode for available options.

The default focus mode varies by device and camera, and is set to optimize AR tracking. Currently the default on most ARCore devices and cameras is FIXED, although this default might change in the future.

Note, on devices where ARCore does not support auto focus due to the use of a fixed focus camera, setting AUTO will be ignored. Similarly, on devices where tracking requires auto focus, setting FIXED will be ignored. See the ARCore supported devices page for a list of affected devices.

To determine whether the configured ARCore camera supports auto focus, query CONTROL_AF_AVAILABLE_MODES.

Parameters
focusMode The desired focus mode.

public Config setLightEstimationMode (Config.LightEstimationMode lightEstimationMode)

Sets the desired lighting estimation mode. See the Config.LightEstimationMode enum for available options.

Parameters
lightEstimationMode The lighting estimation mode to select.

public Config setPlaneFindingMode (Config.PlaneFindingMode planeFindingMode)

Sets the desired plane finding mode. See the Config.PlaneFindingMode enum for available options.

Parameters
planeFindingMode The plane finding mode to select.

public Config setUpdateMode (Config.UpdateMode updateMode)

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

Parameters
updateMode The behavior to select.