Skip to content

textmode.js / conversion / TextmodeConversionContext

Interface: TextmodeConversionContext

Interface for the context provided to conversion strategies during shader and uniform creation.

This context provides access to the renderer, GL context, source asset, and grid dimensions necessary for implementing custom conversion logic.

Properties

PropertyTypeDescription
fontTextmodeGlyphAtlasLegacy alias for the active glyph atlas. Kept for backward compatibility with existing conversion strategies.
glWebGL2RenderingContextThe native WebGL2 rendering context. Use this for creating textures, buffers, or other low-level WebGL resources.
glyphAtlasTextmodeGlyphAtlasBackend-neutral glyph atlas currently being used for rendering. Prefer this in new code.
pass?TextmodeConversionPassContextMetadata for the active source-level conversion stack pass. Undefined for legacy single-conversion rendering.
sourceTextmodeConversionSourceThe source asset (image, video, etc.) being converted. Provides access to the source texture and dimensions.

Methods

createBaseUniforms()

ts
createBaseUniforms(): Record<string, unknown>;

Create the standard source conversion uniforms for this strategy call.

These uniforms include the source texture, color settings, flip/invert flags, brightness range, and character palette texture for the active pass.

Returns

Record<string, unknown>

Example