textmode.js 0.7.0-beta.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,8 +9,8 @@ export type { TextmodeFramebufferOptions } from './rendering/webgl';
9
9
  export { registerConversionStrategy, unregisterConversionStrategy, getConversionStrategy, } from './textmode/conversion';
10
10
  export type { TextmodeConversionStrategy, TextmodeConversionContext, TextmodeConversionMode, } from './textmode/conversion';
11
11
  export type { TextmodePlugin, TextmodePluginAPI, } from './textmode/managers/PluginManager';
12
- export { FilterRegistry } from './textmode/layers';
13
- export type { FilterName, BuiltInFilterName, BuiltInFilterParams, FilterContext, TextmodeFilterStrategy, } from './textmode/layers';
12
+ /** All filter related modules and types. */
13
+ export * as filters from './textmode/filters';
14
14
  export { TextmodeErrorLevel } from './errors/ErrorHandler';
15
15
  export { Textmode as textmode } from './Textmode';
16
16
  /** All loading screen related modules and types. */
@@ -21,7 +21,14 @@ export type TextmodeFramebufferOptions = {
21
21
  width?: number;
22
22
  /** Height of the framebuffer in grid cells */
23
23
  height?: number;
24
- /** Number of color attachments (1-8) */
24
+ /**
25
+ * Number of color attachments *(1-8)*
26
+ *
27
+ * Defaults to 3 for textmode framebuffers *(character/transform data, primary color, secondary color)*.
28
+ * You probably do not want to go below 3 for textmode rendering, otherwise rendering will not function correctly.
29
+ *
30
+ * Going above 3 is only recommended for advanced use cases involving custom shaders that utilize additional attachments.
31
+ */
25
32
  attachments?: number;
26
33
  };
27
34
  /**
@@ -20,6 +20,8 @@ import type { IMouseMixin } from './mixins/interfaces/IMouseMixin';
20
20
  import { LoadingScreenManager } from './loading/LoadingScreenManager';
21
21
  import { LayerManager } from './layers/LayerManager';
22
22
  import type { TextmodeLayerManager } from './layers';
23
+ import { TextmodeFilterManager } from './filters';
24
+ import type { FilterName, BuiltInFilterName, BuiltInFilterParams } from './filters';
23
25
  declare const Textmodifier_base: {
24
26
  new (): {};
25
27
  };
@@ -46,6 +48,11 @@ export declare class Textmodifier extends Textmodifier_base implements ITextmodi
46
48
  _textmodeFramebuffer: GLFramebuffer;
47
49
  _presentShader: GLShader;
48
50
  _layerManager: TextmodeLayerManager;
51
+ /** @internal */
52
+ _filterManager: TextmodeFilterManager;
53
+ private _globalFilterQueue;
54
+ private _preFilterFramebuffer;
55
+ private _postFilterFramebuffer;
49
56
  private _pluginManager;
50
57
  private _destroyRequested;
51
58
  private _isRenderingFrame;
@@ -88,6 +95,64 @@ export declare class Textmodifier extends Textmodifier_base implements ITextmodi
88
95
  get overlay(): TextmodeImage | undefined;
89
96
  get loading(): LoadingScreenManager;
90
97
  get layers(): LayerManager;
