@pixerate/editor 0.275.1 → 0.277.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.
Files changed (81) hide show
  1. package/dist/animation-editor/index.cjs +62 -62
  2. package/dist/animation-editor/index.js +6 -6
  3. package/dist/brushes/index.cjs +84 -71
  4. package/dist/brushes/index.js +20 -7
  5. package/dist/brushes/patch.d.cts +4 -4
  6. package/dist/brushes/patch.d.ts +4 -4
  7. package/dist/brushes/profiles.d.cts +4 -0
  8. package/dist/brushes/profiles.d.ts +4 -0
  9. package/dist/brushes/schema.d.cts +2 -0
  10. package/dist/brushes/schema.d.ts +2 -0
  11. package/dist/brushes/types.d.cts +32 -1
  12. package/dist/brushes/types.d.ts +32 -1
  13. package/dist/{brushstrokeRender-2RQL46WB.cjs → brushstrokeRender-7HOMKZNO.cjs} +21 -21
  14. package/dist/{brushstrokeRender-WGY4DZHF.js → brushstrokeRender-EIK3625T.js} +5 -5
  15. package/dist/canvas/index.cjs +13 -13
  16. package/dist/canvas/index.js +1 -1
  17. package/dist/{chunk-T6KNJVBP.cjs → chunk-4NZTK7LM.cjs} +35 -35
  18. package/dist/{chunk-LMG57L5A.js → chunk-CTHWXW5M.js} +121 -8
  19. package/dist/{chunk-43XJC3PP.js → chunk-DWPFGWW5.js} +1 -1
  20. package/dist/{chunk-MSWLJI4G.js → chunk-FNIWHSLI.js} +2 -2
  21. package/dist/{chunk-JDXWLCXF.cjs → chunk-H3EME3S5.cjs} +2 -2
  22. package/dist/{chunk-Y2ISSVPH.js → chunk-HHX7ST6Z.js} +167 -9
  23. package/dist/{chunk-6QNDGMK7.cjs → chunk-HRUK5TFW.cjs} +187 -45
  24. package/dist/{chunk-NIBFKXMD.cjs → chunk-IFWLZZCW.cjs} +619 -2
  25. package/dist/{chunk-W6JDUXP3.js → chunk-J23JOHPR.js} +1 -1
  26. package/dist/{chunk-HVO6XCI4.js → chunk-JPB65KQ6.js} +1 -1
  27. package/dist/{chunk-Y354ETAE.cjs → chunk-JVFGK3DK.cjs} +69 -58
  28. package/dist/{chunk-ACTHSQOI.js → chunk-LDZOXESA.js} +618 -1
  29. package/dist/{chunk-IEEY5RJV.js → chunk-LZE2QZCT.js} +1 -1
  30. package/dist/{chunk-DHC4E2DU.cjs → chunk-MITQGHN3.cjs} +121 -8
  31. package/dist/{chunk-75SYKUOT.js → chunk-N4MCWQZ7.js} +1 -1
  32. package/dist/{chunk-G5TCMKX5.js → chunk-NJLPW4MM.js} +17 -6
  33. package/dist/{chunk-STLTOISW.cjs → chunk-NPPMKMCU.cjs} +17 -17
  34. package/dist/{chunk-OLZXXAER.cjs → chunk-PEQWARCP.cjs} +408 -250
  35. package/dist/{chunk-ZM7IKQ4X.js → chunk-PPDUCZZV.js} +152 -10
  36. package/dist/{chunk-RAPNRK4R.cjs → chunk-QBZEC2JJ.cjs} +88 -88
  37. package/dist/{chunk-RJGW3RQS.js → chunk-ROURHJYT.js} +1 -1
  38. package/dist/{chunk-62MFUHSI.cjs → chunk-UQXULAMQ.cjs} +16 -16
  39. package/dist/{chunk-YYZC2EQO.cjs → chunk-VNF7A2JA.cjs} +23 -23
  40. package/dist/{chunk-C6VB7CPY.cjs → chunk-WFSYZO5Z.cjs} +1 -1
  41. package/dist/image-editor/index.cjs +880 -852
  42. package/dist/image-editor/index.js +36 -8
  43. package/dist/paint/index.cjs +33 -5
  44. package/dist/paint/index.d.cts +1 -0
  45. package/dist/paint/index.d.ts +1 -0
  46. package/dist/paint/index.js +32 -4
  47. package/dist/paint/live-patterns.d.cts +149 -0
  48. package/dist/paint/live-patterns.d.ts +149 -0
  49. package/dist/paint/wet/world.d.cts +13 -0
  50. package/dist/paint/wet/world.d.ts +13 -0
  51. package/dist/paint-editor/brush-model.d.cts +21 -1
  52. package/dist/paint-editor/brush-model.d.ts +21 -1
  53. package/dist/paint-editor/controller.d.cts +102 -1
  54. package/dist/paint-editor/controller.d.ts +102 -1
  55. package/dist/paint-editor/document.d.cts +8 -1
  56. package/dist/paint-editor/document.d.ts +8 -1
  57. package/dist/paint-editor/ferro-tools.d.cts +10 -0
  58. package/dist/paint-editor/ferro-tools.d.ts +10 -0
  59. package/dist/paint-editor/ferro.d.cts +134 -0
  60. package/dist/paint-editor/ferro.d.ts +134 -0
  61. package/dist/paint-editor/index.cjs +2291 -904
  62. package/dist/paint-editor/index.d.cts +2 -0
  63. package/dist/paint-editor/index.d.ts +2 -0
  64. package/dist/paint-editor/index.js +1533 -146
  65. package/dist/paint-editor/stroke.d.cts +14 -0
  66. package/dist/paint-editor/stroke.d.ts +14 -0
  67. package/dist/paint-editor/thick.d.cts +15 -2
  68. package/dist/paint-editor/thick.d.ts +15 -2
  69. package/dist/paint-editor/ui.d.cts +7 -1
  70. package/dist/paint-editor/ui.d.ts +7 -1
  71. package/dist/paint-editor/wet-tools.d.cts +42 -0
  72. package/dist/paint-editor/wet-tools.d.ts +42 -0
  73. package/dist/paint-editor/wet.d.cts +22 -1
  74. package/dist/paint-editor/wet.d.ts +22 -1
  75. package/dist/vector/index.cjs +1002 -1002
  76. package/dist/vector/index.js +7 -7
  77. package/package.json +1 -1
  78. package/skills/pixerate-brushes/SKILL.md +1 -0
  79. package/skills/pixerate-paint-editor/SKILL.md +11 -29
  80. package/skills/pixerate-paint-editor/references/brush-facets.md +1 -0
  81. package/skills/pixerate-paint-editor/references/ferrofluid.md +36 -0
