pub struct Pixmap { /* private fields */ }Expand description
A CPU pixel buffer in straight (non-premultiplied) RGBA8, row-major,
tightly packed (stride == width * 4).
This is the payload handed to a Surface for display. It is what the
software backend produces today; a future GPU backend may bypass it.
Implementations§
Source§impl Pixmap
impl Pixmap
Sourcepub fn new(size: PhysicalSize) -> Self
pub fn new(size: PhysicalSize) -> Self
Allocate a fully transparent pixmap of size.
Sourcepub fn from_rgba8(size: PhysicalSize, data: Vec<u8>) -> Self
pub fn from_rgba8(size: PhysicalSize, data: Vec<u8>) -> Self
Wrap existing RGBA8 bytes. Panics if data.len() != width*height*4.
pub fn size(&self) -> PhysicalSize
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Sourcepub fn blit(&mut self, src: &Pixmap, dst_x: u32, dst_y: u32)
pub fn blit(&mut self, src: &Pixmap, dst_x: u32, dst_y: u32)
Copy src into this pixmap with its top-left at (dst_x, dst_y),
clipped to this pixmap’s bounds. A straight row-by-row replace (no alpha
blend) — used to composite an opaque area-repaint render (see
SoftwareRenderer::render_region) into the retained full-window buffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pixmap
impl RefUnwindSafe for Pixmap
impl Send for Pixmap
impl Sync for Pixmap
impl Unpin for Pixmap
impl UnsafeUnpin for Pixmap
impl UnwindSafe for Pixmap
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