-
Notifications
You must be signed in to change notification settings - Fork 1
LookupTable
A precalculated lookup table to help us traverse the pixel buffer.
[red1, green1, blue1, alpha1, redN, greenN, blueN, alphaN...]
Remarks
By precalculating a frequent traversal through a pixel buffer, we can avoid expensive and repetitive calculations while during rasterization.
The pixel index contains groups of four values that represent the RGBA values of a pixel:
- Red channel index
- Green channel index
- Blue channel index
- Alpha channel index
The length of this array is equal to the area of the row and column counts.
• new LookupTable(rowCount
, columnCount
, characterHeight
, pixelRatio
)
Name | Type |
---|---|
rowCount |
number |
columnCount |
number |
characterHeight |
number |
pixelRatio |
number |
• columnCount: number
• Readonly
coords: CharacterCoords
• Readonly
coordsFlipped: CharacterCoords
• Readonly
pixelIndex: Uint32Array
The lookup table used to map the RGBA buffer to the ASCII art canvas.
• Readonly
pixelIndexFlippedY: Uint32Array
The lookup table used to map the RGBA buffer to the ASCII art canvas.
This is the same as pixelIndex
, but with the Y axis flipped for WebGL.
• rowCount: number
• get
length(): number
number