Skip to main content

Module framing

Module framing 

Source
Expand description

Presentation canvas synthesis (src/core/framing.ts): layout/coordinate mapping, background-extension statistics, and the two per-tile passes buildFramedCanvas drives (chrome/content copy, then source-tile evidence fold). Tile-cache traversal, the O(perimeter) candidate pre-check and KV writes stay in TS.

Structs§

Layout
Presentation layout: native chrome (pane) plus a decorative background-extension band wrapped around the live content rect (content), matching frameLayout.
OutputTile
Output tile buffers buildFramedCanvas mutates. frozen is written by the evidence fold, not read.
SourceTile
One resident source tile the evidence fold reads from.

Enums§

Coordinate
Native source coordinate for a context pixel: None is a decorative extension, Some(None) is reconstructed content, Some(Some((x, y))) is a native-chrome pixel copied from the reference frame.

Functions§

backgrounds
One sampled row/column per background axis, matching backgrounds(): the modal pixel sampled every max(1, floor(pane.dim / 128)) columns/rows across the pane.
fold_evidence
Evidence fold (buildFramedCanvas’s pass 2) for one output tile against up to four overlapping source tiles: copies covered source pixels into the tile (healing provisional bits, carrying coverage), then folds each touched 16×16 block’s quality/score/owner/conflicts/frozen into the destination block.
frame_coordinate
frame_layout
paint_tile
Chrome/content synthesis (buildFramedCanvas’s pass 1) for one output tile: every pixel of bounds (already clipped to the framed canvas) either copies a native reference pixel, paints a background band, or is left untouched (reconstructed-content interior, filled later by fold_evidence).