public final class

CaptureConfig.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.camera.core.impl.CaptureConfig.Builder

Overview

Builder for easy modification/rebuilding of a CaptureConfig.

Summary

Constructors
publicBuilder()

Methods
public voidaddAllCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks.

public voidaddAllTags(TagBundle bundle)

Adds a TagBundle to CaptureConfig.

public voidaddCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback.

public voidaddImplementationOption(Config.Option<java.lang.Object> option, java.lang.Object value)

Add a single implementation option to the request.

public voidaddImplementationOptions(Config config)

Add a set of implementation specific options to the request.

public voidaddSurface(DeferrableSurface surface)

Add a surface that the request will write data to.

public voidaddTag(java.lang.String key, java.lang.Object tag)

Sets a tag with a key to CaptureConfig.

public CaptureConfigbuild()

Builds an instance of a CaptureConfig that has all the combined parameters of the CaptureConfig that have been added to the Builder.

public voidclearSurfaces()

Remove all the surfaces that the request will write data to.

public static CaptureConfig.BuildercreateFrom(UseCaseConfig<UseCase> config)

Creates a CaptureConfig.Builder from a UseCaseConfig.

public static CaptureConfig.Builderfrom(CaptureConfig base)

Create a CaptureConfig.Builder from a CaptureConfig

public <any>getExpectedFrameRateRange()

public ConfiggetImplementationOptions()

public java.util.Set<DeferrableSurface>getSurfaces()

Gets the surfaces attached to the request.

public java.lang.ObjectgetTag(java.lang.String key)

Gets a tag's value by a key.

public intgetTemplateType()

public booleanisUseRepeatingSurface()

public booleanremoveCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Removes a previously added CameraCaptureCallback callback.

public voidremoveSurface(DeferrableSurface surface)

Remove a surface that the request will write data to.

public voidsetCameraCaptureResult(CameraCaptureResult cameraCaptureResult)

Set the CameraCaptureResult for reprocessable capture request.

public voidsetExpectedFrameRateRange(<any> expectedFrameRateRange)

Set the expected frame rate range of the CaptureConfig.

public voidsetId(int id)

Sets the ID of the CaptureConfig that helps identify which CaptureConfig is triggering the CameraCaptureCallback callback methods upon its submission.

public voidsetImplementationOptions(Config config)

public voidsetPostviewEnabled(boolean postviewEnabled)

public voidsetPreviewStabilization(int mode)

Set the preview stabilization mode of the CaptureConfig.

public voidsetTemplateType(int templateType)

Set the template characteristics of the CaptureConfig.

public voidsetUseRepeatingSurface(boolean useRepeatingSurface)

public voidsetVideoStabilization(int mode)

Set the video stabilization mode of the CaptureConfig.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public static CaptureConfig.Builder createFrom(UseCaseConfig<UseCase> config)

Creates a CaptureConfig.Builder from a UseCaseConfig.

Populates the builder with all the properties defined in the base configuration.

public static CaptureConfig.Builder from(CaptureConfig base)

Create a CaptureConfig.Builder from a CaptureConfig

public void setCameraCaptureResult(CameraCaptureResult cameraCaptureResult)

Set the CameraCaptureResult for reprocessable capture request.

Parameters:

cameraCaptureResult: CameraCaptureResult.

public int getTemplateType()

public <any> getExpectedFrameRateRange()

public void setTemplateType(int templateType)

Set the template characteristics of the CaptureConfig.

Parameters:

templateType: Template constant that must match those defined by CameraDevice

public void setExpectedFrameRateRange(<any> expectedFrameRateRange)

Set the expected frame rate range of the CaptureConfig.

Parameters:

expectedFrameRateRange: The frame rate range calculated from the UseCases for CameraDevice

public void setPreviewStabilization(int mode)

Set the preview stabilization mode of the CaptureConfig.

Parameters:

mode: StabilizationMode

public void setVideoStabilization(int mode)

Set the video stabilization mode of the CaptureConfig.

Parameters:

mode: StabilizationMode

public void setPostviewEnabled(boolean postviewEnabled)

public void addCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Adds a CameraCaptureCallback callback.

public void addAllCameraCaptureCallbacks(java.util.Collection<CameraCaptureCallback> cameraCaptureCallbacks)

Adds all CameraCaptureCallback callbacks.

public boolean removeCameraCaptureCallback(CameraCaptureCallback cameraCaptureCallback)

Removes a previously added CameraCaptureCallback callback.

Parameters:

cameraCaptureCallback: The callback to remove.

Returns:

true if the callback was successfully removed. false if the callback wasn't present in this builder.

public void addSurface(DeferrableSurface surface)

Add a surface that the request will write data to.

public void removeSurface(DeferrableSurface surface)

Remove a surface that the request will write data to.

public void clearSurfaces()

Remove all the surfaces that the request will write data to.

public java.util.Set<DeferrableSurface> getSurfaces()

Gets the surfaces attached to the request.

public void setImplementationOptions(Config config)

public void addImplementationOptions(Config config)

Add a set of implementation specific options to the request.

public void addImplementationOption(Config.Option<java.lang.Object> option, java.lang.Object value)

Add a single implementation option to the request.

public Config getImplementationOptions()

public boolean isUseRepeatingSurface()

public void setUseRepeatingSurface(boolean useRepeatingSurface)

public java.lang.Object getTag(java.lang.String key)

Gets a tag's value by a key.

public void addTag(java.lang.String key, java.lang.Object tag)

Sets a tag with a key to CaptureConfig.

public void setId(int id)

Sets the ID of the CaptureConfig that helps identify which CaptureConfig is triggering the CameraCaptureCallback callback methods upon its submission.

The ID will be passed in every methods in CameraCaptureCallback. To ensure it uniquely identifies the CaptureConfig, set a unique ID for every CaptureConfig.

public void addAllTags(TagBundle bundle)

Adds a TagBundle to CaptureConfig.

public CaptureConfig build()

Builds an instance of a CaptureConfig that has all the combined parameters of the CaptureConfig that have been added to the Builder.