code wiki / (root) / nx_fb.nx

nx_fb.nx

buildroot/runtime/nx_fb.nx

5107 B90 linesdepth 2pulls 2 transitivereach 20 importersview sourcekind librarytopic fb
docsdependenciesstructsconstsfunctions

about

nx_fb.nx -- sovereign FRAMEBUFFER library (the kernel's pixel/draw layer for the NishiOS GUI). Reusable primitives extracted (Rule 15 DRY) so every GUI organ draws the same way: clipped pixel, filled rect, 8x8 bitmap-font glyph install + draw (scalable), and a real 24-bit BMP export. A framebuffer is just W*H*3 RGB bytes; on real x86 the kernel gets this region from VESA/VBE or UEFI GOP. license_tier: ORIGINAL

dependencies 1 imports · 20 importers

nx_syscalls.nx nx_fb.nx nx_drawfb_probe.nx nx_gpu_geometry.nx nx_gpu_graphics_gate.nx nx_nishi_usb_desktop.nx nx_nishi_usb_fbkernel.nx nx_nishios_boot_gui.nx nx_nishios_browser.nx nx_nishios_browser_input.nx nx_nishios_browser_x86.nx nx_nishios_docview.nx

diagram shows first 10 each side; +0 more imports, +10 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_drawfb_probe.nxnx_gpu_geometry.nxnx_gpu_graphics_gate.nxnx_nishi_usb_desktop.nxnx_nishi_usb_fbkernel.nxnx_nishios_boot_gui.nxnx_nishios_browser.nxnx_nishios_browser_input.nxnx_nishios_browser_x86.nxnx_nishios_docview.nxnx_nishios_events.nxnx_nishios_fb_x86.nxnx_nishios_irq.nxnx_nishios_kbd.nxnx_nishios_net.nxnx_nishios_net_wire.nxnx_nishios_raster.nxnx_nishios_shell.nxnx_nishios_term.nxnx_nishios_wm.nx

structs

none

consts

7const K_MAGIC_2835: i64 = 2835

functions

9func fb_setpx(fb: *u8, W: i64, H: i64, x: i64, y: i64, r: i64, g: i64, b: i64) -> i64
13func fb_rect(fb: *u8, W: i64, H: i64, x: i64, y: i64, w: i64, h: i64, r: i64, g: i64, b: i64) -> i64
18func fb_gly(f: *u8, i: i64, r0: i64, r1: i64, r2: i64, r3: i64, r4: i64, r5: i64, r6: i64, r7: i64) -> i64
called by 2: fb_nishi_fontmain
23func fb_char(fb: *u8, W: i64, H: i64, x: i64, y: i64, g: *u8, scale: i64, r: i64, gg: i64, b: i64) -> i64
called by 1: fb_text calls 1: fb_rect
33func fb_text(fb: *u8, W: i64, H: i64, font: *u8, idx: *u8, n: i64, x: i64, y: i64, scale: i64, r: i64, g: i64, b: i64) -> i64
39func fb_window(fb: *u8, W: i64, H: i64, font: *u8, idx: *u8, x: i64, y: i64, w: i64, h: i64, tr: i64, tg: i64, tb: i64, br: i64, bg: i64, bb: i64) -> i64
47func fb_nishi_font(font: *u8, idx: *u8) -> i64
57func fb_cursor(fb: *u8, W: i64, H: i64, cx: i64, cy: i64) -> i64
66func fb_p32(buf: *u8, o: i64, v: i64) -> i64 { buf[o]=(v & 0xFF) as u8; buf[o+1]=((v>>8)&0xFF) as u8; buf[o+2]=((v>>16)&0xFF) as u8; buf[o+3]=((v>>24)&0xFF) as u8; return o+4 }
called by 1: fb_bmp_save
67func fb_p16(buf: *u8, o: i64, v: i64) -> i64 { buf[o]=(v & 0xFF) as u8; buf[o+1]=((v>>8)&0xFF) as u8; return o+2 }
called by 1: fb_bmp_save
70func fb_bmp_save(fb: *u8, W: i64, H: i64, path: *u8) -> i64