ImageOverlay

class ImageOverlay(val image: ImageSource, val corner: Corner, val margin: Float = DEFAULT_MARGIN, val scale: Float = DEFAULT_SCALE, val opacity: Float = 1.0f, val visibleDuring: TimeRange? = null, val animation: OverlayAnimation? = null) : OverlayEffect(source)

Composite an image over the video.

Every measurement is a fraction of the frame the overlay is drawn on rather than a pixel count, so an overlay lands in the same place at any preview or export resolution. That frame is the clip's frame for an overlay added to a clip, and the output frame for one added to the composition.

The picture is drawn in the color its file describes, through an embedded ICC profile, CICP or PNG's own color chunks, and an untagged picture is read as sRGB. SDR output clips a tagged picture's colors to BT.709, and an HDR grade keeps them inside BT.2020. A platform decoder that cannot land the picture that way resolves the overlay as degraded or unsupported, naming why.

Constructors

Link copied to clipboard
constructor(image: ImageSource, corner: Corner, margin: Float = DEFAULT_MARGIN, scale: Float = DEFAULT_SCALE, opacity: Float = 1.0f, visibleDuring: TimeRange? = null, animation: OverlayAnimation? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val animation: OverlayAnimation?

How the overlay is drawn at each frame of its run, or null to hold it still.

Link copied to clipboard
Link copied to clipboard

Which corner the overlay sits in.

Link copied to clipboard
open override val id: String
Link copied to clipboard

The image to composite.

Link copied to clipboard
open val isInert: Boolean
Link copied to clipboard

Inset from the corner, as a fraction of the shorter side of the frame it is drawn on.

Link copied to clipboard

Alpha applied to the overlay, in 0f..1f.

Link copied to clipboard
Link copied to clipboard

Width as a fraction of the width of the frame it is drawn on. The height follows the image's own aspect.

Link copied to clipboard
open val scope: EffectScope
Link copied to clipboard
open override val stage: EffectStage
Link copied to clipboard
open override val visibleDuring: TimeRange?

When the overlay is visible, or null for the whole composition.

Functions

Link copied to clipboard

Resolves this overlay against the frame it is composited onto.