Documentation / @ripl/terminal / BrailleRasterizer
Class: BrailleRasterizer
Defined in: terminal/src/rasterizer.ts:107
Braille-dot rasterizer. Each terminal cell encodes a 2×4 grid of sub-pixel dots via Unicode braille patterns (U+2800–U+28FF).
Implements
Constructors
Constructor
new BrailleRasterizer(
cols,rows):BrailleRasterizer
Defined in: terminal/src/rasterizer.ts:129
Parameters
| Parameter | Type |
|---|---|
cols | number |
rows | number |
Returns
BrailleRasterizer
Accessors
pixelHeight
Get Signature
get pixelHeight():
number
Defined in: terminal/src/rasterizer.ts:125
Total pixel height of the grid (rows times cell height).
Returns
number
Total height of the pixel grid the rasterizer renders into.
Implementation of
pixelWidth
Get Signature
get pixelWidth():
number
Defined in: terminal/src/rasterizer.ts:120
Total pixel width of the grid (columns times cell width).
Returns
number
Total width of the pixel grid the rasterizer renders into.
Implementation of
Methods
clear()
clear():
void
Defined in: terminal/src/rasterizer.ts:187
Clears all dots, characters, and colors from the grid.
Returns
void
Implementation of
resize()
resize(
cols,rows):void
Defined in: terminal/src/rasterizer.ts:141
Resizes the grid to the given columns and rows, discarding all existing contents.
Parameters
| Parameter | Type |
|---|---|
cols | number |
rows | number |
Returns
void
Implementation of
serialize()
serialize(
options?):string
Defined in: terminal/src/rasterizer.ts:257
Serializes the grid to a string, including ANSI color and cursor codes unless ansi is disabled.
Parameters
| Parameter | Type |
|---|---|
options? | SerializeOptions |
Returns
string
Implementation of
setChar()
setChar(
col,row,char,color):void
Defined in: terminal/src/rasterizer.ts:175
Places a literal character in the given cell, overriding its braille dots; out-of-bounds cells are ignored.
Parameters
| Parameter | Type |
|---|---|
col | number |
row | number |
char | string |
color | string |
Returns
void
Implementation of
setPixel()
setPixel(
x,y,color):void
Defined in: terminal/src/rasterizer.ts:153
Sets the braille dot covering pixel (x, y) and stores its color; out-of-bounds pixels are ignored.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
color | string |
Returns
void
Implementation of
toImageData()
toImageData():
ImageData
Defined in: terminal/src/rasterizer.ts:281
Rasterizes the grid to environment-agnostic RGBA pixel data.
Returns
ImageData