limine_protocol/structures/framebuffer.rs
1#[repr(C)]
2#[derive(Debug, PartialEq, Eq)]
3/// Framebuffer structure
4pub struct Framebuffer {
5 /// The address of the framebuffer
6 pub address: *mut u8,
7 /// The width of the framebuffer
8 pub width: u16,
9 /// The height of the framebuffer
10 pub height: u16,
11 /// The pitch of the framebuffer
12 pub pitch: u16,
13 /// How many bits are present per pixel
14 pub bpp: u16,
15 /// The memory model of the framebuffer
16 pub memory_model: u8,
17 /// The red mask size
18 pub red_mask_size: u8,
19 /// The red mask shift amount
20 pub red_mask_shift: u8,
21 /// The green mask size
22 pub green_mask_size: u8,
23 /// The green mask shift amount
24 pub green_mask_shift: u8,
25 /// The blue mask size
26 pub blue_mask_size: u8,
27 /// The blue mask shift amount
28 pub blue_mask_shift: u8,
29 /// This is unused, you shouldn't even see this.
30 unused: u8,
31 /// The size of the EDID
32 pub edid_size: u64,
33 /// A pointer to the EDID
34 pub edid: *mut u8,
35}
36
37#[cfg(test)]
38impl Framebuffer {
39 pub fn new_empty() -> Self {
40 use core::ptr::null_mut;
41 Self {
42 address: null_mut(),
43 width: 100,
44 height: 100,
45 pitch: 3,
46 bpp: 3,
47 memory_model: 0,
48 red_mask_size: 0,
49 red_mask_shift: 0,
50 green_mask_size: 0,
51 green_mask_shift: 0,
52 blue_mask_size: 0,
53 blue_mask_shift: 0,
54 unused: 0,
55 edid_size: 0,
56 edid: null_mut(),
57 }
58 }
59}