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: u32Width in pixels of frames pushed to this layer.
height: u32Height in pixels of frames pushed to this layer.
pixel_format: PixelFormatPixel 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: BlendModeHow this layer blends with the layer below. BlendMode::Normal uses
overlay; other modes use blend=all_mode=<token>.
composite_op: CompositeOpPorter-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
impl RealtimeLayer
Sourcepub fn with_dimensions(
descriptor: RealtimeLayerDescriptor,
width: u32,
height: u32,
pixel_format: PixelFormat,
) -> Self
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
impl Clone for RealtimeLayer
Source§fn clone(&self) -> RealtimeLayer
fn clone(&self) -> RealtimeLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more