interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / native / omega / allen / SURFACE.md

41 lines · 2652 bytes Raw Blame History Rendered
1# Bounded native text surface (L765)
2
3A necessary rendering component for the iMac-first visual alpha, not a full
4window system, animation, layout engine or display driver. Handwritten Omega;
5qualified existing font geometry and retained presentation are reused.
6
7`Canvas` is a fixed884736-byte RGB buffer. `Cv` fields are width,height,
8clip-x,clip-y,clip-width,clip-height,initialized,last-advance256.
9
10- `cvinit(w,h)`: accepts1..768 by1..384, clears the full buffer, fills active
11 pixels with night RGB(6,8,18), and establishes a full-surface clip.
12- `cvclip(x,y,w,h)`: unsigned clip must fit wholly within active dimensions.
13 Zero-area clips at the edge are valid. Validate using subtraction before
14 adding coordinates, so an oversized width cannot wrap into acceptance.
15- `cvglyph(byte,x,y,color)`: requires initialized surface and font, signed
16 baseline coordinates within[-4096,4096], packed24-bit RGB. Renders through
17 the existing font and clips every pixel. Saves glyph advance in Cv[7].
18- `cvspan(beg,size,x,y,color)`: same guards; reads an explicit bounded Dtext
19 span. Length0 at2304 is legal. Glyph advance accumulates in256ths of a pixel,
20 with signed floor at each baseline; no per-glyph rounding drift. All bytes
21 use the existing font fallback. No implicit wrapping/newline interpretation.
22
23Invalid public arguments preserve Canvas/Cv; font, mask and pose are scratch
24for admitted drawing. Global arrays are module-owned, not an untrusted caller
25mutation interface. Valid font settings and immutable glyph data are required;
26this component does not promise rollback after arbitrary corruption of those
27private globals. Maximum span is2304 bytes and positions remain bounded by the
28qualified maximum glyph advance. No heap, file font or foreign runtime.
29
30Blend each channel using integer `(background*(255-alpha)+foreground*alpha)/255`,
31truncated down, from the CURRENT destination pixel. In/Inlen, retained D* text,
32and offered Outb/Outlen/Err are not renderer scratch. Native tests cover analytic
33alpha0/128/255 and repeated overlap, an independent crop comparison, negative
34origins, exact edge/zero clips, oversized/refused arguments and span/glyph parity.
35Compiled mutants remove the right clip or replace the destination color.
36
37The actual `surface-render` executable submits BOOT/ASK/RECV through prdo,
38projects a fixture note into retained presentation, and draws its title/body.
39Its P6 image is real Omega-produced pixels; reply content is an explicit test
40fixture, NOT a claimed live-model response. PNG conversion is external lossless
41format conversion only. Hosted application/boot/device qualification remains open.