Documentation / @ripl/terminal / Rasterizer
Interface: Rasterizer ​
Defined in: terminal/src/rasterizer.ts:34
Abstract rasterizer interface for converting pixel data to terminal characters.
Properties ​
Methods ​
clear() ​
clear():
void
Defined in: terminal/src/rasterizer.ts:50
Clears all pixels, characters, and colors from the grid.
Returns ​
void
resize() ​
resize(
cols,rows):void
Defined in: terminal/src/rasterizer.ts:44
Resizes the grid to the given number of terminal columns and rows, clearing its contents.
Parameters ​
| Parameter | Type |
|---|---|
cols | number |
rows | number |
Returns ​
void
serialize() ​
serialize(
options?):string
Defined in: terminal/src/rasterizer.ts:52
Serializes the grid to a terminal-ready string (ANSI-colored by default).
Parameters ​
| Parameter | Type |
|---|---|
options? | SerializeOptions |
Returns ​
string
setChar() ​
setChar(
col,row,char,color):void
Defined in: terminal/src/rasterizer.ts:48
Places a literal character in the given cell with the given color.
Parameters ​
| Parameter | Type |
|---|---|
col | number |
row | number |
char | string |
color | TerminalColor |
Returns ​
void
setPixel() ​
setPixel(
x,y,color):void
Defined in: terminal/src/rasterizer.ts:46
Composites the given color onto the sub-cell pixel at (x, y).
Parameters ​
| Parameter | Type |
|---|---|
x | number |
y | number |
color | TerminalColor |
Returns ​
void
toImageData() ​
toImageData():
ImageData
Defined in: terminal/src/rasterizer.ts:54
Rasterizes the current grid to environment-agnostic RGBA pixel data.
Returns ​
ImageData