pub struct FbInfo {
pub size: Size,
pub stride_bytes: u32,
pub bits_per_pixel: u32,
pub layout: PixelLayout,
}Expand description
The geometry of a framebuffer.
Fields§
§size: SizeVisible extent in pixels.
stride_bytes: u32Distance between the starts of consecutive rows, in bytes.
fbdev calls this line_length, and it is routinely wider than
width * bytes_per_pixel. Assuming otherwise is the classic fbdev bug: a
picture that shears diagonally on hardware and looks fine in a VM.
bits_per_pixel: u32Bit depth as reported.
layout: PixelLayoutInferred pixel layout.
Implementations§
Source§impl FbInfo
impl FbInfo
Sourcepub fn from_sysfs(
virtual_size: &str,
modes: &str,
stride: &str,
bits_per_pixel: &str,
) -> Result<Self, FbInfoError>
pub fn from_sysfs( virtual_size: &str, modes: &str, stride: &str, bits_per_pixel: &str, ) -> Result<Self, FbInfoError>
Builds the geometry from raw sysfs attribute contents.
modes is preferred for the visible extent because virtual_size includes
any area reserved for panning, which on a double-buffered framebuffer is
twice the height of what is actually on screen.
Sourcepub fn required_bytes(&self) -> usize
pub fn required_bytes(&self) -> usize
Bytes the mapping must cover for this geometry.
Sourcepub fn stride_pixels(&self) -> Option<u32>
pub fn stride_pixels(&self) -> Option<u32>
Row stride in pixels, when that is a whole number.
Trait Implementations§
impl Copy for FbInfo
impl Eq for FbInfo
impl StructuralPartialEq for FbInfo
Auto Trait Implementations§
impl Freeze for FbInfo
impl RefUnwindSafe for FbInfo
impl Send for FbInfo
impl Sync for FbInfo
impl Unpin for FbInfo
impl UnsafeUnpin for FbInfo
impl UnwindSafe for FbInfo
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