nx_paint_fb_ascii_dump.nx
buildroot/runtime/nx_paint_fb_ascii_dump.nx
about
nx_paint_fb_ascii_dump.nx -- dump a Framebuffer to ASCII-art bytes
in a caller-supplied output buffer. Phase 5 first primitive of
NISHI_BROWSER_ROADMAP. Lets the bits-up substrate produce
VISIBLE output we can read in a terminal -- closes the demo gap.
Char selection (5-level luminance bucket per pixel):
alpha == 0 -> ' ' (transparent)
luminance 0..63 (with alpha) -> '.'
luminance 64..127 -> '+'
luminance 128..191 -> 'o'
luminance 192..255 -> '#'
Luminance computed as a simple sum of the three channels divided
by 3 (close-enough for ASCII art; not the perceptual Rec.601
weights). Integer-only; no FP.
Output layout: WIDTH chars per row followed by '\n', repeated for
every row. Total output bytes = (width + 1) * height.
What it does NOT handle yet (Phase 5b queued, explicit in header):
- Unicode block characters (▀ ▄ █ ░ ▒ ▓) for richer 2:1 ratio
- ANSI color escape codes for true-color terminals
- Multi-pixel-per-cell averaging (Phase 5b "half-block" mode
gets twice the vertical resolution by using ▀ + bg/fg color)
- Perceptual Rec.601 luminance weights (0.299, 0.587, 0.114)
Per cardinal feedback-honest-perf-verdict-no-aspirational-claims:
gap list is EXACT in header.
genealogy_id: classical_ascii_art_dither + nishi_substrate_phase_5
lineage_id: nishi_browser_fb_ascii_dump_v1
dependencies 2 imports · 13 importers
diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.
imports: nx_syscalls.nxnx_paint_solid_rect.nx
imported by: nx_browser_demo_42.nxnx_browser_demo_hello.nxnx_browser_demo_html.nxnx_browser_demo_html_nishi.nxnx_browser_demo_lowercase.nxnx_browser_demo_multiline.nxnx_browser_demo_pangram.nxnx_browser_demo_styled.nxnx_browser_render_own_test.nxnx_jpeg_ascii.nxnx_jpeg_ascii_test.nxnx_paint_fb_ascii_dump_test.nxnx_render_ascii.nx
structs
| none |
consts
| none |
functions
| 39 | func _fb_ascii_char_for_pixel(r: i64, g: i64, b: i64, a: i64) -> i64 called by 1: nx_paint_fb_ascii_dump |
| 53 | func nx_paint_fb_ascii_dump(fb: *Framebuffer, |
| 81 | func nx_paint_fb_ascii_write(fb: *Framebuffer) -> i64 |