etui/braille

Types

pub type Pixels =
  dict.Dict(#(Int, Int), #(Int, style.Color))

Values

pub fn bit(col: Int, row: Int) -> Int

Bitmask bit for the dot at (col, row) inside a 2×4 braille cell. Layout (Unicode braille dot numbering): col 0 col 1 row 0 1 8 row 1 2 16 row 2 4 32 row 3 64 128

pub fn flush(
  buf: buffer.Buffer,
  area: geometry.Rect,
  pixels: dict.Dict(#(Int, Int), #(Int, style.Color)),
  bg: style.Color,
) -> buffer.Buffer

Flush the pixel grid into a buffer at the given area’s origin. Each populated cell becomes one braille glyph.

pub fn new() -> dict.Dict(#(Int, Int), #(Int, style.Color))

Empty pixel grid.

pub fn put(
  pixels: dict.Dict(#(Int, Int), #(Int, style.Color)),
  px: Int,
  py: Int,
  fg: style.Color,
) -> dict.Dict(#(Int, Int), #(Int, style.Color))

Write a single pixel at absolute braille-pixel coords (px, py) into the pixel grid. Out-of-bounds coords (px < 0 or py < 0) are dropped.

pub fn set_pixel(
  pixels: dict.Dict(#(Int, Int), #(Int, style.Color)),
  char_x: Int,
  char_y: Int,
  bit: Int,
  fg: style.Color,
) -> dict.Dict(#(Int, Int), #(Int, style.Color))

Set a pixel at terminal-cell (char_x, char_y), accumulating its bit into the existing mask. Color overrides any prior color for that cell.

Search Document