@pixerate/editor 0.125.0 → 0.127.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/animation/index.d.cts +2 -3
- package/dist/animation/index.d.ts +2 -3
- package/dist/animation-editor/index.cjs +71 -73
- package/dist/animation-editor/index.cjs.map +1 -1
- package/dist/animation-editor/index.d.cts +6 -8
- package/dist/animation-editor/index.d.ts +6 -8
- package/dist/animation-editor/index.js +11 -13
- package/dist/animation-editor/index.js.map +1 -1
- package/dist/{bezier-CBzKKDjl.d.cts → bezier-DBz0IgEt.d.cts} +22 -2
- package/dist/{bezier-CWv6LQal.d.ts → bezier-DWI5MEkI.d.ts} +22 -2
- package/dist/{brushstrokeRender-LRV7GXGD.js → brushstrokeRender-7RUITO42.js} +3 -3
- package/dist/{brushstrokeRender-EELTV7U4.cjs → brushstrokeRender-OW6ENCZG.cjs} +7 -7
- package/dist/{brushstrokeRender-EELTV7U4.cjs.map → brushstrokeRender-OW6ENCZG.cjs.map} +1 -1
- package/dist/canvas/index.cjs +423 -37
- package/dist/canvas/index.cjs.map +1 -1
- package/dist/canvas/index.d.cts +189 -11
- package/dist/canvas/index.d.ts +189 -11
- package/dist/canvas/index.js +395 -9
- package/dist/canvas/index.js.map +1 -1
- package/dist/{chunk-7LQO6OHH.cjs → chunk-33SO3QWP.cjs} +4 -4
- package/dist/{chunk-7LQO6OHH.cjs.map → chunk-33SO3QWP.cjs.map} +1 -1
- package/dist/{chunk-MPQAO33O.js → chunk-A6KHMKI4.js} +3 -3
- package/dist/{chunk-V5YGPRCZ.cjs → chunk-BEGEWQHD.cjs} +41 -41
- package/dist/{chunk-V5YGPRCZ.cjs.map → chunk-BEGEWQHD.cjs.map} +1 -1
- package/dist/{chunk-N3FVUOZD.cjs → chunk-BJTCSLF6.cjs} +7 -7
- package/dist/{chunk-N3FVUOZD.cjs.map → chunk-BJTCSLF6.cjs.map} +1 -1
- package/dist/{chunk-WUDPFWAN.js → chunk-F7Q2NE2Y.js} +3 -3
- package/dist/{chunk-G6WXWS4Y.js → chunk-FICSDDDF.js} +2 -2
- package/dist/{chunk-GUZ47CJM.cjs → chunk-IZ4WRXZA.cjs} +1 -1
- package/dist/{chunk-GUZ47CJM.cjs.map → chunk-IZ4WRXZA.cjs.map} +1 -1
- package/dist/{chunk-QDJKUBWE.cjs → chunk-JODTP4DP.cjs} +176 -5
- package/dist/chunk-JODTP4DP.cjs.map +1 -0
- package/dist/{chunk-GLWZXQ4Q.js → chunk-KHNZ6MOU.js} +1 -1
- package/dist/chunk-KHNZ6MOU.js.map +1 -0
- package/dist/{chunk-GCJWMEYW.cjs → chunk-KSJLDRHK.cjs} +46 -46
- package/dist/{chunk-GCJWMEYW.cjs.map → chunk-KSJLDRHK.cjs.map} +1 -1
- package/dist/{chunk-QQKTOA4U.cjs → chunk-ORE334I6.cjs} +132 -132
- package/dist/{chunk-QQKTOA4U.cjs.map → chunk-ORE334I6.cjs.map} +1 -1
- package/dist/{chunk-X6KTSFAE.js → chunk-Q4NBEVV5.js} +2 -2
- package/dist/{chunk-XZWOLXWA.js → chunk-QFSTQHZY.js} +174 -3
- package/dist/chunk-QFSTQHZY.js.map +1 -0
- package/dist/{chunk-FPRIUR4T.js → chunk-ROZFX4QI.js} +3 -3
- package/dist/{chunk-UXFI3CDZ.cjs → chunk-SFCPGMCT.cjs} +8 -8
- package/dist/{chunk-UXFI3CDZ.cjs.map → chunk-SFCPGMCT.cjs.map} +1 -1
- package/dist/{chunk-J67OLQUQ.js → chunk-UABQTYQF.js} +3 -3
- package/dist/{chunk-O5RVCDEC.cjs → chunk-XLUYXUBD.cjs} +88 -88
- package/dist/{chunk-O5RVCDEC.cjs.map → chunk-XLUYXUBD.cjs.map} +1 -1
- package/dist/{chunk-FG274FYT.js → chunk-YGJIER2R.js} +2 -2
- package/dist/effects/index.cjs +32 -34
- package/dist/effects/index.cjs.map +1 -1
- package/dist/effects/index.d.cts +6 -38
- package/dist/effects/index.d.ts +6 -38
- package/dist/effects/index.js +3 -5
- package/dist/effects/index.js.map +1 -1
- package/dist/evaluate-BbCeF6pt.d.ts +114 -0
- package/dist/evaluate-BsxYieLN.d.cts +114 -0
- package/dist/{export-DVl4fWy5.d.cts → export-Cbr9IqpJ.d.cts} +1 -1
- package/dist/{export-Bp7ji2r4.d.cts → export-CcldobdN.d.cts} +3 -3
- package/dist/{export-C1s4eolZ.d.ts → export-ClPKUB-v.d.ts} +1 -1
- package/dist/{export-DAyPY94f.d.ts → export-PGhOpDmz.d.ts} +3 -3
- package/dist/{helpers-i95Ob6Vi.d.cts → helpers-C5aAd44p.d.cts} +67 -4
- package/dist/{helpers-BBLlekuM.d.ts → helpers-CPWcK504.d.ts} +67 -4
- package/dist/image-editor/index.cjs +619 -621
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +9 -11
- package/dist/image-editor/index.d.ts +9 -11
- package/dist/image-editor/index.js +6 -8
- package/dist/image-editor/index.js.map +1 -1
- package/dist/{opentype-14PDI5D2.d.ts → opentype-01rMIuQR.d.ts} +1 -1
- package/dist/{opentype-D80AVmMu.d.cts → opentype-BgqvmGT-.d.cts} +1 -1
- package/dist/paint-editor/index.cjs +737 -117
- package/dist/paint-editor/index.cjs.map +1 -1
- package/dist/paint-editor/index.d.cts +248 -13
- package/dist/paint-editor/index.d.ts +248 -13
- package/dist/paint-editor/index.js +635 -15
- package/dist/paint-editor/index.js.map +1 -1
- package/dist/{pathfinder-DjISxkUv.d.ts → pathfinder-D-h0Imus.d.ts} +1 -1
- package/dist/{pathfinder-C0UoFypx.d.cts → pathfinder-DgG0Z9Lr.d.cts} +1 -1
- package/dist/{player-cGLrngL_.d.ts → player-BK2kKbfd.d.ts} +1 -1
- package/dist/{player-CBtEoU2x.d.cts → player-CmbY3218.d.cts} +1 -1
- package/dist/pool-C7GtrL34.d.cts +34 -0
- package/dist/pool-CTrtciaN.d.ts +34 -0
- package/dist/{svg-DJKriJ4A.d.ts → svg-BRLwcibA.d.ts} +2 -3
- package/dist/{svg-BkRL-fZJ.d.cts → svg-DLBBPQP9.d.cts} +2 -3
- package/dist/{tools-CM8Oe8F3.d.ts → tools-AugT22z3.d.ts} +1 -1
- package/dist/{tools-DZCv2kX1.d.cts → tools-BpCmUNxb.d.cts} +1 -1
- package/dist/vector/index.cjs +923 -925
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.d.cts +10 -12
- package/dist/vector/index.d.ts +10 -12
- package/dist/vector/index.js +11 -13
- package/dist/vector/index.js.map +1 -1
- package/dist/video-editor/index.cjs +269 -271
- package/dist/video-editor/index.cjs.map +1 -1
- package/dist/video-editor/index.d.cts +6 -8
- package/dist/video-editor/index.d.ts +6 -8
- package/dist/video-editor/index.js +3 -5
- package/dist/video-editor/index.js.map +1 -1
- package/dist/{warp-CH9MM435.d.cts → warp-C13L_GRn.d.cts} +1 -1
- package/dist/{warp-k_PdtXOG.d.ts → warp-q8FK5HHi.d.ts} +1 -1
- package/package.json +1 -1
- package/skills/pixerate-canvas/SKILL.md +19 -0
- package/skills/pixerate-paint-editor/SKILL.md +40 -1
- package/dist/behavior-Ymbld6jL.d.cts +0 -60
- package/dist/behavior-Ymbld6jL.d.ts +0 -60
- package/dist/chunk-GLWZXQ4Q.js.map +0 -1
- package/dist/chunk-IOXKXQNW.cjs +0 -178
- package/dist/chunk-IOXKXQNW.cjs.map +0 -1
- package/dist/chunk-QDJKUBWE.cjs.map +0 -1
- package/dist/chunk-TGKT5QAB.js +0 -178
- package/dist/chunk-TGKT5QAB.js.map +0 -1
- package/dist/chunk-XZWOLXWA.js.map +0 -1
- package/dist/evaluate-2S3vSPLy.d.cts +0 -55
- package/dist/evaluate-CfmT6xA3.d.ts +0 -55
- package/dist/gradient-KDfCvhuj.d.cts +0 -66
- package/dist/gradient-KDfCvhuj.d.ts +0 -66
- /package/dist/{brushstrokeRender-LRV7GXGD.js.map → brushstrokeRender-7RUITO42.js.map} +0 -0
- /package/dist/{chunk-MPQAO33O.js.map → chunk-A6KHMKI4.js.map} +0 -0
- /package/dist/{chunk-WUDPFWAN.js.map → chunk-F7Q2NE2Y.js.map} +0 -0
- /package/dist/{chunk-G6WXWS4Y.js.map → chunk-FICSDDDF.js.map} +0 -0
- /package/dist/{chunk-X6KTSFAE.js.map → chunk-Q4NBEVV5.js.map} +0 -0
- /package/dist/{chunk-FPRIUR4T.js.map → chunk-ROZFX4QI.js.map} +0 -0
- /package/dist/{chunk-J67OLQUQ.js.map → chunk-UABQTYQF.js.map} +0 -0
- /package/dist/{chunk-FG274FYT.js.map → chunk-YGJIER2R.js.map} +0 -0
|
@@ -3,21 +3,19 @@ import { D as Dab, C as CoverageMap, B as BrushSettings, e as StrokePoint, g as
|
|
|
3
3
|
export { v as DEFAULT_FLOW, w as DEFAULT_PAINT_GRADIENT, x as DEFAULT_PAINT_GRADIENT_MAPPING, y as DEFAULT_WET_PARAMS, z as MAX_BRUSH_SIZE, A as PAINT_COLOR_JSON_SCHEMA, E as PAINT_GRADIENT_FULL_SPEED, F as PAINT_GRADIENT_JSON_SCHEMA, G as PAINT_GRADIENT_KIT, H as PAINT_GRADIENT_MAPPINGS, I as PAINT_GRADIENT_MAPPING_LABELS, J as PAINT_GRADIENT_PRESETS, K as PAINT_GRADIENT_REPEATS, L as PAINT_GRADIENT_REPEAT_LABELS, N as PAINT_GRADIENT_SPACES, O as PAINT_GRADIENT_SPACE_LABELS, Q as PAINT_SOURCE_JSON_SCHEMA, U as PaintColorSource, V as PaintDabParams, X as PaintGradientKit, Y as PaintGradientMapping, Z as PaintGradientMappingKind, _ as PaintGradientRepeat, $ as PaintGradientSample, a0 as PaintGradientSampler, a1 as PaintGradientSpace, a2 as PaintGradientStop, a3 as PaintRgb, a4 as PaintSourceError, a5 as WET_FLOW_KINDS, a6 as WET_PARAM_KEYS, a7 as WetFlowKind, a8 as WetSupport, a9 as addPaintGradientStop, aa as hash2, ab as hexToPaintRgb, ac as isGradientPaint, ad as mix32, ae as normalizeFlow, af as normalizeHexColor, ag as normalizeWetParams, ah as paintGradientMappingFor, ai as paintSourceColor, aj as paintSourceCss, ak as parsePaintSource, al as rand01, am as readPaintSource, an as removePaintGradientStop, ao as resolvePaintGradient, ap as reversePaintGradient, aq as scalePaintGradient, ar as solidPaint, as as updatePaintGradientStop, at as wetSupport } from '../rand-DtazXGOB.js';
|
|
4
4
|
import { R as RasterRect, T as TiledSurface, a as BlendMode, b as BlendModeInfo } from '../surface-1MRncXpF.js';
|
|
5
5
|
export { B as BLEND_MODES, P as PAINTERLY_BLEND_MODES, i as Tile, v as isBlendMode, w as isPainterlyBlendMode, I as standardBlendMode } from '../surface-1MRncXpF.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { e as EffectValue, E as EffectProvider, f as EffectDescription, a as EffectRenderRequest, b as EffectPixels, v as EffectsSlot } from '../helpers-CPWcK504.js';
|
|
7
|
+
import { I as ImageEditorAssetStore, S as SerializedLayer, P as PsdExportResult } from '../export-PGhOpDmz.js';
|
|
8
|
+
import { V as VideoProject, D as VideoFfmpegExport } from '../export-ClPKUB-v.js';
|
|
8
9
|
import { g as PresenceStore, e as PresenceClock, d as PresenceActorInfo, c as PresenceActor, f as PresenceState } from '../presence-Cb6WhcrQ.js';
|
|
9
10
|
import { a as AgentToolProvider, A as AgentTool } from '../registry-D-4fit9C.js';
|
|
10
11
|
import '../types-CwMPoRMU.js';
|
|
11
|
-
import '../builtin-CY97ppKM.js';
|
|
12
|
-
import '../bezier-CWv6LQal.js';
|
|
13
|
-
import '../brushTypes-IG7ZZjIN.js';
|
|
14
|
-
import '../gradient-KDfCvhuj.js';
|
|
15
|
-
import '../warp-k_PdtXOG.js';
|
|
16
|
-
import '../helpers-BBLlekuM.js';
|
|
17
12
|
import '../schema-Di0CS6Pe.js';
|
|
18
|
-
import '../
|
|
13
|
+
import '../evaluate-BbCeF6pt.js';
|
|
19
14
|
import '../easing-lM0Xo9Ni.js';
|
|
20
|
-
import '../
|
|
15
|
+
import '../builtin-CY97ppKM.js';
|
|
16
|
+
import '../bezier-DWI5MEkI.js';
|
|
17
|
+
import '../brushTypes-IG7ZZjIN.js';
|
|
18
|
+
import '../warp-q8FK5HHi.js';
|
|
21
19
|
|
|
22
20
|
/**
|
|
23
21
|
* Seeded, deterministic noise for paper grain and brush jitter (photocraft's counter-based
|
|
@@ -1448,6 +1446,96 @@ declare function thickToJSON(ch: ThickChannels): SavedThickChannels | null;
|
|
|
1448
1446
|
/** Saved form → channels; throws a sentence when it cannot be read. */
|
|
1449
1447
|
declare function thickFromJSON(raw: unknown): ThickChannels;
|
|
1450
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* Provider effects in the paint editor (see `@pixerate/editor/effects`):
|
|
1451
|
+
*
|
|
1452
|
+
* - **Effect paper**: a generator drawn over the paper, under the paint (multiplied by default, so
|
|
1453
|
+
* the paper's grain and colour still show). It is part of the document: undo, save and export.
|
|
1454
|
+
* - **Effect layers**: pixel layers drawn by a generator, overlay or title effect. The layer keeps
|
|
1455
|
+
* its effect, so it can be drawn again with new values; painting on it works as on any layer.
|
|
1456
|
+
* - **Effect fills**: a generator, overlay or title effect composited onto a layer's pixels.
|
|
1457
|
+
* - **Light on dried paint**: a filter effect (light, glow, grade) run on a layer's paint and baked
|
|
1458
|
+
* in. Wet paint is dried first, in the same undo step; thick paint keeps its relief.
|
|
1459
|
+
*
|
|
1460
|
+
* Effects render asynchronously, so each change renders first and commits after (one undo step).
|
|
1461
|
+
*/
|
|
1462
|
+
|
|
1463
|
+
/** Which uses each place in the paint editor takes. */
|
|
1464
|
+
declare const PAINT_EFFECT_PLACES: {
|
|
1465
|
+
/** Effect paper: drawn over the whole sheet. */
|
|
1466
|
+
readonly paper: readonly ["generator"];
|
|
1467
|
+
/** An effect layer: drawn at the canvas size. */
|
|
1468
|
+
readonly layer: readonly ["generator", "overlay", "title"];
|
|
1469
|
+
/** An effect fill: composited onto a layer's pixels. */
|
|
1470
|
+
readonly fill: readonly ["generator", "overlay", "title"];
|
|
1471
|
+
/** Light (or any filter) on a layer's dried paint. */
|
|
1472
|
+
readonly light: readonly ["filter"];
|
|
1473
|
+
};
|
|
1474
|
+
type PaintEffectPlace = keyof typeof PAINT_EFFECT_PLACES;
|
|
1475
|
+
/** Refuses an effect that cannot go in `place`, saying what to use instead. */
|
|
1476
|
+
declare function checkPaintEffectPlace(d: EffectDescription, place: PaintEffectPlace): void;
|
|
1477
|
+
/** The provider effect a layer or the paper is drawn from. */
|
|
1478
|
+
interface PaintEffectSource {
|
|
1479
|
+
effect: string;
|
|
1480
|
+
/** The provider's id when it was drawn. */
|
|
1481
|
+
provider?: string;
|
|
1482
|
+
/** The effect's name when it was drawn (for placeholders without the provider). */
|
|
1483
|
+
name?: string;
|
|
1484
|
+
/** Every control value. */
|
|
1485
|
+
values: Record<string, EffectValue>;
|
|
1486
|
+
/** Which moment of an animated effect, in ms (missing: 0). */
|
|
1487
|
+
time?: number;
|
|
1488
|
+
}
|
|
1489
|
+
/** Blend modes effect paper draws with. */
|
|
1490
|
+
declare const PAPER_EFFECT_BLENDS: readonly ["multiply", "normal", "overlay", "soft-light", "screen", "color"];
|
|
1491
|
+
type PaperEffectBlend = (typeof PAPER_EFFECT_BLENDS)[number];
|
|
1492
|
+
/** Effect paper: its effect, how it is drawn over the sheet, and its rendered pixels. */
|
|
1493
|
+
interface PaintPaperEffect extends PaintEffectSource {
|
|
1494
|
+
/** 0..1 (default 1). */
|
|
1495
|
+
opacity: number;
|
|
1496
|
+
/** How it draws over the paper (default `multiply`, which keeps the paper's grain and colour). */
|
|
1497
|
+
blend: PaperEffectBlend;
|
|
1498
|
+
/** Canvas-sized straight-alpha RGBA. */
|
|
1499
|
+
image: {
|
|
1500
|
+
width: number;
|
|
1501
|
+
height: number;
|
|
1502
|
+
data: Uint8ClampedArray;
|
|
1503
|
+
};
|
|
1504
|
+
/** Changes whenever the pixels change (render caches key on it). */
|
|
1505
|
+
version: number;
|
|
1506
|
+
}
|
|
1507
|
+
/** A new version number for effect paper pixels. */
|
|
1508
|
+
declare function nextPaperEffectVersion(): number;
|
|
1509
|
+
/** Over-composites `top` onto `base` at `opacity` (straight alpha, same size). */
|
|
1510
|
+
declare function overPixels(base: Uint8ClampedArray, top: ArrayLike<number>, opacity?: number): Uint8ClampedArray;
|
|
1511
|
+
/** Mixes `after` back towards `before` by `1 - amount` (for a filter at partial strength), keeping `before`'s alpha. */
|
|
1512
|
+
declare function mixPixels(before: Uint8ClampedArray, after: ArrayLike<number>, amount: number): Uint8ClampedArray;
|
|
1513
|
+
/**
|
|
1514
|
+
* Renders effects for one paint editor through a small renderer pool (GPU providers hold a
|
|
1515
|
+
* graphics context per renderer). Output always has the asked size.
|
|
1516
|
+
*/
|
|
1517
|
+
declare class PaintEffectsRenderer {
|
|
1518
|
+
private readonly pool;
|
|
1519
|
+
private readonly descriptions;
|
|
1520
|
+
private provider;
|
|
1521
|
+
/** Forgets cached descriptions and renderers when the provider changes. */
|
|
1522
|
+
follow(provider: EffectProvider | null): void;
|
|
1523
|
+
describe(provider: EffectProvider, id: string): Promise<EffectDescription>;
|
|
1524
|
+
render(provider: EffectProvider, id: string, size: {
|
|
1525
|
+
width: number;
|
|
1526
|
+
height: number;
|
|
1527
|
+
}, request: EffectRenderRequest): Promise<EffectPixels>;
|
|
1528
|
+
dispose(): void;
|
|
1529
|
+
}
|
|
1530
|
+
/** A saved effect source, or `null` when it is not one. */
|
|
1531
|
+
declare function readPaintEffectSource(raw: unknown): PaintEffectSource | null;
|
|
1532
|
+
/** Effect paper as saved: its settings and its pixels as a PNG data URL. */
|
|
1533
|
+
declare function paperEffectToJSON(p: PaintPaperEffect): Record<string, unknown>;
|
|
1534
|
+
/** Reads saved effect paper for a `width × height` canvas (throws saying what is wrong). */
|
|
1535
|
+
declare function paperEffectFromJSON(raw: unknown, width: number, height: number): PaintPaperEffect;
|
|
1536
|
+
/** Effect layers as saved (layer id → effect). */
|
|
1537
|
+
declare function effectLayersToJSON(map: Readonly<Record<string, PaintEffectSource>>, keep: (id: string) => boolean): Record<string, PaintEffectSource> | undefined;
|
|
1538
|
+
|
|
1451
1539
|
/**
|
|
1452
1540
|
* The paint editor's document: a canvas (size and resolution), a paper, and the shared raster
|
|
1453
1541
|
* layer stack (`@pixerate/editor/raster`: pixel layers and groups with masks, clipping, locks and
|
|
@@ -1489,6 +1577,10 @@ interface PaintDocumentState {
|
|
|
1489
1577
|
stickers?: Readonly<Record<string, Sticker[]>>;
|
|
1490
1578
|
/** Thick paint: each layer's height and material channels (layers without relief are missing). */
|
|
1491
1579
|
thick?: Readonly<Record<string, ThickChannels>>;
|
|
1580
|
+
/** Effect layers: the provider effect each one is drawn from (layers that are gone are ignored). */
|
|
1581
|
+
effectLayers?: Readonly<Record<string, PaintEffectSource>>;
|
|
1582
|
+
/** Effect paper: a provider generator drawn over the paper, under the paint. */
|
|
1583
|
+
paperEffect?: PaintPaperEffect;
|
|
1492
1584
|
}
|
|
1493
1585
|
/** A change a replay repeats besides strokes, recorded with how many strokes came before it. */
|
|
1494
1586
|
interface PaintEvent {
|
|
@@ -1742,14 +1834,14 @@ interface PaperNode extends CompositorLayer {
|
|
|
1742
1834
|
elevation: number;
|
|
1743
1835
|
};
|
|
1744
1836
|
}
|
|
1745
|
-
/**
|
|
1837
|
+
/** An RGBA image under the paint (the tracing image, effect paper), drawn at its opacity and blend. */
|
|
1746
1838
|
interface ImageNode extends CompositorLayer {
|
|
1747
1839
|
type: 'image';
|
|
1748
1840
|
id: string;
|
|
1749
1841
|
name: string;
|
|
1750
1842
|
visible: boolean;
|
|
1751
1843
|
opacity: number;
|
|
1752
|
-
blend:
|
|
1844
|
+
blend: string;
|
|
1753
1845
|
/** Canvas-sized RGBA. */
|
|
1754
1846
|
image: {
|
|
1755
1847
|
width: number;
|
|
@@ -1762,6 +1854,7 @@ interface ImageNode extends CompositorLayer {
|
|
|
1762
1854
|
type ViewLayer = PaintLayer | PaperNode | ImageNode;
|
|
1763
1855
|
declare const PAPER_NODE_ID = "__paper";
|
|
1764
1856
|
declare const TRACING_NODE_ID = "__tracing";
|
|
1857
|
+
declare const PAPER_EFFECT_NODE_ID = "__paper_effect";
|
|
1765
1858
|
declare function paperKey(p: PaperSettings, light?: {
|
|
1766
1859
|
azimuth: number;
|
|
1767
1860
|
elevation: number;
|
|
@@ -2516,6 +2609,10 @@ declare class PaintEditorController {
|
|
|
2516
2609
|
private liveThick;
|
|
2517
2610
|
/** Set while an operation that changes wet paint runs: the simulation before it (for undo). */
|
|
2518
2611
|
private wetOp;
|
|
2612
|
+
/** The effects provider slot (see `setEffectsProvider`). */
|
|
2613
|
+
readonly effects: EffectsSlot;
|
|
2614
|
+
private readonly effectsRenderer;
|
|
2615
|
+
private paperEffectNodeCache;
|
|
2519
2616
|
constructor(options?: PaintEditorOptions);
|
|
2520
2617
|
subscribe(listener: () => void): () => void;
|
|
2521
2618
|
private emit;
|
|
@@ -2529,6 +2626,11 @@ declare class PaintEditorController {
|
|
|
2529
2626
|
takeDirty(): RasterRect[] | 'all';
|
|
2530
2627
|
private requireIdle;
|
|
2531
2628
|
private commit;
|
|
2629
|
+
/**
|
|
2630
|
+
* Commits `next` as a new undo step, or with `commitToHistory` false folds it into the last step
|
|
2631
|
+
* when that step has the same label (the later values of one slider drag).
|
|
2632
|
+
*/
|
|
2633
|
+
private commitOrAmend;
|
|
2532
2634
|
/** Keeps the wet snapshots in history within the wet undo memory, dropping the oldest. */
|
|
2533
2635
|
private trimWetHistory;
|
|
2534
2636
|
/** Throws when wet paint is mid-step (a batch in worker threads); `wetIdle()` waits for it. */
|
|
@@ -2606,6 +2708,117 @@ declare class PaintEditorController {
|
|
|
2606
2708
|
bounds: RasterRect;
|
|
2607
2709
|
};
|
|
2608
2710
|
private applyCoverage;
|
|
2711
|
+
/** The registered effects provider, or `null`. */
|
|
2712
|
+
get effectsProvider(): EffectProvider | null;
|
|
2713
|
+
/** Registers (or with `null` removes) the effects provider. Not an edit: no undo step. */
|
|
2714
|
+
setEffectsProvider(provider: EffectProvider | null): void;
|
|
2715
|
+
/** Registers `provider` and returns a function that removes it again (if it is still the one set). */
|
|
2716
|
+
useEffects(provider: EffectProvider): () => void;
|
|
2717
|
+
/** The provider's description of an effect, checked for `place` (rejects without a provider or for an unknown id). */
|
|
2718
|
+
describeEffect(effect: string, place?: PaintEffectPlace): Promise<EffectDescription>;
|
|
2719
|
+
/** Every effect layer (top first) with its effect. */
|
|
2720
|
+
listEffectLayers(): {
|
|
2721
|
+
layerId: string;
|
|
2722
|
+
name: string;
|
|
2723
|
+
source: PaintEffectSource;
|
|
2724
|
+
}[];
|
|
2725
|
+
/** The effect a layer is drawn from, or `undefined` for other layers. */
|
|
2726
|
+
getEffectLayer(layerId: string): PaintEffectSource | undefined;
|
|
2727
|
+
/** The effect paper (without its pixels), or `null`. */
|
|
2728
|
+
getPaperEffect(): Omit<PaintPaperEffect, 'image' | 'version'> | null;
|
|
2729
|
+
/** Values over `base` (`null` resets a control to its default), checked against the effect's controls. */
|
|
2730
|
+
private effectValues;
|
|
2731
|
+
/** Renders a generator, overlay or title effect at the canvas size. */
|
|
2732
|
+
private renderEffectCanvas;
|
|
2733
|
+
private sourceOf;
|
|
2734
|
+
private checkTime;
|
|
2735
|
+
private checkOpacity;
|
|
2736
|
+
/** A pixel layer that takes effect pixels: unlocked, visible, no sticker layer, no wet paint. */
|
|
2737
|
+
private effectTarget;
|
|
2738
|
+
/** After an effect rendered: the layer must be as it was when the render started. */
|
|
2739
|
+
private sameLayerAfterRender;
|
|
2740
|
+
/** The canvas rectangle in a layer's own coordinates. */
|
|
2741
|
+
private canvasRectOf;
|
|
2742
|
+
/**
|
|
2743
|
+
* Sets the effect paper: a provider generator drawn over the paper and under the paint, at the
|
|
2744
|
+
* canvas size (`multiply` by default, so the paper's colour and grain still show). `null` removes
|
|
2745
|
+
* it. One undo step. Returns the effect paper (without pixels), or `null`.
|
|
2746
|
+
*/
|
|
2747
|
+
setPaperEffect(effect: string | null, options?: {
|
|
2748
|
+
values?: Record<string, EffectValue>;
|
|
2749
|
+
opacity?: number;
|
|
2750
|
+
blend?: PaperEffectBlend;
|
|
2751
|
+
time?: number;
|
|
2752
|
+
}): Promise<ReturnType<PaintEditorController['getPaperEffect']>>;
|
|
2753
|
+
/**
|
|
2754
|
+
* Changes the effect paper: new control `values` (merged over its own; `null` resets one) or
|
|
2755
|
+
* `time` draw it again at the canvas size; `opacity` and `blend` only change how it is drawn.
|
|
2756
|
+
* One undo step; with `commitToHistory` false it joins the previous effect paper step (a slider
|
|
2757
|
+
* drag). Returns the effect paper (without pixels).
|
|
2758
|
+
*/
|
|
2759
|
+
updatePaperEffect(changes: {
|
|
2760
|
+
values?: Record<string, EffectValue | null>;
|
|
2761
|
+
opacity?: number;
|
|
2762
|
+
blend?: PaperEffectBlend;
|
|
2763
|
+
time?: number;
|
|
2764
|
+
}, commitToHistory?: boolean): Promise<NonNullable<ReturnType<PaintEditorController['getPaperEffect']>>>;
|
|
2765
|
+
/**
|
|
2766
|
+
* Adds an effect layer above the active layer (or `aboveId`): a pixel layer drawn by a provider
|
|
2767
|
+
* generator, overlay or title effect at the canvas size. It keeps its effect, so
|
|
2768
|
+
* `updateEffectLayer` draws it again. One undo step. Returns the layer and its effect.
|
|
2769
|
+
*/
|
|
2770
|
+
addEffectLayer(effect: string, options?: {
|
|
2771
|
+
values?: Record<string, EffectValue>;
|
|
2772
|
+
name?: string;
|
|
2773
|
+
aboveId?: string;
|
|
2774
|
+
opacity?: number;
|
|
2775
|
+
blend?: BlendMode;
|
|
2776
|
+
time?: number;
|
|
2777
|
+
}): Promise<{
|
|
2778
|
+
layer: PaintLayerInfo;
|
|
2779
|
+
source: PaintEffectSource;
|
|
2780
|
+
}>;
|
|
2781
|
+
/**
|
|
2782
|
+
* Draws an effect layer again with new `values` (merged over its own; `null` resets one) or
|
|
2783
|
+
* `time`, at the canvas size, replacing its pixels (paint on it is lost). One undo step; with
|
|
2784
|
+
* `commitToHistory` false it joins the previous effect layer step (a slider drag).
|
|
2785
|
+
*/
|
|
2786
|
+
updateEffectLayer(layerId: string, changes: {
|
|
2787
|
+
values?: Record<string, EffectValue | null>;
|
|
2788
|
+
time?: number;
|
|
2789
|
+
}, commitToHistory?: boolean): Promise<PaintEffectSource>;
|
|
2790
|
+
/** Turns an effect layer into a plain pixel layer, keeping its pixels (one undo step). */
|
|
2791
|
+
rasterizeEffectLayer(layerId: string): PaintLayerInfo;
|
|
2792
|
+
/**
|
|
2793
|
+
* Fills a layer with a provider generator, overlay or title effect: its pixels, rendered at the
|
|
2794
|
+
* canvas size, are composited onto the layer's paint at `opacity` (only where it is already
|
|
2795
|
+
* painted with `lockTransparency`, or when the layer's transparency is locked). One undo step.
|
|
2796
|
+
*/
|
|
2797
|
+
fillLayerWithEffect(effect: string, options?: {
|
|
2798
|
+
layerId?: string;
|
|
2799
|
+
values?: Record<string, EffectValue>;
|
|
2800
|
+
opacity?: number;
|
|
2801
|
+
time?: number;
|
|
2802
|
+
lockTransparency?: boolean;
|
|
2803
|
+
}): Promise<{
|
|
2804
|
+
layerId: string;
|
|
2805
|
+
source: PaintEffectSource;
|
|
2806
|
+
}>;
|
|
2807
|
+
/**
|
|
2808
|
+
* Runs a filter effect (light, glow, colour grade …) on a layer's dried paint and bakes it in, at
|
|
2809
|
+
* `amount` strength (0..1, default 1). Transparent areas stay transparent; thick paint keeps its
|
|
2810
|
+
* relief, and an effect with a `height` input gets the relief as a height map. Wet paint is
|
|
2811
|
+
* refused (dry it first). One undo step.
|
|
2812
|
+
*/
|
|
2813
|
+
applyLightEffect(layerId: string | undefined, effect: string, options?: {
|
|
2814
|
+
values?: Record<string, EffectValue>;
|
|
2815
|
+
amount?: number;
|
|
2816
|
+
time?: number;
|
|
2817
|
+
}): Promise<{
|
|
2818
|
+
layerId: string;
|
|
2819
|
+
source: PaintEffectSource;
|
|
2820
|
+
amount: number;
|
|
2821
|
+
}>;
|
|
2609
2822
|
private findBrush;
|
|
2610
2823
|
/** A library brush by id (`undefined` when unknown). */
|
|
2611
2824
|
getBrush(id: string): PaintBrush | undefined;
|
|
@@ -2864,6 +3077,8 @@ declare class PaintEditorController {
|
|
|
2864
3077
|
private currentLayers;
|
|
2865
3078
|
/** View-only layers between the paper and the paint (the painting guides add the tracing image). */
|
|
2866
3079
|
protected underlayLayers(): ViewLayer[];
|
|
3080
|
+
/** The effect paper as a compositor layer (one object per effect paper, so caches hold). */
|
|
3081
|
+
private paperEffectNode;
|
|
2867
3082
|
/** The tracing image resampled onto the canvas (cached until it or the canvas changes). */
|
|
2868
3083
|
private tracingNode;
|
|
2869
3084
|
/** The layers with every wet layer dried where it is (what saving and exporting see). */
|
|
@@ -3496,4 +3711,24 @@ declare function createPaintReplayTools(c: PaintEditorController): AgentTool[];
|
|
|
3496
3711
|
|
|
3497
3712
|
declare function createPaintStickerTools(c: PaintEditorController): AgentTool[];
|
|
3498
3713
|
|
|
3499
|
-
|
|
3714
|
+
/**
|
|
3715
|
+
* Agent tools for provider effects in the paint editor: the shared effect tools, where
|
|
3716
|
+
* `apply_effect` runs a filter (light, glow, grade) on a layer's dried paint and bakes it in, and
|
|
3717
|
+
* the target `paper` is the effect paper; plus `set_paper_effect`, `add_effect_layer` and
|
|
3718
|
+
* `fill_layer_with_effect`.
|
|
3719
|
+
*/
|
|
3720
|
+
|
|
3721
|
+
interface PaintEffectsToolProviderOptions {
|
|
3722
|
+
/** Provider id (unique per registry). Default `paint-effects`. */
|
|
3723
|
+
id?: string;
|
|
3724
|
+
/** Always prefix tool names with `<namespace>__`. */
|
|
3725
|
+
namespace?: string;
|
|
3726
|
+
/** The painting cannot be edited: write tools are hidden. A string is the reason. */
|
|
3727
|
+
readOnly?: boolean | string | (() => boolean | string);
|
|
3728
|
+
}
|
|
3729
|
+
/** The target id of the effect paper. */
|
|
3730
|
+
declare const PAPER_TARGET = "paper";
|
|
3731
|
+
/** The effect tools for a paint editor (see the module comment). */
|
|
3732
|
+
declare function createPaintEffectsToolProvider(controller: PaintEditorController, options?: PaintEffectsToolProviderOptions): AgentToolProvider;
|
|
3733
|
+
|
|
3734
|
+
export { type Affine, BLEND_MENU_GROUPS, BRUSH_ID, BRUSH_ROTATIONS, BRUSH_SLIDERS, BUILTIN_BRUSHES, type BlendMenuGroup, BlendMode, BlendModeInfo, type BristleSettings, BristleStroke, type BrushBehavior, type BrushBehaviorInput, type BrushDynamics, type BrushEngineControls, type BrushLibraryFile, type BrushRotation, type BrushThumbnail, type ColorWheel, type CoverageStroke, DEFAULT_BEHAVIOR, DEFAULT_BRISTLE, DEFAULT_BRUSH_ID, DEFAULT_DPI, DEFAULT_DYNAMICS, DEFAULT_IMPASTO, DEFAULT_LIGHTING, DEFAULT_MULTI_COLOR, DEFAULT_PAPER, DEFAULT_PARTICLE, DEFAULT_STICKER, DEFAULT_SWATCHES, DEFAULT_VIEW, DEFAULT_WET_BRUSH, DryStroke, type DryStrokeOptions, type FillLayerOptions, GPU_LEAD, GRAIN_PATTERNS, GRAIN_TILE, type GrainPattern, type GrainTuning, HARMONY_KINDS, type Hand, type HarmonyColor, type HarmonyKind, IDENTITY_AFFINE, IDENTITY_COPY, IMPASTO_TOOLS, IMPASTO_TOOL_LABELS, type ImageEncoder, type ImageFormat, type ImageNode, type ImpastoSettings, type ImpastoTool, LIGHT_SLIDERS, type LayerUpdate, type Linear2, LitCache, type LoadedPaintDocument, MAX_CANVAS_SIDE, MAX_COORDINATE, MAX_IMAGE_SIDE, MAX_ZOOM, MIN_CANVAS_SIDE, MIN_ZOOM, MIXING_PAD_HEIGHT, MIXING_PAD_WIDTH, MULTI_COLOR_MODES, MixingPad, type MixingPadTool, type MultiColorMode, type MultiColorSettings, PAD_SAMPLE_SIZES, PAINT_BRUSH_CATEGORIES, PAINT_BRUSH_ENGINES, PAINT_EFFECT_PLACES, PAINT_FORMAT, PAINT_SCHEMA_VERSION, PAINT_TOOLS, PAPER_EFFECT_BLENDS, PAPER_EFFECT_NODE_ID, PAPER_FAMILIES, PAPER_LIBRARY, PAPER_NODE_ID, PAPER_SLIDERS, PAPER_TARGET, PARTICLE_KINDS, PARTICLE_KIND_LABELS, PARTICLE_RENDERS, PARTICLE_RENDER_LABELS, type PadMixOptions, type PadMixPart, type Paint2DContext, type PaintAgentCommand, type PaintAssetStore, type PaintBrush, type PaintBrushCategory, type PaintBrushEngine, type PaintBrushInput, type PaintCanvas, PaintCanvasPresenter, PaintDabStroke, type PaintDabStrokeOptions, PaintDirector, type PaintDirectorOptions, PaintDocumentError, type PaintDocumentExtensions, type PaintDocumentState, PaintEditorController, PaintEditorError, type PaintEditorOptions, type PaintEditorState, type PaintEditorToolProviderOptions, type PaintEffectPlace, type PaintEffectSource, PaintEffectsRenderer, type PaintEffectsToolProviderOptions, type PaintEvent, PaintGesture, PaintGradientSource, type PaintGroupLayer, type PaintGuides, type PaintLayer, type PaintLayerInfo, type PaintLighting, type PaintPaperEffect, type PaintPerformanceResult, type PaintPixelLayer, type PaintPointerEvent, PaintPresence, type PaintPresenceActor, type PaintPresenceState, type PaintReplayOptions, PaintSource, type PaintStrokeInit, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type PaintView, type PaintWetHost, PaintWetLayers, type PaintWetOptions, type PaintWetStateInfo, type PaperEffectBlend, type PaperFamily, PaperGrain, type PaperNode, type PaperSettings, type PaperTiling, type ParticleKind, type ParticleRender, type ParticleSettings, ParticleStroke, type PenDab, PenDabWalker, type PenPoint, PenSmoother, type PerspectiveGuide, PerspectiveSnapper, type PixelImage, type Point2, type PointerSample, type ProceduralStrokeOptions, type RecordedStroke, type ReferenceImage, type RenderOptions, type ReplayFrame, type ReplayOptions, type Rgb255, SNAP_DECIDE_DISTANCE, STAMP_KINDS, STAMP_LABELS, STENCIL_KINDS, STENCIL_SHAPES, STICKER_SLIDERS, SYMMETRY_MODES, type SavedMixingPadInfo, type SavedThickChannels, type SerializeOptions, type SerializedPaintDocument, type SliderControl, type StampKind, type Stencil, type StencilInput, type StencilKind, type StencilShape, StencilSnapper, type Sticker, type StickerSettings, StickerSpray, type StickerSprayInit, type StrokeCopy, type StrokeSessionHost, type StrokeSessionInit, type StrokeVariation, type Swatch, type SymmetryGuide, type SymmetryMode, TRACING_NODE_ID, type ThickChannels, ThickStrokeDriver, type ThickStrokeInit, TileableNoise, type TimeLapse, type TimeLapseOptions, type TracingImage, type ViewLayer, type ViewportBox, WET_GPU_MODES, WET_GPU_OPTIONS, WET_MEDIA, WET_MEDIUM_LABELS, WET_MEDIUM_PARAMS, WET_PARAM_SCHEMA, WET_PARAM_SLIDERS, WET_SPEED_SLIDER, WET_TILT_SLIDERS, WET_TOOLS, WET_TOOL_LABELS, WetBackendInfo, type WetBrushSettings, type WetEngineInfo, type WetEvent, WetFlowSpec, type WetGpuMode, type WetLayerInfo, type WetLayerSettings, type WetMediumKind, WetParams, WetStrokeDriver, type WetStrokeInit, WetTilt, type WetTool, affineCopy, applyAffine, brushEngineControls, brushLoadColor, brushLoadForStroke, brushTakesPaint, brushToJSON, buildTimeLapse, checkPaintEffectPlace, clonePaper, colorHarmony, composeAffine, contactSheet, createPaintCompositor, createPaintDocument, createPaintEditorToolProvider, createPaintEffectsToolProvider, createPaintLayer, createPaintReplayTools, createPaintStickerTools, createPaintThickTools, createPaintWetTools, decodeImageBlob, defaultGuides, defaultImageEncoder, deserializePaintDocument, deserializePaintDocumentAsync, documentExtensions, documentToScreen, downloadBytes, downsampleRgba, drawSticker, drawWaterOverlay, effectLayersToJSON, emptiedLayers, emptyThickChannels, fitZoom, grainCatch, grainHeights, guideOverlay, handlePaintShortcut, hexToRgb8, hslToRgb, hsvToRgb, hueToWheel, invertAffine, isPalmTouch, isWetBrush, isWetCapable, lightTile, lightingKey, mapPenPoint, mixPixels, mixerLoadForStroke, mixerTip, multiColorForDab, multiColorGradient, multiColorPalette, multiColorSliders, multiColorToPaint, newPaintLayerId, nextPaperEffectVersion, normalizeBehavior, normalizeBristle, normalizeBrushStroke, normalizeCanvas, normalizeDynamics, normalizeImpasto, normalizeLighting, normalizeMultiColor, normalizePaintBrush, normalizePaper, normalizeParticle, normalizePerspective, normalizeRotation, normalizeStencil, normalizeStickerSettings, normalizeStickerUpdate, normalizeSymmetry, normalizeView, normalizeWetBrush, overPixels, padSampleRadius, paintToMultiColor, paperEffectFromJSON, paperEffectToJSON, paperGrain, paperKey, paperNode, paperPreset, parseBrushLibrary, parseHexColor, patchBrushValue, patchPath, penOrientation, perspectiveDirections, perspectiveGuideLines, pointerToPenPoint, quickStencil, randSigned, readPaintEffectSource, readPath, readSwatch, reliefInfo, renderBrushThumbnail, renderColorWheel, renderPaper, renderStickers, replayFrame, replayItems, replayPainting, rgbToHexColor, rgbToHsl, rgbToHsv, samplePressure, scaleStencil, screenToDocument, seedFromString, serializePaintDocument, serializePaintDocumentExternal, stampCoverage, startWetClock, stencilMask, stencilOutline, stickerRect, stickerSurface, strokeBounds, strokeDuration, strokeSchedule, sweepPath, symmetryAxisAngles, symmetryAxisSegments, symmetryCopies, thickFromJSON, thickToJSON, thumbnailStroke, tiltToOrientation, timeLapseVideo, timeLapseZip, toStrokePoint, toggleStamp, usesPaintExchange, variationAffine, varyStroke, viewCssTransform, viewMatrix, viewPenToDocument, wetEngineSummary, wetPaperInput, wetPigmentOf, wheelAngle, wheelPick, wheelPoint, wheelToHue };
|