public class

FocusMeteringAction.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.camera.core.FocusMeteringAction.Builder

Overview

The builder used to create the FocusMeteringAction.

Summary

Constructors
publicBuilder(MeteringPoint point)

Creates a Builder from a MeteringPoint with default mode FocusMeteringAction.FLAG_AF | FocusMeteringAction.FLAG_AE | FocusMeteringAction.FLAG_AWB.

publicBuilder(MeteringPoint point, int meteringMode)

Creates a Builder from a MeteringPoint and MeteringMode.

Methods
public FocusMeteringAction.BuilderaddPoint(MeteringPoint point)

Adds another MeteringPoint with default metering mode FocusMeteringAction.FLAG_AF | FocusMeteringAction.FLAG_AE | FocusMeteringAction.FLAG_AWB.

public FocusMeteringAction.BuilderaddPoint(MeteringPoint point, int meteringMode)

Adds another MeteringPoint with specified meteringMode.

public FocusMeteringActionbuild()

Builds the FocusMeteringAction instance.

public FocusMeteringAction.BuilderdisableAutoCancel()

Disables the auto-cancel.

public FocusMeteringAction.BuildersetAutoCancelDuration(long duration, java.util.concurrent.TimeUnit timeUnit)

Sets the auto-cancel duration.

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

Constructors

public Builder(MeteringPoint point)

Creates a Builder from a MeteringPoint with default mode FocusMeteringAction.FLAG_AF | FocusMeteringAction.FLAG_AE | FocusMeteringAction.FLAG_AWB.

public Builder(MeteringPoint point, int meteringMode)

Creates a Builder from a MeteringPoint and MeteringMode.

Metering mode is a combination of flags consisting of FocusMeteringAction.FLAG_AF, FocusMeteringAction.FLAG_AE, and FocusMeteringAction.FLAG_AWB. This combination indicates whether the MeteringPoint is used to set AF(Auto Focus) region, AE(Auto Exposure) region or AWB(Auto White Balance) region.

Methods

Adds another MeteringPoint with default metering mode FocusMeteringAction.FLAG_AF | FocusMeteringAction.FLAG_AE | FocusMeteringAction.FLAG_AWB.

The points added here will be appended in order after the point set in builder constructor.

If more points are added than what current device supports for AF/AE/AWB, only the first point and then in order up to the number of points supported on the device will be enabled.

If none of the points is supported on the device, this FocusMeteringAction will cause CameraControl.startFocusAndMetering(FocusMeteringAction) to fail.

See also: CameraControl.startFocusAndMetering(FocusMeteringAction)

public FocusMeteringAction.Builder addPoint(MeteringPoint point, int meteringMode)

Adds another MeteringPoint with specified meteringMode.

Metering mode is a combination of flags consisting of FocusMeteringAction.FLAG_AF, FocusMeteringAction.FLAG_AE, and FocusMeteringAction.FLAG_AWB. This combination indicates whether the MeteringPoint is used to set AF(Auto Focus) region, AE(Auto Exposure) region or AWB(Auto White Balance) region.

The points added here will be appended in order after the point set in builder constructor.

If more points are added than what current device supports for AF/AE/AWB, only the first point and then in order up to the number of points supported on the device will be enabled.

If none of the points is supported on the device, this FocusMeteringAction will cause CameraControl.startFocusAndMetering(FocusMeteringAction) to fail.

See also: CameraControl.startFocusAndMetering(FocusMeteringAction)

public FocusMeteringAction.Builder setAutoCancelDuration(long duration, java.util.concurrent.TimeUnit timeUnit)

Sets the auto-cancel duration. After set, CameraControl.cancelFocusAndMetering() will be called in specified duration. By default, auto-cancel is enabled with 5 seconds duration. The duration must be greater than or equal to 1 otherwise it will throw a java.lang.IllegalArgumentException.

public FocusMeteringAction.Builder disableAutoCancel()

Disables the auto-cancel.

public FocusMeteringAction build()

Builds the FocusMeteringAction instance.