textmode.js 0.1.6-beta.5 → 0.1.6-beta.7

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.
Files changed (48) hide show
  1. package/dist/textmode.esm.js +1871 -0
  2. package/dist/textmode.esm.min.js +1870 -0
  3. package/dist/textmode.umd.js +64 -0
  4. package/dist/textmode.umd.min.js +63 -0
  5. package/dist/types/ColorPalette.d.ts +1 -5
  6. package/dist/types/Textmode.d.ts +0 -10
  7. package/dist/types/errors/Error.d.ts +3 -5
  8. package/dist/types/errors/ErrorHandler.d.ts +3 -3
  9. package/dist/types/export/base/DataExtractor.d.ts +3 -3
  10. package/dist/types/export/base/FileHandler.d.ts +6 -6
  11. package/dist/types/export/image/ImageContentGenerator.d.ts +3 -3
  12. package/dist/types/export/image/ImageDataExtractor.d.ts +2 -2
  13. package/dist/types/export/image/ImageExporter.d.ts +9 -9
  14. package/dist/types/export/image/ImageFileHandler.d.ts +3 -21
  15. package/dist/types/export/svg/SVGContentGenerator.d.ts +12 -12
  16. package/dist/types/export/svg/SVGDataExtractor.d.ts +4 -4
  17. package/dist/types/export/svg/SVGExporter.d.ts +6 -6
  18. package/dist/types/export/svg/SVGFileHandler.d.ts +3 -3
  19. package/dist/types/export/svg/SVGPathGenerator.d.ts +5 -11
  20. package/dist/types/export/txt/TXTContentGenerator.d.ts +1 -1
  21. package/dist/types/export/txt/TXTDataExtractor.d.ts +2 -2
  22. package/dist/types/export/txt/TXTExporter.d.ts +6 -6
  23. package/dist/types/export/txt/TXTFileHandler.d.ts +2 -2
  24. package/dist/types/index.d.ts +0 -1
  25. package/dist/types/rendering/webgl/Framebuffer.d.ts +8 -8
  26. package/dist/types/rendering/webgl/Renderer.d.ts +35 -35
  27. package/dist/types/rendering/webgl/Shader.d.ts +14 -14
  28. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +10 -10
  29. package/dist/types/rendering/webgl/geometries/Line.d.ts +1 -1
  30. package/dist/types/rendering/webgl/geometries/Rectangle.d.ts +2 -2
  31. package/dist/types/textmode/Canvas.d.ts +9 -18
  32. package/dist/types/textmode/ConversionPipeline.d.ts +31 -20
  33. package/dist/types/textmode/Grid.d.ts +7 -12
  34. package/dist/types/textmode/Textmodifier.d.ts +18 -40
  35. package/dist/types/textmode/converters/BrightnessConverter.d.ts +8 -8
  36. package/dist/types/textmode/converters/Converter.d.ts +5 -5
  37. package/dist/types/textmode/converters/FeatureConverter.d.ts +27 -3
  38. package/dist/types/textmode/font/TextmodeFont.d.ts +8 -8
  39. package/dist/types/textmode/mixins/ConversionMixin.d.ts +63 -0
  40. package/dist/types/textmode/mixins/ExportMixin.d.ts +112 -1
  41. package/dist/types/textmode/mixins/FontMixin.d.ts +1 -1
  42. package/dist/types/textmode/mixins/RenderingMixin.d.ts +304 -1
  43. package/dist/types/textmode/mixins/{MixinBase.d.ts → TextmodifierMixin.d.ts} +4 -4
  44. package/dist/types/textmode/mixins/index.d.ts +2 -1
  45. package/package.json +16 -2
  46. package/dist/textmode.js +0 -26
  47. package/dist/textmode.min.js +0 -25
  48. package/dist/types/types/index.d.ts +0 -4
@@ -4,24 +4,24 @@ import { Shader } from "./Shader";
4
4
  * Core WebGL renderer that manages the WebGL context and provides high-level rendering operations
5
5
  */
