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 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 voidsetImplementationOptions(Config config)

public voidsetTemplateType(int templateType)

Set the template characteristics of the CaptureConfig.

public voidsetUseRepeatingSurface(boolean useRepeatingSurface)

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 void setTemplateType(int templateType)

Set the template characteristics of the CaptureConfig.

Parameters:

templateType: Template constant that must match those defined by CameraDevice

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 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.