@pixerate/editor 0.256.0 → 0.258.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.
- package/dist/agent/index.cjs +40 -38
- package/dist/agent/index.js +9 -7
- package/dist/animation/index.cjs +4 -2
- package/dist/animation/index.js +4 -2
- package/dist/animation-editor/index.cjs +63 -61
- package/dist/animation-editor/index.js +7 -5
- package/dist/brushes/colour.d.cts +11 -0
- package/dist/brushes/colour.d.ts +11 -0
- package/dist/brushes/index.cjs +51 -30
- package/dist/brushes/index.d.cts +1 -0
- package/dist/brushes/index.d.ts +1 -0
- package/dist/brushes/index.js +25 -4
- package/dist/brushes/resolve.d.cts +2 -0
- package/dist/brushes/resolve.d.ts +2 -0
- package/dist/brushes/schema.d.cts +1 -0
- package/dist/brushes/schema.d.ts +1 -0
- package/dist/brushes/tools.d.cts +7 -0
- package/dist/brushes/tools.d.ts +7 -0
- package/dist/brushes/types.d.cts +10 -2
- package/dist/brushes/types.d.ts +10 -2
- package/dist/brushes/ui.d.cts +14 -3
- package/dist/brushes/ui.d.ts +14 -3
- package/dist/{brushstrokeRender-HCOQUSWW.js → brushstrokeRender-JI4W6F2G.js} +2 -2
- package/dist/{brushstrokeRender-ZZOXI5O5.cjs → brushstrokeRender-MQ6PSDM5.cjs} +11 -11
- package/dist/canvas/index.cjs +20 -18
- package/dist/canvas/index.js +7 -5
- package/dist/chart/index.cjs +159 -157
- package/dist/chart/index.js +9 -7
- package/dist/{chunk-7272D3K2.js → chunk-2EUW2XZX.js} +27 -276
- package/dist/{chunk-L6Y7TSQ4.js → chunk-2VJ6OVJV.js} +1 -1
- package/dist/{chunk-6ZZKRH7R.js → chunk-47V3WXDG.js} +2 -2
- package/dist/{chunk-H7ET2ISK.cjs → chunk-4IMD2TLY.cjs} +52 -52
- package/dist/{chunk-VUKUTT2W.js → chunk-4M4E3N6X.js} +1 -1
- package/dist/{chunk-TBAVCLEQ.cjs → chunk-5Q5MLXAD.cjs} +23 -23
- package/dist/{chunk-MONXNVZK.js → chunk-6I23ZCGK.js} +5 -3
- package/dist/{chunk-GOBOCZZI.js → chunk-6NQPKNUZ.js} +1 -1
- package/dist/{chunk-WYGSR3IJ.js → chunk-AORZ5M5C.js} +1 -1
- package/dist/chunk-AVTPZO4Z.cjs +142 -0
- package/dist/{chunk-WKMUBATU.js → chunk-C2WEIEUB.js} +1 -1
- package/dist/{chunk-P3K2JCJA.js → chunk-D5BXSOSU.js} +3 -3
- package/dist/chunk-E2V5DA3W.js +36 -0
- package/dist/{chunk-WZOGDKCQ.js → chunk-F7CPSRLN.js} +0 -133
- package/dist/chunk-FJBQTZS4.js +17 -0
- package/dist/{chunk-SOSBOS5T.cjs → chunk-G23BTQA5.cjs} +22 -22
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-I3Y2Q3PM.cjs} +59 -308
- package/dist/{chunk-YHUMGBZD.js → chunk-ICTPLVSR.js} +22 -4
- package/dist/{chunk-LRNUZKWV.cjs → chunk-IPUTIUGQ.cjs} +1 -1
- package/dist/{chunk-6GRUVGKU.js → chunk-ITURMC2M.js} +3 -3
- package/dist/{chunk-HYWRU5VX.js → chunk-IXQZHCOF.js} +1 -1
- package/dist/chunk-J5UQHWVL.js +142 -0
- package/dist/{chunk-YBAPT7NL.js → chunk-JC2SHA4A.js} +1 -23
- package/dist/chunk-LRTR4ASZ.cjs +17 -0
- package/dist/{chunk-HUAISCUX.cjs → chunk-M2HG5DJ2.cjs} +18 -18
- package/dist/{chunk-N76AMOKE.cjs → chunk-MDLEGVEN.cjs} +42 -42
- package/dist/chunk-MEGSQUQO.cjs +36 -0
- package/dist/chunk-MLLTWAXH.cjs +276 -0
- package/dist/{chunk-RHPSE2YR.js → chunk-MQ6MGIQM.js} +2 -2
- package/dist/{chunk-PGPFWC35.cjs → chunk-MQGQTKVW.cjs} +51 -33
- package/dist/{chunk-5YWWQ36H.cjs → chunk-O3ZVZSNJ.cjs} +9 -9
- package/dist/{chunk-GCTUOTCW.cjs → chunk-P3PZ63M3.cjs} +35 -35
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-P6WYDBTH.cjs} +4 -4
- package/dist/{chunk-CJ6TBL2N.cjs → chunk-RHEMMGCN.cjs} +16 -16
- package/dist/{chunk-HIMGBZAM.cjs → chunk-RSIKDWOP.cjs} +201 -38
- package/dist/{chunk-SABJMH6M.cjs → chunk-RVGP2XLF.cjs} +2 -135
- package/dist/{chunk-JVRLGV3C.js → chunk-SMTUQWGY.js} +184 -21
- package/dist/{chunk-DMTEQ6SH.js → chunk-SSFMWJDK.js} +4 -4
- package/dist/{chunk-TFF2GTGN.cjs → chunk-SXQHWXEL.cjs} +2 -24
- package/dist/{chunk-IWEVV63O.cjs → chunk-UEYLANO3.cjs} +18 -16
- package/dist/chunk-VR6OGHU5.js +276 -0
- package/dist/{chunk-AF23QK5F.js → chunk-YQ4PQTBB.js} +1 -1
- package/dist/{chunk-B7V34GIH.cjs → chunk-YSGW7VV4.cjs} +88 -88
- package/dist/{chunk-3NS5C7FB.cjs → chunk-YYBW6DF2.cjs} +76 -76
- package/dist/{chunk-UFEDHACQ.js → chunk-Z7BX4TWO.js} +2 -2
- package/dist/{chunk-RUONPPMC.cjs → chunk-ZSE25IZA.cjs} +8 -8
- package/dist/color/index.cjs +7 -3
- package/dist/color/index.js +18 -14
- package/dist/export/index.cjs +8 -6
- package/dist/export/index.js +7 -5
- package/dist/extensions/index.cjs +11 -9
- package/dist/extensions/index.js +10 -8
- package/dist/gradient/index.cjs +33 -31
- package/dist/gradient/index.js +5 -3
- package/dist/image-editor/brush-presets.d.cts +4 -1
- package/dist/image-editor/brush-presets.d.ts +4 -1
- package/dist/image-editor/controller.d.cts +10 -5
- package/dist/image-editor/controller.d.ts +10 -5
- package/dist/image-editor/index.cjs +1090 -1073
- package/dist/image-editor/index.js +37 -20
- package/dist/index.cjs +17 -15
- package/dist/index.js +11 -9
- package/dist/paint-editor/brushes.d.cts +18 -1
- package/dist/paint-editor/brushes.d.ts +18 -1
- package/dist/paint-editor/collaboration.d.cts +38 -0
- package/dist/paint-editor/collaboration.d.ts +38 -0
- package/dist/paint-editor/controller.d.cts +60 -0
- package/dist/paint-editor/controller.d.ts +60 -0
- package/dist/paint-editor/engine.d.cts +7 -0
- package/dist/paint-editor/engine.d.ts +7 -0
- package/dist/paint-editor/index.cjs +1564 -1324
- package/dist/paint-editor/index.js +1198 -958
- package/dist/paint-editor/mark-settings.d.cts +1 -1
- package/dist/paint-editor/mark-settings.d.ts +1 -1
- package/dist/paint-editor/procedural.d.cts +4 -2
- package/dist/paint-editor/procedural.d.ts +4 -2
- package/dist/paint-editor/stamp-tip.d.cts +45 -0
- package/dist/paint-editor/stamp-tip.d.ts +45 -0
- package/dist/paint-editor/stroke.d.cts +4 -0
- package/dist/paint-editor/stroke.d.ts +4 -0
- package/dist/stickers/index.cjs +4 -2
- package/dist/stickers/index.js +6 -4
- package/dist/typography/index.cjs +3 -2
- package/dist/typography/index.js +2 -1
- package/dist/vector/index.cjs +971 -969
- package/dist/vector/index.js +8 -6
- package/dist/video-editor/index.cjs +4 -2
- package/dist/video-editor/index.js +4 -2
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +21 -11
- package/skills/pixerate-brushes-design/SKILL.md +6 -2
- package/skills/pixerate-brushes-design/evals/canvas-chalk.json +8 -8
- package/skills/pixerate-canvas/SKILL.md +3 -2
- package/skills/pixerate-image-editor/SKILL.md +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +5 -1
- package/skills/pixerate-vector/SKILL.md +1 -1
|
@@ -22,6 +22,7 @@ import { type PaintBrushInput, type PaintBrush } from './brushes.cjs';
|
|
|
22
22
|
import { type BrushLibrary, type BrushLibraryFile } from '../brushes/library.cjs';
|
|
23
23
|
import { type BrushPatch, type UnsettableBrushFacet } from '../brushes/patch.cjs';
|
|
24
24
|
import type { Brush } from '../brushes/types.cjs';
|
|
25
|
+
import type { ColorScheme } from '../color/dual.cjs';
|
|
25
26
|
import { type PaintCanvas, type PaintDocumentState, type PaintLayer } from './document.cjs';
|
|
26
27
|
import { type ImageEncoder, type ImageFormat } from './encode.cjs';
|
|
27
28
|
import type { PenPoint } from './engine.cjs';
|
|
@@ -67,6 +68,11 @@ export interface PaintEditorOptions extends Partial<PaintCanvas> {
|
|
|
67
68
|
brushLibrary?: BrushLibrary;
|
|
68
69
|
/** Saved user brushes to start the default library with (or to add to `brushLibrary`). */
|
|
69
70
|
brushes?: readonly PaintBrush[];
|
|
71
|
+
/**
|
|
72
|
+
* The host's colour scheme (default `light`): a brush's light / dark default colour resolves to
|
|
73
|
+
* its side when the brush is chosen and when a stroke starts. Follow the host with `setColorScheme`.
|
|
74
|
+
*/
|
|
75
|
+
colorScheme?: ColorScheme;
|
|
70
76
|
/** Paint colour #rrggbb (default #1f2937). */
|
|
71
77
|
color?: string;
|
|
72
78
|
hand?: Hand;
|
|
@@ -114,6 +120,10 @@ export interface PaintEditorState {
|
|
|
114
120
|
brushes: readonly PaintBrush[];
|
|
115
121
|
/** Paint colour #rrggbb. */
|
|
116
122
|
color: string;
|
|
123
|
+
/** The colour scheme light / dark brush colours resolve for. */
|
|
124
|
+
colorScheme: ColorScheme;
|
|
125
|
+
/** Locked: choosing a brush with a default colour keeps the paint colour. */
|
|
126
|
+
colorLocked: boolean;
|
|
117
127
|
/** The second colour (swap with `swapColors`). */
|
|
118
128
|
secondaryColor: string;
|
|
119
129
|
/**
|
|
@@ -194,6 +204,21 @@ export interface PaintLayerInfo {
|
|
|
194
204
|
/** How many live layer effects (glows, shadows, strokes…) it has, when any (`getLayerEffects`). */
|
|
195
205
|
effects?: number;
|
|
196
206
|
}
|
|
207
|
+
/** A live stroke as it is painted (`onStrokeSample`), for agents that paint along with the user. */
|
|
208
|
+
export interface PaintStrokeSample {
|
|
209
|
+
/** `begin`: the pen went down. `points`: new samples. `end`: the stroke was recorded. `cancel`: it was abandoned. */
|
|
210
|
+
phase: 'begin' | 'points' | 'end' | 'cancel';
|
|
211
|
+
layerId: string;
|
|
212
|
+
brush: PaintBrush;
|
|
213
|
+
/** #rrggbb */
|
|
214
|
+
color: string;
|
|
215
|
+
/** Every raw sample so far (document pixels), in order. */
|
|
216
|
+
points: readonly PenPoint[];
|
|
217
|
+
/** The samples this event added (`points` only). */
|
|
218
|
+
added: readonly PenPoint[];
|
|
219
|
+
/** `end`: the recorded stroke's id, or `null` when it painted nothing. */
|
|
220
|
+
strokeId?: string | null;
|
|
221
|
+
}
|
|
197
222
|
/** One change to the paint history, for hosts and change feeds (`onCommit`). */
|
|
198
223
|
export interface PaintCommitEvent {
|
|
199
224
|
/** `execute`: a new undo step. `merge`: folded into the last one (a slider drag). */
|
|
@@ -361,6 +386,7 @@ export declare class PaintEditorController {
|
|
|
361
386
|
private readonly encodeImage;
|
|
362
387
|
private listeners;
|
|
363
388
|
private commitListeners;
|
|
389
|
+
private sampleListeners;
|
|
364
390
|
/** Origins set by `withOrigin`, innermost last. */
|
|
365
391
|
private origins;
|
|
366
392
|
/** `group` in progress: commits fold into one step, recorded when it ends. */
|
|
@@ -423,6 +449,21 @@ export declare class PaintEditorController {
|
|
|
423
449
|
private paperEffectNodeCache;
|
|
424
450
|
constructor(options?: PaintEditorOptions);
|
|
425
451
|
subscribe(listener: () => void): () => void;
|
|
452
|
+
/**
|
|
453
|
+
* Hears the user's live strokes as they are painted (`beginStroke` sessions, not strokes painted
|
|
454
|
+
* from data): when the pen goes down, each batch of samples, and the end or cancel. For agents
|
|
455
|
+
* that paint along in real time. Returns an unsubscribe function.
|
|
456
|
+
*/
|
|
457
|
+
onStrokeSample(listener: (sample: PaintStrokeSample) => void): () => void;
|
|
458
|
+
private notifySample;
|
|
459
|
+
/** The stroke being painted now, or `null`: its layer, brush, colour and samples so far. */
|
|
460
|
+
getLiveStroke(): {
|
|
461
|
+
layerId: string;
|
|
462
|
+
brushId: string;
|
|
463
|
+
brushName: string;
|
|
464
|
+
color: string;
|
|
465
|
+
points: readonly PenPoint[];
|
|
466
|
+
} | null;
|
|
426
467
|
/** Hears each undo step recorded, merged, undone or redone, with who made it. Returns an unsubscribe function. */
|
|
427
468
|
onCommit(listener: (event: PaintCommitEvent) => void): () => void;
|
|
428
469
|
private notifyCommit;
|
|
@@ -825,6 +866,25 @@ export declare class PaintEditorController {
|
|
|
825
866
|
height?: number;
|
|
826
867
|
color?: string;
|
|
827
868
|
}): BrushThumbnail;
|
|
869
|
+
private colorScheme;
|
|
870
|
+
private colorLocked;
|
|
871
|
+
/** The brush default colour the paint colour came from (resolved again when the scheme changes), or `null`. */
|
|
872
|
+
private brushColour;
|
|
873
|
+
/**
|
|
874
|
+
* The host's colour scheme: a paint colour that came from a brush's light / dark default
|
|
875
|
+
* resolves to the new side. Editor state, not an undo step.
|
|
876
|
+
*/
|
|
877
|
+
setColorScheme(scheme: ColorScheme): void;
|
|
878
|
+
/** Locks the paint colour: choosing a brush with a default colour keeps it. Editor state, not an undo step. */
|
|
879
|
+
setColorLocked(locked: boolean): void;
|
|
880
|
+
/**
|
|
881
|
+
* After the user chooses a brush: its solid or light / dark default colour becomes the paint
|
|
882
|
+
* colour (resolved for the colour scheme), unless the colour is locked. Gradient defaults are the
|
|
883
|
+
* brush's own paint already; effect defaults stay a suggestion.
|
|
884
|
+
*/
|
|
885
|
+
private takeBrushColour;
|
|
886
|
+
/** A brush that always paints its own colour (`colour.own`): that colour, resolved for the scheme now; else `null`. */
|
|
887
|
+
private ownColour;
|
|
828
888
|
/** Sets the paint colour (and goes back to one colour from gradient paint). */
|
|
829
889
|
setColor(color: string): string;
|
|
830
890
|
/**
|
|
@@ -22,6 +22,7 @@ import { type PaintBrushInput, type PaintBrush } from './brushes.js';
|
|
|
22
22
|
import { type BrushLibrary, type BrushLibraryFile } from '../brushes/library.js';
|
|
23
23
|
import { type BrushPatch, type UnsettableBrushFacet } from '../brushes/patch.js';
|
|
24
24
|
import type { Brush } from '../brushes/types.js';
|
|
25
|
+
import type { ColorScheme } from '../color/dual.js';
|
|
25
26
|
import { type PaintCanvas, type PaintDocumentState, type PaintLayer } from './document.js';
|
|
26
27
|
import { type ImageEncoder, type ImageFormat } from './encode.js';
|
|
27
28
|
import type { PenPoint } from './engine.js';
|
|
@@ -67,6 +68,11 @@ export interface PaintEditorOptions extends Partial<PaintCanvas> {
|
|
|
67
68
|
brushLibrary?: BrushLibrary;
|
|
68
69
|
/** Saved user brushes to start the default library with (or to add to `brushLibrary`). */
|
|
69
70
|
brushes?: readonly PaintBrush[];
|
|
71
|
+
/**
|
|
72
|
+
* The host's colour scheme (default `light`): a brush's light / dark default colour resolves to
|
|
73
|
+
* its side when the brush is chosen and when a stroke starts. Follow the host with `setColorScheme`.
|
|
74
|
+
*/
|
|
75
|
+
colorScheme?: ColorScheme;
|
|
70
76
|
/** Paint colour #rrggbb (default #1f2937). */
|
|
71
77
|
color?: string;
|
|
72
78
|
hand?: Hand;
|
|
@@ -114,6 +120,10 @@ export interface PaintEditorState {
|
|
|
114
120
|
brushes: readonly PaintBrush[];
|
|
115
121
|
/** Paint colour #rrggbb. */
|
|
116
122
|
color: string;
|
|
123
|
+
/** The colour scheme light / dark brush colours resolve for. */
|
|
124
|
+
colorScheme: ColorScheme;
|
|
125
|
+
/** Locked: choosing a brush with a default colour keeps the paint colour. */
|
|
126
|
+
colorLocked: boolean;
|
|
117
127
|
/** The second colour (swap with `swapColors`). */
|
|
118
128
|
secondaryColor: string;
|
|
119
129
|
/**
|
|
@@ -194,6 +204,21 @@ export interface PaintLayerInfo {
|
|
|
194
204
|
/** How many live layer effects (glows, shadows, strokes…) it has, when any (`getLayerEffects`). */
|
|
195
205
|
effects?: number;
|
|
196
206
|
}
|
|
207
|
+
/** A live stroke as it is painted (`onStrokeSample`), for agents that paint along with the user. */
|
|
208
|
+
export interface PaintStrokeSample {
|
|
209
|
+
/** `begin`: the pen went down. `points`: new samples. `end`: the stroke was recorded. `cancel`: it was abandoned. */
|
|
210
|
+
phase: 'begin' | 'points' | 'end' | 'cancel';
|
|
211
|
+
layerId: string;
|
|
212
|
+
brush: PaintBrush;
|
|
213
|
+
/** #rrggbb */
|
|
214
|
+
color: string;
|
|
215
|
+
/** Every raw sample so far (document pixels), in order. */
|
|
216
|
+
points: readonly PenPoint[];
|
|
217
|
+
/** The samples this event added (`points` only). */
|
|
218
|
+
added: readonly PenPoint[];
|
|
219
|
+
/** `end`: the recorded stroke's id, or `null` when it painted nothing. */
|
|
220
|
+
strokeId?: string | null;
|
|
221
|
+
}
|
|
197
222
|
/** One change to the paint history, for hosts and change feeds (`onCommit`). */
|
|
198
223
|
export interface PaintCommitEvent {
|
|
199
224
|
/** `execute`: a new undo step. `merge`: folded into the last one (a slider drag). */
|
|
@@ -361,6 +386,7 @@ export declare class PaintEditorController {
|
|
|
361
386
|
private readonly encodeImage;
|
|
362
387
|
private listeners;
|
|
363
388
|
private commitListeners;
|
|
389
|
+
private sampleListeners;
|
|
364
390
|
/** Origins set by `withOrigin`, innermost last. */
|
|
365
391
|
private origins;
|
|
366
392
|
/** `group` in progress: commits fold into one step, recorded when it ends. */
|
|
@@ -423,6 +449,21 @@ export declare class PaintEditorController {
|
|
|
423
449
|
private paperEffectNodeCache;
|
|
424
450
|
constructor(options?: PaintEditorOptions);
|
|
425
451
|
subscribe(listener: () => void): () => void;
|
|
452
|
+
/**
|
|
453
|
+
* Hears the user's live strokes as they are painted (`beginStroke` sessions, not strokes painted
|
|
454
|
+
* from data): when the pen goes down, each batch of samples, and the end or cancel. For agents
|
|
455
|
+
* that paint along in real time. Returns an unsubscribe function.
|
|
456
|
+
*/
|
|
457
|
+
onStrokeSample(listener: (sample: PaintStrokeSample) => void): () => void;
|
|
458
|
+
private notifySample;
|
|
459
|
+
/** The stroke being painted now, or `null`: its layer, brush, colour and samples so far. */
|
|
460
|
+
getLiveStroke(): {
|
|
461
|
+
layerId: string;
|
|
462
|
+
brushId: string;
|
|
463
|
+
brushName: string;
|
|
464
|
+
color: string;
|
|
465
|
+
points: readonly PenPoint[];
|
|
466
|
+
} | null;
|
|
426
467
|
/** Hears each undo step recorded, merged, undone or redone, with who made it. Returns an unsubscribe function. */
|
|
427
468
|
onCommit(listener: (event: PaintCommitEvent) => void): () => void;
|
|
428
469
|
private notifyCommit;
|
|
@@ -825,6 +866,25 @@ export declare class PaintEditorController {
|
|
|
825
866
|
height?: number;
|
|
826
867
|
color?: string;
|
|
827
868
|
}): BrushThumbnail;
|
|
869
|
+
private colorScheme;
|
|
870
|
+
private colorLocked;
|
|
871
|
+
/** The brush default colour the paint colour came from (resolved again when the scheme changes), or `null`. */
|
|
872
|
+
private brushColour;
|
|
873
|
+
/**
|
|
874
|
+
* The host's colour scheme: a paint colour that came from a brush's light / dark default
|
|
875
|
+
* resolves to the new side. Editor state, not an undo step.
|
|
876
|
+
*/
|
|
877
|
+
setColorScheme(scheme: ColorScheme): void;
|
|
878
|
+
/** Locks the paint colour: choosing a brush with a default colour keeps it. Editor state, not an undo step. */
|
|
879
|
+
setColorLocked(locked: boolean): void;
|
|
880
|
+
/**
|
|
881
|
+
* After the user chooses a brush: its solid or light / dark default colour becomes the paint
|
|
882
|
+
* colour (resolved for the colour scheme), unless the colour is locked. Gradient defaults are the
|
|
883
|
+
* brush's own paint already; effect defaults stay a suggestion.
|
|
884
|
+
*/
|
|
885
|
+
private takeBrushColour;
|
|
886
|
+
/** A brush that always paints its own colour (`colour.own`): that colour, resolved for the scheme now; else `null`. */
|
|
887
|
+
private ownColour;
|
|
828
888
|
/** Sets the paint colour (and goes back to one colour from gradient paint). */
|
|
829
889
|
setColor(color: string): string;
|
|
830
890
|
/**
|
|
@@ -18,6 +18,7 @@ import { CoverageMap, type BrushSettings, type Dab, type StrokePoint } from '../
|
|
|
18
18
|
import type { RasterRect } from '../raster/surface.cjs';
|
|
19
19
|
import type { PaintBrush } from './brushes.cjs';
|
|
20
20
|
import { type EffectPaintPixels } from './effect-paint.cjs';
|
|
21
|
+
import type { StickerArtLookup } from './sticker-art.cjs';
|
|
21
22
|
import { type PaperGrain } from './paper.cjs';
|
|
22
23
|
/** One pen sample in document pixels. Every channel but x and y is optional. */
|
|
23
24
|
export interface PenPoint {
|
|
@@ -126,6 +127,8 @@ export interface DryStrokeOptions {
|
|
|
126
127
|
copies?: readonly StrokeCopy[];
|
|
127
128
|
/** Effect paint: each pixel takes its colour (and alpha) from these canvas-sized pixels. */
|
|
128
129
|
effect?: EffectPaintPixels | null;
|
|
130
|
+
/** Loaded sticker art, for a stamp tip of a sticker from the sticker library (`brush.stamp`); without it such a tip paints round. */
|
|
131
|
+
stampArt?: StickerArtLookup;
|
|
129
132
|
}
|
|
130
133
|
/**
|
|
131
134
|
* One dab-engine stroke (dab and eraser brushes): smoothing, the dab walk of every copy, grain and
|
|
@@ -144,12 +147,16 @@ export declare class DryStroke {
|
|
|
144
147
|
private field;
|
|
145
148
|
private lastRaw;
|
|
146
149
|
private lastFed;
|
|
150
|
+
/** The stamp tip's shape, or `null` for the round computed tip. */
|
|
151
|
+
private readonly stamp;
|
|
147
152
|
constructor(brush: PaintBrush, options: DryStrokeOptions);
|
|
148
153
|
/** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
|
|
149
154
|
push(points: readonly PenPoint[]): RasterRect[];
|
|
150
155
|
/** Ends the stroke: the smoothed path catches up with the last raw sample; a single tap paints one dab. */
|
|
151
156
|
finish(): RasterRect[];
|
|
152
157
|
private paint;
|
|
158
|
+
/** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the paper grain, effect paint. */
|
|
159
|
+
private mark;
|
|
153
160
|
}
|
|
154
161
|
/** The shared engine's tip for the Mixer Brush engine (it smooths and walks by itself, so smoothing is applied before). */
|
|
155
162
|
export declare function mixerTip(brush: PaintBrush): BrushSettings;
|
|
@@ -18,6 +18,7 @@ import { CoverageMap, type BrushSettings, type Dab, type StrokePoint } from '../
|
|
|
18
18
|
import type { RasterRect } from '../raster/surface.js';
|
|
19
19
|
import type { PaintBrush } from './brushes.js';
|
|
20
20
|
import { type EffectPaintPixels } from './effect-paint.js';
|
|
21
|
+
import type { StickerArtLookup } from './sticker-art.js';
|
|
21
22
|
import { type PaperGrain } from './paper.js';
|
|
22
23
|
/** One pen sample in document pixels. Every channel but x and y is optional. */
|
|
23
24
|
export interface PenPoint {
|
|
@@ -126,6 +127,8 @@ export interface DryStrokeOptions {
|
|
|
126
127
|
copies?: readonly StrokeCopy[];
|
|
127
128
|
/** Effect paint: each pixel takes its colour (and alpha) from these canvas-sized pixels. */
|
|
128
129
|
effect?: EffectPaintPixels | null;
|
|
130
|
+
/** Loaded sticker art, for a stamp tip of a sticker from the sticker library (`brush.stamp`); without it such a tip paints round. */
|
|
131
|
+
stampArt?: StickerArtLookup;
|
|
129
132
|
}
|
|
130
133
|
/**
|
|
131
134
|
* One dab-engine stroke (dab and eraser brushes): smoothing, the dab walk of every copy, grain and
|
|
@@ -144,12 +147,16 @@ export declare class DryStroke {
|
|
|
144
147
|
private field;
|
|
145
148
|
private lastRaw;
|
|
146
149
|
private lastFed;
|
|
150
|
+
/** The stamp tip's shape, or `null` for the round computed tip. */
|
|
151
|
+
private readonly stamp;
|
|
147
152
|
constructor(brush: PaintBrush, options: DryStrokeOptions);
|
|
148
153
|
/** Feeds raw pen samples; returns the document rectangles the new dabs touched. */
|
|
149
154
|
push(points: readonly PenPoint[]): RasterRect[];
|
|
150
155
|
/** Ends the stroke: the smoothed path catches up with the last raw sample; a single tap paints one dab. */
|
|
151
156
|
finish(): RasterRect[];
|
|
152
157
|
private paint;
|
|
158
|
+
/** Lays one mark (a dab, or a spray droplet of dab `d`): the round tip or the stamp, the paper grain, effect paint. */
|
|
159
|
+
private mark;
|
|
153
160
|
}
|
|
154
161
|
/** The shared engine's tip for the Mixer Brush engine (it smooths and walks by itself, so smoothing is applied before). */
|
|
155
162
|
export declare function mixerTip(brush: PaintBrush): BrushSettings;
|