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 Describes the desired behavior of the ARCore Cloud Anchor API. 
enum Config.DepthMode Selects the desired depth mode. 
enum Config.FlashMode Selects the desired behavior of the camera flash subsystem. 
enum Config.FocusMode On supported devices, selects the desired camera focus mode. 
enum Config.GeospatialMode Describes the desired behavior of the ARCore Geospatial API. 
enum Config.ImageStabilizationMode Describes the behavior of the Electronic Image Stabilization (EIS) API. 
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.SemanticMode Describes the desired behavior of the Scene Semantics API. 
enum Config.StreetscapeGeometryMode Describes the behavior of the Geospatial Streetscape Geometry API. 
enum Config.TextureUpdateMode Describes how ARCore will update the camera texture. 
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.FlashMode
getFlashMode()
Returns the currently configured flash mode.
Config.FocusMode
getFocusMode()
Returns the currently configured desired focus mode.
Config.GeospatialMode
getGeospatialMode()
Returns the Geospatial mode set on this Config.
Config.ImageStabilizationMode
getImageStabilizationMode()
Gets the camera image stabilization mode set.
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.SemanticMode
getSemanticMode()
Gets the currently configured Config.SemanticMode.
Config.StreetscapeGeometryMode
getStreetscapeGeometryMode()
Returns the Streetscape Geometry mode set on this Config.
Config.TextureUpdateMode
getTextureUpdateMode()
Gets the currently configured Config.TextureUpdateMode.
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
setFlashMode(Config.FlashMode flashMode)
Sets the flash mode.
Config
setFocusMode(Config.FocusMode focusMode)
Sets the desired focus mode.
Config
setGeospatialMode(Config.GeospatialMode geospatialMode)
Sets the desired Geospatial mode.
Config
setImageStabilizationMode(Config.ImageStabilizationMode imageStabilizationMode)
Sets the camera image stabilization 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
setSemanticMode(Config.SemanticMode semanticMode)
Sets the desired configuration for the Scene Semantics API.
Config
setStreetscapeGeometryMode(Config.StreetscapeGeometryMode streetscapeGeometryMode)
Sets the desired configuration for the Streetscape Geometry API.
Config
setTextureUpdateMode(Config.TextureUpdateMode textureUpdateMode)
Sets the desired Texture Update Mode.
Config
setUpdateMode(Config.UpdateMode updateMode)
Sets the behavior of Session.update().

Inherited Methods

Public Constructors

Config

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.

Details
Parameters
session

Public Methods

getAugmentedFaceMode

public Config.AugmentedFaceMode getAugmentedFaceMode()

Returns the currently configured Augmented Faces mode.

getAugmentedImageDatabase

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.

Details
Returns The AugmentedImageDatabase from the session config, or an empty AugmentedImageDatabase constructed by AugmentedImageDatabase.AugmentedImageDatabase(Session) if no AugmentedImageDatabase has been configured.

getCloudAnchorMode

public Config.CloudAnchorMode getCloudAnchorMode()

Returns the currently configured cloud anchor mode.

getDepthMode

public Config.DepthMode getDepthMode()

Gets the currently configured Config.DepthMode.

getFlashMode

public Config.FlashMode getFlashMode()

Returns the currently configured flash mode.

getFocusMode

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.

getGeospatialMode

public Config.GeospatialMode getGeospatialMode()

Returns the Geospatial mode set on this Config.

getImageStabilizationMode

public Config.ImageStabilizationMode getImageStabilizationMode()

Gets the camera image stabilization mode set.

getInstantPlacementMode

public Config.InstantPlacementMode getInstantPlacementMode()

Returns the currently configured Config.InstantPlacementMode.

getLightEstimationMode

public Config.LightEstimationMode getLightEstimationMode()

Returns the currently configured lighting estimation mode.

getPlaneFindingMode

public Config.PlaneFindingMode getPlaneFindingMode()

