pub struct OutputLayer {
pub video_source_id: String,
pub bounds: Rect,
pub fit: Fit,
pub z_index: i32,
pub opacity: f32,
pub visible: bool,
}Expand description
A single layer in an output, referencing a source with position and styling.
Stacked by z-index, 0 on top: an output is drawn from its highest z-index down to 0, and layers with the same z-index stack in the order they were added, the later one on top. Each layer independently specifies where and how large its source appears.
§Coordinates
Position and size are in output space, where (0, 0) is the top-left corner of the output texture, regardless of where the output is placed on a monitor.
Fields§
§video_source_id: StringPersistent ID of the video source to render (references VideoSource).
bounds: RectPosition and size of this layer within the output, in output coordinates.
fit: FitHow the source’s picture sits inside bounds when the shapes differ.
Fit::Contain by default: the whole picture, letterboxed.
z_index: i32Stacking order: 0 is topmost, higher values are further back.
opacity: f32Layer opacity: 0.0 (transparent) to 1.0 (opaque).
visible: boolWhether this layer is visible. Hidden layers are skipped during rendering.
Implementations§
Source§impl OutputLayer
impl OutputLayer
Sourcepub fn new(video_source_id: impl Into<String>, bounds: Rect) -> Self
pub fn new(video_source_id: impl Into<String>, bounds: Rect) -> Self
Create a new layer referencing a video source.
Sourcepub fn with_z_index(self, z_index: i32) -> Self
pub fn with_z_index(self, z_index: i32) -> Self
Set the stacking order (z-index).
Sourcepub fn with_opacity(self, opacity: f32) -> Self
pub fn with_opacity(self, opacity: f32) -> Self
Set the opacity (0.0 to 1.0).
Sourcepub fn with_visible(self, visible: bool) -> Self
pub fn with_visible(self, visible: bool) -> Self
Set visibility.