98
+ /**
99
+ * Access the filter manager for this Textmodifier instance.
100
+ *
101
+ * Use this to register custom filters that can be applied both globally
102
+ * (via {@link filter}) and on individual layers (via {@link TextmodeLayer.filter}).
103
+ * Filters only need to be registered once and are available everywhere.
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * // Register a custom filter once
108
+ * await t.filters.register('vignette', vignetteShader, {
109
+ * u_intensity: ['intensity', 0.5]
110
+ * });
111
+ *
112
+ * t.draw(() => {
113
+ * t.background(0);
114
+ * t.char('A');
115
+ * t.rect(10, 10);
116
+ *
117
+ * // Apply filter globally to final output
118
+ * t.filter('vignette', { intensity: 0.8 });
119
+ *
120
+ * // Or apply to a specific layer
121
+ * t.layers.base.filter('vignette', 0.5);
122
+ * });
123
+ * ```
124
+ */
125
+ get filters(): TextmodeFilterManager;
126
+ /**
127
+ * Apply a filter to the final composited output.
128
+ *
129
+ * Filters are applied after all layers are composited but before
130
+ * the result is presented to the canvas. Multiple filters can be
131
+ * queued per frame and will be applied in order.
132
+ *
133
+ * @param name The name of the filter to apply (built-in or custom)
134
+ * @param params Optional parameters for the filter
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * t.draw(() => {
139
+ * t.background(0);
140
+ * t.charColor(255);
141
+ * t.char('A');
142
+ * t.rect(10, 10);
143
+ *
144
+ * // Apply built-in filters
145
+ * t.filter('grayscale', 0.5);
146
+ * t.filter('invert');
147
+ *
148
+ * // Chain multiple filters
149
+ * t.filter('sepia', { amount: 0.3 });
150
+ * t.filter('threshold', 0.5);
151
+ * });
152
+ * ```
153
+ */
154
+ filter<T extends BuiltInFilterName>(name: T, params?: BuiltInFilterParams[T]): void;
155
+ filter(name: FilterName, params?: unknown): void;
91
156
  $registerSource(source: TextmodeSource): void;
92
157
  }