6
6
  export declare class GLRenderer {
7
- private gl;
8
- private imageShader;
9
- private solidColorShader;
10
- private currentShader;
11
- private rectangleGeometry;
12
- private lineGeometry;
13
- private currentFillColor;
14
- private fillMode;
15
- private currentStrokeColor;
16
- private currentStrokeWeight;
17
- private strokeMode;
18
- private currentRotation;
19
- private stateStack;
7
+ private _gl;
8
+ private _imageShader;
9
+ private _solidColorShader;
10
+ private _currentShader;
11
+ private _rectangleGeometry;
12
+ private _lineGeometry;
13
+ private _currentFillColor;
14
+ private _fillMode;
15
+ private _currentStrokeColor;
16
+ private _currentStrokeWeight;
17
+ private _strokeMode;
18
+ private _currentRotation;
19
+ private _stateStack;
20
20
  constructor(gl: WebGLRenderingContext | WebGL2RenderingContext);
21
21
  /**
22
22
  * Set the current shader
23
23
  */
24
- shader(shader: Shader): void;
24
+ $shader(shader: Shader): void;
25
25
  /**
26
26
  * Sets the fill color for subsequent rendering operations
27
27
  * @param r Red component *(0-255)*
@@ -29,7 +29,7 @@ export declare class GLRenderer {
29
29
  * @param b Blue component *(0-255, optional)*
30
30
  * @param a Alpha component *(0-255, optional)*
31
31
  */
32
- fill(r: number, g?: number, b?: number, a?: number): void;
32
+ $fill(r: number, g?: number, b?: number, a?: number): void;
33
33
  /**
34
34
  * Sets the stroke color for subsequent rendering operations
35
35
  * @param r Red component *(0-255)*
@@ -37,49 +37,49 @@ export declare class GLRenderer {
37
37
  * @param b Blue component *(0-255, optional)*
38
38
  * @param a Alpha component *(0-255, optional)*
39
39
  */
40
- stroke(r: number, g?: number, b?: number, a?: number): void;
40
+ $stroke(r: number, g?: number, b?: number, a?: number): void;
41
41
  /**
42
42
  * Sets the stroke weight (thickness) for subsequent stroke operations
43
43
  * @param weight The stroke thickness in pixels
44
44
  */
45
- strokeWeight(weight: number): void;
45
+ $strokeWeight(weight: number): void;
46
46
  /**
47
47
  * Disables stroke rendering for subsequent operations
48
48
  */
49
- noStroke(): void;
49
+ $noStroke(): void;
50
50
  /**
51
51
  * Disables fill rendering for subsequent operations
52
52
  */
53
- noFill(): void;
53
+ $noFill(): void;
54
54
  /**
55
55
  * Sets the rotation angle for subsequent rendering operations
56
56
  * @param degrees The rotation angle in degrees
57
57
  */
58
- rotate(degrees: number): void;
58
+ $rotate(degrees: number): void;
59
59
  /**
60
60
  * Save the current rendering state (fill, stroke, etc.) to the state stack
61
61
  */
62
- push(): void;
62
+ $push(): void;
63
63
  /**
64
64
  * Restore the most recently saved rendering state from the state stack
65
65
  */
66
- pop(): void;
66
+ $pop(): void;
67
67
  /**
68
68
  * Reset frame-specific state - called automatically after each frame.
69
69
  * Note: This does not reset fill/stroke state as that should persist
70
70
  * across frames and be managed by push/pop or explicit calls.
71
71
  */
72
- reset(): void;
73
- createShader(vertexSource: string, fragmentSource: string): Shader;
74
- createFilterShader(fragmentSource: string): Shader;
72
+ $reset(): void;
73
+ $createShader(vertexSource: string, fragmentSource: string): Shader;
74
+ $createFilterShader(fragmentSource: string): Shader;
75
75
  /**
76
76
  * Set a uniform value for the current shader
77
77
  */
78
- setUniform(name: string, value: any): void;
78
+ $setUniform(name: string, value: any): void;
79
79
  /**
80
80
  * Draw a rectangle with the current fill and/or stroke settings
81
81
  */
82
- rect(x: number, y: number, width: number, height: number): void;
82
+ $rect(x: number, y: number, width: number, height: number): void;
83
83
  /**
84
84
  * Draw a line from (x1, y1) to (x2, y2) with the current stroke settings.
85
85
  * Lines only support stroke rendering - fill properties are ignored.
@@ -88,27 +88,27 @@ export declare class GLRenderer {
88
88
  * @param x2 X-coordinate of the line end point
89
89
  * @param y2 Y-coordinate of the line end point
90
90
  */
91
- line(x1: number, y1: number, x2: number, y2: number): void;
91
+ $line(x1: number, y1: number, x2: number, y2: number): void;
92
92
  /**
93
93
  * Calculate rotation parameters for built-in shaders (NDC coordinates)
94
94
  */
95
- private calculateRotationParams;
95
+ private _calculateRotationParams;
96
96
  /**
97
97
  * Create a new framebuffer
98
98
  */
99
- createFramebuffer(width: number, height: number, options?: FramebufferOptions): Framebuffer;
99
+ $createFramebuffer(width: number, height: number, options?: FramebufferOptions): Framebuffer;
100
100
  /**
101
101
  * Fill the current framebuffer with a solid color
102
102
  */
103
- background(r: number, g?: number, b?: number, a?: number): void;
103
+ $background(r: number, g?: number, b?: number, a?: number): void;
104
104
  /**
105
105
  * Clear the current framebuffer
106
106
  */
107
- clear(r?: number, g?: number, b?: number, a?: number): void;
107
+ $clear(r?: number, g?: number, b?: number, a?: number): void;
108
108
  /**
109
109
  * Ensure viewport matches canvas dimensions
110
110
  */
111
- resetViewport(): void;
111
+ $resetViewport(): void;
112
112
  /**
113
113
  * Get the WebGL context
114
114
  */
@@ -117,9 +117,9 @@ export declare class GLRenderer {
117
117
  * Dispose of all WebGL resources managed by this renderer.
118
118
  * This method is idempotent and safe to call multiple times.
119
119
  */
120
- dispose(): void;
120
+ $dispose(): void;
121
121
  /**
122
122
  * Render a framebuffer at a specific position with optional scaling
123
123
  */
124
- image(source: Framebuffer, posX: number, posY: number, width?: number, height?: number): void;
124
+ $image(source: Framebuffer, posX: number, posY: number, width?: number, height?: number): void;
125
125
  }
@@ -2,29 +2,29 @@
2
2
  * Shader program wrapper with simplified uniform management
3
3
  */
4
4
  export declare class Shader {
5
- private gl;
6
- private program;
7
- private uniformLocations;
8
- private uniformTypes;
9
- private textureUnitCounter;
10
- private maxTextureUnits;
5
+ private _gl;
6
+ private _program;
7
+ private _uniformLocations;
8
+ private _uniformTypes;
9
+ private _textureUnitCounter;
10
+ private _maxTextureUnits;
11
11
  constructor(gl: WebGLRenderingContext, vertexSource: string, fragmentSource: string);
12
- private cacheLocations;
13
- private createProgram;
14
- private createShader;
12
+ private _cacheLocations;
13
+ private _createProgram;
14
+ private _createShader;
15
15
  /**
16
16
  * Use this shader program
17
17
  */
18
- use(): void;
18
+ $use(): void;
19
19
  /**
20
20
  * Set a single uniform value with automatic texture unit management
21
21
  */
22
22
  setUniform(name: string, value: any): void;
23
- private getNextTextureUnit;
23
+ private _getNextTextureUnit;
24
24
  /**
25
25
  * Check if a uniform is an integer type
26
26
  */
27
- private isUniformInteger;
27
+ private _isUniformInteger;
28
28
  /**
29
29
  * Get the WebGL program
30
30
  */
@@ -33,9 +33,9 @@ export declare class Shader {
33
33
  * Dispose of WebGL resources used by this shader.
34
34
  * This method is idempotent and safe to call multiple times.
35
35
  */
36
- dispose(): void;
36
+ $dispose(): void;
37
37
  /**
38
38
  * Reset texture unit counter (useful when starting a new frame)
39
39
  */
40
- resetTextureUnits(): void;
40
+ private _resetTextureUnits;
41
41
  }
@@ -2,39 +2,39 @@
2
2
  * Base class for WebGL geometry rendering with shared vertex buffer management
3
3
  */
4
4
  export declare abstract class BaseGeometry {
5
- protected gl: WebGLRenderingContext;
6
- protected unitBuffer: WebGLBuffer | null;
7
- protected bytesPerVertex: number;
8
- private attribCache;
5
+ protected _gl: WebGLRenderingContext;
6
+ protected _unitBuffer: WebGLBuffer | null;
7
+ protected _bytesPerVertex: number;
8
+ private _attribCache;
9
9
  constructor(gl: WebGLRenderingContext);
10
10
  /**
11
11
  * Ensure the unit buffer is created and bound
12
12
  */
13
- protected ensureUnitBuffer(): void;
13
+ protected _ensureUnitBuffer(): void;
14
14
  /**
15
15
  * Enable vertex attributes and return their locations
16
16
  */
17
- protected enableAttribs(): {
17
+ protected _enableAttribs(): {
18
18
  positionLoc: number;
19
19
  texLoc: number;
20
20
  };
21
21
  /**
22
22
  * Disable vertex attributes
23
23
  */
24
- protected disableAttribs(positionLoc: number, texLoc: number): void;
24
+ protected _disableAttribs(positionLoc: number, texLoc: number): void;
25
25
  /**
26
26
  * Convert screen coordinates to NDC (Normalized Device Coordinates)
27
27
  */
28
- protected toNDC(x: number, y: number): {
28
+ protected _toNDC(x: number, y: number): {
29
29
  nx: number;
30
30
  ny: number;
31
31
  };
32
32
  /**
33
33
  * Upload quad vertices to the buffer in NDC coordinates
34
34
  */
35
- protected uploadQuadNDC(x1: number, y1: number, x2: number, y2: number): void;
35
+ protected _uploadQuadNDC(x1: number, y1: number, x2: number, y2: number): void;
36
36
  /**
37
37
  * Dispose of WebGL resources used by this geometry
38
38
  */
39
- dispose(): void;
39
+ $dispose(): void;
40
40
  }
@@ -7,5 +7,5 @@ export declare class Line extends BaseGeometry {
7
7
  /**
8
8
  * Draw a line from (x1, y1) to (x2, y2) with specified weight
9
9
  */
10
- draw(x1: number, y1: number, x2: number, y2: number, weight: number): void;
10
+ $draw(x1: number, y1: number, x2: number, y2: number, weight: number): void;
11
11
  }
@@ -7,9 +7,9 @@ export declare class Rectangle extends BaseGeometry {
7
7
  /**
8
8
  * Draw a filled rectangle
9
9
  */
10
- drawFill(x: number, y: number, width: number, height: number): void;
10
+ $drawFill(x: number, y: number, width: number, height: number): void;
11
11
  /**
12
12
  * Draw a rectangle stroke (outline)
13
13
  */
14
- drawStroke(x: number, y: number, width: number, height: number, weight: number): void;
14
+ $drawStroke(x: number, y: number, width: number, height: number, weight: number): void;
15
15
  }
@@ -11,38 +11,29 @@ export type CaptureSource = HTMLCanvasElement | HTMLVideoElement;
11
11
  */
12
12
  export declare class TextmodeCanvas {
13
13
  private _canvas;
14
- private captureSource;
14
+ private _captureSource;
15
15
  private _isStandalone;
16
- private resizeObserver?;
16
+ private _resizeObserver?;
17
17
  onTransformChange?: () => void;
18
18
  constructor(captureSource: CaptureSource, isStandalone?: boolean, opts?: TextmodeOptions);
19
- private createCanvas;
20
- private positionOverlayCanvas;
21
- resize(width?: number, height?: number): void;
19
+ private _createCanvas;
20
+ private _positionOverlayCanvas;
21
+ $resize(width?: number, height?: number): void;
22
22
  /**
23
23
  * Get the WebGL context for the overlay canvas
24
24
  */
25
- getWebGLContext(): WebGL2RenderingContext | WebGLRenderingContext;
26
- /**
27
- * Get the effective rendering dimensions accounting for CSS transforms
28
- */
29
- getEffectiveRenderingDimensions(): {
30
- width: number;
31
- height: number;
32
- };
33
- /**
34
- * Check if the canvas is affected by CSS transforms
35
- */
36
- isTransformed(): boolean;
25
+ $getWebGLContext(): WebGL2RenderingContext | WebGLRenderingContext;
37
26
  /**
38
27
  * Set up ResizeObserver to monitor for CSS transform changes
28
+ *
29
+ * note: might be redundant and can be deleted?
39
30
  */
40
31
  private setupTransformObserver;
41
32
  /**
42
33
  * Dispose of this TextmodeCanvas and clean up all resources.
43
34
  * This method is idempotent and safe to call multiple times.
44
35
  */
45
- dispose(): void;
36
+ $dispose(): void;
46
37
  get canvas(): HTMLCanvasElement;
47
38
  get width(): number;
48
39
  get height(): number;
@@ -1,6 +1,6 @@
1
1
  import type { Framebuffer } from "../rendering/webgl/Framebuffer";
2
2
  import type { GLRenderer } from "../rendering/webgl/Renderer";
3
- import { TextmodeConverter } from "./converters";
3
+ import { TextmodeBrightnessConverter, TextmodeConverter } from "./converters";
4
4
  import type { TextmodeFont } from "./font";
5
5
  import type { TextmodeGrid } from "./Grid";
6
6
  /**
@@ -11,10 +11,12 @@ import type { TextmodeGrid } from "./Grid";
11
11
  * color adjustments, transformations, and more.
12
12
  */
13
13
  export declare class TextmodeConversionPipeline {
14
- private renderer;
15
- private font;
16
- private grid;
17
- private converters;
14
+ private _renderer;
15
+ private _font;
16
+ private _grid;
17
+ private _converters;
18
+ private _brightness;
19
+ private _custom;
18
20
  private _resultFramebuffer;
19
21
  private _asciiShader;
20
22
  private _characterFramebuffer;
@@ -35,34 +37,29 @@ export declare class TextmodeConversionPipeline {
35
37
  * @param sourceFramebuffer The source framebuffer to convert.
36
38
  * @ignore
37
39
  */
38
- render(sourceFramebuffer: Framebuffer): void;
40
+ $render(sourceFramebuffer: Framebuffer): void;
39
41
  /**
40
- * Get a specific converter by name.
41
- * @param name The name of the converter to retrieve.
42
- * @returns The requested `TextmodeConverter` instance.
42
+ * Adds a new converter to the pipeline.
43
+ * @param converter The converter instance to add.
44
+ * @returns The added {@link TextmodeConverter} instance.
43
45
  */
44
- get(name: string): TextmodeConverter | void;
45
46
  /**
46
47
  * Adds a new converter to the pipeline.
47
48
  * @param name A unique name for the converter.
48
49
  * @param type The type of converter to add. Can be either "brightness" or "custom".
49
50
  * @returns The newly created {@link TextmodeConverter} instance or `void` if the addition failed.
50
51
  */
51
- add(name: string, type: "brightness" | "custom"): TextmodeConverter | void;
52
+ add(type: "brightness" | "custom"): TextmodeConverter | void;
52
53
  /**
53
- * Removes a converter from the pipeline by name or instance.
54
- * @param nameOrInstance The unique name of the converter or the converter instance to remove.
54
+ * Removes a converter from the pipeline.
55
+ * @param converter The converter instance to remove.
55
56
  */
56
- remove(nameOrInstance: string | TextmodeConverter): void;
57
- /**
58
- * Returns the framebuffer containing the textmode conversion result.
59
- */
60
- get texture(): Framebuffer;
57
+ remove(converter: TextmodeConverter): void;
61
58
  /**
62
59
  * Resizes all internal framebuffers.
63
60
  * @ignore
64
61
  */
65
- resize(): void;
62
+ $resize(): void;
66
63
  /**
67
64
  * Checks if any converter in the pipeline is enabled.
68
65
  * @returns `true` if any converter is enabled, `false` otherwise.
@@ -80,7 +77,9 @@ export declare class TextmodeConversionPipeline {
80
77
  * Dispose of all resources used by this conversion pipeline.
81
78
  * This method is idempotent and safe to call multiple times.
82
79
  */
83
- dispose(): void;
80
+ $dispose(): void;
81
+ /** Returns the framebuffer containing the textmode conversion result.*/
82
+ get texture(): Framebuffer;
84
83
  /** Returns the character framebuffer containing the combined result of all converters. */
85
84
  get characterFramebuffer(): Framebuffer;
86
85
  /** Returns the primary color framebuffer containing the combined result of all converters. */
@@ -91,4 +90,16 @@ export declare class TextmodeConversionPipeline {
91
90
  get rotationFramebuffer(): Framebuffer;
92
91
  /** Returns the transform framebuffer containing the combined result of all converters. */
93
92
  get transformFramebuffer(): Framebuffer;
93
+ /**
94
+ * Returns the pre-defined brightness converter that is part of the pipeline by default.
95
+ *
96
+ * This converter can also be removed from the pipeline via `pipeline.remove(pipeline.brightness)`.
97
+ */
98
+ get brightness(): TextmodeBrightnessConverter;
99
+ /**
100
+ * Returns the pre-defined custom converter that is part of the pipeline by default.
101
+ *
102
+ * This converter can also be removed from the pipeline via `pipeline.remove(pipeline.custom)`.
103
+ */
104
+ get custom(): TextmodeConverter;
94
105
  }
@@ -34,18 +34,18 @@ export declare class TextmodeGrid {
34
34
  * Reset the grid to the default number of columns and rows based on the current canvas dimensions, and the grid cell dimensions.
35
35
  * @ignore
36
36
  */
37
- reset(): void;
37
+ $reset(): void;
38
38
  /**
39
39
  * Reset the total grid width & height, and the offset to the outer canvas.
40
40
  */
41
- private _resizeGrid;
41
+ private _updateDimensions;
42
42
  /**
43
43
  * Re-assign the grid cell dimensions and `reset()` the grid.
44
44
  * @param newCellWidth The new cell width.
45
45
  * @param newCellHeight The new cell height.
46
46
  * @ignore
47
47
  */
48
- resizeCellPixelDimensions(newCellWidth: number, newCellHeight: number): void;
48
+ $resizeCellPixelDimensions(newCellWidth: number, newCellHeight: number): void;
49
49
  /**
50
50
  * Re-assign the grid dimensions and resize the grid.
51
51
  *
@@ -54,34 +54,29 @@ export declare class TextmodeGrid {
54
54
  * @param newRows The new number of rows.
55
55
  * @ignore
56
56
  */
57
- resizeGridDimensions(newCols: number, newRows: number): void;
57
+ $resizeGridDimensions(newCols: number, newRows: number): void;
58
58
  /**
59
59
  * Make the grid dimensions flexible again, and `reset()` the grid.
60
60
  * @ignore
61
61
  */
62
- resetGridDimensions(): void;
62
+ $resetGridDimensions(): void;
63
63
  /**
64
64
  * Update the canvas used by the grid, and reset the grid dimensions.
65
65
  * @param canvas The new canvas element to use for the grid.
66
66
  * @ignore
67
67
  */
68
- resize(): void;
68
+ $resize(): void;
69
69
  /**
70
70
  * Gets or sets whether the grid dimensions *(columns and rows)* are fixed or responsive based on the canvas dimensions.
71
71
  * @param value Optional. `true` to make the grid dimensions fixed, or `false` to make them responsive. If not provided, returns the current state.
72
72
  * @returns If no parameter is provided, returns `true` if the grid dimensions are fixed, or `false` if they are responsive.
73
73
  * @ignore
74
74
  */
75
- fixedDimensions(value?: boolean): boolean | void;
75
+ $fixedDimensions(value?: boolean): boolean | void;
76
76
  /** Returns the width of each cell in the grid. */
77
77
  get cellWidth(): number;
78
78
  /** Returns the height of each cell in the grid. */
79
79
  get cellHeight(): number;
80
- /**
81
- * Dispose of this TextmodeGrid and clean up references.
82
- * This method is idempotent and safe to call multiple times.
83
- */
84
- dispose(): void;
85
80
  /** Returns the number of columns in the grid. */
86
81
  get cols(): number;
87
82
  /** Returns the number of rows in the grid. */
@@ -3,11 +3,11 @@ import { TextmodeFont } from './font';
3
3
  import { TextmodeGrid } from './Grid';
4
4
  import { TextmodeCanvas } from './Canvas';
5
5
  import { TextmodeConversionPipeline } from './ConversionPipeline';
6
- import type { TextmodeConverter } from './converters';
7
- import { type TextmodifierCore } from './mixins';
6
+ import { type TextmodifierContext } from './mixins';
8
7
  import type { RenderingCapabilities } from './mixins/RenderingMixin';
9
8
  import type { ExportCapabilities } from './mixins/ExportMixin';
10
9
  import type { FontCapabilities } from './mixins/FontMixin';
10
+ import type { ConversionCapabilities } from './mixins/ConversionMixin';
11
11
  /**
12
12
  * Supported capture sources for textmode rendering
13
13
  */
@@ -40,14 +40,14 @@ export type TextmodeOptions = {
40
40
  /**
41
41
  * Base class for mixin application
42
42
  */
43
- declare class TextmodifierBase implements TextmodifierCore {
43
+ declare class TextmodifierCore implements TextmodifierContext {
44
44
  _renderer: GLRenderer;
45
45
  _font: TextmodeFont;
46
46
  _pipeline: TextmodeConversionPipeline;
47
47
  textmodeCanvas: TextmodeCanvas;
48
48
  _grid: TextmodeGrid;
49
49
  }
50
- declare const Textmodifier_base: typeof TextmodifierBase;
50
+ declare const Textmodifier_base: typeof TextmodifierCore;
51
51
  /**
52
52
  * Manages textmode rendering on a canvas or video element.
53
53
  *
@@ -56,27 +56,26 @@ declare const Textmodifier_base: typeof TextmodifierBase;
56
56
  */
57
57
  export declare class Textmodifier extends Textmodifier_base {
58
58
  /** The element to capture content from (optional for standalone mode) */
59
- private captureSource;
59
+ private _captureSource;
60
60
  /** Canvas framebuffer for capturing source content */
61
61
  private _canvasFramebuffer;
62
- private resizeObserver;
62
+ private _resizeObserver;
63
63
  private _mode;
64
64
  private _frameRateLimit;
65
- private animationFrameId;
66
- private lastFrameTime;
67
- private frameInterval;
65
+ private _animationFrameId;
66
+ private _lastFrameTime;
67
+ private _frameInterval;
68
68
  private _isLooping;
69
69
  private _frameRate;
70
- private lastRenderTime;
70
+ private _lastRenderTime;
71
71
  private _frameCount;
72
- private frameTimeHistory;
73
- private frameTimeHistorySize;
72
+ private _frameTimeHistory;
73
+ private _frameTimeHistorySize;
74
74
  private _isDisposed;
75
75
  private _standalone;
76
76
  private _drawCallback;
77
77
  private _resizedCallback;
78
78
  private _windowResizeListener;
79
- private _printDebug;
80
79
  constructor(source?: CaptureSource | null, opts?: TextmodeOptions);
81
80
  /**
82
81
  * Static factory method for creating and initializing a Textmodifier instance.
@@ -85,7 +84,7 @@ export declare class Textmodifier extends Textmodifier_base {
85
84
  * @ignore
86
85
  */
87
86
  static create<T extends Textmodifier>(source?: CaptureSource | null, opts?: TextmodeOptions): Promise<T>;
88
- setupEventListeners(): void;
87
+ $setupEventListeners(): void;
89
88
  /**
90
89
  * Apply textmode rendering to the canvas.
91
90
  *
@@ -125,20 +124,20 @@ export declare class Textmodifier extends Textmodifier_base {
125
124
  * ```
126
125
  */
127
126
  render(): void;
128
- private resize;
127
+ private _resize;
129
128
  /**
130
129
  * Start automatic rendering
131
130
  */
132
- startAutoRendering(): void;
131
+ private _startAutoRendering;
133
132
  /**
134
133
  * Update FPS measurement - works for both auto and manual modes
135
134
  * Uses a rolling average for smoother frame rate reporting
136
135
  */
137
- private measureFrameRate;
136
+ private _measureFrameRate;
138
137
  /**
139
138
  * Stop automatic rendering
140
139
  */
141
- private stopAutoRendering;
140
+ private _stopAutoRendering;
142
141
  /**
143
142
  * Update the rendering mode.
144
143
  *
@@ -359,26 +358,6 @@ export declare class Textmodifier extends Textmodifier_base {
359
358
  * @param height The new height of the canvas.
360
359
  */
361
360
  resizeCanvas(width: number, height: number): void;
362
- /**
363
- * @inheritDoc TextmodeConversionPipeline.get
364
- *
365
- * @example
366
- * ```javascript
367
- * // Fetch a canvas element to apply textmode rendering to
368
- * const canvas = document.querySelector('canvas#myCanvas');
369
- *
370
- * // Create a Textmodifier instance
371
- * const textmodifier = await textmode.create(canvas);
372
- *
373
- * // Get the pre-defined brightness converter from the pipeline
374
- * const brightnessConverter = textmodifier.converter('brightness');
375
- *
376
- * // Update properties of the brightness converter
377
- * brightnessConverter.invert(true);
378
- * brightnessConverter.characters(" .,;:*");
379
- * ```
380
- */
381
- converter(name: string): TextmodeConverter | void;
382
361
  /**
383
362
  * Completely destroy this Textmodifier instance and free all associated resources.
384
363
  *
@@ -407,7 +386,6 @@ export declare class Textmodifier extends Textmodifier_base {
407
386
  * ```
408
387
  */
409
388
  destroy(): void;
410
- debug(bool: boolean): void;
411
389
  /** Get the current grid object used for rendering. */
412
390
  get grid(): TextmodeGrid;
413
391
  /** Get the current font object used for rendering. */
@@ -427,6 +405,6 @@ export declare class Textmodifier extends Textmodifier_base {
427
405
  /** Check if the instance has been disposed/destroyed. */
428
406
  get isDisposed(): boolean;
429
407
  }
430
- export interface Textmodifier extends RenderingCapabilities, ExportCapabilities, FontCapabilities {
408
+ export interface Textmodifier extends RenderingCapabilities, ExportCapabilities, FontCapabilities, ConversionCapabilities {
431
409
  }
432
410
  export {};
@@ -31,12 +31,12 @@ export declare const BRIGHTNESS_DEFAULT_OPTIONS: {
31
31
  * Converter that maps brightness values from a source texture to ASCII characters.
32
32
  */
33
33
  export declare class TextmodeBrightnessConverter extends TextmodeFeatureConverter {
34
- private sampleShader;
35
- private colorFillShader;
36
- private charMappingShader;
37
- private transformFillShader;
38
- private rotationFillShader;
39
- private sampleFramebuffer;
34
+ private _sampleShader;
35
+ private _colorFillShader;
36
+ private _charMappingShader;
37
+ private _transformFillShader;
38
+ private _rotationFillShader;
39
+ private _sampleFramebuffer;
40
40
  /**
41
41
  * Creates a new TextmodeBrightnessConverter instance.
42
42
  * @param renderer Renderer instance for texture creation
@@ -45,8 +45,8 @@ export declare class TextmodeBrightnessConverter extends TextmodeFeatureConverte
45
45
  * @ignore
46
46
  */
47
47
  constructor(renderer: GLRenderer, fontManager: TextmodeFont, grid: TextmodeGrid);
48
- convert(framebuffer: Framebuffer): void;
49
- resize(): void;
48
+ $convert(framebuffer: Framebuffer): void;
49
+ $resize(): void;
50
50
  /**
51
51
  * Sets the brightness range for ASCII character mapping.
52
52
  *