Create a new cell buffer filled with empty cells.
Buffer width in columns.
Buffer height in rows.
Buffer height in rows.
Buffer width in columns.
Reset all cells to EMPTY_CELL.
Compare this buffer against another and return positions that differ. Used for differential rendering — only changed cells need terminal updates.
The buffer to compare against.
Array of { x, y } positions where cells differ.
Fill a rectangular region with a cell value. Coordinates are clipped to buffer bounds.
Left column (inclusive).
Top row (inclusive).
Width in columns.
Height in rows.
Cell value to fill with.
Get the cell at (x, y).
Returns EMPTY_CELL for out-of-bounds coordinates.
Check if the cell at (x, y) is empty (transparent).
A cell is empty if it matches EMPTY_CELL exactly.
Resize the buffer. Existing content within the new bounds is preserved. New cells are initialized to EMPTY_CELL.
New width in columns.
New height in rows.
Set the cell at (x, y).
Out-of-bounds writes are silently ignored.
A 2D grid of styled terminal cells.
The cell buffer is the core rendering target. The layout engine computes rects, painting writes styled cells into those rects, and the diff algorithm compares the current buffer against the previous one to produce minimal terminal updates.
Empty cells (matching EMPTY_CELL) are considered transparent for layer compositing — higher layers overwrite lower layers only where they have non-empty content.