@pixerate/editor 0.201.0 → 0.203.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 +2 -2
- package/dist/agent/index.js +1 -1
- package/dist/{chunk-GLQQ2VIL.cjs → chunk-53GOGBTM.cjs} +23 -1
- package/dist/{chunk-3TNA7JKI.js → chunk-ZPJEH456.js} +22 -0
- package/dist/commands/builtins.d.cts +6 -0
- package/dist/commands/builtins.d.ts +6 -0
- package/dist/commands/index.cjs +4 -2
- package/dist/commands/index.js +4 -2
- package/dist/image-editor/controller.d.cts +24 -1
- package/dist/image-editor/controller.d.ts +24 -1
- package/dist/image-editor/index.cjs +226 -171
- package/dist/image-editor/index.js +78 -23
- package/dist/image-editor/selection/segmentation.d.cts +7 -0
- package/dist/image-editor/selection/segmentation.d.ts +7 -0
- package/dist/paint-editor/guide-tools.d.cts +2 -2
- package/dist/paint-editor/guide-tools.d.ts +2 -2
- package/dist/paint-editor/hosted.d.cts +34 -0
- package/dist/paint-editor/hosted.d.ts +34 -0
- package/dist/paint-editor/index.cjs +101 -10
- package/dist/paint-editor/index.d.cts +1 -0
- package/dist/paint-editor/index.d.ts +1 -0
- package/dist/paint-editor/index.js +96 -5
- package/dist/paint-editor/sticker-tools.d.cts +2 -2
- package/dist/paint-editor/sticker-tools.d.ts +2 -2
- package/dist/paint-editor/thick-tools.d.cts +2 -2
- package/dist/paint-editor/thick-tools.d.ts +2 -2
- package/dist/paint-editor/tools.d.cts +19 -2
- package/dist/paint-editor/tools.d.ts +19 -2
- package/dist/paint-editor/wet-tools.d.cts +2 -2
- package/dist/paint-editor/wet-tools.d.ts +2 -2
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +2 -2
- package/skills/pixerate-paint-editor/SKILL.md +9 -0
package/dist/agent/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
var _chunkSOSBOS5Tcjs = require('../chunk-SOSBOS5T.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk53GOGBTMcjs = require('../chunk-53GOGBTM.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
@@ -2107,7 +2107,7 @@ function createCanvasComponentToolProvider(controller, options = { id: "canvas-c
|
|
|
2107
2107
|
({ id }) => check(controller.restoreMainComponent(id))
|
|
2108
2108
|
)
|
|
2109
2109
|
];
|
|
2110
|
-
if (
|
|
2110
|
+
if (_chunk53GOGBTMcjs.hasVariantCommands.call(void 0, controller)) {
|
|
2111
2111
|
const SET = { type: "string", description: "Component set, or one of its variants (default: the selection\u2019s set)." };
|
|
2112
2112
|
const VARIANT = { type: "string", description: "Variant id (default: the first selected variant)." };
|
|
2113
2113
|
const VALUES = { type: "object", additionalProperties: { type: "string" }, description: 'Variant property \u2192 value, e.g. { "Size": "Medium" }.' };
|
package/dist/agent/index.js
CHANGED
|
@@ -283,6 +283,26 @@ var BRUSH_PAINT_PARAM = {
|
|
|
283
283
|
}
|
|
284
284
|
]
|
|
285
285
|
};
|
|
286
|
+
function planFreehandPlayback(points, max = 32) {
|
|
287
|
+
if (!Array.isArray(points)) return null;
|
|
288
|
+
const all = points.filter((p) => Array.isArray(p) && Number.isFinite(p[0]) && Number.isFinite(p[1])).map(([x, y]) => ({ x, y }));
|
|
289
|
+
if (!all.length) return null;
|
|
290
|
+
const step = (all.length - 1) / (max - 1);
|
|
291
|
+
const picked = all.length <= max ? all : Array.from({ length: max }, (_, i) => all[Math.round(i * step)]);
|
|
292
|
+
const [first, ...rest] = picked;
|
|
293
|
+
const gap = (p, i) => {
|
|
294
|
+
const prev = i ? rest[i - 1] : first;
|
|
295
|
+
return Math.hypot(p.x - prev.x, p.y - prev.y);
|
|
296
|
+
};
|
|
297
|
+
const total = rest.reduce((sum, p, i) => sum + gap(p, i), 0);
|
|
298
|
+
return [
|
|
299
|
+
{ type: "move", to: first },
|
|
300
|
+
{ type: "press", gesture: "path" },
|
|
301
|
+
...rest.map((p, i) => ({ type: "drag", to: p, ms: total > 0 ? Math.max(16, 900 * gap(p, i) / total) : 16 })),
|
|
302
|
+
{ type: "release" },
|
|
303
|
+
{ type: "commit" }
|
|
304
|
+
];
|
|
305
|
+
}
|
|
286
306
|
function createDrawCommands(target, options = {}) {
|
|
287
307
|
const prefix = _nullishCoalesce(options.prefix, () => ( "canvas."));
|
|
288
308
|
const group = _nullishCoalesce(options.group, () => ( "Draw"));
|
|
@@ -323,6 +343,7 @@ function createDrawCommands(target, options = {}) {
|
|
|
323
343
|
}
|
|
324
344
|
},
|
|
325
345
|
enabled: () => _optionalChain([options, 'access', _29 => _29.readOnlyReason, 'optionalCall', _30 => _30()]) || true,
|
|
346
|
+
plan: (_ctx, params) => planFreehandPlayback(params.points),
|
|
326
347
|
run: (_ctx, params) => target.drawStroke({
|
|
327
348
|
points: params.points,
|
|
328
349
|
...params.tool ? { tool: params.tool } : {},
|
|
@@ -676,4 +697,5 @@ function createSpreadsheetCommands(controller, options = {}) {
|
|
|
676
697
|
|
|
677
698
|
|
|
678
699
|
|
|
679
|
-
|
|
700
|
+
|
|
701
|
+
exports.DEFAULT_HISTORY_SHORTCUTS = DEFAULT_HISTORY_SHORTCUTS; exports.createHistoryCommands = createHistoryCommands; exports.matchHistoryShortcut = matchHistoryShortcut; exports.createArrangeCommands = createArrangeCommands; exports.createShapeCommands = createShapeCommands; exports.planFreehandPlayback = planFreehandPlayback; exports.createDrawCommands = createDrawCommands; exports.hasVariantCommands = hasVariantCommands; exports.createComponentCommands = createComponentCommands; exports.createSpreadsheetCommands = createSpreadsheetCommands;
|
|
@@ -283,6 +283,26 @@ var BRUSH_PAINT_PARAM = {
|
|
|
283
283
|
}
|
|
284
284
|
]
|
|
285
285
|
};
|
|
286
|
+
function planFreehandPlayback(points, max = 32) {
|
|
287
|
+
if (!Array.isArray(points)) return null;
|
|
288
|
+
const all = points.filter((p) => Array.isArray(p) && Number.isFinite(p[0]) && Number.isFinite(p[1])).map(([x, y]) => ({ x, y }));
|
|
289
|
+
if (!all.length) return null;
|
|
290
|
+
const step = (all.length - 1) / (max - 1);
|
|
291
|
+
const picked = all.length <= max ? all : Array.from({ length: max }, (_, i) => all[Math.round(i * step)]);
|
|
292
|
+
const [first, ...rest] = picked;
|
|
293
|
+
const gap = (p, i) => {
|
|
294
|
+
const prev = i ? rest[i - 1] : first;
|
|
295
|
+
return Math.hypot(p.x - prev.x, p.y - prev.y);
|
|
296
|
+
};
|
|
297
|
+
const total = rest.reduce((sum, p, i) => sum + gap(p, i), 0);
|
|
298
|
+
return [
|
|
299
|
+
{ type: "move", to: first },
|
|
300
|
+
{ type: "press", gesture: "path" },
|
|
301
|
+
...rest.map((p, i) => ({ type: "drag", to: p, ms: total > 0 ? Math.max(16, 900 * gap(p, i) / total) : 16 })),
|
|
302
|
+
{ type: "release" },
|
|
303
|
+
{ type: "commit" }
|
|
304
|
+
];
|
|
305
|
+
}
|
|
286
306
|
function createDrawCommands(target, options = {}) {
|
|
287
307
|
const prefix = options.prefix ?? "canvas.";
|
|
288
308
|
const group = options.group ?? "Draw";
|
|
@@ -323,6 +343,7 @@ function createDrawCommands(target, options = {}) {
|
|
|
323
343
|
}
|
|
324
344
|
},
|
|
325
345
|
enabled: () => options.readOnlyReason?.() || true,
|
|
346
|
+
plan: (_ctx, params) => planFreehandPlayback(params.points),
|
|
326
347
|
run: (_ctx, params) => target.drawStroke({
|
|
327
348
|
points: params.points,
|
|
328
349
|
...params.tool ? { tool: params.tool } : {},
|
|
@@ -672,6 +693,7 @@ export {
|
|
|
672
693
|
matchHistoryShortcut,
|
|
673
694
|
createArrangeCommands,
|
|
674
695
|
createShapeCommands,
|
|
696
|
+
planFreehandPlayback,
|
|
675
697
|
createDrawCommands,
|
|
676
698
|
hasVariantCommands,
|
|
677
699
|
createComponentCommands,
|
|
@@ -3,6 +3,7 @@ import type { CanvasArrangeAction } from '../canvas/arrangeShortcuts.cjs';
|
|
|
3
3
|
import type { AlignEdge, DistributeAxis, DistributeMode, ZOrderOperation } from '../canvas/arrange.cjs';
|
|
4
4
|
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset } from '../canvas/brushTypes.cjs';
|
|
5
5
|
import type { CommandSpec } from './registry.cjs';
|
|
6
|
+
import type { PlaybackStep } from '../tools/playback.cjs';
|
|
6
7
|
import { type ShortcutBinding } from './shortcuts.cjs';
|
|
7
8
|
import type { KeyboardEventLike, Platform } from './chords.cjs';
|
|
8
9
|
/** Minimal history surface (`HistoryManager` satisfies it). */
|
|
@@ -135,6 +136,11 @@ export interface DrawCommandOptions {
|
|
|
135
136
|
/** Refuse drawing with this reason (e.g. a read-only canvas); `canvas.listBrushes` still runs. */
|
|
136
137
|
readOnlyReason?: () => string | null | undefined;
|
|
137
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Agent playback for `canvas.drawFreehand`: traces the stroke (canvas coordinates) with the
|
|
141
|
+
* button down, through at most `max` of its points, paced by length (about 900 ms in all).
|
|
142
|
+
*/
|
|
143
|
+
export declare function planFreehandPlayback(points: unknown, max?: number): PlaybackStep[] | null;
|
|
138
144
|
/**
|
|
139
145
|
* Agent / palette commands for freehand drawing: `canvas.drawFreehand` (a pen or highlighter
|
|
140
146
|
* stroke through given points, optionally brushed with a dry paint preset and a pressure / tilt
|
|
@@ -3,6 +3,7 @@ import type { CanvasArrangeAction } from '../canvas/arrangeShortcuts.js';
|
|
|
3
3
|
import type { AlignEdge, DistributeAxis, DistributeMode, ZOrderOperation } from '../canvas/arrange.js';
|
|
4
4
|
import type { CanvasBrush, CanvasBrushPaint, CanvasBrushPreset } from '../canvas/brushTypes.js';
|
|
5
5
|
import type { CommandSpec } from './registry.js';
|
|
6
|
+
import type { PlaybackStep } from '../tools/playback.js';
|
|
6
7
|
import { type ShortcutBinding } from './shortcuts.js';
|
|
7
8
|
import type { KeyboardEventLike, Platform } from './chords.js';
|
|
8
9
|
/** Minimal history surface (`HistoryManager` satisfies it). */
|
|
@@ -135,6 +136,11 @@ export interface DrawCommandOptions {
|
|
|
135
136
|
/** Refuse drawing with this reason (e.g. a read-only canvas); `canvas.listBrushes` still runs. */
|
|
136
137
|
readOnlyReason?: () => string | null | undefined;
|
|
137
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Agent playback for `canvas.drawFreehand`: traces the stroke (canvas coordinates) with the
|
|
141
|
+
* button down, through at most `max` of its points, paced by length (about 900 ms in all).
|
|
142
|
+
*/
|
|
143
|
+
export declare function planFreehandPlayback(points: unknown, max?: number): PlaybackStep[] | null;
|
|
138
144
|
/**
|
|
139
145
|
* Agent / palette commands for freehand drawing: `canvas.drawFreehand` (a pen or highlighter
|
|
140
146
|
* stroke through given points, optionally brushed with a dry paint preset and a pressure / tilt
|
package/dist/commands/index.cjs
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
var _chunk53GOGBTMcjs = require('../chunk-53GOGBTM.cjs');
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
|
|
@@ -1027,4 +1028,5 @@ function createCanvasAnimationCommands(controller, options = {}) {
|
|
|
1027
1028
|
|
|
1028
1029
|
|
|
1029
1030
|
|
|
1030
|
-
|
|
1031
|
+
|
|
1032
|
+
exports.CommandRegistry = CommandRegistry; exports.CommandRegistryError = CommandRegistryError; exports.DEFAULT_HISTORY_SHORTCUTS = _chunk53GOGBTMcjs.DEFAULT_HISTORY_SHORTCUTS; exports.DEFAULT_RECENT_LIMIT = DEFAULT_RECENT_LIMIT; exports.PLATFORMS = _chunk4EFNS2HVcjs.PLATFORMS; exports.ShortcutMap = _chunk4EFNS2HVcjs.ShortcutMap; exports.chordToString = _chunk4EFNS2HVcjs.chordToString; exports.codeFromKey = _chunk4EFNS2HVcjs.codeFromKey; exports.codeToKeyText = _chunk4EFNS2HVcjs.codeToKeyText; exports.createArrangeCommands = _chunk53GOGBTMcjs.createArrangeCommands; exports.createCanvasAnimationCommands = createCanvasAnimationCommands; exports.createCommandPaletteController = createCommandPaletteController; exports.createCommandRegistry = createCommandRegistry; exports.createCommandToolProvider = createCommandToolProvider; exports.createComponentCommands = _chunk53GOGBTMcjs.createComponentCommands; exports.createDrawCommands = _chunk53GOGBTMcjs.createDrawCommands; exports.createFormatCommands = _chunkVCL7CB56cjs.createFormatCommands; exports.createHistoryCommands = _chunk53GOGBTMcjs.createHistoryCommands; exports.createShapeCommands = _chunk53GOGBTMcjs.createShapeCommands; exports.createSpreadsheetCommands = _chunk53GOGBTMcjs.createSpreadsheetCommands; exports.defineCommand = defineCommand; exports.detectPlatform = _chunk4EFNS2HVcjs.detectPlatform; exports.effectiveChord = _chunk4EFNS2HVcjs.effectiveChord; exports.effectiveChordKey = _chunk4EFNS2HVcjs.effectiveChordKey; exports.eventCode = _chunk4EFNS2HVcjs.eventCode; exports.exactBonus = exactBonus; exports.formatCommandsFor = _chunkVCL7CB56cjs.formatCommandsFor; exports.formatShortcut = _chunk4EFNS2HVcjs.formatShortcut; exports.fuzzyMatch = fuzzyMatch; exports.fuzzyScore = fuzzyScore; exports.hasVariantCommands = _chunk53GOGBTMcjs.hasVariantCommands; exports.isEditableEventTarget = _chunk4EFNS2HVcjs.isEditableEventTarget; exports.keyToCode = _chunk4EFNS2HVcjs.keyToCode; exports.matchHistoryShortcut = _chunk53GOGBTMcjs.matchHistoryShortcut; exports.matchPaletteHotkey = matchPaletteHotkey; exports.normalizeChord = _chunk4EFNS2HVcjs.normalizeChord; exports.parseChord = _chunk4EFNS2HVcjs.parseChord; exports.planFreehandPlayback = _chunk53GOGBTMcjs.planFreehandPlayback; exports.pushRecent = pushRecent; exports.rankCommands = rankCommands; exports.shortcutCode = _chunk4EFNS2HVcjs.shortcutCode; exports.toShortcutBindings = _chunk4EFNS2HVcjs.toShortcutBindings;
|
package/dist/commands/index.js
CHANGED
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
createShapeCommands,
|
|
8
8
|
createSpreadsheetCommands,
|
|
9
9
|
hasVariantCommands,
|
|
10
|
-
matchHistoryShortcut
|
|
11
|
-
|
|
10
|
+
matchHistoryShortcut,
|
|
11
|
+
planFreehandPlayback
|
|
12
|
+
} from "../chunk-ZPJEH456.js";
|
|
12
13
|
import {
|
|
13
14
|
PLATFORMS,
|
|
14
15
|
ShortcutMap,
|
|
@@ -1023,6 +1024,7 @@ export {
|
|
|
1023
1024
|
matchPaletteHotkey,
|
|
1024
1025
|
normalizeChord,
|
|
1025
1026
|
parseChord,
|
|
1027
|
+
planFreehandPlayback,
|
|
1026
1028
|
pushRecent,
|
|
1027
1029
|
rankCommands,
|
|
1028
1030
|
shortcutCode,
|
|
@@ -163,6 +163,9 @@ export interface FocusAreaCommandOptions extends FocusAreaOptions {
|
|
|
163
163
|
}
|
|
164
164
|
/** Options of {@link ImageEditorController.selectSky}. */
|
|
165
165
|
export interface SkyCommandOptions extends SkyOptions {
|
|
166
|
+
/** With a segmentation provider set, ask it for the sky (default true); false finds it classically. */
|
|
167
|
+
useModel?: boolean;
|
|
168
|
+
signal?: AbortSignal;
|
|
166
169
|
/** How the sky combines with the selection (default `replace`). */
|
|
167
170
|
mode?: SelectionMode;
|
|
168
171
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -170,6 +173,12 @@ export interface SkyCommandOptions extends SkyOptions {
|
|
|
170
173
|
}
|
|
171
174
|
/** Options of {@link ImageEditorController.selectObject}. */
|
|
172
175
|
export interface SelectObjectCommandOptions {
|
|
176
|
+
/**
|
|
177
|
+
* With a segmentation provider set, ask it for the object in the box or under the point (default
|
|
178
|
+
* true), falling back to GrabCut when nothing it returns fits; false always uses GrabCut.
|
|
179
|
+
*/
|
|
180
|
+
useModel?: boolean;
|
|
181
|
+
signal?: AbortSignal;
|
|
173
182
|
/** How the object combines with the selection (default `replace`). */
|
|
174
183
|
mode?: SelectionMode;
|
|
175
184
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -1549,13 +1558,26 @@ export declare class ImageEditorController {
|
|
|
1549
1558
|
* one undo step. Resolves to the resulting selection.
|
|
1550
1559
|
*/
|
|
1551
1560
|
quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Asks the segmentation provider (which must be set) for `request.target` in the flattened image
|
|
1563
|
+
* and returns its results with masks decoded to pixels.
|
|
1564
|
+
*/
|
|
1565
|
+
private modelSegments;
|
|
1566
|
+
/**
|
|
1567
|
+
* The model's object for Object Selection: of what it returns, the pieces mostly inside the box
|
|
1568
|
+
* (clipped to the box grown by a tenth) or those under the point. `null` when none fits.
|
|
1569
|
+
*/
|
|
1570
|
+
private modelObject;
|
|
1552
1571
|
/**
|
|
1553
1572
|
* Object Selection: the object inside `target.rect` (natural pixels; what is outside the box is
|
|
1554
1573
|
* background) or under `target.point`, found by GrabCut (colour models of object and background
|
|
1555
1574
|
* plus a graph cut along edges), combined with the selection by `mode` as one undo step.
|
|
1556
1575
|
* Resolves to the resulting selection.
|
|
1557
1576
|
*/
|
|
1558
|
-
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<
|
|
1577
|
+
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<{
|
|
1578
|
+
selection: SelectionMask | null;
|
|
1579
|
+
method: 'model' | 'grabcut';
|
|
1580
|
+
}>;
|
|
1559
1581
|
/**
|
|
1560
1582
|
* Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
|
|
1561
1583
|
* image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
|
|
@@ -1573,6 +1595,7 @@ export declare class ImageEditorController {
|
|
|
1573
1595
|
*/
|
|
1574
1596
|
selectSky(options?: SkyCommandOptions): Promise<{
|
|
1575
1597
|
selection: SelectionMask | null;
|
|
1598
|
+
method: 'model' | 'classical';
|
|
1576
1599
|
note?: string;
|
|
1577
1600
|
}>;
|
|
1578
1601
|
/**
|
|
@@ -163,6 +163,9 @@ export interface FocusAreaCommandOptions extends FocusAreaOptions {
|
|
|
163
163
|
}
|
|
164
164
|
/** Options of {@link ImageEditorController.selectSky}. */
|
|
165
165
|
export interface SkyCommandOptions extends SkyOptions {
|
|
166
|
+
/** With a segmentation provider set, ask it for the sky (default true); false finds it classically. */
|
|
167
|
+
useModel?: boolean;
|
|
168
|
+
signal?: AbortSignal;
|
|
166
169
|
/** How the sky combines with the selection (default `replace`). */
|
|
167
170
|
mode?: SelectionMode;
|
|
168
171
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -170,6 +173,12 @@ export interface SkyCommandOptions extends SkyOptions {
|
|
|
170
173
|
}
|
|
171
174
|
/** Options of {@link ImageEditorController.selectObject}. */
|
|
172
175
|
export interface SelectObjectCommandOptions {
|
|
176
|
+
/**
|
|
177
|
+
* With a segmentation provider set, ask it for the object in the box or under the point (default
|
|
178
|
+
* true), falling back to GrabCut when nothing it returns fits; false always uses GrabCut.
|
|
179
|
+
*/
|
|
180
|
+
useModel?: boolean;
|
|
181
|
+
signal?: AbortSignal;
|
|
173
182
|
/** How the object combines with the selection (default `replace`). */
|
|
174
183
|
mode?: SelectionMode;
|
|
175
184
|
/** Sample every layer (default true) or only the active pixel layer. */
|
|
@@ -1549,13 +1558,26 @@ export declare class ImageEditorController {
|
|
|
1549
1558
|
* one undo step. Resolves to the resulting selection.
|
|
1550
1559
|
*/
|
|
1551
1560
|
quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
|
|
1561
|
+
/**
|
|
1562
|
+
* Asks the segmentation provider (which must be set) for `request.target` in the flattened image
|
|
1563
|
+
* and returns its results with masks decoded to pixels.
|
|
1564
|
+
*/
|
|
1565
|
+
private modelSegments;
|
|
1566
|
+
/**
|
|
1567
|
+
* The model's object for Object Selection: of what it returns, the pieces mostly inside the box
|
|
1568
|
+
* (clipped to the box grown by a tenth) or those under the point. `null` when none fits.
|
|
1569
|
+
*/
|
|
1570
|
+
private modelObject;
|
|
1552
1571
|
/**
|
|
1553
1572
|
* Object Selection: the object inside `target.rect` (natural pixels; what is outside the box is
|
|
1554
1573
|
* background) or under `target.point`, found by GrabCut (colour models of object and background
|
|
1555
1574
|
* plus a graph cut along edges), combined with the selection by `mode` as one undo step.
|
|
1556
1575
|
* Resolves to the resulting selection.
|
|
1557
1576
|
*/
|
|
1558
|
-
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<
|
|
1577
|
+
selectObject(target: ObjectTarget, options?: SelectObjectCommandOptions): Promise<{
|
|
1578
|
+
selection: SelectionMask | null;
|
|
1579
|
+
method: 'model' | 'grabcut';
|
|
1580
|
+
}>;
|
|
1559
1581
|
/**
|
|
1560
1582
|
* Select › Focus Area: selects the parts of the image that are in focus (fine detail above the
|
|
1561
1583
|
* image's noise), fitted to its edges, combined with the selection by `mode` as one undo step.
|
|
@@ -1573,6 +1595,7 @@ export declare class ImageEditorController {
|
|
|
1573
1595
|
*/
|
|
1574
1596
|
selectSky(options?: SkyCommandOptions): Promise<{
|
|
1575
1597
|
selection: SelectionMask | null;
|
|
1598
|
+
method: 'model' | 'classical';
|
|
1576
1599
|
note?: string;
|
|
1577
1600
|
}>;
|
|
1578
1601
|
/**
|