#[repr(C, packed)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "default", derive(Default))]
pub struct Framebuffer {
fb_addr: *mut u8,
width: u64,
height: u64,
bpp: u64,
pitch: u64,
}
impl Framebuffer {
#[cfg(feature = "loader_main")]
pub fn new(addr: *mut u8, width: u64, height: u64, bpp: u64, pitch: u64) -> Self {
Self {
fb_addr: addr,
width,
height,
bpp,
pitch,
}
}
pub fn address(&self) -> *mut u8 {
self.fb_addr
}
pub fn width(&self) -> u64 {
self.width
}
pub fn height(&self) -> u64 {
self.height
}
pub fn bpp(&self) -> u64 {
self.bpp
}
pub fn pitch(&self) -> u64 {
self.pitch
}
}