93
158
  export interface Textmodifier extends IRenderingMixin, IFontMixin, IAnimationMixin, IMouseMixin, ITouchMixin, IKeyboardMixin {
@@ -0,0 +1,137 @@
1
+ import type { GLRenderer, GLShader, GLFramebuffer } from '../../rendering';
2
+ import type { QueuedFilter, FilterName } from './types';
3
+ /**
4
+ * Manages filter registration, shader compilation, and filter chain application.
5
+ *
6
+ * This class provides:
7
+ * - A registry for custom and built-in filter strategies
8
+ * - Lazy shader compilation and caching
9
+ * - Ping-pong rendering for efficient multi-filter chains
10
+ *
11
+ * Used both for layer-level filters and global post-processing filters.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // Register a custom filter
16
+ * await t.filters.register('brightness', brightnessShader, {
17
+ * u_amount: ['amount', 1.0]
18
+ * });
19
+ *
20
+ * // Use the filter globally
21
+ * t.filter('brightness', 1.5);
22
+ *
23
+ * // Or on a layer
24
+ * t.layers.base.filter('brightness', { amount: 0.8 });
25
+ * ```
26
+ */
27
+ export declare class TextmodeFilterManager {
28
+ private readonly _renderer;
29
+ private readonly _shaderCache;
30
+ private readonly _copyShader;
31
+ private _pingPongBuffers;
32
+ private _isInitialized;
33
+ private _filterRegistry;
34
+ /**
35
+ * Create a new TextmodeFilterManager.
36
+ * @param renderer The WebGL renderer instance
37
+ * @ignore
38
+ */
39
+ constructor(renderer: GLRenderer);
40
+ /**
41
+ * Register a custom filter with the given ID, shader, and uniform definitions.
42
+ *
43
+ * @param id Unique filter identifier
44
+ * @param shader Pre-compiled GLShader, fragment shader source string, or path to a .frag/.glsl file
45
+ * @param uniformDefs Maps uniform names to [paramName, defaultValue] tuples
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * // Register with inline shader source
50
+ * await t.filters.register('blur', blurFragSource, {
51
+ * u_radius: ['radius', 5.0],
52
+ * u_direction: ['direction', [1.0, 0.0]]
53
+ * });
54
+ *
55
+ * // Register with file path
56
+ * await t.filters.register('vignette', './vignette.frag', {
57
+ * u_intensity: ['intensity', 0.5]
58
+ * });
59
+ *
60
+ * // Register with pre-compiled shader
61
+ * const shader = await t.createShader(vertSrc, fragSrc);
62
+ * await t.filters.register('custom', shader, {});
63
+ * ```
64
+ */
65
+ register(id: FilterName, shader: GLShader | string, uniformDefs?: Record<string, [paramName: string, defaultValue: unknown]>): Promise<void>;
66
+ /**
67
+ * Unregister a filter by its ID.
68
+ *
69
+ * @param id The filter ID to unregister
70
+ * @returns true if the filter was unregistered, false if it wasn't found
71
+ */
72
+ unregister(id: FilterName): boolean;
73
+ /**
74
+ * Check if a filter with the given ID is registered.
75
+ *
76
+ * @param id The filter ID to check
77
+ * @returns true if the filter exists
78
+ */
79
+ has(id: FilterName): boolean;
80
+ /**
81
+ * Initialize ping-pong buffers for filter chain processing.
82
+ * @param width Buffer width in pixels
83
+ * @param height Buffer height in pixels
84
+ * @ignore
85
+ */
86
+ $initialize(width: number, height: number): void;
87
+ /**
88
+ * Apply a chain of filters to the source texture, outputting to target.
89
+ * Uses the manager's internal ping-pong buffers.
90
+ *
91
+ * @param sourceTexture The input texture
92
+ * @param targetFramebuffer The output framebuffer
93
+ * @param filters The queue of filters to apply in order
94
+ * @param width Framebuffer width
95
+ * @param height Framebuffer height
96
+ * @ignore
97
+ */
98
+ $applyFilters(sourceTexture: WebGLTexture, targetFramebuffer: GLFramebuffer, filters: QueuedFilter[], width: number, height: number): void;
99
+ /**
100
+ * Apply a chain of filters using external ping-pong buffers.
101
+ * This allows sharing the filter registry while using different buffer sizes
102
+ * (e.g., layer filters at grid dimensions vs global filters at canvas dimensions).
103
+ *
104
+ * @param sourceTexture The input texture
105
+ * @param targetFramebuffer The output framebuffer
106
+ * @param filters The queue of filters to apply in order
107
+ * @param width Framebuffer width
108
+ * @param height Framebuffer height
109
+ * @param pingPongBuffers External ping-pong buffers to use
110
+ * @ignore
111
+ */
112
+ $applyFiltersWithBuffers(sourceTexture: WebGLTexture, targetFramebuffer: GLFramebuffer, filters: QueuedFilter[], width: number, height: number, pingPongBuffers: [GLFramebuffer, GLFramebuffer]): void;
113
+ /**
114
+ * Apply a single filter pass with explicit source buffer.
115
+ */
116
+ private _applyFilterWithBuffer;
117
+ /**
118
+ * Get or create a cached shader for the given filter.
119
+ */
120
+ private _getOrCreateShader;
121
+ /**
122
+ * Copy a texture to a framebuffer using the copy shader.
123
+ */
124
+ private _copyTexture;
125
+ /**
126
+ * Resize the ping-pong buffers.
127
+ * @param width New width in pixels
128
+ * @param height New height in pixels
129
+ * @ignore
130
+ */
131
+ $resize(width: number, height: number): void;
132
+ /**
133
+ * Dispose of all resources.
134
+ * @ignore
135
+ */
136
+ $dispose(): void;
137
+ }
@@ -1,28 +1,21 @@
1
- import type { GLRenderer, GLShader } from '../../../rendering';
1
+ import type { GLRenderer, GLShader } from '../../rendering';
2
2
  import type { TextmodeFilterStrategy, FilterName } from './types';
3
3
  /**
4
4
  * Instance-based registry for filter strategies.
5
5
  *
6
- * Each {@link Textmodifier} instance has its own FilterRegistry, allowing
7
- * filters to be scoped to a specific instance rather than registered globally.
8
- *
9
- * Access via `t.layers.filters`.
6
+ * Each {@link FilterManager} instance has its own FilterRegistry, allowing
7
+ * filters to be scoped to a specific context rather than registered globally.
10
8
  *
11
9
  * @example
12
10
  * ```typescript
13
11
  * // Define a simple filter with the declarative API
14
- * t.layers.filters.define('blur', blurShader, { radius: 5.0 });
15
- *
16
- * // Register a custom filter strategy
17
- * t.layers.filters.register({
18
- * id: 'custom',
19
- * createShader(ctx) { ... },
20
- * createUniforms(params, ctx) { ... }
21
- * });
12
+ * t.filters.register('blur', blurShader, { radius: 5.0 });
22
13
  *
23
14
  * // Use the filter
24
- * t.layers.base.filter('blur', { radius: 10 });
15
+ * t.filter('blur', { radius: 10 });
25
16
  * ```
17
+ *
18
+ * @ignore
26
19
  */
27
20
  export declare class FilterRegistry {
28
21
  private readonly _renderer;
@@ -31,7 +24,6 @@ export declare class FilterRegistry {
31
24
  /**
32
25
  * Create a new FilterRegistry.
33
26
  * @param renderer The WebGL renderer instance
34
- * @internal
35
27
  */
36
28
  constructor(renderer: GLRenderer);
37
29
  /**
@@ -48,14 +40,14 @@ export declare class FilterRegistry {
48
40
  * ```typescript
49
41
  * // With pre-compiled shader (recommended for add-ons)
50
42
  * const shader = await t.createShader(vertSrc, fragSrc);
51
- * t.layers.filters.define('brightness', shader, { u_amount: ['amount', 1.0] });
43
+ * t.filters.register('brightness', shader, { u_amount: ['amount', 1.0] });
52
44
  *
53
45
  * // With a path to a fragment shader file
54
- * await t.layers.filters.define('brightness', './brightness.frag', { u_amount: ['amount', 1.0] });
46
+ * await t.filters.register('brightness', './brightness.frag', { u_amount: ['amount', 1.0] });
55
47
  *
56
48
  * // Usage:
57
- * t.layers.base.filter('brightness', 1.5);
58
- * t.layers.base.filter('brightness', { amount: 1.5 });
49
+ * t.filter('brightness', 1.5);
50
+ * t.filter('brightness', { amount: 1.5 });
59
51
  * ```
60
52
  */
61
53
  $register(id: FilterName, shader: GLShader | string, defs?: Record<string, [paramName: string, defaultValue: unknown]>): Promise<void>;
@@ -0,0 +1,3 @@
1
+ export type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter, FilterContext, TextmodeFilterStrategy } from './types';
2
+ export { FilterRegistry } from './FilterRegistry';
3
+ export { TextmodeFilterManager } from './FilterManager';
@@ -1,13 +1,13 @@
1
- import type { GLShader } from '../../../rendering';
2
- import type { GLRenderer } from '../../../rendering/webgl/core/Renderer';
1
+ import type { GLShader } from '../../rendering';
2
+ import type { GLRenderer } from '../../rendering/webgl/core/Renderer';
3
3
  /**
4
4
  * Built-in filter names provided by textmode.js
5
5
  */
6
- export type BuiltInFilterName = 'invert' | 'grayscale' | 'sepia' | 'hueRotate' | 'saturate' | 'brightness' | 'contrast' | 'threshold' | 'chromaticAberration' | 'pixelate';
6
+ export type BuiltInFilterName = 'invert' | 'grayscale' | 'sepia' | 'threshold';
7
7
  /**
8
8
  * Filter name type that allows both built-in and custom filter names
9
9
  */
10
- export type FilterName = BuiltInFilterName | (string & {});
10
+ export type FilterName = BuiltInFilterName | string;
11
11
  /**
12
12
  * Filter parameter types for built-in filters.
13
13
  *
@@ -25,39 +25,14 @@ export interface BuiltInFilterParams {
25
25
  sepia: number | {
26
26
  amount?: number;
27
27
  } | void;
28
- /** Rotates hue. Angle in degrees */
29
- hueRotate: number | {
30
- angle?: number;
31
- };
32
- /** Adjusts saturation. Amount: 1 = normal, >1 = more saturated */
33
- saturate: number | {
34
- amount?: number;
35
- };
36
- /** Adjusts brightness. Amount: 1 = normal, >1 = brighter */
37
- brightness: number | {
38
- amount?: number;
39
- };
40
- /** Adjusts contrast. Amount: 1 = normal, >1 = more contrast */
41
- contrast: number | {
42
- amount?: number;
43
- };
44
- /** Black/white threshold. Threshold: 0-1 */
28
+ /** Black/white threshold. Threshold: 0-1, default 0.5 */
45
29
  threshold: number | {
46
30
  threshold?: number;
47
31
  };
48
- /** Chromatic aberration (color fringing) */
49
- chromaticAberration: number | {
50
- amount?: number;
51
- direction?: [number, number];
52
- };
53
- /** Pixelate effect. PixelSize in pixels */
54
- pixelate: number | {
55
- pixelSize?: number;
56
- };
57
32
  }
58
33
  /**
59
34
  * A queued filter operation to be applied during rendering
60
- * @internal
35
+ * @ignore
61
36
  */
62
37
  export interface QueuedFilter {
63
38
  name: FilterName;
@@ -65,6 +40,7 @@ export interface QueuedFilter {
65
40
  }
66
41
  /**
67
42
  * Context provided to filter strategies for shader creation
43
+ * @ignore
68
44
  */
69
45
  export interface FilterContext {
70
46
  /** The WebGL renderer instance */
@@ -78,29 +54,7 @@ export interface FilterContext {
78
54
  }
79
55
  /**
80
56
  * Interface for implementing custom filter strategies.
81
- *
82
- * Custom filters can be registered using {@link registerFilterStrategy} and will
83
- * be available for use with `layer.filter('myFilter', params)`.
84
- *
85
- * @example
86
- * ```typescript
87
- * import { registerFilterStrategy } from 'textmode.js';
88
- *
89
- * const myCustomFilter: TextmodeFilterStrategy = {
90
- * id: 'myFilter',
91
- * createShader(context) {
92
- * return context.renderer.$createShader(vertexSource, fragmentSource);
93
- * },
94
- * createUniforms(params, context) {
95
- * return {
96
- * u_intensity: params?.intensity ?? 1.0,
97
- * u_resolution: [context.width, context.height]
98
- * };
99
- * }
100
- * };
101
- *
102
- * registerFilterStrategy(myCustomFilter);
103
- * ```
57
+ * @ignore
104
58
  */
105
59
  export interface TextmodeFilterStrategy {
106
60
  /** Unique identifier for this filter */
@@ -1,9 +1,8 @@
1
1
  import type { GLFramebuffer } from '../../rendering';
2
2
  import type { Textmodifier } from '../Textmodifier';
3
3
  import { TextmodeLayer } from './TextmodeLayer';
4
- import { LayerFilterManager } from './filters';
5
4
  import type { TextmodeLayerOptions } from './types';
6
- import type { ILayerManager } from './ILayerManager';
5
+ import type { ILayerManager } from './interfaces/ILayerManager';
7
6
  /**
8
7
  * Manages all user-defined layers within a Textmodifier instance.
9
8
  *
@@ -13,20 +12,19 @@ import type { ILayerManager } from './ILayerManager';
13
12
  *
14
13
  * The instance of this class can be accessed via {@link Textmodifier.layers}.
15
14
  *
16
- * The base layer at {@link Textmodifier.baseLayer} is not part of this manager's
17
- * public layer stack, but is instead managed internally.
15
+ * The {@link base} layer is not part of the public layer stack, but is instead managed internally.
18
16
  */
19
17
  export declare class LayerManager implements ILayerManager {
20
18
  private readonly _textmodifier;
21
19
  private readonly _renderer;
22
20
  private readonly _conversionShader;
23
21
  private readonly _compositor2D;
24
- private readonly _filterManager;
25
22
  private readonly _pendingLayers;
26
23
  private readonly _layers;
27
24
  private readonly _baseLayer;
28
25
  private _baseFramebuffer;
29
26
  private _baseRawFramebuffer;
27
+ private _layerPingPongBuffers;
30
28
  private _isReady;
31
29
  /**
32
30
  * Create a new LayerManager.
@@ -70,29 +68,6 @@ export declare class LayerManager implements ILayerManager {
70
68
  $dispose(): void;
71
69
  get all(): readonly TextmodeLayer[];
72
70
  get base(): TextmodeLayer;
73
- /**
74
- * Access the filter registry for this Textmodifier instance.
75
- *
76
- * Use this to define or register custom filters scoped to this instance.
77
- *
78
- * @example
79
- * ```typescript
80
- * // Define a filter using the simplified API
81
- * const shader = await t.createShader(vertSrc, fragSrc);
82
- * t.layers.filters.define('brightness', shader, { amount: 1.0 });
83
- *
84
- * // Register a custom filter strategy
85
- * t.layers.filters.register({
86
- * id: 'custom',
87
- * createShader() { return shader; },
88
- * createUniforms(params, ctx) { return { ... }; }
89
- * });
90
- *
91
- * // Use the filter
92
- * t.layers.base.filter('brightness', 1.5);
93
- * ```
94
- */
95
- get filters(): LayerFilterManager;
96
71
  /**
97
72
  * Initialize a single layer with required dependencies.
98
73
  */
@@ -2,7 +2,8 @@ import type { GLFramebuffer, GLShader } from '../../rendering';
2
2
  import type { TextmodeGrid } from '../Grid';
3
3
  import type { Textmodifier } from '../Textmodifier';
4
4
  import type { TextmodeLayerBlendMode, TextmodeLayerOptions, LayerDependencies } from './types';
5
- import type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter } from './filters';
5
+ import type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter } from '../filters';
6
+ import type { ITextmodeLayer } from './interfaces/ITextmodeLayer';
6
7
  /**
7
8
  * A single layer within a multi-layered textmode rendering context.
8
9
  *
@@ -12,11 +13,8 @@ import type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter }
12
13
  *
13
14
  * You can draw on each layer by providing a draw callback function,
14
15
  * like you would with the base layer's {@link Textmodifier.draw} method.
15
- *
16
- * The base layer, which is always present at the bottom of the layer stack,
17
- * can be accessed via {@link Textmodifier.baseLayer}.
18
16
  */
19
- export declare class TextmodeLayer {
17
+ export declare class TextmodeLayer implements ITextmodeLayer {
20
18
  /** @ignore */
21
19
  $visible: boolean;
22
20
  /** @ignore */
@@ -59,86 +57,15 @@ export declare class TextmodeLayer {
59
57
  * @ignore
60
58
  */
61
59
  $runDraw(textmodifier: Textmodifier): void;
62
- /**
63
- * Define this layers draw callback.
64
- * @param callback The function to call when drawing this layer.
65
- */
66
60
  draw(callback: () => void): void;
67
- /**
68
- * Show this layer for rendering.
69
- */
70
61
  show(): void;
71
- /**
72
- * Hide this layer from rendering.
73
- */
74
62
  hide(): void;
75
- /**
76
- * Define or retrieve the layer's opacity.
77
- * @param opacity The opacity value to set (between 0 and 1).
78
- * @returns The current opacity if no parameter is provided.
79
- */
80
63
  opacity(opacity?: number): number | void;
81
- /**
82
- * Set or get the layer's blend mode.
83
- * @param mode The blend mode to set.
84
- * @returns The current blend mode if no parameter is provided.
85
- */
86
64
  blendMode(mode: TextmodeLayerBlendMode): TextmodeLayerBlendMode | void;
87
- /**
88
- * Set or get the layer's offset in pixels.
89
- * @param x The x offset in pixels.
90
- * @param y The y offset in pixels.
91
- * @returns The current offset if no parameters are provided.
92
- */
93
65
  offset(x?: number, y?: number): {
94
66
  x: number;
95
67
  y: number;
96
68
  } | void;
97
- /**
98
- * Apply a post-processing filter to this layer's rendered output.
99
- *
100
- * Filters are applied after ASCII conversion in the order they are called.
101
- * Call this method within your layer's draw callback to apply effects.
102
- *
103
- * @param name The name of the filter to apply (built-in or custom registered filter)
104
- * @param params Optional parameters for the filter
105
- *
106
- * @example
107
- * ```typescript
108
- * layer.draw(function() {
109
- * // Drawing commands...
110
- * this.rect(10, 10);
111
- *
112
- * // Apply filters in sequence
113
- * layer.filter('invert');
114
- * layer.filter('hueRotate', 45);
115
- * layer.filter('glow', { intensity: 0.8, radius: 10 });
116
- * layer.filter('crt');
117
- * });
118
- * ```
119
- *
120
- * **Color Adjustment Filters:**
121
- * - `'invert'` - Inverts all colors
122
- * - `'grayscale'` - Converts to grayscale (param: amount 0-1, default 1)
123
- * - `'sepia'` - Applies sepia tone (param: amount 0-1, default 1)
124
- * - `'hueRotate'` - Rotates hue (param: angle in degrees)
125
- * - `'saturate'` - Adjusts saturation (param: amount, 1 = normal)
126
- * - `'brightness'` - Adjusts brightness (param: amount, 1 = normal)
127
- * - `'contrast'` - Adjusts contrast (param: amount, 1 = normal)
128
- * - `'threshold'` - Black/white threshold (param: threshold 0-1)
129
- *
130
- * **Post-Processing Effects:**
131
- * - `'blur'` - Gaussian blur (param: radius in pixels)
132
- * - `'glow'` - Bloom/glow effect (params: intensity, radius, threshold)
133
- * - `'chromaticAberration'` - RGB color fringing (param: amount, direction)
134
- * - `'scanlines'` - Horizontal scanlines (params: spacing, intensity, offset)
135
- * - `'crt'` - Full CRT monitor effect (params: curvature, scanlineIntensity, vignetteIntensity, brightness)
136
- * - `'vignette'` - Darkened edges (params: intensity, softness)
137
- * - `'pixelate'` - Pixelation effect (param: pixelSize)
138
- * - `'noise'` - Random noise overlay (params: intensity, seed)
139
- *
140
- * Custom filters can be registered using {@link registerFilterStrategy}.
141
- */
142
69
  filter<T extends BuiltInFilterName>(name: T, params?: BuiltInFilterParams[T]): void;
143
70
  filter(name: FilterName, params?: unknown): void;
144
71
  /**
@@ -165,29 +92,14 @@ export declare class TextmodeLayer {
165
92
  * @ignore
166
93
  */
167
94
  $dispose(): void;
168
- /**
169
- * Returns the WebGL texture of the final ASCII framebuffer.
170
- * If the layer is not yet initialized, returns undefined.
171
- */
172
95
  get texture(): WebGLTexture | undefined;
173
- /**
174
- * Returns the width of the final ASCII framebuffer in pixels.
175
- * If the layer is not yet initialized, returns 0.
176
- */
177
96
  get width(): number;
178
- /**
179
- * Returns the height of the final ASCII framebuffer in pixels.
180
- * If the layer is not yet initialized, returns 0.
181
- */
182
97
  get height(): number;
183
98
  /**
184
99
  * Return true when this layer has renderable content.
185
100
  * @ignore
186
101
  */
187
102
  get $hasRenderableContent(): boolean;
188
- /**
189
- * Returns the draw framebuffer for this layer. If the layer is not yet initialized, returns undefined.
190
- */
191
103
  get drawFramebuffer(): GLFramebuffer | undefined;
192
104
  private _initializeFramebuffers;
193
105
  }
@@ -1,3 +1,6 @@
1
- export type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter, FilterContext, TextmodeFilterStrategy } from './types';
2
- export { FilterRegistry } from './FilterRegistry';
3
- export { LayerFilterManager } from './LayerFilterManager';
1
+ export type { FilterName, BuiltInFilterName, BuiltInFilterParams, QueuedFilter, FilterContext, TextmodeFilterStrategy } from '../../filters';
2
+ export { FilterRegistry, TextmodeFilterManager as FilterManager } from '../../filters';
3
+ /**
4
+ * @deprecated Use `FilterManager` instead. This alias exists for backwards compatibility.
5
+ */
6
+ export { TextmodeFilterManager as LayerFilterManager } from '../../filters';
@@ -2,5 +2,3 @@ export { TextmodeLayer } from './TextmodeLayer';
2
2
  export { LayerManager as TextmodeLayerManager } from './LayerManager';
3
3
  export { Layer2DCompositor as LayerCompositor } from './Layer2DCompositor';
4
4
  export type { TextmodeLayerOptions, TextmodeLayerBlendMode } from './types';
5
- export { FilterRegistry } from './filters';
6
- export type { FilterName, BuiltInFilterName, BuiltInFilterParams, FilterContext, TextmodeFilterStrategy } from './filters';
@@ -1,5 +1,5 @@
1
- import type { TextmodeLayer } from './TextmodeLayer';
2
- import type { TextmodeLayerOptions } from './types';
1
+ import type { TextmodeLayer } from '../TextmodeLayer';
2
+ import type { TextmodeLayerOptions } from '../types';
3
3
  export interface ILayerManager {
4
4
  /**
5
5
  * Get all user layers as a readonly array.