Skip to main content

RealtimeLayer

Struct RealtimeLayer 

Source
pub struct RealtimeLayer {
    pub width: u32,
    pub height: u32,
    pub pixel_format: PixelFormat,
    pub effects: Vec<FilterStep>,
    pub opacity: AnimatedValue<f64>,
    pub x: AnimatedValue<f64>,
    pub y: AnimatedValue<f64>,
    pub scale_x: AnimatedValue<f64>,
    pub scale_y: AnimatedValue<f64>,
    pub rotation: AnimatedValue<f64>,
    pub blend_mode: BlendMode,
    pub composite_op: CompositeOp,
}
Expand description

One layer in a RealtimeComposer, composited bottom-up in Vec order (index 0 is the base; later layers blend on top).

Frames pushed to this layer via RealtimeComposer::push_layer must match the width, height, and pixel_format declared here — these fix the layer’s buffersrc format at build time.

Fields§

§width: u32

Width in pixels of frames pushed to this layer.

§height: u32

Height in pixels of frames pushed to this layer.

§pixel_format: PixelFormat

Pixel format of frames pushed to this layer.

§effects: Vec<FilterStep>

Per-clip video effect chain applied to this layer before compositing (the same FilterSteps as Clip::video_effect_chain / the export path).

§opacity: AnimatedValue<f64>

Opacity in [0.0, 1.0], static or animated. Applied via colorchannelmixer alpha when this layer is blended onto the layer below (Normal blend only). An AnimatedValue::Track registers the node for per-frame send_command. No effect on the base layer 0 (apply base opacity host-side).

§x: AnimatedValue<f64>

X position (pixels) of this layer’s top-left on the canvas, static or animated. Maps to the overlay filter’s x (Normal blend only); a AnimatedValue::Track uses :eval=frame + per-frame send_command. Applies to the base layer 0 too (ADR-0016).

§y: AnimatedValue<f64>

Overlay Y position; see x.

§scale_x: AnimatedValue<f64>

Horizontal scale multiplier, evaluated statically at t=0 (matching the export path): 1.0 leaves the frame at its native size, any other value scales it to canvas * scale_x. Applied before the layer’s effects, on every layer.

§scale_y: AnimatedValue<f64>

Vertical scale multiplier; see scale_x.

§rotation: AnimatedValue<f64>

Clockwise rotation in degrees, evaluated statically at t=0 (matching the export path); 0.0 = no rotation, exposed corners fill black. Applied before the layer’s effects, on every layer.

§blend_mode: BlendMode

How this layer blends with the layer below. BlendMode::Normal uses overlay; other modes use blend=all_mode=<token>.

§composite_op: CompositeOp

Porter-Duff composite operator. Carried for representation parity with the export VideoLayer; the realtime builder renders Over today (the other operators land in C4b).

Implementations§

Source§

impl RealtimeLayer

Source

pub fn with_dimensions( descriptor: RealtimeLayerDescriptor, width: u32, height: u32, pixel_format: PixelFormat, ) -> Self

Build a RealtimeLayer from a RealtimeLayerDescriptor plus the frame dimensions and pixel format known at decode time.

Trait Implementations§

Source§

impl Clone for RealtimeLayer

Source§

fn clone(&self) -> RealtimeLayer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RealtimeLayer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.