Processor

Extension of ImageProcessor that allows to apply and remove lenses on top of the incoming image and audio input stream rendered to connected outputs.

Types

Link copied to clipboard
interface Configuration

Exposes configuration options available to lenses processor.

Link copied to clipboard
sealed class Event

All lens lifecycle events available to observe.

Link copied to clipboard
sealed class Failure : RuntimeException

Defines known failure modes of a lenses processor.

Link copied to clipboard

Defines how each input frame should be rotated relative to device rotation while processing.

Link copied to clipboard

Convenience implementation of Processor which does nothing but notify operation callbacks with failure.

Functions

Link copied to clipboard
open fun apply(lens: LensesComponent.Lens, callback: Consumer<Boolean> = Consumer {})

Attempts to apply the provided lens model with Lens.LaunchData.Empty. The operation is async with the result provided as success or failure flag to the callback.

open fun apply(lens: LensesComponent.Lens, launchData: LensesComponent.Lens.LaunchData = Lens.LaunchData.Empty, callback: Consumer<Boolean> = Consumer {})

Attempts to apply the provided lens model with launchData. The operation is async with the result provided as success or failure flag to the callback.

abstract fun apply(lens: LensesComponent.Lens, launchData: LensesComponent.Lens.LaunchData = Lens.LaunchData.Empty, reset: Boolean = false, callback: Consumer<Boolean> = Consumer {})

Attempts to apply the provided lens model with launchData and the reset flag which determines whether lens state should be reset if the same lens is currently applied. The operation is async with the result provided as success or failure flag to the callback.

Link copied to clipboard
abstract fun clear(callback: Consumer<Boolean> = Consumer {})

Removes any applied Lens models. The result of the async operation is success if any Lens was removed or failure when there were no lenses to be removed or operation failed to execute.

Link copied to clipboard

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Connects the provided input to this processor and returns a Closeable to release the connection when required. Normally, processing of the provided input starts instantly however certain processors may do it async so it is not guaranteed that any work will be done as soon as input is connected.

Link copied to clipboard

Connects the provided output to this processor and returns a Closeable to release the connection when required. Similarly to connectInput, it is not guaranteed that the provided output will receive results as soon as it is connected, the processor may do it async.

Link copied to clipboard

Allows to observe lens lifecycle events defined in Event.

Link copied to clipboard

Takes in onCapabilitiesRequested that will be notified when image processing operations require additional data from connected Input. Right after observeRequiredCapabilities is called onCapabilitiesRequested consumer will be invoked on the caller thread with the current set of required capabilities. emptySet is used to represent that additional capabilities aren't required.

Inheritors

Link copied to clipboard