ExperimentalBitmapProcessor


@ExperimentalApi
class ExperimentalBitmapProcessor


Applies effects to a Bitmap.

This class is experimental and will be renamed or removed in a future release.

Only supports SDR input and output.

If a call to setEffectsAsync fails or is cancelled, subsequent calls to applyEffectsAsync will be failed or cancelled with the same result until setEffectsAsync is called again.

If a call to applyEffectsAsync fails, subsequent calls applyEffectsAsync fail with the same error until setEffectsAsync is called again.

Cancellations to applyEffectsAsync calls are not propagated up or downstream.

This class is NOT thread-safe. All public methods must be called from the same thread that instantiated the instance. This is verified by the implementation.

Summary

Nested types

A builder for ExperimentalBitmapProcessor instances.

Public functions

ListenableFuture<Bitmap!>!
applyEffectsAsync(inputBitmap: Bitmap!)

Applies the effects used in the last setEffectsAsync call to the given Bitmap.

ListenableFuture<Void!>!

Initiates the release of the BitmapProcessor's resources and shuts down the internal executor service.

ListenableFuture<Void!>!

Configures the ExperimentalBitmapProcessor with the given effects.

Public functions

applyEffectsAsync

fun applyEffectsAsync(inputBitmap: Bitmap!): ListenableFuture<Bitmap!>!

Applies the effects used in the last setEffectsAsync call to the given Bitmap.

The input Bitmap is recycled so should not be reused after calling this method.

If a call to this method fails, all subsequent calls will also fail until setEffectsAsync is called again to reconfigure the pipeline.

Parameters
inputBitmap: Bitmap!

The bitmap to apply effects to.

Returns
ListenableFuture<Bitmap!>!

A ListenableFuture that resolves to a new Bitmap instance with the configured effects applied after processing is complete.

releaseAsync

fun releaseAsync(): ListenableFuture<Void!>!

Initiates the release of the BitmapProcessor's resources and shuts down the internal executor service.

Once all pending operations are executed, the method shuts down the internal executor.

Returns
ListenableFuture<Void!>!

A ListenableFuture that completes when the shutdown process has been completed on the GL thread.

setEffectsAsync

fun setEffectsAsync(effects: (Mutable)List<Effect!>!): ListenableFuture<Void!>!

Configures the ExperimentalBitmapProcessor with the given effects.

This method will wait for any previously scheduled calls to complete before reconfiguring the pipeline.

If a call to this method fails, all subsequent applyEffectsAsync calls will also fail until this method is called again to reconfigure the pipeline.

Parameters
effects: (Mutable)List<Effect!>!

The effects to apply in subsequent applyEffectsAsync calls.

Public properties

glThreadExecutorService

val glThreadExecutorServiceListeningExecutorService!