package miaou-driver-matrix
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6
doc/miaou-driver-matrix.driver/Miaou_driver_matrix/Matrix_diff/index.html
Module Miaou_driver_matrix.Matrix_diffSource
Diff algorithm for the Matrix driver.
Compares front and back buffers to compute minimal changes needed to update the terminal display. Optimizes for:
- Skipping unchanged cells
- Minimizing cursor movements
- Batching consecutive characters
- Minimizing style changes
type change = | MoveTo of int * int(*Move cursor to (row, col), 0-indexed
*)| SetStyle of Matrix_cell.style(*Change current text style
*)| WriteChar of string(*Write a single character
*)| WriteRun of string * int(*Write character repeated N times
*)
A single change operation.
Compute diff between front (displayed) and back (new) buffers. Returns list of changes to transform front into back. NOT thread-safe - use compute_atomic for two-domain architecture.
Compute diff atomically with buffer lock held. Thread-safe for two-domain architecture. Also swaps buffers while holding the lock to prevent torn reads. Use this from the render domain.
val compute_region :
Matrix_buffer.t ->
row:int ->
col:int ->
width:int ->
height:int ->
change listCompute diff for a specific region of the buffer.
Count number of cells that differ between front and back.