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

Configuration
Link copied to clipboard
interface Configuration
Exposes configuration options available to lenses processor.
Event
Link copied to clipboard
sealed class Event
All lens lifecycle events available to observe.
Failure
Link copied to clipboard
sealed class Failure : RuntimeException
Defines known failure modes of a lenses processor.
InputFrameRotationBehavior
Link copied to clipboard
Defines how each input frame should be rotated relative to device rotation while processing.
Noop
Link copied to clipboard
object Noop : LensesComponent.Processor
Convenience implementation of Processor which does nothing but notify operation callbacks with failure.

Functions

apply
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.
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.
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.
clear
Link copied to clipboard
abstract fun clear(callback: Consumer<Boolean> = Consumer {})
Removes any applied Lens models.
connectInput
Link copied to clipboard
abstract fun connectInput(input: AudioProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
abstract fun connectInput(input: ImageProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
abstract fun connectInput(input: LocationProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
abstract fun connectInput(input: MediaProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
abstract fun connectInput(input: SafeRenderAreaProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
abstract fun connectInput(input: UserProcessor.Input): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
open fun connectInput(input: ImageProcessor.Input, options: Set<ImageProcessor.Input.Option>): Closeable
Connects the provided input to this processor and returns a Closeable to release the connection when required.
connectOutput
Link copied to clipboard
abstract fun connectOutput(output: ImageProcessor.Output): Closeable
Connects the provided output to this processor and returns a Closeable to release the connection when required.
open fun connectOutput(output: ImageProcessor.Output, options: Set<ImageProcessor.Output.Option>): Closeable
Connects the provided output to this processor and returns a Closeable to release the connection when required.
observe
Link copied to clipboard
abstract fun observe(onEvent: Consumer<LensesComponent.Processor.Event>): Closeable
Allows to observe lens lifecycle events defined in Event.
observeRequiredCapabilities
Link copied to clipboard
abstract fun observeRequiredCapabilities(onCapabilitiesRequested: Consumer<Set<ImageProcessor.Input.Capability>>): Closeable
Takes in onCapabilitiesRequested that will be notified when image processing operations require additional data from connected Input.

Inheritors

LensesComponent.Processor
Link copied to clipboard