Skip to content

textmode.js / TextmodeConversionPipeline

Class: TextmodeConversionPipeline

Manages the conversion pipeline for textmode rendering.

A conversion pipeline consists of multiple converters that process the input texture in sequence. Each converter can modify the texture in various ways, such as applying brightness mapping, color adjustments, transformations, and more.

Accessors

texture

Get Signature

ts
get texture(): Framebuffer;

Returns the framebuffer containing the textmode conversion result.

Returns

Framebuffer

Methods

add()

ts
add(name, type): 
  | void
  | TextmodeConverter;

Adds a new converter to the pipeline.

Parameters

name

string

A unique name for the converter.

type

The type of converter to add. Can be either "brightness" or "custom".

"brightness" | "custom"

Returns

| void | TextmodeConverter

The newly created TextmodeConverter instance or void if the addition failed.


disable()

ts
disable(): void;

Disables all converters in the pipeline.

Returns

void


enable()

ts
enable(): void;

Enables all converters in the pipeline.

Returns

void


get()

ts
get(name): 
  | void
  | TextmodeConverter;

Get a specific converter by name.

Parameters

name

string

The name of the converter to retrieve.

Returns

| void | TextmodeConverter

The requested TextmodeConverter instance.


hasEnabledConverters()

ts
hasEnabledConverters(): boolean;

Checks if any converter in the pipeline is enabled.

Returns

boolean

true if any converter is enabled, false otherwise.


remove()

ts
remove(nameOrInstance): boolean;

Removes a converter from the pipeline by name or instance.

Parameters

nameOrInstance

The unique name of the converter or the converter instance to remove.

string | TextmodeConverter

Returns

boolean

true if the converter was successfully removed, false otherwise.