Tuix.Renderer (tuix v0.1.0)

Copy Markdown View Source

Paints a placed element tree into a Tuix.Buffer and serializes frames (or frame diffs) into ANSI iodata.

Summary

Functions

Paints a placed tree into a buffer.

Renders an element tree at the given size: layout + paint.

Serializes the difference between two frames as ANSI iodata.

Functions

paint(placed, buffer)

Paints a placed tree into a buffer.

render(element, width, height)

Renders an element tree at the given size: layout + paint.

to_iodata(new, old \\ nil)

@spec to_iodata(Tuix.Buffer.t(), Tuix.Buffer.t() | nil) :: iodata()

Serializes the difference between two frames as ANSI iodata.

With old as nil, serializes the full frame (preceded by a clear).

Rows whose contents are unchanged are skipped with a single term comparison. Within a changed row, consecutive changed cells are emitted as runs (one cursor move per run), in a single pass over the row.