public static final class ImageAnalysis.Builder
extends Object implements ExtendableBuilder<T extends UseCase>


Builder for a ImageAnalysis.


Public constructors


Creates a new Builder object.

Public methods

ImageAnalysis build()

Builds an ImageAnalysis from the current state.

ImageAnalysis.Builder setBackgroundExecutor(Executor executor)

Sets the default executor that will be used for background tasks.

ImageAnalysis.Builder setBackpressureStrategy(int strategy)

Sets the backpressure strategy to apply to the image producer to deal with scenarios where images may be produced faster than they can be analyzed.

ImageAnalysis.Builder setImageQueueDepth(int depth)

Sets the number of images available to the camera pipeline for ImageAnalysis.STRATEGY_BLOCK_PRODUCER mode.

ImageAnalysis.Builder setOutputImageFormat(int outputImageFormat)

Sets output image format.

ImageAnalysis.Builder setOutputImageRotationEnabled(boolean outputImageRotationEnabled)

Enable or disable output image rotation.

ImageAnalysis.Builder setTargetAspectRatio(int aspectRatio)

Sets the aspect ratio of the intended target for images from this configuration.

ImageAnalysis.Builder setTargetName(String targetName)

Sets the name of the target object being configured, used only for debug logging.

ImageAnalysis.Builder setTargetResolution(Size resolution)

Sets the resolution of the intended target from this configuration.

ImageAnalysis.Builder setTargetRotation(int rotation)

Sets the rotation of the intended target for images from this configuration.

Inherited methods