Documentation / @ripl/terminal / Rasterizer
Interface: Rasterizer
Defined in: terminal/src/rasterizer.ts:12
Abstract rasterizer interface for converting pixel data to terminal characters.
Properties
Methods
clear()
clear():
void
Defined in: terminal/src/rasterizer.ts:24
Clears all pixels, characters, and colors from the grid.
Returns
void
resize()
resize(
cols,rows):void
Defined in: terminal/src/rasterizer.ts:18
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:26
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:22
Places a literal character in the given cell with the given color.
Parameters
| Parameter | Type |
|---|---|
col | number |
row | number |
char | string |
color | string |
Returns
void
setPixel()
setPixel(
x,y,color):void
Defined in: terminal/src/rasterizer.ts:20
Sets the sub-cell pixel at (x, y) to the given color.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
color | string |
Returns
void
toImageData()
toImageData():
ImageData
Defined in: terminal/src/rasterizer.ts:28
Rasterizes the current grid to environment-agnostic RGBA pixel data.
Returns
ImageData