ResolutionSelector.Builder

class ResolutionSelector.Builder


Builder for a ResolutionSelector.

Summary

Public constructors

Creates a Builder instance.

Public functions

ResolutionSelector

Builds the resolution selector.

ResolutionSelector.Builder

Sets the allowed resolution mode.

ResolutionSelector.Builder

Sets the aspect ratio selection strategy for the UseCase.

ResolutionSelector.Builder

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

ResolutionSelector.Builder

Sets the resolution selection strategy for the UseCase.

Public constructors

Builder

Added in 1.3.0
Builder()

Creates a Builder instance.

Public functions

build

Added in 1.3.0
fun build(): ResolutionSelector

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
fun setAllowedResolutionMode(mode: Int): ResolutionSelector.Builder

Sets the allowed resolution mode.

If not specified, the default setting is PREFER_CAPTURE_RATE_OVER_HIGHER_RESOLUTION.

setAspectRatioStrategy

Added in 1.3.0
fun setAspectRatioStrategy(aspectRatioStrategy: AspectRatioStrategy): ResolutionSelector.Builder

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
fun setResolutionFilter(resolutionFilter: ResolutionFilter): ResolutionSelector.Builder

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
fun setResolutionStrategy(resolutionStrategy: ResolutionStrategy): ResolutionSelector.Builder

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