@pixerate/editor 0.280.0 → 0.282.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 +59 -59
- package/dist/animation-editor/index.js +3 -3
- package/dist/brushes/index.cjs +76 -71
- package/dist/brushes/index.js +13 -8
- package/dist/brushes/schema.d.cts +1 -0
- package/dist/brushes/schema.d.ts +1 -0
- package/dist/brushes/types.d.cts +29 -3
- package/dist/brushes/types.d.ts +29 -3
- package/dist/{brushstrokeRender-EIK3625T.js → brushstrokeRender-4MA5CBW3.js} +3 -3
- package/dist/{brushstrokeRender-7HOMKZNO.cjs → brushstrokeRender-JVKVKWDA.cjs} +15 -15
- package/dist/canvas/edge-animation-tools.d.cts +115 -0
- package/dist/canvas/edge-animation-tools.d.ts +115 -0
- package/dist/canvas/edgeAnimation.d.cts +164 -0
- package/dist/canvas/edgeAnimation.d.ts +164 -0
- package/dist/canvas/edgePaths.d.cts +63 -0
- package/dist/canvas/edgePaths.d.ts +63 -0
- package/dist/canvas/index.cjs +691 -21
- package/dist/canvas/index.d.cts +3 -0
- package/dist/canvas/index.d.ts +3 -0
- package/dist/canvas/index.js +679 -9
- package/dist/{chunk-NJDEKU5D.js → chunk-2YGYYVSG.js} +1 -1
- package/dist/{chunk-JVFGK3DK.cjs → chunk-3JUKN3RM.cjs} +76 -53
- package/dist/{chunk-HN57I7KT.js → chunk-CG3FBNXE.js} +1 -1
- package/dist/{chunk-WFSYZO5Z.cjs → chunk-DFZ4I7EZ.cjs} +1 -1
- package/dist/{chunk-LZE2QZCT.js → chunk-IHMMHZGP.js} +1 -1
- package/dist/{chunk-K4ANWBF7.cjs → chunk-IJQ2YH2M.cjs} +35 -35
- package/dist/{chunk-HRUK5TFW.cjs → chunk-IUKPQCYQ.cjs} +164 -71
- package/dist/{chunk-WCC4NXWY.cjs → chunk-JD63B33V.cjs} +86 -86
- package/dist/{chunk-NJLPW4MM.js → chunk-KV7QHPKL.js} +27 -4
- package/dist/{chunk-H3EME3S5.cjs → chunk-MRIAR5DY.cjs} +2 -2
- package/dist/{chunk-ROURHJYT.js → chunk-NEDS6DSC.js} +1 -1
- package/dist/{chunk-FKO3CY2C.js → chunk-ULPXJ3NB.js} +1 -1
- package/dist/{chunk-WZYRYYXN.cjs → chunk-UOM5S4W5.cjs} +12 -12
- package/dist/{chunk-YOM76H2V.js → chunk-VEX6YVNG.js} +1 -1
- package/dist/{chunk-MNHP3AQT.cjs → chunk-WEXWDBUF.cjs} +23 -23
- package/dist/{chunk-PPDUCZZV.js → chunk-YRGTQLDN.js} +122 -29
- package/dist/image-editor/index.cjs +788 -788
- package/dist/image-editor/index.js +4 -4
- package/dist/paint-editor/antimatter.d.cts +154 -0
- package/dist/paint-editor/antimatter.d.ts +154 -0
- package/dist/paint-editor/brush-controls.d.cts +1 -0
- package/dist/paint-editor/brush-controls.d.ts +1 -0
- package/dist/paint-editor/brush-model.d.cts +9 -5
- package/dist/paint-editor/brush-model.d.ts +9 -5
- package/dist/paint-editor/controller.d.cts +23 -0
- package/dist/paint-editor/controller.d.ts +23 -0
- package/dist/paint-editor/index.cjs +1931 -891
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +1098 -58
- package/dist/paint-editor/mark-settings.d.cts +30 -0
- package/dist/paint-editor/mark-settings.d.ts +30 -0
- package/dist/paint-editor/stroke.d.cts +16 -0
- package/dist/paint-editor/stroke.d.ts +16 -0
- package/dist/paint-editor/strokes.d.cts +2 -0
- package/dist/paint-editor/strokes.d.ts +2 -0
- package/dist/paint-editor/ui.d.cts +4 -2
- package/dist/paint-editor/ui.d.ts +4 -2
- package/dist/vector/index.cjs +999 -999
- package/dist/vector/index.js +4 -4
- package/package.json +1 -1
- package/skills/pixerate-brushes/SKILL.md +1 -1
- package/skills/pixerate-canvas/SKILL.md +25 -2
- package/skills/pixerate-paint-editor/SKILL.md +8 -2
- package/skills/pixerate-paint-editor/references/antimatter.md +49 -0
- package/skills/pixerate-paint-editor/references/brush-facets.md +1 -0
|
@@ -102,3 +102,33 @@ export interface BristleSettings {
|
|
|
102
102
|
}
|
|
103
103
|
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
104
104
|
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
105
|
+
/** How antimatter blasts invert paint colour: `rgb` (channel complement) or `oklab` (flips lightness and hue so mid-grey changes too). */
|
|
106
|
+
export type InvertMode = 'rgb' | 'oklab';
|
|
107
|
+
export declare const INVERT_MODES: readonly InvertMode[];
|
|
108
|
+
/** Antimatter engine settings. */
|
|
109
|
+
export interface AntimatterSettings {
|
|
110
|
+
/** Blast size, in tip radii (1..6, default 2.5). */
|
|
111
|
+
blastRadius: number;
|
|
112
|
+
/** Stroke travel between blasts, in tip diameters (0.5..8, default 2). */
|
|
113
|
+
blastSpacing: number;
|
|
114
|
+
/** Paint needed under the tip to fire (0..1, default 0.1). */
|
|
115
|
+
threshold: number;
|
|
116
|
+
/** Strength of the colour inversion in the blast core (0..1, default 1). */
|
|
117
|
+
invert: number;
|
|
118
|
+
/** Colour inversion mode: `rgb` (default) or `oklab` (flips lightness and hue). */
|
|
119
|
+
invertMode: InvertMode;
|
|
120
|
+
/** Strength of the soot ring around the blast (0..1, default 0.6). */
|
|
121
|
+
scorch: number;
|
|
122
|
+
/** Paint destroyed at the centre — alpha removed (0..1, default 0.25). */
|
|
123
|
+
annihilate: number;
|
|
124
|
+
/** How many sparks fly out from each blast (0..1, default 0.5). */
|
|
125
|
+
sparks: number;
|
|
126
|
+
/** How far sparks fly, in tip diameters (0.5..8, default 3). */
|
|
127
|
+
sparkReach: number;
|
|
128
|
+
/** Depth of the dent and raised rim on layers with relief (0..1, default 0.5). */
|
|
129
|
+
crater: number;
|
|
130
|
+
/** Seconds a blast plays on screen (0..2, default 0.7; 0 shows the result at once). */
|
|
131
|
+
duration: number;
|
|
132
|
+
}
|
|
133
|
+
export declare const DEFAULT_ANTIMATTER: Readonly<AntimatterSettings>;
|
|
134
|
+
export declare function normalizeAntimatter(raw?: Partial<AntimatterSettings>, base?: AntimatterSettings): AntimatterSettings;
|
|
@@ -102,3 +102,33 @@ export interface BristleSettings {
|
|
|
102
102
|
}
|
|
103
103
|
export declare const DEFAULT_BRISTLE: Readonly<BristleSettings>;
|
|
104
104
|
export declare function normalizeBristle(raw?: Partial<BristleSettings>, base?: BristleSettings): BristleSettings;
|
|
105
|
+
/** How antimatter blasts invert paint colour: `rgb` (channel complement) or `oklab` (flips lightness and hue so mid-grey changes too). */
|
|
106
|
+
export type InvertMode = 'rgb' | 'oklab';
|
|
107
|
+
export declare const INVERT_MODES: readonly InvertMode[];
|
|
108
|
+
/** Antimatter engine settings. */
|
|
109
|
+
export interface AntimatterSettings {
|
|
110
|
+
/** Blast size, in tip radii (1..6, default 2.5). */
|
|
111
|
+
blastRadius: number;
|
|
112
|
+
/** Stroke travel between blasts, in tip diameters (0.5..8, default 2). */
|
|
113
|
+
blastSpacing: number;
|
|
114
|
+
/** Paint needed under the tip to fire (0..1, default 0.1). */
|
|
115
|
+
threshold: number;
|
|
116
|
+
/** Strength of the colour inversion in the blast core (0..1, default 1). */
|
|
117
|
+
invert: number;
|
|
118
|
+
/** Colour inversion mode: `rgb` (default) or `oklab` (flips lightness and hue). */
|
|
119
|
+
invertMode: InvertMode;
|
|
120
|
+
/** Strength of the soot ring around the blast (0..1, default 0.6). */
|
|
121
|
+
scorch: number;
|
|
122
|
+
/** Paint destroyed at the centre — alpha removed (0..1, default 0.25). */
|
|
123
|
+
annihilate: number;
|
|
124
|
+
/** How many sparks fly out from each blast (0..1, default 0.5). */
|
|
125
|
+
sparks: number;
|
|
126
|
+
/** How far sparks fly, in tip diameters (0.5..8, default 3). */
|
|
127
|
+
sparkReach: number;
|
|
128
|
+
/** Depth of the dent and raised rim on layers with relief (0..1, default 0.5). */
|
|
129
|
+
crater: number;
|
|
130
|
+
/** Seconds a blast plays on screen (0..2, default 0.7; 0 shows the result at once). */
|
|
131
|
+
duration: number;
|
|
132
|
+
}
|
|
133
|
+
export declare const DEFAULT_ANTIMATTER: Readonly<AntimatterSettings>;
|
|
134
|
+
export declare function normalizeAntimatter(raw?: Partial<AntimatterSettings>, base?: AntimatterSettings): AntimatterSettings;
|
|
@@ -22,6 +22,7 @@ import { type PaperGrain } from './paper.cjs';
|
|
|
22
22
|
import { type Sticker } from './stickers.cjs';
|
|
23
23
|
import type { StickerArtLookup } from './sticker-art.cjs';
|
|
24
24
|
import type { StickerRef, StickerVariant } from '../stickers/types.cjs';
|
|
25
|
+
import { AntimatterStrokeDriver, type AntimatterLayerOutput, type AntimatterStats, type AntimatterTarget } from './antimatter.cjs';
|
|
25
26
|
import type { DualColor } from '../color/dual.cjs';
|
|
26
27
|
export interface StrokeSessionHost {
|
|
27
28
|
/** Shows the layer's live surface (no history); `rects` are where it changed. */
|
|
@@ -124,6 +125,14 @@ export interface StrokeSessionInit {
|
|
|
124
125
|
ferro?: {
|
|
125
126
|
surface: TiledSurface;
|
|
126
127
|
} | null;
|
|
128
|
+
/**
|
|
129
|
+
* Antimatter paint: all visible fuel layers before the stroke (with `editable: true` on editable
|
|
130
|
+
* pixel layers), and the clock for blast playback.
|
|
131
|
+
*/
|
|
132
|
+
antimatter?: {
|
|
133
|
+
targets: readonly AntimatterTarget[];
|
|
134
|
+
now?: () => number;
|
|
135
|
+
} | null;
|
|
127
136
|
}
|
|
128
137
|
export interface PaintStrokeResult {
|
|
129
138
|
layerId: string;
|
|
@@ -138,6 +147,8 @@ export interface PaintStrokeResult {
|
|
|
138
147
|
wet?: boolean;
|
|
139
148
|
/** Sticker brushes: refs the spray picked but skipped because their art had not loaded yet. */
|
|
140
149
|
skippedStickers?: string[];
|
|
150
|
+
/** Antimatter paint: blasts fired, sparks spawned, fuel measured, and which layers changed or were skipped. */
|
|
151
|
+
antimatter?: AntimatterStats;
|
|
141
152
|
}
|
|
142
153
|
export declare class PaintStrokeSession {
|
|
143
154
|
private readonly host;
|
|
@@ -155,6 +166,7 @@ export declare class PaintStrokeSession {
|
|
|
155
166
|
private thickDriver;
|
|
156
167
|
private filmBuffer;
|
|
157
168
|
private stickerSpray;
|
|
169
|
+
private antimatter;
|
|
158
170
|
/** Light paint: the stroke's twin over the light channel, and what it left there. */
|
|
159
171
|
private readonly lightTwin;
|
|
160
172
|
private lightResult;
|
|
@@ -207,6 +219,10 @@ export declare class PaintStrokeSession {
|
|
|
207
219
|
get open(): boolean;
|
|
208
220
|
/** Adds raw pen samples (document pixels). */
|
|
209
221
|
push(points: readonly PenPoint[]): void;
|
|
222
|
+
/** Antimatter strokes: per-layer outputs (pixel surface, light channel, thick channels) after the stroke so far. */
|
|
223
|
+
antimatterOutputs(): AntimatterLayerOutput[] | null;
|
|
224
|
+
/** Antimatter strokes: the driver, used to play blast animations after commit. */
|
|
225
|
+
antimatterDriver(): AntimatterStrokeDriver | null;
|
|
210
226
|
/** Sticker strokes: the stickers sprayed so far. */
|
|
211
227
|
stickers(): Sticker[] | null;
|
|
212
228
|
/** Impasto or iridescent strokes: the layer's thick-paint channels with the stroke so far. */
|
|
@@ -22,6 +22,7 @@ import { type PaperGrain } from './paper.js';
|
|
|
22
22
|
import { type Sticker } from './stickers.js';
|
|
23
23
|
import type { StickerArtLookup } from './sticker-art.js';
|
|
24
24
|
import type { StickerRef, StickerVariant } from '../stickers/types.js';
|
|
25
|
+
import { AntimatterStrokeDriver, type AntimatterLayerOutput, type AntimatterStats, type AntimatterTarget } from './antimatter.js';
|
|
25
26
|
import type { DualColor } from '../color/dual.js';
|
|
26
27
|
export interface StrokeSessionHost {
|
|
27
28
|
/** Shows the layer's live surface (no history); `rects` are where it changed. */
|
|
@@ -124,6 +125,14 @@ export interface StrokeSessionInit {
|
|
|
124
125
|
ferro?: {
|
|
125
126
|
surface: TiledSurface;
|
|
126
127
|
} | null;
|
|
128
|
+
/**
|
|
129
|
+
* Antimatter paint: all visible fuel layers before the stroke (with `editable: true` on editable
|
|
130
|
+
* pixel layers), and the clock for blast playback.
|
|
131
|
+
*/
|
|
132
|
+
antimatter?: {
|
|
133
|
+
targets: readonly AntimatterTarget[];
|
|
134
|
+
now?: () => number;
|
|
135
|
+
} | null;
|
|
127
136
|
}
|
|
128
137
|
export interface PaintStrokeResult {
|
|
129
138
|
layerId: string;
|
|
@@ -138,6 +147,8 @@ export interface PaintStrokeResult {
|
|
|
138
147
|
wet?: boolean;
|
|
139
148
|
/** Sticker brushes: refs the spray picked but skipped because their art had not loaded yet. */
|
|
140
149
|
skippedStickers?: string[];
|
|
150
|
+
/** Antimatter paint: blasts fired, sparks spawned, fuel measured, and which layers changed or were skipped. */
|
|
151
|
+
antimatter?: AntimatterStats;
|
|
141
152
|
}
|
|
142
153
|
export declare class PaintStrokeSession {
|
|
143
154
|
private readonly host;
|
|
@@ -155,6 +166,7 @@ export declare class PaintStrokeSession {
|
|
|
155
166
|
private thickDriver;
|
|
156
167
|
private filmBuffer;
|
|
157
168
|
private stickerSpray;
|
|
169
|
+
private antimatter;
|
|
158
170
|
/** Light paint: the stroke's twin over the light channel, and what it left there. */
|
|
159
171
|
private readonly lightTwin;
|
|
160
172
|
private lightResult;
|
|
@@ -207,6 +219,10 @@ export declare class PaintStrokeSession {
|
|
|
207
219
|
get open(): boolean;
|
|
208
220
|
/** Adds raw pen samples (document pixels). */
|
|
209
221
|
push(points: readonly PenPoint[]): void;
|
|
222
|
+
/** Antimatter strokes: per-layer outputs (pixel surface, light channel, thick channels) after the stroke so far. */
|
|
223
|
+
antimatterOutputs(): AntimatterLayerOutput[] | null;
|
|
224
|
+
/** Antimatter strokes: the driver, used to play blast animations after commit. */
|
|
225
|
+
antimatterDriver(): AntimatterStrokeDriver | null;
|
|
210
226
|
/** Sticker strokes: the stickers sprayed so far. */
|
|
211
227
|
stickers(): Sticker[] | null;
|
|
212
228
|
/** Impasto or iridescent strokes: the layer's thick-paint channels with the stroke so far. */
|
|
@@ -49,6 +49,8 @@ export interface RecordedStroke {
|
|
|
49
49
|
* readers), or effect paint (the effect it took its colours from; replays render it first).
|
|
50
50
|
*/
|
|
51
51
|
paint?: PaintGradientSource | PaintEffectPaint;
|
|
52
|
+
/** Antimatter brushes: the visible fuel layer ids at the time of the stroke, so a replay reads fuel from (and changes) exactly the same layers. */
|
|
53
|
+
targets?: string[];
|
|
52
54
|
}
|
|
53
55
|
export declare function applyAffine(m: Affine, x: number, y: number): {
|
|
54
56
|
x: number;
|
|
@@ -49,6 +49,8 @@ export interface RecordedStroke {
|
|
|
49
49
|
* readers), or effect paint (the effect it took its colours from; replays render it first).
|
|
50
50
|
*/
|
|
51
51
|
paint?: PaintGradientSource | PaintEffectPaint;
|
|
52
|
+
/** Antimatter brushes: the visible fuel layer ids at the time of the stroke, so a replay reads fuel from (and changes) exactly the same layers. */
|
|
53
|
+
targets?: string[];
|
|
52
54
|
}
|
|
53
55
|
export declare function applyAffine(m: Affine, x: number, y: number): {
|
|
54
56
|
x: number;
|
|
@@ -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, LivePatternKind } from './brushes.cjs';
|
|
13
|
+
import type { ImpastoTool, InvertMode, 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';
|
|
@@ -156,7 +156,7 @@ export declare function guideOverlay(controller: PaintEditorController, drag?: {
|
|
|
156
156
|
to: Point2;
|
|
157
157
|
kind: GuideOverlayKind;
|
|
158
158
|
}>;
|
|
159
|
-
export { BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, IRIDESCENCE_SLIDERS, multiColorSliders, MUTATION_SLIDERS, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.cjs';
|
|
159
|
+
export { ANTIMATTER_SLIDERS, BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, IRIDESCENCE_SLIDERS, multiColorSliders, MUTATION_SLIDERS, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.cjs';
|
|
160
160
|
import type { SliderControl } from './brush-controls.cjs';
|
|
161
161
|
export declare const PAPER_SLIDERS: readonly SliderControl[];
|
|
162
162
|
/** Reads `a.b` from an object. */
|
|
@@ -274,6 +274,8 @@ export declare const PARTICLE_RENDER_LABELS: Readonly<Record<ParticleRender, str
|
|
|
274
274
|
export declare const RIBBON_PAIR_LABELS: Readonly<Record<RibbonPairs, string>>;
|
|
275
275
|
export declare const DOT_TEXTURE_ORDER_LABELS: Readonly<Record<DotTextureOrder, string>>;
|
|
276
276
|
export declare const DOT_ROTATION_LABELS: Readonly<Record<DotRotation, string>>;
|
|
277
|
+
/** Labels of the antimatter colour inversion modes. */
|
|
278
|
+
export declare const INVERT_MODE_LABELS: Readonly<Record<InvertMode, string>>;
|
|
277
279
|
/** Labels of the sticker stamps. */
|
|
278
280
|
export declare const STAMP_LABELS: Readonly<Record<StampKind, string>>;
|
|
279
281
|
/** Toggles one stamp in a sticker brush's set (never leaving it empty). */
|
|
@@ -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, LivePatternKind } from './brushes.js';
|
|
13
|
+
import type { ImpastoTool, InvertMode, 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';
|
|
@@ -156,7 +156,7 @@ export declare function guideOverlay(controller: PaintEditorController, drag?: {
|
|
|
156
156
|
to: Point2;
|
|
157
157
|
kind: GuideOverlayKind;
|
|
158
158
|
}>;
|
|
159
|
-
export { BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, IRIDESCENCE_SLIDERS, multiColorSliders, MUTATION_SLIDERS, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.js';
|
|
159
|
+
export { ANTIMATTER_SLIDERS, BRUSH_SLIDERS, brushEngineControls, GHOST_SLIDERS, IRIDESCENCE_SLIDERS, multiColorSliders, MUTATION_SLIDERS, patchBrushValue, type BrushEngineControls, type SliderControl } from './brush-controls.js';
|
|
160
160
|
import type { SliderControl } from './brush-controls.js';
|
|
161
161
|
export declare const PAPER_SLIDERS: readonly SliderControl[];
|
|
162
162
|
/** Reads `a.b` from an object. */
|
|
@@ -274,6 +274,8 @@ export declare const PARTICLE_RENDER_LABELS: Readonly<Record<ParticleRender, str
|
|
|
274
274
|
export declare const RIBBON_PAIR_LABELS: Readonly<Record<RibbonPairs, string>>;
|
|
275
275
|
export declare const DOT_TEXTURE_ORDER_LABELS: Readonly<Record<DotTextureOrder, string>>;
|
|
276
276
|
export declare const DOT_ROTATION_LABELS: Readonly<Record<DotRotation, string>>;
|
|
277
|
+
/** Labels of the antimatter colour inversion modes. */
|
|
278
|
+
export declare const INVERT_MODE_LABELS: Readonly<Record<InvertMode, string>>;
|
|
277
279
|
/** Labels of the sticker stamps. */
|
|
278
280
|
export declare const STAMP_LABELS: Readonly<Record<StampKind, string>>;
|
|
279
281
|
/** Toggles one stamp in a sticker brush's set (never leaving it empty). */
|