Google is committed to advancing racial equity for Black communities. See how.

Config

public class Config

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

Nested Classes

enum Config.AugmentedFaceMode Selects the behavior of Augmented Faces subsystem. 
enum Config.CloudAnchorMode The cloud anchor mode in Config
enum Config.DepthMode Selects the desired depth mode. 
enum Config.FocusMode On supported devices, selects the desired camera focus mode. 
enum Config.InstantPlacementMode Select the behavior of Instant Placement. 
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 Session.update()

Public Constructors

Config(Session session)
Constructs a sensible default configuration.

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.DepthMode
getDepthMode()
Gets the currently configured Config.DepthMode.
Config.FocusMode
getFocusMode()
Returns the currently configured desired focus mode.
Config.InstantPlacementMode
getInstantPlacementMode()
Returns the currently configured Config.InstantPlacementMode.
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 Session.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
Config
setFocusMode(Config.FocusMode focusMode)
Sets the desired focus mode.
Config
setInstantPlacementMode(Config.InstantPlacementMode instantPlacementMode)
Sets the desired Instant Placement 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 Session.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

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.DepthMode getDepthMode ()

Gets the currently configured Config.DepthMode.

public Config.FocusMode getFocusMode ()

Returns the currently configured desired focus mode.

Note: Desired focus mode may be different from the actual focus mode. See the ARCore supported devices page for a list of affected devices.

public Config.InstantPlacementMode getInstantPlacementMode ()

Returns the currently configured Config.InstantPlacementMode.

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 Session.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 Session.Feature.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 setDepthMode (Config.DepthMode mode)

Sets the desired Config.DepthMode.

Notes:

Parameters
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 Config.FocusMode.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 Config.FocusMode.AUTO will be ignored. Similarly, on devices where tracking requires auto focus, setting Config.FocusMode.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 CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES.

Parameters
focusMode The desired focus mode.

public Config setInstantPlacementMode (Config.InstantPlacementMode instantPlacementMode)

Sets the desired Instant Placement mode. See Config.InstantPlacementMode for available options.

Parameters
instantPlacementMode the desired Instant Placement 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 Session.update(). See the Config.UpdateMode enum for available options.

Parameters
updateMode The behavior to select.