aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / omega / allen / SURFACE.md
| 1 | # Bounded native text surface (L765) |
| 2 | |
| 3 | A necessary rendering component for the iMac-first visual alpha, not a full |
| 4 | window system, animation, layout engine or display driver. Handwritten Omega; |
| 5 | qualified existing font geometry and retained presentation are reused. |
| 6 | |
| 7 | `Canvas` is a fixed884736-byte RGB buffer. `Cv` fields are width,height, |
| 8 | clip-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 | |
| 23 | Invalid public arguments preserve Canvas/Cv; font, mask and pose are scratch |
| 24 | for admitted drawing. Global arrays are module-owned, not an untrusted caller |
| 25 | mutation interface. Valid font settings and immutable glyph data are required; |
| 26 | this component does not promise rollback after arbitrary corruption of those |
| 27 | private globals. Maximum span is2304 bytes and positions remain bounded by the |
| 28 | qualified maximum glyph advance. No heap, file font or foreign runtime. |
| 29 | |
| 30 | Blend each channel using integer `(background*(255-alpha)+foreground*alpha)/255`, |
| 31 | truncated down, from the CURRENT destination pixel. In/Inlen, retained D* text, |
| 32 | and offered Outb/Outlen/Err are not renderer scratch. Native tests cover analytic |
| 33 | alpha0/128/255 and repeated overlap, an independent crop comparison, negative |
| 34 | origins, exact edge/zero clips, oversized/refused arguments and span/glyph parity. |
| 35 | Compiled mutants remove the right clip or replace the destination color. |
| 36 | |
| 37 | The actual `surface-render` executable submits BOOT/ASK/RECV through prdo, |
| 38 | projects a fixture note into retained presentation, and draws its title/body. |
| 39 | Its P6 image is real Omega-produced pixels; reply content is an explicit test |
| 40 | fixture, NOT a claimed live-model response. PNG conversion is external lossless |
| 41 | format conversion only. Hosted application/boot/device qualification remains open. |