Skip to content

LookupTable

Teffen Ellis edited this page Feb 15, 2023 · 3 revisions

Class: 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.

Table of contents

Constructors

Properties

Accessors

Constructors

constructor

new LookupTable(rowCount, columnCount, characterHeight, pixelRatio)

Parameters

Name Type
rowCount number
columnCount number
characterHeight number
pixelRatio number

Defined in

utils/LookupTable.mts:42

Properties

columnCount

columnCount: number

Defined in

utils/LookupTable.mts:42


coords

Readonly coords: CharacterCoords

Defined in

utils/LookupTable.mts:39


coordsFlipped

Readonly coordsFlipped: CharacterCoords

Defined in

utils/LookupTable.mts:40


pixelIndex

Readonly pixelIndex: Uint32Array

The lookup table used to map the RGBA buffer to the ASCII art canvas.

Defined in

utils/LookupTable.mts:33


pixelIndexFlippedY

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.

Defined in

utils/LookupTable.mts:38


rowCount

rowCount: number

Defined in

utils/LookupTable.mts:42

Accessors

length

get length(): number

Returns

number

Defined in

utils/LookupTable.mts:85