Screen

abstract class Screen(val context: Context) : ScreenObjectContainer

The root container for an offscreen video composition.

Constructors

Link copied to clipboard
constructor(context: Context)

Types

Link copied to clipboard
abstract class Callback

Callbacks for a screen.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Specifies the screen's background color.

Link copied to clipboard

The rectangle computed by the most recent layout pass, in pixels.

Link copied to clipboard

The number of direct children in this container.

Link copied to clipboard
Link copied to clipboard

The radius of the object's rounded corners, in composition pixels. Zero keeps square corners. The effective radius is limited to half of the object's shorter side.

Link copied to clipboard
open override var elements: Map<String, String>

A key-value representation of this object for serialization.

Link copied to clipboard
open var frame: Rect

The requested layout rectangle, in pixels.

Link copied to clipboard

Specifies the alignment position along the horizontal axis.

Link copied to clipboard
val id: String

Unique identifier of this screen object.

Link copied to clipboard
open var isVisible: Boolean

Specifies the visibility of the object.

Link copied to clipboard

Margins used to position and size this object, in pixels.

Link copied to clipboard

The 4 × 4 model-view-projection matrix used for rendering.

Link copied to clipboard
open override var parent: ScreenObjectContainer?

The container that owns this object, or null when detached.

Link copied to clipboard
open override var shouldInvalidateLayout: Boolean

Whether the object needs another layout pass.

Link copied to clipboard
val target: Int
Link copied to clipboard
open var textureId: Int

OpenGL ES texture ID associated with this screen object.

Link copied to clipboard
open override val type: String

Logical type of this screen object.

Link copied to clipboard

Specifies the alignment position along the vertical axis.

Link copied to clipboard

The effect applied when rendering this object.

Functions

Link copied to clipboard
open fun addChild(child: ScreenObject?)

Adds a child and invalidates the layout. A null child is ignored.

Link copied to clipboard
abstract fun attachVideo(track: Int, video: VideoSource?)

Attaches a video source to a rendering track.

Link copied to clipboard
abstract fun bind(screenObject: ScreenObject)

Binds GPU resources for the screen object.

Link copied to clipboard

Change the z order of the child so it's on top of all other children.

Link copied to clipboard
open fun dispose()

Removes all children and detaches their screen bindings.

Link copied to clipboard
open override fun draw(renderer: Renderer)

Draws the screen object.

Link copied to clipboard
open fun <T : ScreenObject> findByClass(clazz: Class<T>): List<T>

Finds descendants of the requested type, including nested containers.

Link copied to clipboard
open override fun findById(id: String): ScreenObject?

Returns this object if its identifier matches, or null. Containers also search their descendants.

Link copied to clipboard

Returns a snapshot of the direct children in drawing order.

Link copied to clipboard

Returns packed scissor rectangles in local coordinates for the renderers.

Link copied to clipboard
open override fun invalidateLayout()

Invalidates the current layout and triggers a layout update.

Link copied to clipboard
open override fun layout(renderer: Renderer)

Calculates the object bounds and updates its rendering layout.

Link copied to clipboard
abstract fun readPixels(lambda: (bitmap: Bitmap?) -> Unit)

Reads the pixels of a displayed image.

Link copied to clipboard
open fun registerCallback(callback: Screen.Callback)

Registers a callback for frame layout notifications. Duplicate registrations are ignored.

Link copied to clipboard
open fun removeChild(child: ScreenObject?)

Removes a direct child and invalidates the layout. Ignores null and objects owned by other containers.

Link copied to clipboard
open fun sendChildToBack(child: ScreenObject)

Change the z order of the child so it's on bottom of all other children.

Link copied to clipboard
open fun transition(screenObjectContainer: ScreenObjectContainer)

Replaces this container's children with the supplied container's children and invalidates the layout.

Link copied to clipboard
abstract fun unbind(screenObject: ScreenObject)

Releases the GPU binding for the screen object.

Link copied to clipboard

Unregisters a screen listener.