Experimental terminal backend for Easel.
This backend renders Easel canvas ops by rasterizing off-screen with
Easel.WX.rasterize/2, then converting pixels into terminal glyphs.
It is currently optimized for feasibility over perfect fidelity.
Summary
Functions
Runs a terminal animation loop.
Returns true when both wx rasterization and Termite terminal I/O are available.
Converts raw RGB pixels into a terminal frame string.
Renders a canvas in the terminal.
Functions
Runs a terminal animation loop.
The fun receives the current animation state and must return
{%Easel{}, new_state}.
Press q (or Ctrl+C) to stop.
Options
:fps- frames per second (default30):interval- frame interval in ms (overrides:fps):columns,:rows- output frame size (defaults to terminal size):on_key_down-fn key_event, state -> new_state end:alt_screen- use alternate screen buffer (defaulttrue):hide_cursor- hide cursor during rendering (defaulttrue):title- terminal title (OSC):charset,:invert,:fit,:cell_aspect,:samples,:char_cache,:char_cache_size,:theme,:auto_contrast,:color,:dpr
Returns true when both wx rasterization and Termite terminal I/O are available.
Converts raw RGB pixels into a terminal frame string.
Arguments
image-%{width: w, height: h, rgb: <<r, g, b, ...>>}columns- output character columnsrows- output character rows
Options
:charset- set a manual luma ramp string, or:auto(default) for silhouette fitting:invert- invert luma ramp mapping (only for manual charset mode, defaultfalse):fit-:contain(default) or:fill:cell_aspect- character cell height/width ratio (default2.0):samples- per-cell supersampling edge length (manual charset mode, default2):background_threshold- brightness below which pixels are treated as background in silhouette mode (default0.05):glyph_width/:glyph_height- silhouette glyph mask size (defaults9x19):glyph_threshold- threshold for binarizing glyph masks (default0.5):char_cache- cache silhouette mask→glyph lookups (defaulttrue):char_cache_size- max cached masks before reset (default8192):theme-:auto(default),:dark, or:lightfor optional contrast adaptation:auto_contrast- adapt colors to terminal theme (defaultfalse):dark_min_luma- minimum foreground luma on dark terminals (default0.28):light_max_luma- maximum foreground luma on light terminals (default0.72):color-:none(default) or:ansi256
Renders a canvas in the terminal.
Defaults to alt-screen mode and waits for q (or Ctrl+C) before returning.
Options
:columns,:rows- output frame size (defaults to terminal size):charset,:invert,:fit,:cell_aspect,:samples,:char_cache,:char_cache_size,:theme,:auto_contrast,:color- seeframe_from_rgb/4:dpr- rasterization DPR (default1.0, higher looks better but costs more):title- terminal title (OSC):wait- wait for quit key (defaulttrue):alt_screen- use alternate screen buffer (defaulttrue):hide_cursor- hide cursor during rendering (defaulttrue):on_key_down- callback for key events in wait loop (fn key_event -> ... end)