EnhancementSession

public interface EnhancementSession


An enhancement session.

Manages the necessary Surface to receive input frames from the app and send the enhanced frames to a Surface provided by the app.

Summary

Public methods

abstract @NonNull Surface

Returns the input surface for the session.

abstract void
process(
    @NonNull Bitmap bitmap,
    @NonNull EnhancementOptions options,
    @NonNull EnhancementCallback callback
)

Processes a bitmap.

abstract void

Releases this session, freeing up resources.

abstract void
setOutputSurface(
    @NonNull Surface surface,
    @NonNull EnhancementOptions options,
    @NonNull EnhancementCallback callback
)

Sets the output surface for the session.

Public methods

getInputSurface

abstract @NonNull Surface getInputSurface()

Returns the input surface for the session.

Returns
@NonNull Surface

The surface to receive input frames to during the session.

process

abstract void process(
    @NonNull Bitmap bitmap,
    @NonNull EnhancementOptions options,
    @NonNull EnhancementCallback callback
)

Processes a bitmap.

Parameters
@NonNull Bitmap bitmap

The bitmap to process.

@NonNull EnhancementOptions options

The options for the session.

@NonNull EnhancementCallback callback

The callback for frame processing during the session.

release

abstract void release()

Releases this session, freeing up resources.

The session should no longer be used once released.

setOutputSurface

abstract void setOutputSurface(
    @NonNull Surface surface,
    @NonNull EnhancementOptions options,
    @NonNull EnhancementCallback callback
)

Sets the output surface for the session.

Parameters
@NonNull Surface surface

The surface the enhanced frames are sent to during the session.

@NonNull EnhancementOptions options

The options for the session.

@NonNull EnhancementCallback callback

The callback for frame processing during the session.