ResolutionSelector.Builder

public final class ResolutionSelector.Builder


Builder for a ResolutionSelector.

Summary

Public constructors

Creates a Builder instance.

Public methods

@NonNull ResolutionSelector

Builds the resolution selector.

@NonNull ResolutionSelector.Builder

Sets the allowed resolution mode.

@NonNull ResolutionSelector.Builder

Sets the aspect ratio selection strategy for the UseCase.

@NonNull ResolutionSelector.Builder

Sets the resolution filter to output the final desired sizes list.

@NonNull ResolutionSelector.Builder

Sets the resolution selection strategy for the UseCase.

Public constructors

Builder

Added in 1.3.0
public Builder()

Creates a Builder instance.

Public methods

build

Added in 1.3.0
public @NonNull ResolutionSelector build()

Builds the resolution selector. This will create a resolution selector that can be used to select the desired resolution for the captured image.

setAllowedResolutionMode

Added in 1.3.0
public @NonNull ResolutionSelector.Builder setAllowedResolutionMode(int mode)

Sets the allowed resolution mode.

If not specified, the default setting is PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION.

setAspectRatioStrategy

Added in 1.3.0
public @NonNull ResolutionSelector.Builder setAspectRatioStrategy(@NonNull AspectRatioStrategy aspectRatioStrategy)

Sets the aspect ratio selection strategy for the UseCase. The aspect ratio selection strategy determines how the UseCase will choose the aspect ratio of the captured image.

If the aspect ratio strategy is not specified, RATIO_4_3_FALLBACK_AUTO_STRATEGY will be used as the default.

UseCases can be bound by a UseCaseGroup with a ViewPort setting. If a ViewPort is set, it is recommended that the ViewPort and the bound UseCases should have matching aspect ratio settings. Otherwise, the output crop rectangles may be double-cropped from the full camera sensor field of view. See ViewPort.Builder for details.

setResolutionFilter

Added in 1.3.0
public @NonNull ResolutionSelector.Builder setResolutionFilter(@NonNull ResolutionFilter resolutionFilter)

Sets the resolution filter to output the final desired sizes list. The resolution filter will filter out unsuitable sizes and sort the resolution list in the preferred order. The preferred order is the order in which the resolutions should be tried first.

setResolutionStrategy

Added in 1.3.0
public @NonNull ResolutionSelector.Builder setResolutionStrategy(@NonNull ResolutionStrategy resolutionStrategy)

Sets the resolution selection strategy for the UseCase. The resolution selection strategy determines how the UseCase will choose the resolution of the captured image.