Raxol.Terminal.Buffer.Updater (Raxol v0.3.0)
View SourceHandles calculating differences and applying updates to the Raxol.Terminal.ScreenBuffer.
Summary
Functions
Calculates the difference between the current buffer state and a list of desired cell changes.
Returns a list of {x, y, cell_map} tuples representing only the cells that need to be updated.
Input changes
must be a list of {x, y, map} tuples.
Updates the buffer state by applying a list of cell changes. Changes must be in the format {x, y, Cell.t() | map()}. Returns the updated buffer.
Functions
@spec diff( Raxol.Terminal.ScreenBuffer.t(), [{non_neg_integer(), non_neg_integer(), map()}] ) :: [{non_neg_integer(), non_neg_integer(), map()}]
Calculates the difference between the current buffer state and a list of desired cell changes.
Returns a list of {x, y, cell_map} tuples representing only the cells that need to be updated.
Input changes
must be a list of {x, y, map} tuples.
@spec update( Raxol.Terminal.ScreenBuffer.t(), [{non_neg_integer(), non_neg_integer(), Raxol.Terminal.Cell.t() | map()}] ) :: Raxol.Terminal.ScreenBuffer.t()
Updates the buffer state by applying a list of cell changes. Changes must be in the format {x, y, Cell.t() | map()}. Returns the updated buffer.