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
|
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
|
setDepthMode(Config.DepthMode mode)
Sets the desired
Config.DepthMode . |
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
public Config (Session session)
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 |
|
Public Methods
public Config.AugmentedFaceMode getAugmentedFaceMode ()
getAugmentedFaceMode
public Config.AugmentedFaceMode getAugmentedFaceMode()
Returns the currently configured Augmented Faces mode.
public AugmentedImageDatabase getAugmentedImageDatabase ()
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.
|
public Config.CloudAnchorMode getCloudAnchorMode ()
getCloudAnchorMode
public Config.CloudAnchorMode getCloudAnchorMode()
Returns the currently configured cloud anchor mode.
public Config.DepthMode getDepthMode ()
getDepthMode
public Config.DepthMode getDepthMode()
Gets the currently configured Config.DepthMode
.
public Config.FlashMode getFlashMode ()
getFlashMode
public Config.FlashMode getFlashMode()
Returns the currently configured flash mode.
public Config.FocusMode getFocusMode ()
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.
public Config.GeospatialMode getGeospatialMode ()
getGeospatialMode
public Config.GeospatialMode getGeospatialMode()
Returns the Geospatial mode set on this Config
.
public Config.ImageStabilizationMode getImageStabilizationMode ()
getImageStabilizationMode
public Config.ImageStabilizationMode getImageStabilizationMode()
Gets the camera image stabilization mode set.
public Config.InstantPlacementMode getInstantPlacementMode ()
getInstantPlacementMode
public Config.InstantPlacementMode getInstantPlacementMode()
Returns the currently configured Config.InstantPlacementMode
.
public Config.LightEstimationMode getLightEstimationMode ()
getLightEstimationMode
public Config.LightEstimationMode getLightEstimationMode()
Returns the currently configured lighting estimation mode.
public Config.PlaneFindingMode getPlaneFindingMode ()
getPlaneFindingMode
public Config.PlaneFindingMode getPlaneFindingMode()
Returns the currently configured plane finding mode.
public Config.SemanticMode getSemanticMode ()
getSemanticMode
public Config.SemanticMode getSemanticMode()
Gets the currently configured Config.SemanticMode
.
public Config.StreetscapeGeometryMode getStreetscapeGeometryMode ()
getStreetscapeGeometryMode
public Config.StreetscapeGeometryMode getStreetscapeGeometryMode()
Returns the Streetscape Geometry mode set on this Config
.
public Config.TextureUpdateMode getTextureUpdateMode ()
getTextureUpdateMode
public Config.TextureUpdateMode getTextureUpdateMode()
Gets the currently configured Config.TextureUpdateMode
.
public Config.UpdateMode getUpdateMode ()
getUpdateMode
public Config.UpdateMode getUpdateMode()
Returns the currently configured behavior of Session.update()
.
public Config setAugmentedFaceMode (Config.AugmentedFaceMode augmentedFaceMode)
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 |
|
public Config setAugmentedImageDatabase (AugmentedImageDatabase augmentedImageDatabase)
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 |
|
public Config setCloudAnchorMode (Config.CloudAnchorMode cloudAnchorMode)
setCloudAnchorMode
public Config setCloudAnchorMode( Config.CloudAnchorMode cloudAnchorMode )
Sets the cloud anchor mode of the Session
.
Details | |||
---|---|---|---|
Parameters |
|
public Config setDepthMode (Config.DepthMode mode)
setDepthMode
public Config setDepthMode( Config.DepthMode mode )
Sets the desired Config.DepthMode
.
Notes:
- Not all devices support all modes. Use
Session.isDepthModeSupported(Config.DepthMode)
to determine whether the current device and the selected camera support a particular depth mode. - With depth enabled through this call, calls to
Frame.acquireDepthImage16Bits()
andFrame.acquireRawDepthImage16Bits()
can be made to acquire the latest computed depth image.
Details | |||
---|---|---|---|
Parameters |
|
public Config setFlashMode (Config.FlashMode flashMode)
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 |
|
public Config setFocusMode (Config.FocusMode focusMode)
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 |
|
public Config setGeospatialMode (Config.GeospatialMode geospatialMode)
setGeospatialMode
public Config setGeospatialMode( Config.GeospatialMode geospatialMode )
Sets the desired Geospatial mode. See Config.GeospatialMode
for available options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setImageStabilizationMode (Config.ImageStabilizationMode imageStabilizationMode)
setImageStabilizationMode
public Config setImageStabilizationMode( Config.ImageStabilizationMode imageStabilizationMode )
Sets the camera image stabilization mode. See Config.ImageStabilizationMode
for available
options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setInstantPlacementMode (Config.InstantPlacementMode instantPlacementMode)
setInstantPlacementMode
public Config setInstantPlacementMode( Config.InstantPlacementMode instantPlacementMode )
Sets the desired Instant Placement mode. See Config.InstantPlacementMode
for available
options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setLightEstimationMode (Config.LightEstimationMode lightEstimationMode)
setLightEstimationMode
public Config setLightEstimationMode( Config.LightEstimationMode lightEstimationMode )
Sets the desired lighting estimation mode. See the Config.LightEstimationMode
enum for
available options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setPlaneFindingMode (Config.PlaneFindingMode planeFindingMode)
setPlaneFindingMode
public Config setPlaneFindingMode( Config.PlaneFindingMode planeFindingMode )
Sets the desired plane finding mode. See the Config.PlaneFindingMode
enum for available
options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setSemanticMode (Config.SemanticMode semanticMode)
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 |
|
public Config setStreetscapeGeometryMode (Config.StreetscapeGeometryMode streetscapeGeometryMode)
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 |
|
public Config setTextureUpdateMode (Config.TextureUpdateMode textureUpdateMode)
setTextureUpdateMode
public Config setTextureUpdateMode( Config.TextureUpdateMode textureUpdateMode )
Sets the desired Texture Update Mode. See Config.TextureUpdateMode
for available options.
Details | |||
---|---|---|---|
Parameters |
|
public Config setUpdateMode (Config.UpdateMode updateMode)
setUpdateMode
public Config setUpdateMode( Config.UpdateMode updateMode )
Sets the behavior of Session.update()
. See the Config.UpdateMode
enum for available
options.
Details | |||
---|---|---|---|
Parameters |
|