#[repr(packed(1))]
pub struct GraphicInfo { /* private fields */ }
Expand description

A structure to access information about the graphical framebuffer mode that was discovered and chosen in the AP’s real-mode initialization sequence.

Struct format

The layout of fields in this struct must be kept in sync with the code in ap_realmode.asm that writes to this structure.

Implementations§

source§

impl GraphicInfo

source

pub fn width(&self) -> u16

Returns the visible width of the screen, in pixels.

source

pub fn height(&self) -> u16

Returns the visible height of the screen, in pixels.

source

pub fn physical_address(&self) -> u32

Returns the physical address of the primary framebuffer memory.

source

pub fn total_memory_size_in_bytes(&self) -> u32

Returns the total size in bytes of the VGA graphics memory.

This memory contains the framebuffer as well as any extra visible displayable memory, which can be used for any graphics purposes, e.g., a backbuffer for double buffering (aka page flipping).

source

pub fn bytes_per_scanline(&self) -> u16

The number of bytes in each row or line of the framebuffer’s memory.

This is similar to the “stride” of a framebuffer, but is expressed in units of bytes rather than in units of pixels.

source

pub fn bits_per_pixel(&self) -> u8

The size of each pixel, in number of bits, not bytes.

source

pub fn red_size(&self) -> u8

The size of a pixel’s Red value, in number of bits.

source

pub fn red_position(&self) -> u8

The position of the least significant bit of a pixel’s Red value.

source

pub fn green_size(&self) -> u8

The size of a pixel’s Green value, in number of bits.

source

pub fn green_position(&self) -> u8

The position of the least significant bit of a pixel’s Green value.

source

pub fn blue_size(&self) -> u8

The size of a pixel’s Blue value, in number of bits.

source

pub fn blue_position(&self) -> u8

The position of the least significant bit of a pixel’s Blue value.

Trait Implementations§

source§

impl Clone for GraphicInfo

source§

fn clone(&self) -> GraphicInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for GraphicInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for GraphicInfo

source§

impl FromBytes for GraphicInfo

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.