textmode.filters.js 1.2.1 → 1.2.3-beta.1
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.
- package/README.md +69 -369
- package/dist/textmode.filters.esm.js +1 -24
- package/dist/textmode.filters.umd.js +1 -15
- package/dist/types/index.d.ts +15 -46
- package/dist/types/types.d.ts +111 -16
- package/package.json +86 -39
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/types.d.ts.map +0 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,34 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @packageDocumentation
|
|
3
3
|
*
|
|
4
|
-
* GPU-accelerated image filters
|
|
5
|
-
*
|
|
6
|
-
* This plugin provides customizable visual effects that run entirely on the GPU
|
|
7
|
-
* via WebGL2 fragment shaders for maximum performance.
|
|
8
|
-
*
|
|
9
|
-
* ## Available filters
|
|
4
|
+
* Apply GPU-accelerated image filters to finished textmode.js scenes.
|
|
10
5
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - {@link SaturationOptions | saturation} - Adjust color intensity
|
|
15
|
-
* - {@link HueRotateOptions | hueRotate} - Rotate colors around the color wheel
|
|
16
|
-
* - {@link PosterizeOptions | posterize} - Reduce color levels
|
|
6
|
+
* Add {@link FiltersPlugin} to a sketch to register the built-in WebGL2
|
|
7
|
+
* effects. Use the option interfaces below to configure a filter when adding
|
|
8
|
+
* it to a layer, the composited scene, or the final presentation stage.
|
|
17
9
|
*
|
|
18
|
-
*
|
|
19
|
-
* - {@link ChromaticAberrationOptions | chromaticAberration} - RGB channel separation
|
|
20
|
-
* - {@link PixelateOptions | pixelate} - Pixelation/mosaic effect
|
|
21
|
-
* - {@link GridDistortionOptions | gridDistortion} - Custom grid warping
|
|
10
|
+
* ## Choose a filter
|
|
22
11
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* - {@link VignetteOptions | vignette} - Darkened edges effect
|
|
28
|
-
* - {@link BloomOptions | bloom} - Glow around bright areas
|
|
29
|
-
* - {@link FilmGrainOptions | filmGrain} - Animated film grain overlay
|
|
12
|
+
* **Color adjustment** changes brightness, contrast, saturation, hue, and
|
|
13
|
+
* posterization. **Distortion** changes pixels, color channels, or grid
|
|
14
|
+
* geometry. **Stylization** adds glitch, CRT, scanlines, vignette, bloom, and
|
|
15
|
+
* film grain treatments.
|
|
30
16
|
*
|
|
31
|
-
* @
|
|
17
|
+
* Start with {@link FiltersPlugin}, then read the
|
|
18
|
+
* [Filters guide](/docs/filters) for scopes and workflows.
|
|
32
19
|
*/
|
|
33
20
|
import type { TextmodePlugin } from 'textmode.js';
|
|
34
21
|
export type { BrightnessOptions, ContrastOptions, SaturationOptions, HueRotateOptions, PosterizeOptions, ChromaticAberrationOptions, PixelateOptions, GridDistortionOptions, GlitchOptions, CrtMattiasOptions, ScanlinesOptions, VignetteOptions, BloomOptions, FilmGrainOptions, } from './types';
|
|
@@ -38,34 +25,16 @@ export type { BrightnessOptions, ContrastOptions, SaturationOptions, HueRotateOp
|
|
|
38
25
|
* Add this plugin to your textmode.js instance to enable additional customizable
|
|
39
26
|
* visual effects that run entirely on the GPU via WebGL2 fragment shaders.
|
|
40
27
|
*
|
|
41
|
-
* @
|
|
42
|
-
* {@includeCode ../examples/brightness/sketch.js}
|
|
43
|
-
*/
|
|
44
|
-
export declare const FiltersPlugin: TextmodePlugin;
|
|
45
|
-
/**
|
|
46
|
-
* Creates the `textmode.filters.js` plugin for textmode.js.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated Use {@link FiltersPlugin} directly instead.
|
|
49
|
-
* This function is provided for backwards compatibility only.
|
|
28
|
+
* @category Workflow
|
|
50
29
|
*
|
|
51
30
|
* @example
|
|
52
|
-
*
|
|
53
|
-
* // Old way (deprecated)
|
|
54
|
-
* import { createFiltersPlugin } from 'textmode.filters.js';
|
|
55
|
-
* const t = textmode.create({ plugins: [createFiltersPlugin()] });
|
|
31
|
+
* {@includeCode ../examples/ColorAdjustment/brightness/sketch.js}
|
|
56
32
|
*
|
|
57
|
-
*
|
|
58
|
-
* import { FiltersPlugin } from 'textmode.filters.js';
|
|
59
|
-
* const t = textmode.create({ plugins: [FiltersPlugin] });
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @returns A textmode.js plugin instance.
|
|
33
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/variables/FiltersPlugin | FiltersPlugin API reference}
|
|
63
34
|
*/
|
|
64
|
-
export declare const
|
|
35
|
+
export declare const FiltersPlugin: TextmodePlugin;
|
|
65
36
|
declare global {
|
|
66
37
|
interface Window {
|
|
67
38
|
FiltersPlugin?: TextmodePlugin;
|
|
68
|
-
createFiltersPlugin?: typeof createFiltersPlugin;
|
|
69
39
|
}
|
|
70
40
|
}
|
|
71
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - An options object with named parameters
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* {@includeCode ../examples/bloom/sketch.js}
|
|
9
|
+
* {@includeCode ../examples/Stylization/bloom/sketch.js}
|
|
10
10
|
*
|
|
11
11
|
* @module
|
|
12
12
|
*/
|
|
@@ -16,9 +16,11 @@
|
|
|
16
16
|
* Adjusts image brightness by multiplying pixel values.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
|
-
* {@includeCode ../examples/brightness/sketch.js}
|
|
19
|
+
* {@includeCode ../examples/ColorAdjustment/brightness/sketch.js}
|
|
20
20
|
*
|
|
21
21
|
* @category Color adjustment filters
|
|
22
|
+
*
|
|
23
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BrightnessOptions | BrightnessOptions API reference}
|
|
22
24
|
*/
|
|
23
25
|
export interface BrightnessOptions {
|
|
24
26
|
/**
|
|
@@ -30,6 +32,8 @@ export interface BrightnessOptions {
|
|
|
30
32
|
* - `0.0` = completely black
|
|
31
33
|
*
|
|
32
34
|
* @default 1.0
|
|
35
|
+
*
|
|
36
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BrightnessOptions#amount | BrightnessOptions.amount API reference}
|
|
33
37
|
*/
|
|
34
38
|
amount: number;
|
|
35
39
|
}
|
|
@@ -39,9 +43,11 @@ export interface BrightnessOptions {
|
|
|
39
43
|
* Adjusts image contrast by scaling pixel values around mid-gray.
|
|
40
44
|
*
|
|
41
45
|
* @example
|
|
42
|
-
* {@includeCode ../examples/contrast/sketch.js}
|
|
46
|
+
* {@includeCode ../examples/ColorAdjustment/contrast/sketch.js}
|
|
43
47
|
*
|
|
44
48
|
* @category Color adjustment filters
|
|
49
|
+
*
|
|
50
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ContrastOptions | ContrastOptions API reference}
|
|
45
51
|
*/
|
|
46
52
|
export interface ContrastOptions {
|
|
47
53
|
/**
|
|
@@ -53,6 +59,8 @@ export interface ContrastOptions {
|
|
|
53
59
|
* - `0.0` = solid gray
|
|
54
60
|
*
|
|
55
61
|
* @default 1.0
|
|
62
|
+
*
|
|
63
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ContrastOptions#amount | ContrastOptions.amount API reference}
|
|
56
64
|
*/
|
|
57
65
|
amount: number;
|
|
58
66
|
}
|
|
@@ -63,9 +71,11 @@ export interface ContrastOptions {
|
|
|
63
71
|
* Perfect for creating vivid, oversaturated looks or desaturating to grayscale.
|
|
64
72
|
*
|
|
65
73
|
* @example
|
|
66
|
-
* {@includeCode ../examples/saturation/sketch.js}
|
|
74
|
+
* {@includeCode ../examples/ColorAdjustment/saturation/sketch.js}
|
|
67
75
|
*
|
|
68
76
|
* @category Color adjustment filters
|
|
77
|
+
*
|
|
78
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/SaturationOptions | SaturationOptions API reference}
|
|
69
79
|
*/
|
|
70
80
|
export interface SaturationOptions {
|
|
71
81
|
/**
|
|
@@ -76,6 +86,8 @@ export interface SaturationOptions {
|
|
|
76
86
|
* - `> 1.0` = vivid/oversaturated colors
|
|
77
87
|
*
|
|
78
88
|
* @default 1.0
|
|
89
|
+
*
|
|
90
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/SaturationOptions#amount | SaturationOptions.amount API reference}
|
|
79
91
|
*/
|
|
80
92
|
amount: number;
|
|
81
93
|
}
|
|
@@ -86,9 +98,11 @@ export interface SaturationOptions {
|
|
|
86
98
|
* Useful for color grading or creating surreal color effects.
|
|
87
99
|
*
|
|
88
100
|
* @example
|
|
89
|
-
* {@includeCode ../examples/hueRotate/sketch.js}
|
|
101
|
+
* {@includeCode ../examples/ColorAdjustment/hueRotate/sketch.js}
|
|
90
102
|
*
|
|
91
103
|
* @category Color adjustment filters
|
|
104
|
+
*
|
|
105
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/HueRotateOptions | HueRotateOptions API reference}
|
|
92
106
|
*/
|
|
93
107
|
export interface HueRotateOptions {
|
|
94
108
|
/**
|
|
@@ -101,6 +115,8 @@ export interface HueRotateOptions {
|
|
|
101
115
|
* Values wrap around, so `370` is equivalent to `10`.
|
|
102
116
|
*
|
|
103
117
|
* @default 0.0
|
|
118
|
+
*
|
|
119
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/HueRotateOptions#angle | HueRotateOptions.angle API reference}
|
|
104
120
|
*/
|
|
105
121
|
angle: number;
|
|
106
122
|
}
|
|
@@ -111,9 +127,11 @@ export interface HueRotateOptions {
|
|
|
111
127
|
* creating a retro quantized/poster-like look.
|
|
112
128
|
*
|
|
113
129
|
* @example
|
|
114
|
-
* {@includeCode ../examples/posterize/sketch.js}
|
|
130
|
+
* {@includeCode ../examples/ColorAdjustment/posterize/sketch.js}
|
|
115
131
|
*
|
|
116
132
|
* @category Color adjustment filters
|
|
133
|
+
*
|
|
134
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PosterizeOptions | PosterizeOptions API reference}
|
|
117
135
|
*/
|
|
118
136
|
export interface PosterizeOptions {
|
|
119
137
|
/**
|
|
@@ -127,6 +145,8 @@ export interface PosterizeOptions {
|
|
|
127
145
|
* - `8+` = subtle posterization
|
|
128
146
|
*
|
|
129
147
|
* @default 4.0
|
|
148
|
+
*
|
|
149
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PosterizeOptions#levels | PosterizeOptions.levels API reference}
|
|
130
150
|
*/
|
|
131
151
|
levels: number;
|
|
132
152
|
}
|
|
@@ -137,9 +157,11 @@ export interface PosterizeOptions {
|
|
|
137
157
|
* found in cheap cameras or creates stylized glitch aesthetics.
|
|
138
158
|
*
|
|
139
159
|
* @example
|
|
140
|
-
* {@includeCode ../examples/chromaticAberration/sketch.js}
|
|
160
|
+
* {@includeCode ../examples/Distortion/chromaticAberration/sketch.js}
|
|
141
161
|
*
|
|
142
162
|
* @category Distortion filters
|
|
163
|
+
*
|
|
164
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ChromaticAberrationOptions | ChromaticAberrationOptions API reference}
|
|
143
165
|
*/
|
|
144
166
|
export interface ChromaticAberrationOptions {
|
|
145
167
|
/**
|
|
@@ -148,6 +170,8 @@ export interface ChromaticAberrationOptions {
|
|
|
148
170
|
* Controls how far the red and blue channels are separated from green.
|
|
149
171
|
*
|
|
150
172
|
* @default 5.0
|
|
173
|
+
*
|
|
174
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ChromaticAberrationOptions#amount | ChromaticAberrationOptions.amount API reference}
|
|
151
175
|
*/
|
|
152
176
|
amount: number;
|
|
153
177
|
/**
|
|
@@ -160,6 +184,8 @@ export interface ChromaticAberrationOptions {
|
|
|
160
184
|
* The vector is normalized internally, so `[2, 0]` is the same as `[1, 0]`.
|
|
161
185
|
*
|
|
162
186
|
* @default [1.0, 0.0]
|
|
187
|
+
*
|
|
188
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ChromaticAberrationOptions#direction | ChromaticAberrationOptions.direction API reference}
|
|
163
189
|
*/
|
|
164
190
|
direction: [number, number];
|
|
165
191
|
}
|
|
@@ -170,9 +196,11 @@ export interface ChromaticAberrationOptions {
|
|
|
170
196
|
* reminiscent of retro video games or censored content.
|
|
171
197
|
*
|
|
172
198
|
* @example
|
|
173
|
-
* {@includeCode ../examples/pixelate/sketch.js}
|
|
199
|
+
* {@includeCode ../examples/Distortion/pixelate/sketch.js}
|
|
174
200
|
*
|
|
175
201
|
* @category Distortion filters
|
|
202
|
+
*
|
|
203
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PixelateOptions | PixelateOptions API reference}
|
|
176
204
|
*/
|
|
177
205
|
export interface PixelateOptions {
|
|
178
206
|
/**
|
|
@@ -183,6 +211,8 @@ export interface PixelateOptions {
|
|
|
183
211
|
* Minimum value: `1.0`
|
|
184
212
|
*
|
|
185
213
|
* @default 4.0
|
|
214
|
+
*
|
|
215
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PixelateOptions#pixelsize | PixelateOptions.pixelSize API reference}
|
|
186
216
|
*/
|
|
187
217
|
pixelSize: number;
|
|
188
218
|
}
|
|
@@ -197,9 +227,11 @@ export interface PixelateOptions {
|
|
|
197
227
|
* you to create dynamic text distortion effects.
|
|
198
228
|
*
|
|
199
229
|
* @example
|
|
200
|
-
* {@includeCode ../examples/gridDistortion/sketch.js}
|
|
230
|
+
* {@includeCode ../examples/Distortion/gridDistortion/sketch.js}
|
|
201
231
|
*
|
|
202
232
|
* @category Distortion filters
|
|
233
|
+
*
|
|
234
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions | GridDistortionOptions API reference}
|
|
203
235
|
*/
|
|
204
236
|
export interface GridDistortionOptions {
|
|
205
237
|
/**
|
|
@@ -210,6 +242,8 @@ export interface GridDistortionOptions {
|
|
|
210
242
|
* Maximum value: `[128, 128]`
|
|
211
243
|
*
|
|
212
244
|
* @default [80.0, 40.0]
|
|
245
|
+
*
|
|
246
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#gridcelldimensions | GridDistortionOptions.gridCellDimensions API reference}
|
|
213
247
|
*/
|
|
214
248
|
gridCellDimensions: [number, number];
|
|
215
249
|
/**
|
|
@@ -219,6 +253,8 @@ export interface GridDistortionOptions {
|
|
|
219
253
|
* `[t.grid.cols * t.grid.cellWidth, t.grid.rows * t.grid.cellHeight]`
|
|
220
254
|
*
|
|
221
255
|
* @default [640.0, 320.0]
|
|
256
|
+
*
|
|
257
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#gridpixeldimensions | GridDistortionOptions.gridPixelDimensions API reference}
|
|
222
258
|
*/
|
|
223
259
|
gridPixelDimensions: [number, number];
|
|
224
260
|
/**
|
|
@@ -227,6 +263,8 @@ export interface GridDistortionOptions {
|
|
|
227
263
|
* Use `[t.grid.offsetX, t.grid.offsetY]` to match your grid position.
|
|
228
264
|
*
|
|
229
265
|
* @default [0.0, 0.0]
|
|
266
|
+
*
|
|
267
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#gridoffsetdimensions | GridDistortionOptions.gridOffsetDimensions API reference}
|
|
230
268
|
*/
|
|
231
269
|
gridOffsetDimensions: [number, number];
|
|
232
270
|
/**
|
|
@@ -239,6 +277,8 @@ export interface GridDistortionOptions {
|
|
|
239
277
|
* - `1.0` = maximum width
|
|
240
278
|
*
|
|
241
279
|
* @default Array(128).fill(0.5)
|
|
280
|
+
*
|
|
281
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#widthfactors | GridDistortionOptions.widthFactors API reference}
|
|
242
282
|
*/
|
|
243
283
|
widthFactors: number[];
|
|
244
284
|
/**
|
|
@@ -251,6 +291,8 @@ export interface GridDistortionOptions {
|
|
|
251
291
|
* - `1.0` = maximum height
|
|
252
292
|
*
|
|
253
293
|
* @default Array(128).fill(0.5)
|
|
294
|
+
*
|
|
295
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#heightfactors | GridDistortionOptions.heightFactors API reference}
|
|
254
296
|
*/
|
|
255
297
|
heightFactors: number[];
|
|
256
298
|
/**
|
|
@@ -259,6 +301,8 @@ export interface GridDistortionOptions {
|
|
|
259
301
|
* Higher values create more dramatic width variations.
|
|
260
302
|
*
|
|
261
303
|
* @default 0.5
|
|
304
|
+
*
|
|
305
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#widthvariationscale | GridDistortionOptions.widthVariationScale API reference}
|
|
262
306
|
*/
|
|
263
307
|
widthVariationScale: number;
|
|
264
308
|
/**
|
|
@@ -267,6 +311,8 @@ export interface GridDistortionOptions {
|
|
|
267
311
|
* Higher values create more dramatic height variations.
|
|
268
312
|
*
|
|
269
313
|
* @default 0.5
|
|
314
|
+
*
|
|
315
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#heightvariationscale | GridDistortionOptions.heightVariationScale API reference}
|
|
270
316
|
*/
|
|
271
317
|
heightVariationScale: number;
|
|
272
318
|
}
|
|
@@ -277,9 +323,11 @@ export interface GridDistortionOptions {
|
|
|
277
323
|
* Creates a corrupted/broken digital signal aesthetic.
|
|
278
324
|
*
|
|
279
325
|
* @example
|
|
280
|
-
* {@includeCode ../examples/glitch/sketch.js}
|
|
326
|
+
* {@includeCode ../examples/Stylization/glitch/sketch.js}
|
|
281
327
|
*
|
|
282
328
|
* @category Stylization filters
|
|
329
|
+
*
|
|
330
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GlitchOptions | GlitchOptions API reference}
|
|
283
331
|
*/
|
|
284
332
|
export interface GlitchOptions {
|
|
285
333
|
/**
|
|
@@ -290,6 +338,8 @@ export interface GlitchOptions {
|
|
|
290
338
|
* - `1.0+` = intense, chaotic glitching
|
|
291
339
|
*
|
|
292
340
|
* @default 0.0
|
|
341
|
+
*
|
|
342
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GlitchOptions#amount | GlitchOptions.amount API reference}
|
|
293
343
|
*/
|
|
294
344
|
amount: number;
|
|
295
345
|
}
|
|
@@ -301,11 +351,13 @@ export interface GlitchOptions {
|
|
|
301
351
|
* classic CRT shader.
|
|
302
352
|
*
|
|
303
353
|
* @example
|
|
304
|
-
* {@includeCode ../examples/crtMattias/sketch.js}
|
|
354
|
+
* {@includeCode ../examples/Stylization/crtMattias/sketch.js}
|
|
305
355
|
*
|
|
306
356
|
* @see {@link https://github.com/libretro/glsl-shaders/blob/master/crt/shaders/crt-mattias.glsl | Original shader by Mattias Gustavsson}
|
|
307
357
|
*
|
|
308
358
|
* @category Stylization filters
|
|
359
|
+
*
|
|
360
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions | CrtMattiasOptions API reference}
|
|
309
361
|
*/
|
|
310
362
|
export interface CrtMattiasOptions {
|
|
311
363
|
/**
|
|
@@ -316,6 +368,8 @@ export interface CrtMattiasOptions {
|
|
|
316
368
|
* - `1.0` = maximum curvature
|
|
317
369
|
*
|
|
318
370
|
* @default 0.5
|
|
371
|
+
*
|
|
372
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#curvature | CrtMattiasOptions.curvature API reference}
|
|
319
373
|
*/
|
|
320
374
|
curvature: number;
|
|
321
375
|
/**
|
|
@@ -324,6 +378,8 @@ export interface CrtMattiasOptions {
|
|
|
324
378
|
* Higher values make the scanline crawl faster.
|
|
325
379
|
*
|
|
326
380
|
* @default 1.0
|
|
381
|
+
*
|
|
382
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#scanspeed | CrtMattiasOptions.scanSpeed API reference}
|
|
327
383
|
*/
|
|
328
384
|
scanSpeed: number;
|
|
329
385
|
/**
|
|
@@ -333,6 +389,8 @@ export interface CrtMattiasOptions {
|
|
|
333
389
|
* Typically use elapsed time in seconds or frame count.
|
|
334
390
|
*
|
|
335
391
|
* @default 0.0
|
|
392
|
+
*
|
|
393
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#time | CrtMattiasOptions.time API reference}
|
|
336
394
|
*/
|
|
337
395
|
time: number;
|
|
338
396
|
}
|
|
@@ -344,9 +402,11 @@ export interface CrtMattiasOptions {
|
|
|
344
402
|
* the scanlines in crtMattias.
|
|
345
403
|
*
|
|
346
404
|
* @example
|
|
347
|
-
* {@includeCode ../examples/scanlines/sketch.js}
|
|
405
|
+
* {@includeCode ../examples/Stylization/scanlines/sketch.js}
|
|
348
406
|
*
|
|
349
407
|
* @category Stylization filters
|
|
408
|
+
*
|
|
409
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions | ScanlinesOptions API reference}
|
|
350
410
|
*/
|
|
351
411
|
export interface ScanlinesOptions {
|
|
352
412
|
/**
|
|
@@ -357,6 +417,8 @@ export interface ScanlinesOptions {
|
|
|
357
417
|
* Minimum value: `10.0`
|
|
358
418
|
*
|
|
359
419
|
* @default 300.0
|
|
420
|
+
*
|
|
421
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#count | ScanlinesOptions.count API reference}
|
|
360
422
|
*/
|
|
361
423
|
count: number;
|
|
362
424
|
/**
|
|
@@ -367,6 +429,8 @@ export interface ScanlinesOptions {
|
|
|
367
429
|
* - `1.0` = solid (no gaps)
|
|
368
430
|
*
|
|
369
431
|
* @default 0.5
|
|
432
|
+
*
|
|
433
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#linewidth | ScanlinesOptions.lineWidth API reference}
|
|
370
434
|
*/
|
|
371
435
|
lineWidth: number;
|
|
372
436
|
/**
|
|
@@ -377,6 +441,8 @@ export interface ScanlinesOptions {
|
|
|
377
441
|
* - `1.0` = maximum darkness (solid black lines)
|
|
378
442
|
*
|
|
379
443
|
* @default 0.75
|
|
444
|
+
*
|
|
445
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#intensity | ScanlinesOptions.intensity API reference}
|
|
380
446
|
*/
|
|
381
447
|
intensity: number;
|
|
382
448
|
/**
|
|
@@ -387,6 +453,8 @@ export interface ScanlinesOptions {
|
|
|
387
453
|
* - Higher values = faster scrolling
|
|
388
454
|
*
|
|
389
455
|
* @default 1.0
|
|
456
|
+
*
|
|
457
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#speed | ScanlinesOptions.speed API reference}
|
|
390
458
|
*/
|
|
391
459
|
speed: number;
|
|
392
460
|
/**
|
|
@@ -395,6 +463,8 @@ export interface ScanlinesOptions {
|
|
|
395
463
|
* Increment this value each frame to animate the scrolling effect.
|
|
396
464
|
*
|
|
397
465
|
* @default 0.0
|
|
466
|
+
*
|
|
467
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#time | ScanlinesOptions.time API reference}
|
|
398
468
|
*/
|
|
399
469
|
time: number;
|
|
400
470
|
}
|
|
@@ -405,9 +475,11 @@ export interface ScanlinesOptions {
|
|
|
405
475
|
* Useful for creating a cinematic look or highlighting central content.
|
|
406
476
|
*
|
|
407
477
|
* @example
|
|
408
|
-
* {@includeCode ../examples/vignette/sketch.js}
|
|
478
|
+
* {@includeCode ../examples/Stylization/vignette/sketch.js}
|
|
409
479
|
*
|
|
410
480
|
* @category Stylization filters
|
|
481
|
+
*
|
|
482
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions | VignetteOptions API reference}
|
|
411
483
|
*/
|
|
412
484
|
export interface VignetteOptions {
|
|
413
485
|
/**
|
|
@@ -418,6 +490,8 @@ export interface VignetteOptions {
|
|
|
418
490
|
* - `1.0` = very dark edges
|
|
419
491
|
*
|
|
420
492
|
* @default 0.5
|
|
493
|
+
*
|
|
494
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#amount | VignetteOptions.amount API reference}
|
|
421
495
|
*/
|
|
422
496
|
amount: number;
|
|
423
497
|
/**
|
|
@@ -428,6 +502,8 @@ export interface VignetteOptions {
|
|
|
428
502
|
* - `1.0` = very soft, gradual falloff
|
|
429
503
|
*
|
|
430
504
|
* @default 0.5
|
|
505
|
+
*
|
|
506
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#softness | VignetteOptions.softness API reference}
|
|
431
507
|
*/
|
|
432
508
|
softness: number;
|
|
433
509
|
/**
|
|
@@ -438,6 +514,8 @@ export interface VignetteOptions {
|
|
|
438
514
|
* - `1.0` = circular/elliptical
|
|
439
515
|
*
|
|
440
516
|
* @default 0.5
|
|
517
|
+
*
|
|
518
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#roundness | VignetteOptions.roundness API reference}
|
|
441
519
|
*/
|
|
442
520
|
roundness: number;
|
|
443
521
|
}
|
|
@@ -449,9 +527,11 @@ export interface VignetteOptions {
|
|
|
449
527
|
* Perfect for creating neon, glowing text, or dreamy effects.
|
|
450
528
|
*
|
|
451
529
|
* @example
|
|
452
|
-
* {@includeCode ../examples/bloom/sketch.js}
|
|
530
|
+
* {@includeCode ../examples/Stylization/bloom/sketch.js}
|
|
453
531
|
*
|
|
454
532
|
* @category Stylization filters
|
|
533
|
+
*
|
|
534
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions | BloomOptions API reference}
|
|
455
535
|
*/
|
|
456
536
|
export interface BloomOptions {
|
|
457
537
|
/**
|
|
@@ -462,6 +542,8 @@ export interface BloomOptions {
|
|
|
462
542
|
* - `1.0` = only the brightest pixels glow
|
|
463
543
|
*
|
|
464
544
|
* @default 0.5
|
|
545
|
+
*
|
|
546
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#threshold | BloomOptions.threshold API reference}
|
|
465
547
|
*/
|
|
466
548
|
threshold: number;
|
|
467
549
|
/**
|
|
@@ -472,6 +554,8 @@ export interface BloomOptions {
|
|
|
472
554
|
* - `2.0+` = very bright, intense glow
|
|
473
555
|
*
|
|
474
556
|
* @default 1.0
|
|
557
|
+
*
|
|
558
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#intensity | BloomOptions.intensity API reference}
|
|
475
559
|
*/
|
|
476
560
|
intensity: number;
|
|
477
561
|
/**
|
|
@@ -484,6 +568,8 @@ export interface BloomOptions {
|
|
|
484
568
|
* - `10.0+` = wide, diffuse glow
|
|
485
569
|
*
|
|
486
570
|
* @default 4.0
|
|
571
|
+
*
|
|
572
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#radius | BloomOptions.radius API reference}
|
|
487
573
|
*/
|
|
488
574
|
radius: number;
|
|
489
575
|
}
|
|
@@ -496,9 +582,11 @@ export interface BloomOptions {
|
|
|
496
582
|
* real film characteristics.
|
|
497
583
|
*
|
|
498
584
|
* @example
|
|
499
|
-
* {@includeCode ../examples/filmGrain/sketch.js}
|
|
585
|
+
* {@includeCode ../examples/Stylization/filmGrain/sketch.js}
|
|
500
586
|
*
|
|
501
587
|
* @category Stylization filters
|
|
588
|
+
*
|
|
589
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions | FilmGrainOptions API reference}
|
|
502
590
|
*/
|
|
503
591
|
export interface FilmGrainOptions {
|
|
504
592
|
/**
|
|
@@ -509,6 +597,8 @@ export interface FilmGrainOptions {
|
|
|
509
597
|
* - `0.5+` = heavy, noticeable grain
|
|
510
598
|
*
|
|
511
599
|
* @default 0.2
|
|
600
|
+
*
|
|
601
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#intensity | FilmGrainOptions.intensity API reference}
|
|
512
602
|
*/
|
|
513
603
|
intensity: number;
|
|
514
604
|
/**
|
|
@@ -519,6 +609,8 @@ export interface FilmGrainOptions {
|
|
|
519
609
|
* - `5.0+` = coarse, chunky grain
|
|
520
610
|
*
|
|
521
611
|
* @default 2.0
|
|
612
|
+
*
|
|
613
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#size | FilmGrainOptions.size API reference}
|
|
522
614
|
*/
|
|
523
615
|
size: number;
|
|
524
616
|
/**
|
|
@@ -529,6 +621,8 @@ export interface FilmGrainOptions {
|
|
|
529
621
|
* - `2.0+` = fast, flickering grain
|
|
530
622
|
*
|
|
531
623
|
* @default 1.0
|
|
624
|
+
*
|
|
625
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#speed | FilmGrainOptions.speed API reference}
|
|
532
626
|
*/
|
|
533
627
|
speed: number;
|
|
534
628
|
/**
|
|
@@ -537,7 +631,8 @@ export interface FilmGrainOptions {
|
|
|
537
631
|
* Increment this value each frame to animate the grain effect.
|
|
538
632
|
*
|
|
539
633
|
* @default 0.0
|
|
634
|
+
*
|
|
635
|
+
* @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#time | FilmGrainOptions.time API reference}
|
|
540
636
|
*/
|
|
541
637
|
time: number;
|
|
542
638
|
}
|
|
543
|
-
//# sourceMappingURL=types.d.ts.map
|