textmode.filters.js 1.2.3 → 1.2.4

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 (34) hide show
  1. package/README.md +21 -1
  2. package/dist/textmode.filters.esm.js +1 -1
  3. package/dist/textmode.filters.umd.js +1 -1
  4. package/dist/types/builtins/catalog.d.ts +167 -0
  5. package/dist/types/builtins/color-adjustment/brightness.d.ts +28 -0
  6. package/dist/types/builtins/color-adjustment/contrast.d.ts +28 -0
  7. package/dist/types/builtins/color-adjustment/grayscale.d.ts +16 -0
  8. package/dist/types/builtins/color-adjustment/hueRotate.d.ts +30 -0
  9. package/dist/types/builtins/color-adjustment/invert.d.ts +1 -0
  10. package/dist/types/builtins/color-adjustment/posterize.d.ts +31 -0
  11. package/dist/types/builtins/color-adjustment/saturation.d.ts +28 -0
  12. package/dist/types/builtins/color-adjustment/sepia.d.ts +16 -0
  13. package/dist/types/builtins/color-adjustment/threshold.d.ts +16 -0
  14. package/dist/types/builtins/definition.d.ts +26 -0
  15. package/dist/types/builtins/distortion/chromaticAberration.d.ts +40 -0
  16. package/dist/types/builtins/distortion/gridDistortion.d.ts +101 -0
  17. package/dist/types/builtins/distortion/pixelate.d.ts +28 -0
  18. package/dist/types/builtins/stylization/bloom.d.ts +55 -0
  19. package/dist/types/builtins/stylization/crtMattias.d.ts +52 -0
  20. package/dist/types/builtins/stylization/filmGrain.d.ts +64 -0
  21. package/dist/types/builtins/stylization/glitch.d.ts +28 -0
  22. package/dist/types/builtins/stylization/scanlines.d.ts +75 -0
  23. package/dist/types/builtins/stylization/vignette.d.ts +52 -0
  24. package/dist/types/index.d.ts +41 -24
  25. package/dist/types/plugin/FiltersPlugin.d.ts +9 -0
  26. package/dist/types/public/augmentations.d.ts +15 -0
  27. package/dist/types/public/filter-types.d.ts +26 -0
  28. package/dist/types/runtime/FilterRegistry.d.ts +26 -0
  29. package/dist/types/runtime/FilterRenderer.d.ts +26 -0
  30. package/dist/types/runtime/FilterScheduler.d.ts +35 -0
  31. package/dist/types/runtime/TextmodeFilterManager.d.ts +54 -0
  32. package/dist/types/runtime/types.d.ts +22 -0
  33. package/package.json +24 -67
  34. package/dist/types/types.d.ts +0 -638
