pub struct HeadlessRenderer {
pub width: f32,
pub height: f32,
pub dpi_factor: f32,
}Expand description
Headless renderer for CPU-based screenshot capture.
Wraps cpurender::render() with headless-specific configuration.
This is separate from CpuCompositor (which implements the Compositor
trait for the WebRender software fallback path). The headless renderer
operates entirely without WebRender.
Fields§
§width: f32§height: f32§dpi_factor: f32Implementations§
Source§impl HeadlessRenderer
impl HeadlessRenderer
Sourcepub fn new(width: f32, height: f32, dpi_factor: f32) -> Self
pub fn new(width: f32, height: f32, dpi_factor: f32) -> Self
Create a new headless renderer with the given dimensions.
Sourcepub fn render_frame(
&self,
display_list: &DisplayList,
renderer_resources: &RendererResources,
) -> Result<AzulPixmap, String>
pub fn render_frame( &self, display_list: &DisplayList, renderer_resources: &RendererResources, ) -> Result<AzulPixmap, String>
Render a display list to a pixel buffer.
Returns an AzulPixmap that can be saved as PNG.
Auto Trait Implementations§
impl Freeze for HeadlessRenderer
impl RefUnwindSafe for HeadlessRenderer
impl Send for HeadlessRenderer
impl Sync for HeadlessRenderer
impl Unpin for HeadlessRenderer
impl UnsafeUnpin for HeadlessRenderer
impl UnwindSafe for HeadlessRenderer
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> 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