pub struct LayerCompositor;Expand description
Composites a stack of BlendLayers onto a destination buffer.
Implementations§
Source§impl LayerCompositor
impl LayerCompositor
Sourcepub fn blend_layers(
_device: &GpuDevice,
layers: &[BlendLayer<'_>],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
pub fn blend_layers( _device: &GpuDevice, layers: &[BlendLayer<'_>], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
Composite layers (bottom-to-top order) into output.
outputmust bewidth * height * 4bytes and is pre-cleared to transparent black before compositing begins.- All layers must have the same
width×heightdimensions as the output buffer.
device is kept as a parameter for future GPU compute shader dispatch;
the current implementation is a CPU-parallel fallback.
§Errors
Returns an error if:
outputis notwidth * height * 4bytes.- Any layer has mismatched dimensions.
- Dimensions are zero or exceed 16 384.
Sourcepub fn blend_layers_cpu(
layers: &[BlendLayer<'_>],
output: &mut [u8],
width: u32,
height: u32,
) -> Result<()>
pub fn blend_layers_cpu( layers: &[BlendLayer<'_>], output: &mut [u8], width: u32, height: u32, ) -> Result<()>
CPU-only variant — useful for unit tests and CPU fallback paths.
§Errors
Same conditions as blend_layers.
Auto Trait Implementations§
impl Freeze for LayerCompositor
impl RefUnwindSafe for LayerCompositor
impl Send for LayerCompositor
impl Sync for LayerCompositor
impl Unpin for LayerCompositor
impl UnsafeUnpin for LayerCompositor
impl UnwindSafe for LayerCompositor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more