@@ -1,638 +0,0 @@
1
- /**
2
- * Type definitions for all filter options in textmode.filters.js.
3
- *
4
- * Each filter can be applied using either:
5
- * - A single value (shorthand for the primary parameter)
6
- * - An options object with named parameters
7
- *
8
- * @example
9
- * {@includeCode ../examples/Stylization/bloom/sketch.js}
10
- *
11
- * @module
12
- */
13
- /**
14
- * Configuration options for the `'brightness'` filter.
15
- *
16
- * Adjusts image brightness by multiplying pixel values.
17
- *
18
- * @example
19
- * {@includeCode ../examples/ColorAdjustment/brightness/sketch.js}
20
- *
21
- * @category Color adjustment filters
22
- *
23
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BrightnessOptions | BrightnessOptions API reference}
24
- */
25
- export interface BrightnessOptions {
26
- /**
27
- * Brightness multiplier.
28
- *
29
- * - `1.0` = normal brightness (no change)
30
- * - `> 1.0` = brighter
31
- * - `< 1.0` = darker
32
- * - `0.0` = completely black
33
- *
34
- * @default 1.0
35
- *
36
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BrightnessOptions#amount | BrightnessOptions.amount API reference}
37
- */
38
- amount: number;
39
- }
40
- /**
41
- * Configuration options for the `'contrast'` filter.
42
- *
43
- * Adjusts image contrast by scaling pixel values around mid-gray.
44
- *
45
- * @example
46
- * {@includeCode ../examples/ColorAdjustment/contrast/sketch.js}
47
- *
48
- * @category Color adjustment filters
49
- *
50
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ContrastOptions | ContrastOptions API reference}
51
- */
52
- export interface ContrastOptions {
53
- /**
54
- * Contrast multiplier.
55
- *
56
- * - `1.0` = normal contrast (no change)
57
- * - `> 1.0` = more contrast (darker darks, brighter brights)
58
- * - `< 1.0` = less contrast (more gray/washed out)
59
- * - `0.0` = solid gray
60
- *
61
- * @default 1.0
62
- *
63
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ContrastOptions#amount | ContrastOptions.amount API reference}
64
- */
65
- amount: number;
66
- }
67
- /**
68
- * Configuration options for the `'saturation'` filter.
69
- *
70
- * Adjusts color intensity without affecting luminance.
71
- * Perfect for creating vivid, oversaturated looks or desaturating to grayscale.
72
- *
73
- * @example
74
- * {@includeCode ../examples/ColorAdjustment/saturation/sketch.js}
75
- *
76
- * @category Color adjustment filters
77
- *
78
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/SaturationOptions | SaturationOptions API reference}
79
- */
80
- export interface SaturationOptions {
81
- /**
82
- * Saturation multiplier.
83
- *
84
- * - `0.0` = grayscale (no color)
85
- * - `1.0` = normal saturation (no change)
86
- * - `> 1.0` = vivid/oversaturated colors
87
- *
88
- * @default 1.0
89
- *
90
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/SaturationOptions#amount | SaturationOptions.amount API reference}
91
- */
92
- amount: number;
93
- }
94
- /**
95
- * Configuration options for the `'hueRotate'` filter.
96
- *
97
- * Shifts all colors around the color wheel by a specified angle.
98
- * Useful for color grading or creating surreal color effects.
99
- *
100
- * @example
101
- * {@includeCode ../examples/ColorAdjustment/hueRotate/sketch.js}
102
- *
103
- * @category Color adjustment filters
104
- *
105
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/HueRotateOptions | HueRotateOptions API reference}
106
- */
107
- export interface HueRotateOptions {
108
- /**
109
- * Rotation angle in degrees.
110
- *
111
- * - `0` = no change
112
- * - `180` = complementary colors
113
- * - `360` = full rotation (same as 0)
114
- *
115
- * Values wrap around, so `370` is equivalent to `10`.
116
- *
117
- * @default 0.0
118
- *
119
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/HueRotateOptions#angle | HueRotateOptions.angle API reference}
120
- */
121
- angle: number;
122
- }
123
- /**
124
- * Configuration options for the `'posterize'` filter.
125
- *
126
- * Reduces the color palette to a limited number of bands per channel,
127
- * creating a retro quantized/poster-like look.
128
- *
129
- * @example
130
- * {@includeCode ../examples/ColorAdjustment/posterize/sketch.js}
131
- *
132
- * @category Color adjustment filters
133
- *
134
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PosterizeOptions | PosterizeOptions API reference}
135
- */
136
- export interface PosterizeOptions {
137
- /**
138
- * Number of color levels per channel.
139
- *
140
- * Lower values create more dramatic banding effects.
141
- * Higher values approach the original image quality.
142
- *
143
- * - `2` = extreme posterization (very few colors)
144
- * - `4` = strong posterization (default)
145
- * - `8+` = subtle posterization
146
- *
147
- * @default 4.0
148
- *
149
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PosterizeOptions#levels | PosterizeOptions.levels API reference}
150
- */
151
- levels: number;
152
- }
153
- /**
154
- * Configuration options for the `'chromaticAberration'` filter.
155
- *
156
- * RGB color channel separation effect that simulates lens distortion
157
- * found in cheap cameras or creates stylized glitch aesthetics.
158
- *
159
- * @example
160
- * {@includeCode ../examples/Distortion/chromaticAberration/sketch.js}
161
- *
162
- * @category Distortion filters
163
- *
164
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ChromaticAberrationOptions | ChromaticAberrationOptions API reference}
165
- */
166
- export interface ChromaticAberrationOptions {
167
- /**
168
- * Offset amount in pixels.
169
- *
170
- * Controls how far the red and blue channels are separated from green.
171
- *
172
- * @default 5.0
173
- *
174
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ChromaticAberrationOptions#amount | ChromaticAberrationOptions.amount API reference}
175
- */
176
- amount: number;
177
- /**
178
- * Direction of the color separation as `[x, y]`.
179
- *
180
- * - `[1, 0]` = horizontal separation
181
- * - `[0, 1]` = vertical separation
182
- * - `[1, 1]` = diagonal separation
183
- *
184
- * The vector is normalized internally, so `[2, 0]` is the same as `[1, 0]`.
185
- *
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}
189
- */
190
- direction: [number, number];
191
- }
192
- /**
193
- * Configuration options for the `'pixelate'` filter.
194
- *
195
- * Reduces image resolution to create a mosaic/pixelated effect
196
- * reminiscent of retro video games or censored content.
197
- *
198
- * @example
199
- * {@includeCode ../examples/Distortion/pixelate/sketch.js}
200
- *
201
- * @category Distortion filters
202
- *
203
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PixelateOptions | PixelateOptions API reference}
204
- */
205
- export interface PixelateOptions {
206
- /**
207
- * Size of each pixel block in pixels.
208
- *
209
- * Larger values create bigger, more visible pixels.
210
- *
211
- * Minimum value: `1.0`
212
- *
213
- * @default 4.0
214
- *
215
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/PixelateOptions#pixelsize | PixelateOptions.pixelSize API reference}
216
- */
217
- pixelSize: number;
218
- }
219
- /**
220
- * Configuration options for the `'gridDistortion'` filter.
221
- *
222
- * Distorts a monospaced character grid by varying the width and height
223
- * of individual cells. Create wave effects, perspective distortions,
224
- * or other grid warping effects by providing custom factor arrays.
225
- *
226
- * This filter is designed specifically for textmode.js grids, allowing
227
- * you to create dynamic text distortion effects.
228
- *
229
- * @example
230
- * {@includeCode ../examples/Distortion/gridDistortion/sketch.js}
231
- *
232
- * @category Distortion filters
233
- *
234
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions | GridDistortionOptions API reference}
235
- */
236
- export interface GridDistortionOptions {
237
- /**
238
- * Grid dimensions as `[columns, rows]`.
239
- *
240
- * Should match your textmode grid dimensions.
241
- *
242
- * Maximum value: `[128, 128]`
243
- *
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}
247
- */
248
- gridCellDimensions: [number, number];
249
- /**
250
- * Grid size in pixels as `[width, height]`.
251
- *
252
- * Typically calculated as:
253
- * `[t.grid.cols * t.grid.cellWidth, t.grid.rows * t.grid.cellHeight]`
254
- *
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}
258
- */
259
- gridPixelDimensions: [number, number];
260
- /**
261
- * Grid offset in pixels as `[offsetX, offsetY]`.
262
- *
263
- * Use `[t.grid.offsetX, t.grid.offsetY]` to match your grid position.
264
- *
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}
268
- */
269
- gridOffsetDimensions: [number, number];
270
- /**
271
- * Array of distortion values (0-1) for each column.
272
- *
273
- * Must contain at least as many elements as columns (max 128).
274
- * Values control the relative width of each column:
275
- * - `0.0` = minimum width
276
- * - `0.5` = normal width
277
- * - `1.0` = maximum width
278
- *
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}
282
- */
283
- widthFactors: number[];
284
- /**
285
- * Array of distortion values (0-1) for each row.
286
- *
287
- * Must contain at least as many elements as rows (max 128).
288
- * Values control the relative height of each row:
289
- * - `0.0` = minimum height
290
- * - `0.5` = normal height
291
- * - `1.0` = maximum height
292
- *
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}
296
- */
297
- heightFactors: number[];
298
- /**
299
- * Intensity multiplier for width distortion.
300
- *
301
- * Higher values create more dramatic width variations.
302
- *
303
- * @default 0.5
304
- *
305
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#widthvariationscale | GridDistortionOptions.widthVariationScale API reference}
306
- */
307
- widthVariationScale: number;
308
- /**
309
- * Intensity multiplier for height distortion.
310
- *
311
- * Higher values create more dramatic height variations.
312
- *
313
- * @default 0.5
314
- *
315
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GridDistortionOptions#heightvariationscale | GridDistortionOptions.heightVariationScale API reference}
316
- */
317
- heightVariationScale: number;
318
- }
319
- /**
320
- * Configuration options for the `'glitch'` filter.
321
- *
322
- * Digital glitch effect with RGB channel separation, scanlines, and noise.
323
- * Creates a corrupted/broken digital signal aesthetic.
324
- *
325
- * @example
326
- * {@includeCode ../examples/Stylization/glitch/sketch.js}
327
- *
328
- * @category Stylization filters
329
- *
330
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GlitchOptions | GlitchOptions API reference}
331
- */
332
- export interface GlitchOptions {
333
- /**
334
- * Glitch intensity.
335
- *
336
- * - `0.0` = no glitch effect
337
- * - `0.5` = subtle glitching
338
- * - `1.0+` = intense, chaotic glitching
339
- *
340
- * @default 0.0
341
- *
342
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/GlitchOptions#amount | GlitchOptions.amount API reference}
343
- */
344
- amount: number;
345
- }
346
- /**
347
- * Configuration options for the `'crtMattias'` filter.
348
- *
349
- * CRT monitor emulation effect with screen curvature, animated scanlines,
350
- * blur, vignette, and film grain noise. Based on Mattias Gustavsson's
351
- * classic CRT shader.
352
- *
353
- * @example
354
- * {@includeCode ../examples/Stylization/crtMattias/sketch.js}
355
- *
356
- * @see {@link https://github.com/libretro/glsl-shaders/blob/master/crt/shaders/crt-mattias.glsl | Original shader by Mattias Gustavsson}
357
- *
358
- * @category Stylization filters
359
- *
360
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions | CrtMattiasOptions API reference}
361
- */
362
- export interface CrtMattiasOptions {
363
- /**
364
- * Amount of screen curvature/barrel distortion.
365
- *
366
- * - `0.0` = flat screen
367
- * - `0.5` = moderate curvature (default)
368
- * - `1.0` = maximum curvature
369
- *
370
- * @default 0.5
371
- *
372
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#curvature | CrtMattiasOptions.curvature API reference}
373
- */
374
- curvature: number;
375
- /**
376
- * Speed of the scrolling scanline effect.
377
- *
378
- * Higher values make the scanline crawl faster.
379
- *
380
- * @default 1.0
381
- *
382
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#scanspeed | CrtMattiasOptions.scanSpeed API reference}
383
- */
384
- scanSpeed: number;
385
- /**
386
- * Animation time parameter.
387
- *
388
- * Increment this value each frame to animate the effect.
389
- * Typically use elapsed time in seconds or frame count.
390
- *
391
- * @default 0.0
392
- *
393
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/CrtMattiasOptions#time | CrtMattiasOptions.time API reference}
394
- */
395
- time: number;
396
- }
397
- /**
398
- * Configuration options for the `'scanlines'` filter.
399
- *
400
- * A standalone scanline effect that adds horizontal lines to the image
401
- * to simulate a CRT display or old monitor. More customizable than
402
- * the scanlines in crtMattias.
403
- *
404
- * @example
405
- * {@includeCode ../examples/Stylization/scanlines/sketch.js}
406
- *
407
- * @category Stylization filters
408
- *
409
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions | ScanlinesOptions API reference}
410
- */
411
- export interface ScanlinesOptions {
412
- /**
413
- * Number of scanlines across the image height.
414
- *
415
- * Higher values create finer, more dense lines.
416
- *
417
- * Minimum value: `10.0`
418
- *
419
- * @default 300.0
420
- *
421
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#count | ScanlinesOptions.count API reference}
422
- */
423
- count: number;
424
- /**
425
- * Width of the lines relative to the spacing.
426
- *
427
- * - `0.0` = very thin lines (mostly transparent)
428
- * - `0.5` = equal line and gap width
429
- * - `1.0` = solid (no gaps)
430
- *
431
- * @default 0.5
432
- *
433
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#linewidth | ScanlinesOptions.lineWidth API reference}
434
- */
435
- lineWidth: number;
436
- /**
437
- * Opacity/darkness of the scanlines.
438
- *
439
- * - `0.0` = invisible lines
440
- * - `0.75` = clearly visible (default)
441
- * - `1.0` = maximum darkness (solid black lines)
442
- *
443
- * @default 0.75
444
- *
445
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#intensity | ScanlinesOptions.intensity API reference}
446
- */
447
- intensity: number;
448
- /**
449
- * Scrolling speed of the lines.
450
- *
451
- * - `0.0` = static lines
452
- * - `1.0` = normal scrolling speed
453
- * - Higher values = faster scrolling
454
- *
455
- * @default 1.0
456
- *
457
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#speed | ScanlinesOptions.speed API reference}
458
- */
459
- speed: number;
460
- /**
461
- * Animation time parameter.
462
- *
463
- * Increment this value each frame to animate the scrolling effect.
464
- *
465
- * @default 0.0
466
- *
467
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/ScanlinesOptions#time | ScanlinesOptions.time API reference}
468
- */
469
- time: number;
470
- }
471
- /**
472
- * Configuration options for the `'vignette'` filter.
473
- *
474
- * Darkens the edges and corners of the image, drawing focus to the center.
475
- * Useful for creating a cinematic look or highlighting central content.
476
- *
477
- * @example
478
- * {@includeCode ../examples/Stylization/vignette/sketch.js}
479
- *
480
- * @category Stylization filters
481
- *
482
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions | VignetteOptions API reference}
483
- */
484
- export interface VignetteOptions {
485
- /**
486
- * Intensity of the darkening effect.
487
- *
488
- * - `0.0` = no vignette
489
- * - `0.5` = moderate vignette (default)
490
- * - `1.0` = very dark edges
491
- *
492
- * @default 0.5
493
- *
494
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#amount | VignetteOptions.amount API reference}
495
- */
496
- amount: number;
497
- /**
498
- * Falloff gradient softness.
499
- *
500
- * - `0.0` = hard edge (sharp transition)
501
- * - `0.5` = moderate gradient (default)
502
- * - `1.0` = very soft, gradual falloff
503
- *
504
- * @default 0.5
505
- *
506
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#softness | VignetteOptions.softness API reference}
507
- */
508
- softness: number;
509
- /**
510
- * Shape of the vignette.
511
- *
512
- * - `0.0` = rectangular (follows screen edges)
513
- * - `0.5` = rounded rectangle (default)
514
- * - `1.0` = circular/elliptical
515
- *
516
- * @default 0.5
517
- *
518
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/VignetteOptions#roundness | VignetteOptions.roundness API reference}
519
- */
520
- roundness: number;
521
- }
522
- /**
523
- * Configuration options for the `'bloom'` filter.
524
- *
525
- * Creates a glow effect around bright areas of the image. Pixels above
526
- * the brightness threshold emit a soft glow that spreads outward.
527
- * Perfect for creating neon, glowing text, or dreamy effects.
528
- *
529
- * @example
530
- * {@includeCode ../examples/Stylization/bloom/sketch.js}
531
- *
532
- * @category Stylization filters
533
- *
534
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions | BloomOptions API reference}
535
- */
536
- export interface BloomOptions {
537
- /**
538
- * Brightness level above which pixels will glow.
539
- *
540
- * - `0.0` = everything glows
541
- * - `0.5` = mid-brightness and above glows (default)
542
- * - `1.0` = only the brightest pixels glow
543
- *
544
- * @default 0.5
545
- *
546
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#threshold | BloomOptions.threshold API reference}
547
- */
548
- threshold: number;
549
- /**
550
- * Strength of the glow effect.
551
- *
552
- * - `0.0` = no visible glow
553
- * - `1.0` = normal glow intensity (default)
554
- * - `2.0+` = very bright, intense glow
555
- *
556
- * @default 1.0
557
- *
558
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#intensity | BloomOptions.intensity API reference}
559
- */
560
- intensity: number;
561
- /**
562
- * Size of the glow spread in pixels.
563
- *
564
- * Larger values create a wider, softer glow.
565
- *
566
- * - `1.0` = tight glow
567
- * - `4.0` = moderate spread (default)
568
- * - `10.0+` = wide, diffuse glow
569
- *
570
- * @default 4.0
571
- *
572
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/BloomOptions#radius | BloomOptions.radius API reference}
573
- */
574
- radius: number;
575
- }
576
- /**
577
- * Configuration options for the `'filmGrain'` filter.
578
- *
579
- * Adds an animated film grain/noise texture overlay to simulate vintage
580
- * film stock or analog video. The multi-layered noise creates an organic,
581
- * moving grain pattern that's less visible in darker areas, mimicking
582
- * real film characteristics.
583
- *
584
- * @example
585
- * {@includeCode ../examples/Stylization/filmGrain/sketch.js}
586
- *
587
- * @category Stylization filters
588
- *
589
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions | FilmGrainOptions API reference}
590
- */
591
- export interface FilmGrainOptions {
592
- /**
593
- * Strength of the grain effect.
594
- *
595
- * - `0.0` = no grain
596
- * - `0.2` = subtle grain (default)
597
- * - `0.5+` = heavy, noticeable grain
598
- *
599
- * @default 0.2
600
- *
601
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#intensity | FilmGrainOptions.intensity API reference}
602
- */
603
- intensity: number;
604
- /**
605
- * Size of grain particles.
606
- *
607
- * - `1.0` = fine grain
608
- * - `2.0` = medium grain (default)
609
- * - `5.0+` = coarse, chunky grain
610
- *
611
- * @default 2.0
612
- *
613
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#size | FilmGrainOptions.size API reference}
614
- */
615
- size: number;
616
- /**
617
- * Animation speed of the grain.
618
- *
619
- * - `0.0` = static grain (not recommended)
620
- * - `1.0` = normal animation speed (default)
621
- * - `2.0+` = fast, flickering grain
622
- *
623
- * @default 1.0
624
- *
625
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#speed | FilmGrainOptions.speed API reference}
626
- */
627
- speed: number;
628
- /**
629
- * Animation time parameter.
630
- *
631
- * Increment this value each frame to animate the grain effect.
632
- *
633
- * @default 0.0
634
- *
635
- * @see {@link https://code.textmode.art/api/textmode.filters.js/interfaces/FilmGrainOptions#time | FilmGrainOptions.time API reference}
636
- */
637
- time: number;
638
- }