@@ -114,6 +114,13 @@ export interface StrokeSessionInit {
114
114
  thermo?: {
115
115
  surface: TiledSurface;
116
116
  } | null;
117
+ /**
118
+ * Ferrofluid paint: the layer's ferrofluid channel before the stroke. With it, a twin of the
119
+ * stroke paints the ferrofluid channel as grey (see `ferro.ts`); `ferroChannel()` returns the result.
120
+ */
121
+ ferro?: {
122
+ surface: TiledSurface;
123
+ } | null;
117
124
  }
118
125
  export interface PaintStrokeResult {
119
126
  layerId: string;
@@ -148,6 +155,9 @@ export declare class PaintStrokeSession {
148
155
  /** Light paint: the stroke's twin over the light channel, and what it left there. */
149
156
  private readonly lightTwin;
150
157
  private lightResult;
158
+ /** Ferrofluid paint: the stroke's twin over the ferrofluid channel, and what it left there. */
159
+ private readonly ferroTwin;
160
+ private ferroResult;
151
161
  /** UV-fluorescent ink: the stroke's twin over the fluorescence channel, and what it left there. */
152
162
  private readonly fluorTwin;
153
163
  private fluorResult;
@@ -186,6 +196,10 @@ export declare class PaintStrokeSession {
186
196
  fluorChannel(): TiledSurface | null;
187
197
  /** Thermochromic ink: the layer's thermochromic channel after the stroke, or `null` when unchanged. */
188
198
  thermoChannel(): TiledSurface | null;
199
+ /** The stroke's twin over the ferrofluid channel: the same marks in grey at the brush's ferro amount (see `ferro.ts`). */
200
+ private makeFerroTwin;
201
+ /** Ferrofluid paint: the layer's ferrofluid channel after the stroke, or `null` when the stroke has no twin or left it unchanged. */
202
+ ferroChannel(): TiledSurface | null;
189
203
  private tileTarget;
190
204
  get open(): boolean;
191
205
  /** Adds raw pen samples (document pixels). */
@@ -114,6 +114,13 @@ export interface StrokeSessionInit {
114
114
  thermo?: {
115
115
  surface: TiledSurface;
116
116
  } | null;
117
+ /**
118
+ * Ferrofluid paint: the layer's ferrofluid channel before the stroke. With it, a twin of the
119
+ * stroke paints the ferrofluid channel as grey (see `ferro.ts`); `ferroChannel()` returns the result.
120
+ */
121
+ ferro?: {
122
+ surface: TiledSurface;
123
+ } | null;
117
124
  }
118
125
  export interface PaintStrokeResult {
119
126
  layerId: string;
@@ -148,6 +155,9 @@ export declare class PaintStrokeSession {
148
155
  /** Light paint: the stroke's twin over the light channel, and what it left there. */
149
156
  private readonly lightTwin;
150
157
  private lightResult;
158
+ /** Ferrofluid paint: the stroke's twin over the ferrofluid channel, and what it left there. */
159
+ private readonly ferroTwin;
160
+ private ferroResult;
151
161
  /** UV-fluorescent ink: the stroke's twin over the fluorescence channel, and what it left there. */
152
162
  private readonly fluorTwin;
153
163
  private fluorResult;
@@ -186,6 +196,10 @@ export declare class PaintStrokeSession {
186
196
  fluorChannel(): TiledSurface | null;
187
197
  /** Thermochromic ink: the layer's thermochromic channel after the stroke, or `null` when unchanged. */
188
198
  thermoChannel(): TiledSurface | null;
199
+ /** The stroke's twin over the ferrofluid channel: the same marks in grey at the brush's ferro amount (see `ferro.ts`). */
200
+ private makeFerroTwin;
201
+ /** Ferrofluid paint: the layer's ferrofluid channel after the stroke, or `null` when the stroke has no twin or left it unchanged. */
202
+ ferroChannel(): TiledSurface | null;
189
203
  private tileTarget;
190
204
  get open(): boolean;
191
205
  /** Adds raw pen samples (document pixels). */
@@ -20,6 +20,7 @@ import { TiledSurface, type RasterRect } from '../raster/surface.cjs';
20
20
  import type { IridescenceSettings } from './brush-model.cjs';
21
21
  import type { PaintBrush } from './brushes.cjs';
22
22
  import { type PenPoint, type StrokeCopy } from './engine.cjs';
23
+ import { type FerroLayerInput } from './ferro.cjs';
23
24
  /** Where the light comes from. */
24
25
  export interface PaintLighting {
25
26
  /** Degrees clockwise from the top of the canvas (315: top left, the default). */
@@ -66,8 +67,20 @@ export declare function lightTile(color: Uint8ClampedArray, height: Uint8Clamped
66
67
  /** Cache of lit tiles for one layer, by the identity of their inputs. */
67
68
  export declare class LitCache {
68
69
  private readonly tiles;
69
- /** The layer's pixels lit (tiles without relief or film nearby are the colour tiles themselves). */
70
- lit(color: TiledSurface, ch: ThickChannels, light: PaintLighting, viewTilt?: PaintViewTilt): TiledSurface;
70
+ /**
71
+ * The layer's pixels lit (tiles without relief, film or ferrofluid nearby are the colour tiles
72
+ * themselves). Without ferrofluid this is the thick-paint / thin-film pass; with it, the liquid
73
+ * ferrofluid adds its carrier colour, glossy metallic material and (near magnets) Rosensweig
74
+ * spike heights before the same lighting.
75
+ */
76
+ lit(color: TiledSurface, ch: ThickChannels, light: PaintLighting, viewTilt?: PaintViewTilt, ferro?: FerroLayerInput | null): TiledSurface;
77
+ /**
78
+ * The ferrofluid lighting pass: every tile with ferrofluid or thick relief nearby is lit, with the
79
+ * liquid's carrier colour and gloss / metal material blended in and its spikes added to the
80
+ * height field. Thick relief is lit even when `light.relief` is 0 here (the spikes need it), and
81
+ * a thin film on the same layer still colours the lit tiles.
82
+ */
83
+ private litFerro;
71
84
  }
72
85
  /** Live thin-film iridescence buffer for any stroke engine (deposits or erases into 4-channel `ThickChannels.film`). */
73
86
  export declare class FilmBuffer {
@@ -20,6 +20,7 @@ import { TiledSurface, type RasterRect } from '../raster/surface.js';
20
20
  import type { IridescenceSettings } from './brush-model.js';
21
21
  import type { PaintBrush } from './brushes.js';
22
22
  import { type PenPoint, type StrokeCopy } from './engine.js';
23
+ import { type FerroLayerInput } from './ferro.js';
23
24
  /** Where the light comes from. */
24
25
  export interface PaintLighting {
25
26
  /** Degrees clockwise from the top of the canvas (315: top left, the default). */
@@ -66,8 +67,20 @@ export declare function lightTile(color: Uint8ClampedArray, height: Uint8Clamped
66
67
  /** Cache of lit tiles for one layer, by the identity of their inputs. */
67
68
  export declare class LitCache {
68
69
  private readonly tiles;
69
- /** The layer's pixels lit (tiles without relief or film nearby are the colour tiles themselves). */
70
- lit(color: TiledSurface, ch: ThickChannels, light: PaintLighting, viewTilt?: PaintViewTilt): TiledSurface;
70
+ /**
71
+ * The layer's pixels lit (tiles without relief, film or ferrofluid nearby are the colour tiles
72
+ * themselves). Without ferrofluid this is the thick-paint / thin-film pass; with it, the liquid
73
+ * ferrofluid adds its carrier colour, glossy metallic material and (near magnets) Rosensweig
74
+ * spike heights before the same lighting.
75
+ */
76
+ lit(color: TiledSurface, ch: ThickChannels, light: PaintLighting, viewTilt?: PaintViewTilt, ferro?: FerroLayerInput | null): TiledSurface;
77
+ /**
78
+ * The ferrofluid lighting pass: every tile with ferrofluid or thick relief nearby is lit, with the
79
+ * liquid's carrier colour and gloss / metal material blended in and its spikes added to the
80
+ * height field. Thick relief is lit even when `light.relief` is 0 here (the spikes need it), and
81
+ * a thin film on the same layer still colours the lit tiles.
82
+ */
83
+ private litFerro;
71
84
  }
72
85
  /** Live thin-film iridescence buffer for any stroke engine (deposits or erases into 4-channel `ThickChannels.film`). */
73
86
  export declare class FilmBuffer {
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import type { MixerLoad } from '../paint/exchange.cjs';
12
12
  import { type BlendModeInfo } from '../raster/blend.cjs';
13
- import type { ImpastoTool, WetMediumKind, WetTool } from './brushes.cjs';
13
+ import type { ImpastoTool, WetMediumKind, WetTool, LivePatternKind } from './brushes.cjs';
14
14
  import type { FillRegionOptions, PaintEditorController } from './controller.cjs';
15
15
  import type { PenPoint } from './engine.cjs';
16
16
  import { type Point2 } from './guides.cjs';
@@ -204,6 +204,10 @@ export declare const WET_PARAM_SLIDERS: readonly SliderControl[];
204
204
  export declare const WET_TILT_SLIDERS: readonly SliderControl[];
205
205
  /** The speed slider (steps per second). */
206
206
  export declare const WET_SPEED_SLIDER: SliderControl;
207
+ /** Labels of the Gray-Scott live pattern kinds. */
208
+ export declare const LIVE_PATTERN_LABELS: Readonly<Record<LivePatternKind, string>>;
209
+ /** The wet panel's sliders for a layer's live patterns. */
210
+ export declare const LIVE_PATTERN_SLIDERS: readonly SliderControl[];
207
211
  /** The wet-engine choices a panel offers (Engine B, the WebGPU accelerator). */
208
212
  export declare const WET_GPU_OPTIONS: readonly {
209
213
  value: WetGpuMode;
@@ -298,6 +302,8 @@ export declare const STROKE_SLIDERS: readonly SliderControl[];
298
302
  export declare const STICKER_SLIDERS: readonly SliderControl[];
299
303
  /** The evolution panel's mutation sliders (`0..1`). */
300
304
  export declare const EVOLUTION_SLIDERS: readonly SliderControl[];
305
+ /** The ferrofluid panel's sliders for a magnet (`strength` and `radius`). */
306
+ export declare const MAGNET_SLIDERS: readonly SliderControl[];
301
307
  /** Stencils a toolbar can lay with one click, centred on the canvas. */
302
308
  export declare function quickStencil(kind: 'ruler' | 'circle' | 'ellipse-mask' | 'edge-mask', canvas: {
303
309
  width: number;
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import type { MixerLoad } from '../paint/exchange.js';
12
12
  import { type BlendModeInfo } from '../raster/blend.js';
13
- import type { ImpastoTool, WetMediumKind, WetTool } from './brushes.js';
13
+ import type { ImpastoTool, WetMediumKind, WetTool, LivePatternKind } from './brushes.js';
14
14
  import type { FillRegionOptions, PaintEditorController } from './controller.js';
15
15
  import type { PenPoint } from './engine.js';
16
16
  import { type Point2 } from './guides.js';
@@ -204,6 +204,10 @@ export declare const WET_PARAM_SLIDERS: readonly SliderControl[];
204
204
  export declare const WET_TILT_SLIDERS: readonly SliderControl[];
205
205
  /** The speed slider (steps per second). */
206
206
  export declare const WET_SPEED_SLIDER: SliderControl;
207
+ /** Labels of the Gray-Scott live pattern kinds. */
208
+ export declare const LIVE_PATTERN_LABELS: Readonly<Record<LivePatternKind, string>>;
209
+ /** The wet panel's sliders for a layer's live patterns. */
210
+ export declare const LIVE_PATTERN_SLIDERS: readonly SliderControl[];
207
211
  /** The wet-engine choices a panel offers (Engine B, the WebGPU accelerator). */
208
212
  export declare const WET_GPU_OPTIONS: readonly {
209
213
  value: WetGpuMode;
@@ -298,6 +302,8 @@ export declare const STROKE_SLIDERS: readonly SliderControl[];
298
302
  export declare const STICKER_SLIDERS: readonly SliderControl[];
299
303
  /** The evolution panel's mutation sliders (`0..1`). */
300
304
  export declare const EVOLUTION_SLIDERS: readonly SliderControl[];
305
+ /** The ferrofluid panel's sliders for a magnet (`strength` and `radius`). */
306
+ export declare const MAGNET_SLIDERS: readonly SliderControl[];
301
307
  /** Stencils a toolbar can lay with one click, centred on the canvas. */
302
308
  export declare function quickStencil(kind: 'ruler' | 'circle' | 'ellipse-mask' | 'edge-mask', canvas: {
303
309
  width: number;
@@ -63,4 +63,46 @@ export declare const WET_PARAM_SCHEMA: {
63
63
  readonly description: string;
64
64
  };
65
65
  };
66
+ export declare const LIVE_PATTERN_SCHEMA: {
67
+ readonly pattern: {
68
+ readonly type: "string";
69
+ readonly enum: readonly ["spots", "stripes", "coral", "maze", "worms"];
70
+ readonly description: "Pearson Gray-Scott preset: spots, stripes, coral, maze or worms (default spots). Sets feed and kill unless explicit feed/kill are also passed.";
71
+ };
72
+ readonly feed: {
73
+ readonly type: "number";
74
+ readonly minimum: 0.005;
75
+ readonly maximum: 0.1;
76
+ readonly description: "Gray-Scott feed rate F, 0.005..0.1 (default: the pattern preset’s feed rate).";
77
+ };
78
+ readonly kill: {
79
+ readonly type: "number";
80
+ readonly minimum: 0.02;
81
+ readonly maximum: 0.08;
82
+ readonly description: "Gray-Scott kill rate k, 0.02..0.08 (default: the pattern preset’s kill rate).";
83
+ };
84
+ readonly scale: {
85
+ readonly type: "number";
86
+ readonly minimum: 0.25;
87
+ readonly maximum: 4;
88
+ readonly description: "Diffusion scale 0.25..4 (larger values grow broader pattern features; default 1).";
89
+ };
90
+ readonly contrast: {
91
+ readonly type: "number";
92
+ readonly minimum: 0;
93
+ readonly maximum: 2;
94
+ readonly description: "How strongly V modulates the wet pigment or blends toward secondColor, 0..2 (default 0.85).";
95
+ };
96
+ readonly secondColor: {
97
+ readonly type: readonly ["string", "null"];
98
+ readonly pattern: "^#[0-9a-fA-F]{6}$";
99
+ readonly description: "Optional #rrggbb colour that high-V pattern ridges blend toward, or null to modulate pigment contrast (default null).";
100
+ };
101
+ readonly relief: {
102
+ readonly type: "number";
103
+ readonly minimum: 0;
104
+ readonly maximum: 1;
105
+ readonly description: string;
106
+ };
107
+ };
66
108
  export declare function createPaintWetTools(c: PaintEditorController): PaintAgentTool[];
@@ -63,4 +63,46 @@ export declare const WET_PARAM_SCHEMA: {
63
63
  readonly description: string;
64
64
  };
65
65
  };
66
+ export declare const LIVE_PATTERN_SCHEMA: {
67
+ readonly pattern: {
68
+ readonly type: "string";
69
+ readonly enum: readonly ["spots", "stripes", "coral", "maze", "worms"];
70
+ readonly description: "Pearson Gray-Scott preset: spots, stripes, coral, maze or worms (default spots). Sets feed and kill unless explicit feed/kill are also passed.";
71
+ };
72
+ readonly feed: {
73
+ readonly type: "number";
74
+ readonly minimum: 0.005;
75
+ readonly maximum: 0.1;
76
+ readonly description: "Gray-Scott feed rate F, 0.005..0.1 (default: the pattern preset’s feed rate).";
77
+ };
78
+ readonly kill: {
79
+ readonly type: "number";
80
+ readonly minimum: 0.02;
81
+ readonly maximum: 0.08;
82
+ readonly description: "Gray-Scott kill rate k, 0.02..0.08 (default: the pattern preset’s kill rate).";
83
+ };
84
+ readonly scale: {
85
+ readonly type: "number";
86
+ readonly minimum: 0.25;
87
+ readonly maximum: 4;
88
+ readonly description: "Diffusion scale 0.25..4 (larger values grow broader pattern features; default 1).";
89
+ };
90
+ readonly contrast: {
91
+ readonly type: "number";
92
+ readonly minimum: 0;
93
+ readonly maximum: 2;
94
+ readonly description: "How strongly V modulates the wet pigment or blends toward secondColor, 0..2 (default 0.85).";
95
+ };
96
+ readonly secondColor: {
97
+ readonly type: readonly ["string", "null"];
98
+ readonly pattern: "^#[0-9a-fA-F]{6}$";
99
+ readonly description: "Optional #rrggbb colour that high-V pattern ridges blend toward, or null to modulate pigment contrast (default null).";
100
+ };
101
+ readonly relief: {
102
+ readonly type: "number";
103
+ readonly minimum: 0;
104
+ readonly maximum: 1;
105
+ readonly description: string;
106
+ };
107
+ };
66
108
  export declare function createPaintWetTools(c: PaintEditorController): PaintAgentTool[];
@@ -28,6 +28,7 @@ import { type EffectPaintPixels } from './effect-paint.cjs';
28
28
  import { type WetParams, type WetTilt } from '../paint/wet/model.cjs';
29
29
  import { type WetGpuProvider } from '../paint/wet/gpu.cjs';
30
30
  import { WetWorld, type WetBackendInfo, type WetGhostState, type WetPaperInput, type WetSnapshot, type WetWorldOptions } from '../paint/wet/world.cjs';
31
+ import { LivePatternField, type LivePatternStats, type LivePatternsInput, type LivePatternsSettings } from '../paint/live-patterns.cjs';
31
32
  import { TiledSurface, type RasterRect } from '../raster/surface.cjs';
32
33
  import type { PaintBrush, WetMediumKind } from './brushes.cjs';
33
34
  import { type PenPoint, type StrokeCopy } from './engine.cjs';
@@ -115,6 +116,7 @@ export declare const WET_MEDIUM_PARAMS: Readonly<Record<WetMediumKind, Partial<W
115
116
  export interface WetLayerSettings {
116
117
  params: WetParams;
117
118
  flow: WetFlowSpec;
119
+ livePatterns?: LivePatternsSettings | null;
118
120
  ghost?: WetGhostState | null;
119
121
  }
120
122
  /** One wet layer as tools describe it. */
@@ -130,6 +132,7 @@ export interface WetLayerInfo {
130
132
  activeTiles: number;
131
133
  params: WetParams;
132
134
  flow: WetFlowSpec;
135
+ livePatterns?: LivePatternsSettings | null;
133
136
  /** Active ghost fade on the layer (`remaining` seconds of simulated time), when one is fading. */
134
137
  ghost?: {
135
138
  remaining: number;
@@ -140,7 +143,7 @@ export interface WetEvent {
140
143
  clock: number;
141
144
  /** How many strokes were recorded before it (where it falls between strokes in a replay). */
142
145
  at?: number;
143
- kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'ghost-release' | 'ghost-keep';
146
+ kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'live-patterns' | 'seed-live-patterns' | 'ghost-release' | 'ghost-keep';
144
147
  layerId?: string;
145
148
  data?: unknown;
146
149
  }
@@ -158,6 +161,10 @@ export interface PaintWetHost {
158
161
  layerLight(id: string): TiledSurface | null;
159
162
  /** Shows new light paint for wet layers (not an undo step); the next `updateSurfaces` redraws. */
160
163
  updateLights(lights: ReadonlyMap<string, TiledSurface>): void;
164
+ /** The layer's thick height map (one channel), or `null` without any. */
165
+ layerHeight?(id: string): TiledSurface | null;
166
+ /** Shows new thick height maps for wet layers with live pattern relief (not an undo step). */
167
+ updateHeights?(heights: ReadonlyMap<string, TiledSurface>): void;
161
168
  /** The paint dried while time passed (the editor records nothing, it just redraws). */
162
169
  changed(): void;
163
170
  }
@@ -209,6 +216,7 @@ export declare class PaintWetLayers {
209
216
  world: WetWorld | null;
210
217
  tilt: WetTilt;
211
218
  readonly settings: Map<string, WetLayerSettings>;
219
+ readonly patterns: Map<string, LivePatternField>;
212
220
  paused: boolean;
213
221
  /** Wet strokes dry as soon as they end (one undo step with the stroke). */
214
222
  instantDry: boolean;
@@ -260,10 +268,21 @@ export declare class PaintWetLayers {
260
268
  /** Resolves when no batch is running. */
261
269
  idle(): Promise<void>;
262
270
  settingsOf(layerId: string, medium?: WetMediumKind): WetLayerSettings;
271
+ patternFieldOf(layerId: string): LivePatternField;
263
272
  /** Puts a layer in the world (its current pixels become the base under the wet paint). */
264
273
  ensureLane(layerId: string, medium?: WetMediumKind): WetWorld;
265
274
  setParams(layerId: string, update: Partial<WetParams>): WetParams;
266
275
  setFlow(layerId: string, update: Partial<WetFlowSpec>): WetFlowSpec;
276
+ setLivePatterns(layerId: string, update: LivePatternsInput | null): LivePatternsSettings | null;
277
+ seedLivePatterns(layerId: string, points: ReadonlyArray<{
278
+ x: number;
279
+ y: number;
280
+ strength?: number;
281
+ }>, radius: number, seed?: number, settings?: LivePatternsInput): {
282
+ seededCells: number;
283
+ stats: LivePatternStats;
284
+ };
285
+ livePatternStats(layerId: string): LivePatternStats;
267
286
  setTilt(update: Partial<WetTilt>): WetTilt;
268
287
  /** The paper changed. */
269
288
  paperChanged(): void;
@@ -274,6 +293,8 @@ export declare class PaintWetLayers {
274
293
  syncDisplays(maxTiles?: number): RasterRect[];
275
294
  /** Like `syncDisplays`, shading on the GPU when Engine B is active (all stale tiles at once). */
276
295
  syncDisplaysGpu(maxCpuTiles: number, lead?: boolean): Promise<RasterRect[]>;
296
+ /** Updates thick height maps for any layers with live pattern relief (`relief > 0`). */
297
+ private syncHeights;
277
298
  /** Shows each wet layer's live light paint (the light under it with the wet light shaded in). */
278
299
  private syncLights;
279
300
  /** Drops the wet layers whose paint has all dried (they become ordinary pixel layers). */
@@ -28,6 +28,7 @@ import { type EffectPaintPixels } from './effect-paint.js';
28
28
  import { type WetParams, type WetTilt } from '../paint/wet/model.js';
29
29
  import { type WetGpuProvider } from '../paint/wet/gpu.js';
30
30
  import { WetWorld, type WetBackendInfo, type WetGhostState, type WetPaperInput, type WetSnapshot, type WetWorldOptions } from '../paint/wet/world.js';
31
+ import { LivePatternField, type LivePatternStats, type LivePatternsInput, type LivePatternsSettings } from '../paint/live-patterns.js';
31
32
  import { TiledSurface, type RasterRect } from '../raster/surface.js';
32
33
  import type { PaintBrush, WetMediumKind } from './brushes.js';
33
34
  import { type PenPoint, type StrokeCopy } from './engine.js';
@@ -115,6 +116,7 @@ export declare const WET_MEDIUM_PARAMS: Readonly<Record<WetMediumKind, Partial<W
115
116
  export interface WetLayerSettings {
116
117
  params: WetParams;
117
118
  flow: WetFlowSpec;
119
+ livePatterns?: LivePatternsSettings | null;
118
120
  ghost?: WetGhostState | null;
119
121
  }
120
122
  /** One wet layer as tools describe it. */
@@ -130,6 +132,7 @@ export interface WetLayerInfo {
130
132
  activeTiles: number;
131
133
  params: WetParams;
132
134
  flow: WetFlowSpec;
135
+ livePatterns?: LivePatternsSettings | null;
133
136
  /** Active ghost fade on the layer (`remaining` seconds of simulated time), when one is fading. */
134
137
  ghost?: {
135
138
  remaining: number;
@@ -140,7 +143,7 @@ export interface WetEvent {
140
143
  clock: number;
141
144
  /** How many strokes were recorded before it (where it falls between strokes in a replay). */
142
145
  at?: number;
143
- kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'ghost-release' | 'ghost-keep';
146
+ kind: 'dry' | 'tilt' | 'params' | 'flow' | 'wet-paper' | 'live-patterns' | 'seed-live-patterns' | 'ghost-release' | 'ghost-keep';
144
147
  layerId?: string;
145
148
  data?: unknown;
146
149
  }
@@ -158,6 +161,10 @@ export interface PaintWetHost {
158
161
  layerLight(id: string): TiledSurface | null;
159
162
  /** Shows new light paint for wet layers (not an undo step); the next `updateSurfaces` redraws. */
160
163
  updateLights(lights: ReadonlyMap<string, TiledSurface>): void;
164
+ /** The layer's thick height map (one channel), or `null` without any. */
165
+ layerHeight?(id: string): TiledSurface | null;
166
+ /** Shows new thick height maps for wet layers with live pattern relief (not an undo step). */
167
+ updateHeights?(heights: ReadonlyMap<string, TiledSurface>): void;
161
168
  /** The paint dried while time passed (the editor records nothing, it just redraws). */
162
169
  changed(): void;
163
170
  }
@@ -209,6 +216,7 @@ export declare class PaintWetLayers {
209
216
  world: WetWorld | null;
210
217
  tilt: WetTilt;
211
218
  readonly settings: Map<string, WetLayerSettings>;
219
+ readonly patterns: Map<string, LivePatternField>;
212
220
  paused: boolean;
213
221
  /** Wet strokes dry as soon as they end (one undo step with the stroke). */
214
222
  instantDry: boolean;
@@ -260,10 +268,21 @@ export declare class PaintWetLayers {
260
268
  /** Resolves when no batch is running. */
261
269
  idle(): Promise<void>;
262
270
  settingsOf(layerId: string, medium?: WetMediumKind): WetLayerSettings;
271
+ patternFieldOf(layerId: string): LivePatternField;
263
272
  /** Puts a layer in the world (its current pixels become the base under the wet paint). */
264
273
  ensureLane(layerId: string, medium?: WetMediumKind): WetWorld;
265
274
  setParams(layerId: string, update: Partial<WetParams>): WetParams;
266
275
  setFlow(layerId: string, update: Partial<WetFlowSpec>): WetFlowSpec;
276
+ setLivePatterns(layerId: string, update: LivePatternsInput | null): LivePatternsSettings | null;
277
+ seedLivePatterns(layerId: string, points: ReadonlyArray<{
278
+ x: number;
279
+ y: number;
280
+ strength?: number;
281
+ }>, radius: number, seed?: number, settings?: LivePatternsInput): {
282
+ seededCells: number;
283
+ stats: LivePatternStats;
284
+ };
285
+ livePatternStats(layerId: string): LivePatternStats;
267
286
  setTilt(update: Partial<WetTilt>): WetTilt;
268
287
  /** The paper changed. */
269
288
  paperChanged(): void;
@@ -274,6 +293,8 @@ export declare class PaintWetLayers {
274
293
  syncDisplays(maxTiles?: number): RasterRect[];
275
294
  /** Like `syncDisplays`, shading on the GPU when Engine B is active (all stale tiles at once). */
276
295
  syncDisplaysGpu(maxCpuTiles: number, lead?: boolean): Promise<RasterRect[]>;
296
+ /** Updates thick height maps for any layers with live pattern relief (`relief > 0`). */
297
+ private syncHeights;
277
298
  /** Shows each wet layer's live light paint (the light under it with the wet light shaded in). */
278
299
  private syncLights;
279
300
  /** Drops the wet layers whose paint has all dried (they become ordinary pixel layers). */