Returns the currently configured plane finding mode.

getSemanticMode

public Config.SemanticMode getSemanticMode()

Gets the currently configured Config.SemanticMode.

getStreetscapeGeometryMode

public Config.StreetscapeGeometryMode getStreetscapeGeometryMode()

Returns the Streetscape Geometry mode set on this Config.

getTextureUpdateMode

public Config.TextureUpdateMode getTextureUpdateMode()

Gets the currently configured Config.TextureUpdateMode.

getUpdateMode

public Config.UpdateMode getUpdateMode()

Returns the currently configured behavior of Session.update().

setAugmentedFaceMode

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.

Details
Parameters
augmentedFaceMode The Augmented Face mode to select.

setAugmentedImageDatabase

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.

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

setCloudAnchorMode

public Config setCloudAnchorMode(
  Config.CloudAnchorMode cloudAnchorMode
)

Sets the cloud anchor mode of the Session.

Details
Parameters
cloudAnchorMode The cloud anchor mode.

setDepthMode

public Config setDepthMode(
  Config.DepthMode mode
)

Sets the desired Config.DepthMode.

Notes:

Details
Parameters
mode

setFlashMode

public Config setFlashMode(
  Config.FlashMode flashMode
)

Sets the flash mode. See Config.FlashMode for available options.

The default flash mode is Config.FlashMode.OFF. Note, on devices where camera flash hardware is not supported, calling this function will do nothing. See the documentation page for more information on how to query device capability.

Details
Parameters
flashMode The flash mode to select.

setFocusMode

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.

Details
Parameters
focusMode The desired focus mode.

setGeospatialMode

public Config setGeospatialMode(
  Config.GeospatialMode geospatialMode
)

Sets the desired Geospatial mode. See Config.GeospatialMode for available options.

Details
Parameters
geospatialMode The Geospatial mode to select.

setImageStabilizationMode

public Config setImageStabilizationMode(
  Config.ImageStabilizationMode imageStabilizationMode
)

Sets the camera image stabilization mode. See Config.ImageStabilizationMode for available options.

Details
Parameters
imageStabilizationMode The image stabilization mode to set.

setInstantPlacementMode

public Config setInstantPlacementMode(
  Config.InstantPlacementMode instantPlacementMode
)

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

Details
Parameters
instantPlacementMode the desired Instant Placement mode

setLightEstimationMode

public Config setLightEstimationMode(
  Config.LightEstimationMode lightEstimationMode
)

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

Details
Parameters
lightEstimationMode The lighting estimation mode to select.

setPlaneFindingMode

public Config setPlaneFindingMode(
  Config.PlaneFindingMode planeFindingMode
)

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

Details
Parameters
planeFindingMode The plane finding mode to select.

setSemanticMode

public Config setSemanticMode(
  Config.SemanticMode semanticMode
)

Sets the desired configuration for the Scene Semantics API. See Config.SemanticMode for available options and usage information.

Not all devices support all modes. Use Session.isSemanticModeSupported(Config.SemanticMode) to determine whether the current device and the selected camera support a particular semantic mode.

Details
Parameters
semanticMode

setStreetscapeGeometryMode

public Config setStreetscapeGeometryMode(
  Config.StreetscapeGeometryMode streetscapeGeometryMode
)

Sets the desired configuration for the Streetscape Geometry API. See Config.StreetscapeGeometryMode for available options and usage information.

Details
Parameters
streetscapeGeometryMode The Streetscape Geometry mode to set.

setTextureUpdateMode

public Config setTextureUpdateMode(
  Config.TextureUpdateMode textureUpdateMode
)

Sets the desired Texture Update Mode. See Config.TextureUpdateMode for available options.

Details
Parameters
textureUpdateMode The Texture Update Mode to select.

setUpdateMode

public Config setUpdateMode(
  Config.UpdateMode updateMode
)

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

Details
Parameters
updateMode The behavior to select.