Skip to main content

Module matrix

Module matrix 

Source
Expand description

The matrix: an ordered sequence of chunks the renderer slices.

CellMatrix is the contract between the cell-builder worker (S2 producer, in lattice-host) and the renderers (S3 TUI, S4 GPU consumers). Published wait-free via ArcSwap inside RenderState; the paint loop reads it once per frame.

See docs/dev/architecture/cell-grid-renderer.md § Paint loop for the per-frame contract.

Structs§

CellMatrix
The published cell matrix for a single buffer.
CellSlice
Borrowed iterator over a slice of matrix rows. Created via CellMatrix::slice.
CellSliceIter
Iterator yielded by CellSlice::iter. Walks chunks from the one containing start and yields &CellRow refs through to end.
DisplaySlice
Borrowed slice over the interleaved (document, virtual) display rows. Created via CellMatrix::display_slice.
DisplaySliceIter
Iterator yielded by DisplaySlice::iter. Walks the underlying CellSliceIter in tandem with the virtual rows in virtual_rows, emitting them in the order:

Enums§

DisplayRowEntry
One row yielded by DisplaySliceIter.

Constants§

CHUNK_SIZE_WHOLE_DOC
Sentinel value of CellMatrix::chunk_size meaning whole-doc mode: the matrix has at most one chunk covering the entire document. Below 4 × viewport_height lines the cell-builder uses whole-doc mode (see chunking policy in the design doc).

Functions§

wrap_segments
Soft-wrap (W.2, A2): number of display rows a row of col_count columns occupies when wrapped at wrap_width columns. Floored at 1 (an empty row still occupies one display row) and at 1 when wrap_width == 0 (wrapping off). Shared by the host scroll model and both renderers so segment arithmetic is defined in exactly one place.