Raxol.Core.Runtime.Rendering.Pipeline (Raxol v2.8.0)

View Source

Frame stages shared by Raxol.Core.Runtime.Rendering.Engine and Raxol.Scoreboard, so the scoreboard measures the stages the engine runs rather than a copy of them. They take no process state, though not all are pure: theme/1 reads the configured theme and the border beam reads the clock.

The engine's other per-frame steps stay in the engine: fetching the model and theme id from the dispatcher, the animation pass over the model, process-component substitution in the view, plugin transforms supplied by the dispatcher's plugin manager, and the backend write, whose terminal half is Raxol.Core.Runtime.Rendering.Backends.terminal_frame/2. test/raxol/scoreboard_test.exs checks that the scoreboard's sequence of these stages produces the engine's bytes.

Summary

Functions

Applies the border-beam animation hints carried by positioned elements to the rendered cells. Returns the cells unchanged when no element carries a :border_beam hint, or when applying them fails: a decorative effect must not cost the frame.

The theme a frame renders with. The dispatcher's theme id is the default unless the app (a model :current_theme_id) or the user's preferences chose another. The default renders Theme.current/0, the theme Raxol.set_theme/1 sets; a chosen id renders the theme registered under it, or Theme.current/0 if none is.

Functions

apply_border_beam(cells, positioned_elements)

@spec apply_border_beam(list(), list()) :: list()

Applies the border-beam animation hints carried by positioned elements to the rendered cells. Returns the cells unchanged when no element carries a :border_beam hint, or when applying them fails: a decorative effect must not cost the frame.

theme(theme_id)

@spec theme(atom() | String.t() | nil) :: map()

The theme a frame renders with. The dispatcher's theme id is the default unless the app (a model :current_theme_id) or the user's preferences chose another. The default renders Theme.current/0, the theme Raxol.set_theme/1 sets; a chosen id renders the theme registered under it, or Theme.current/0 if none is.