pub struct Framebuffer {
pub ptr: *mut u8,
pub size: usize,
pub stride: usize,
pub pixel_format: PixelFormat,
pub width: usize,
pub height: usize,
pub bytes_per_pixel: usize,
}Expand description
Metadata that describes a framebuffer.
Fields§
§ptr: *mut u8§size: usizeThe total size of the framebuffer in bytes.
stride: usizeThe number of pixels in each row of the framebuffer.
pixel_format: PixelFormatPixel format of the framebuffer.
width: usizeWidth of the framebuffer in pixels.
height: usizeHeight of the framebuffer in pixels.
bytes_per_pixel: usizeBytes each pixel will take on the framebuffer.
Implementations§
Source§impl Framebuffer
impl Framebuffer
Sourcepub fn draw_pixel(&self, x: usize, y: usize, color: Color)
pub fn draw_pixel(&self, x: usize, y: usize, color: Color)
Draws a single pixel at (x, y).
This panics if the coordinates are outside the framebuffer bounds.
Trait Implementations§
Source§impl Clone for Framebuffer
impl Clone for Framebuffer
Source§fn clone(&self) -> Framebuffer
fn clone(&self) -> Framebuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<Framebuffer> for Framebuffer
impl From<Framebuffer> for Framebuffer
Source§fn from(value: RoxyloaderFb) -> Self
fn from(value: RoxyloaderFb) -> Self
Converts to this type from the input type.
impl Copy for Framebuffer
Auto Trait Implementations§
impl Freeze for Framebuffer
impl RefUnwindSafe for Framebuffer
impl !Send for Framebuffer
impl !Sync for Framebuffer
impl Unpin for Framebuffer
impl UnsafeUnpin for Framebuffer
impl UnwindSafe for Framebuffer
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