@pixerate/editor 0.239.0 → 0.241.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-editor/index.cjs +58 -58
- package/dist/animation-editor/index.js +3 -3
- package/dist/{brushstrokeRender-WB67GMUP.js → brushstrokeRender-MOYGEXOC.js} +2 -2
- package/dist/{brushstrokeRender-MPOM7BFW.cjs → brushstrokeRender-UKADOV5D.cjs} +5 -5
- package/dist/canvas/index.cjs +8 -8
- package/dist/canvas/index.js +1 -1
- package/dist/{chunk-NKTNLJUJ.cjs → chunk-5BR7LC24.cjs} +99 -11
- package/dist/{chunk-ZXNO3ZOX.cjs → chunk-7F4G74UQ.cjs} +35 -35
- package/dist/{chunk-AD7GA3TL.cjs → chunk-AFLMXITL.cjs} +23 -23
- package/dist/{chunk-PP6BXVRL.cjs → chunk-HGGJ36HR.cjs} +1 -1
- package/dist/{chunk-BBUE3UJL.cjs → chunk-HW72ABGR.cjs} +86 -86
- package/dist/{chunk-7YGBSFC6.js → chunk-ILM6GYAX.js} +1 -1
- package/dist/{chunk-THXFU3JB.cjs → chunk-KCMV2534.cjs} +2 -2
- package/dist/{chunk-3E36VDMJ.js → chunk-NE6OOKWJ.js} +1 -1
- package/dist/{chunk-RV5DKZHU.js → chunk-QP2B3MID.js} +1 -1
- package/dist/{chunk-UUBO6RB5.js → chunk-UDBDYZET.js} +1 -1
- package/dist/{chunk-PJYG6FCF.js → chunk-XBZK47LV.js} +98 -10
- package/dist/{chunk-XK4SST43.js → chunk-ZDPLZDTT.js} +1 -1
- package/dist/image-editor/index.cjs +775 -775
- package/dist/image-editor/index.js +4 -4
- package/dist/paint-editor/controller.d.cts +158 -1
- package/dist/paint-editor/controller.d.ts +158 -1
- package/dist/paint-editor/document.d.cts +7 -2
- package/dist/paint-editor/document.d.ts +7 -2
- package/dist/paint-editor/effect-paint.d.cts +60 -3
- package/dist/paint-editor/effect-paint.d.ts +60 -3
- package/dist/paint-editor/index.cjs +1246 -430
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +888 -72
- package/dist/paint-editor/live-strokes.d.cts +24 -0
- package/dist/paint-editor/live-strokes.d.ts +24 -0
- package/dist/paint-editor/stickers.d.cts +6 -0
- package/dist/paint-editor/stickers.d.ts +6 -0
- package/dist/paint-editor/thick.d.cts +4 -0
- package/dist/paint-editor/thick.d.ts +4 -0
- package/dist/paint-editor/ui.d.cts +24 -4
- package/dist/paint-editor/ui.d.ts +24 -4
- package/dist/paint-editor/wet.d.cts +8 -0
- package/dist/paint-editor/wet.d.ts +8 -0
- package/dist/vector/index.cjs +962 -962
- package/dist/vector/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-paint-editor/SKILL.md +38 -27
- package/skills/pixerate-paint-editor/references/effect-paint.md +25 -0
|
@@ -24,12 +24,59 @@ export interface PaintEffectPaint {
|
|
|
24
24
|
values: Record<string, EffectValue>;
|
|
25
25
|
/** Which moment of an animated effect, in ms. */
|
|
26
26
|
time: number;
|
|
27
|
+
/**
|
|
28
|
+
* How the effect lies on the paint: fixed to the canvas (missing, the default), or along each
|
|
29
|
+
* stroke (`by: 'stroke'`): the effect is rendered as a strip `length` px long and 256 px across,
|
|
30
|
+
* and each pixel takes the colour at (distance along the stroke, position across the tip).
|
|
31
|
+
*/
|
|
32
|
+
map?: PaintEffectStrokeMap;
|
|
33
|
+
/**
|
|
34
|
+
* Live: on a stroke layer the stroke keeps playing the effect (each frame drawn at the editor's
|
|
35
|
+
* effect time); elsewhere it bakes the frame at `time` like any effect paint.
|
|
36
|
+
*/
|
|
37
|
+
live?: boolean;
|
|
27
38
|
}
|
|
28
|
-
/**
|
|
39
|
+
/** Effect paint laid along the stroke. */
|
|
40
|
+
export interface PaintEffectStrokeMap {
|
|
41
|
+
by: 'stroke';
|
|
42
|
+
/** Strip length: px of stroke per repeat of the effect, 16..4096. */
|
|
43
|
+
length: number;
|
|
44
|
+
/** Past the strip's end: start again, run back (mirror), or hold the last colour (clamp). */
|
|
45
|
+
repeat: 'repeat' | 'mirror' | 'clamp';
|
|
46
|
+
}
|
|
47
|
+
/** How tall a stroke-mapped effect strip is rendered (the position across the tip maps onto it). */
|
|
48
|
+
export declare const EFFECT_STRIP_HEIGHT = 256;
|
|
49
|
+
export declare const EFFECT_MAP_REPEATS: readonly ["repeat", "mirror", "clamp"];
|
|
50
|
+
/** The size an effect paint renders at: the canvas, or its strip. */
|
|
51
|
+
export declare function effectPaintSize(p: PaintEffectPaint, canvas: {
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
}): {
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
/** A stroke map checked and rounded; throws a sentence naming the bad field. */
|
|
59
|
+
export declare function readEffectStrokeMap(raw: unknown): PaintEffectStrokeMap | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Straight-alpha RGBA an effect paint was rendered to: canvas-sized, or (with `map`) the strip
|
|
62
|
+
* laid along each stroke.
|
|
63
|
+
*/
|
|
29
64
|
export interface EffectPaintPixels {
|
|
30
65
|
width: number;
|
|
31
66
|
height: number;
|
|
32
67
|
data: ArrayLike<number>;
|
|
68
|
+
map?: PaintEffectStrokeMap;
|
|
69
|
+
}
|
|
70
|
+
/** Where a dab is on its stroke, for effect paint laid along the stroke. */
|
|
71
|
+
export interface EffectDabPlace {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
/** Direction of travel, radians counter-clockwise with y up. */
|
|
75
|
+
direction: number;
|
|
76
|
+
/** The tip's radius (px): the position across the tip maps onto the strip's height. */
|
|
77
|
+
radius: number;
|
|
78
|
+
/** Path length (px) travelled to the dab. */
|
|
79
|
+
travel: number;
|
|
33
80
|
}
|
|
34
81
|
/** The cache key of an effect paint (the same source renders the same pixels). */
|
|
35
82
|
export declare function effectPaintKey(p: PaintEffectPaint): string;
|
|
@@ -42,6 +89,16 @@ export declare function readPaintEffectPaint(raw: unknown): PaintEffectPaint | n
|
|
|
42
89
|
* document rectangle) with the effect's colour at each pixel and multiplies `vals` by its alpha.
|
|
43
90
|
* Pixels off the canvas paint nothing.
|
|
44
91
|
*/
|
|
45
|
-
export declare function sampleEffectField(img: EffectPaintPixels, rect: RasterRect, vals: Float32Array, field: Float32Array): void;
|
|
92
|
+
export declare function sampleEffectField(img: EffectPaintPixels, rect: RasterRect, vals: Float32Array, field: Float32Array, dab?: EffectDabPlace | null): void;
|
|
46
93
|
/** The effect's colour (sRGB 0..1 into `out`) at a document point; returns its alpha 0..1 (0 off the canvas). */
|
|
47
|
-
export declare function sampleEffectAt(img: EffectPaintPixels, x: number, y: number, out: [number, number, number]): number;
|
|
94
|
+
export declare function sampleEffectAt(img: EffectPaintPixels, x: number, y: number, out: [number, number, number], dab?: EffectDabPlace | null): number;
|
|
95
|
+
/**
|
|
96
|
+
* Effect colours for one dab of a brush that mixes paint (wet and impasto brushes): fills `field`
|
|
97
|
+
* (sRGB 0..1, 3 per pixel of `rect`) with the effect's colour at each pixel, shifted by how far the
|
|
98
|
+
* brush's mixed paint (`mixed`) moved from the effect's colour at the dab's centre (`centre`, which
|
|
99
|
+
* the brush was loaded with), so paint the brush picked up still drags through the pattern. A clean
|
|
100
|
+
* brush paints the effect's colours exactly. `cov` is multiplied by the effect's alpha, rounded to
|
|
101
|
+
* `steps` levels when given (wet paint keeps its coverage on fixed steps so replays are exact).
|
|
102
|
+
* `dab` places it on its stroke, for effect paint laid along the stroke.
|
|
103
|
+
*/
|
|
104
|
+
export declare function effectDabField(img: EffectPaintPixels, rect: RasterRect, cov: Float32Array, centre: readonly [number, number, number], mixed: readonly [number, number, number], field: Float32Array, steps?: number, dab?: EffectDabPlace | null): void;
|