Skip to content

textmode.js / media / TextmodeSource

Abstract Class: TextmodeSource

Shared base for image, video, and dynamic texture sources drawn with Textmodifier.image.

Extends

  • Disposable

Extended by

Character & color mapping

Map sampled values to glyphs, foreground colors, cell colors, and a background.

MethodDescription
backgroundSet the background color used for transparent pixels.
cellColorSet the cell color used when cellColorMode is 'fixed'.
cellColorModeSet whether cell color is sampled from the source or fixed.
charactersSet the characters used for brightness mapping.
charColorSet the character color used when charColorMode is 'fixed'.
charColorModeSet whether character color is sampled from the source or fixed.

Conversion

Select and clear the conversion stack used when drawing this source.

MethodDescription
brightnessRangeCapture only source pixels whose brightness is inside the inclusive byte range.
clearConversionsClear this source's conversion stack and return to single-mode conversion.
conversionModeSelect the conversion mode for this source.
conversionsSet an ordered conversion stack for this source.

Resource lifecycle

Release the WebGL resources owned by the source.

MethodDescription
disposeDispose of the resource and free associated WebGL textures.

Source dimensions

Inspect the source texture and its original and grid-fitted dimensions.

AccessorDescription
heightIdeal draw height in grid cells.
originalHeightOriginal source height in pixels.
originalWidthOriginal source width in pixels.
textureWebGL texture backing this source.
widthIdeal draw width in grid cells.

Source transforms

Mirror, invert, or rotate the source's converted output.

MethodDescription
charRotationRotate generated characters.
flipXFlip the source horizontally.
flipYFlip the source vertically.
invertEnable or disable source color inversion.