@pixerate/editor 0.183.0 → 0.186.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/{chunk-Y46OMERN.js → chunk-FW7N64XK.js} +298 -189
- package/dist/{chunk-UHMSMUHK.cjs → chunk-X2KQQZBT.cjs} +358 -249
- package/dist/image-editor/controller.d.cts +208 -8
- package/dist/image-editor/controller.d.ts +208 -8
- package/dist/image-editor/index.cjs +2610 -1025
- package/dist/image-editor/index.js +1672 -87
- package/dist/image-editor/layers/model.d.cts +5 -1
- package/dist/image-editor/layers/model.d.ts +5 -1
- package/dist/image-editor/layers/paint-ui.d.cts +2 -1
- package/dist/image-editor/layers/paint-ui.d.ts +2 -1
- package/dist/image-editor/layers/panel.d.cts +23 -1
- package/dist/image-editor/layers/panel.d.ts +23 -1
- package/dist/image-editor/layers/serialize.d.cts +3 -0
- package/dist/image-editor/layers/serialize.d.ts +3 -0
- package/dist/image-editor/psd/channels.d.cts +24 -0
- package/dist/image-editor/psd/channels.d.ts +24 -0
- package/dist/image-editor/psd/export.d.cts +3 -0
- package/dist/image-editor/psd/export.d.ts +3 -0
- package/dist/image-editor/psd/import.d.cts +10 -0
- package/dist/image-editor/psd/import.d.ts +10 -0
- package/dist/image-editor/renderer.d.cts +6 -0
- package/dist/image-editor/renderer.d.ts +6 -0
- package/dist/image-editor/selection/channels.d.cts +52 -0
- package/dist/image-editor/selection/channels.d.ts +52 -0
- package/dist/image-editor/selection/gesture.d.cts +47 -2
- package/dist/image-editor/selection/gesture.d.ts +47 -2
- package/dist/image-editor/selection/index.d.cts +2 -0
- package/dist/image-editor/selection/index.d.ts +2 -0
- package/dist/image-editor/selection/modify.d.cts +3 -2
- package/dist/image-editor/selection/modify.d.ts +3 -2
- package/dist/image-editor/selection/overlay.d.cts +2 -0
- package/dist/image-editor/selection/overlay.d.ts +2 -0
- package/dist/image-editor/selection/stroke.d.cts +8 -0
- package/dist/image-editor/selection/stroke.d.ts +8 -0
- package/dist/image-editor/selection/tool-options.d.cts +12 -2
- package/dist/image-editor/selection/tool-options.d.ts +12 -2
- package/dist/image-editor/selection/wand.d.cts +37 -0
- package/dist/image-editor/selection/wand.d.ts +37 -0
- package/dist/image-editor/selection-tools.d.cts +8 -3
- package/dist/image-editor/selection-tools.d.ts +8 -3
- package/dist/image-editor/tools.d.cts +10 -2
- package/dist/image-editor/tools.d.ts +10 -2
- package/dist/image-editor/types.d.cts +12 -0
- package/dist/image-editor/types.d.ts +12 -0
- package/dist/paint-editor/index.cjs +6 -6
- package/dist/paint-editor/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +19 -21
- package/skills/pixerate-image-editor/references/free-transform.md +22 -0
- package/skills/pixerate-image-selection-masking/SKILL.md +36 -3
|
@@ -4,11 +4,12 @@ import { type BlendMode } from './blend.cjs';
|
|
|
4
4
|
import type { ImageHistogram } from './histogram.cjs';
|
|
5
5
|
import { type PixelBuffer, type SelectionChannel, type SelectionMask, type SelectionMode } from './selection/mask.cjs';
|
|
6
6
|
import { type ShapeSelectionOptions } from './selection/shapes.cjs';
|
|
7
|
-
import { type ColorRangeOptions, type ColorRangeSample, type MagicWandOptions } from './selection/wand.cjs';
|
|
7
|
+
import { type GrowSimilarOptions, type ColorRangeOptions, type ColorRangePreset, type ColorRangeSample, type MagicWandOptions } from './selection/wand.cjs';
|
|
8
8
|
import { type SelectionModifyOp } from './selection/modify.cjs';
|
|
9
9
|
import { type SegmentationProvider } from './selection/segmentation.cjs';
|
|
10
10
|
import { type RefineEdgeParams } from './selection/refine.cjs';
|
|
11
|
-
import type
|
|
11
|
+
import { type LayerMaskProps } from './selection/layer-mask.cjs';
|
|
12
|
+
import { type AlphaChannel } from './selection/channels.cjs';
|
|
12
13
|
import type { AdjustmentLayerMask } from './types.cjs';
|
|
13
14
|
import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeFillRule, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TypeLayer, type ImageEffectAnimation } from './layers/model.cjs';
|
|
14
15
|
import { type TextLayout, type TextShaper } from './layers/text.cjs';
|
|
@@ -107,7 +108,11 @@ export interface SelectionCommandOptions {
|
|
|
107
108
|
mode?: SelectionMode;
|
|
108
109
|
/** Feather the new shape by this many pixels before combining (default 0). */
|
|
109
110
|
feather?: number;
|
|
111
|
+
/** Invert the new shape before combining (Color Range › Invert; default false). */
|
|
112
|
+
invert?: boolean;
|
|
110
113
|
}
|
|
114
|
+
/** How the canvas shows the selection: marching ants, a Quick Mask tint, or not at all. */
|
|
115
|
+
export type SelectionDisplay = 'ants' | 'quickMask' | 'none';
|
|
111
116
|
/** Where an AI result goes (see `applyInpaintedImage`, `applyBackgroundRemovedImage`). */
|
|
112
117
|
export interface AIResultOptions {
|
|
113
118
|
/** `new-layer`: a new layer (inpainting) or a mask (background removal); `replace`: the Background's pixels. Default: by `isMultiLayer`. */
|
|
@@ -133,6 +138,11 @@ export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind>
|
|
|
133
138
|
aboveId?: string;
|
|
134
139
|
/** Put the new layer at the top of this group. */
|
|
135
140
|
parentId?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Mask the new layer with the selection when there is one and no `mask` is given (Photoshop's
|
|
143
|
+
* behaviour). Default false here, for compatibility; the agent tool and the panels pass true.
|
|
144
|
+
*/
|
|
145
|
+
useSelection?: boolean;
|
|
136
146
|
}
|
|
137
147
|
/** A new pixel layer: empty, a solid colour over the canvas, or given pixels, plus its properties and position. */
|
|
138
148
|
export interface PixelLayerInit extends LayerPlacement {
|
|
@@ -345,6 +355,33 @@ export interface FillOptions {
|
|
|
345
355
|
/** Limit to the selection when there is one (default true). */
|
|
346
356
|
useSelection?: boolean;
|
|
347
357
|
}
|
|
358
|
+
/** The `layerId` paint results report for Quick Mask edits (the selection, not a layer). */
|
|
359
|
+
export declare const QUICK_MASK_TARGET = "quick-mask";
|
|
360
|
+
/** Edit › Stroke (see `strokeSelection`). */
|
|
361
|
+
export interface StrokeSelectionOptions extends Omit<FillOptions, 'useSelection'> {
|
|
362
|
+
/** Width of the band in pixels (0 < width ≤ 250). */
|
|
363
|
+
width: number;
|
|
364
|
+
/** Where the band lies against the selection edge (default `outside`). */
|
|
365
|
+
location?: 'inside' | 'center' | 'outside';
|
|
366
|
+
}
|
|
367
|
+
/** Edit › Content-Aware Fill (see `contentAwareFill`). */
|
|
368
|
+
export interface ContentAwareFillOptions {
|
|
369
|
+
/** The pixel layer to sample and fill (default the active layer). */
|
|
370
|
+
layerId?: string;
|
|
371
|
+
/** `current` (default) paints into the layer; `new-layer` puts the fill on a new layer above it. */
|
|
372
|
+
output?: 'current' | 'new-layer';
|
|
373
|
+
/** How far around the selection to sample, in pixels (default its larger side, at least 32). */
|
|
374
|
+
sampleRadius?: number;
|
|
375
|
+
/** Random seed: the same seed gives the same fill (default 0). */
|
|
376
|
+
seed?: number;
|
|
377
|
+
}
|
|
378
|
+
/** Pixels on the editor's clipboard: RGBA, and where they were copied from (document pixels). */
|
|
379
|
+
export interface ClipboardImage extends PixelBuffer {
|
|
380
|
+
x?: number;
|
|
381
|
+
y?: number;
|
|
382
|
+
}
|
|
383
|
+
export type PasteMode = 'new-layer' | 'in-place' | 'into' | 'outside';
|
|
384
|
+
export declare const PASTE_MODES: readonly PasteMode[];
|
|
348
385
|
/** What a stroke, fill or clear changed. */
|
|
349
386
|
export interface PaintStrokeResult {
|
|
350
387
|
layerId: string;
|
|
@@ -595,10 +632,13 @@ export declare class ImageEditorController {
|
|
|
595
632
|
enabled?: boolean;
|
|
596
633
|
blend?: string;
|
|
597
634
|
opacity?: number;
|
|
635
|
+
/** Limit the filter to the selection (sets the filter mask from it, same undo step). Default false. */
|
|
636
|
+
useSelection?: boolean;
|
|
598
637
|
}): Promise<{
|
|
599
638
|
layerId: string;
|
|
600
639
|
filter: SmartFilter;
|
|
601
640
|
converted: boolean;
|
|
641
|
+
masked: boolean;
|
|
602
642
|
}>;
|
|
603
643
|
/**
|
|
604
644
|
* Changes an effect smart filter: `values` merged over its own (`null` resets a control to the
|
|
@@ -668,6 +708,14 @@ export declare class ImageEditorController {
|
|
|
668
708
|
private stack;
|
|
669
709
|
private captureHistoryEntry;
|
|
670
710
|
private restoreHistoryEntry;
|
|
711
|
+
/** Set while `asOneStep` runs: the step is already recorded, so nested commands add none. */
|
|
712
|
+
private historyGrouped;
|
|
713
|
+
/**
|
|
714
|
+
* Runs `fn` as one undo step: history is recorded once, before it, and the commands it calls
|
|
715
|
+
* record none. If `fn` throws, the step is dropped and the state goes back to before it, so a
|
|
716
|
+
* failure never leaves half a change.
|
|
717
|
+
*/
|
|
718
|
+
private asOneStep;
|
|
671
719
|
private recordHistory;
|
|
672
720
|
/**
|
|
673
721
|
* Bytes of pixel tiles held only by undo / redo steps (not by the current state). The oldest
|
|
@@ -824,11 +872,12 @@ export declare class ImageEditorController {
|
|
|
824
872
|
bounds: CropBox | null;
|
|
825
873
|
};
|
|
826
874
|
/**
|
|
827
|
-
* Adds a mask to a layer (one undo step): `reveal-all` (white), `hide-all` (black)
|
|
828
|
-
* `selection` (the selection's coverage)
|
|
875
|
+
* Adds a mask to a layer (one undo step): `reveal-all` (white), `hide-all` (black),
|
|
876
|
+
* `selection` (the selection's coverage), `hide-selection` (its inverse) or `transparency`
|
|
877
|
+
* (the layer's own alpha, so the pixels can then be made opaque and edited). Replaces an existing mask. Makes the mask the paint
|
|
829
878
|
* target when the layer is active.
|
|
830
879
|
*/
|
|
831
|
-
addLayerMask(id: string, from?: 'reveal-all' | 'hide-all' | 'selection', props?: LayerMaskProps): RasterMask;
|
|
880
|
+
addLayerMask(id: string, from?: 'reveal-all' | 'hide-all' | 'selection' | 'hide-selection' | 'transparency', props?: LayerMaskProps): RasterMask;
|
|
832
881
|
/** Removes a layer's mask (one undo step). */
|
|
833
882
|
removeLayerMask(id: string): void;
|
|
834
883
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
@@ -978,7 +1027,14 @@ export declare class ImageEditorController {
|
|
|
978
1027
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
979
1028
|
addSmartFilter(id: string, filter: Record<string, unknown> & {
|
|
980
1029
|
kind: string;
|
|
981
|
-
}, index?: number
|
|
1030
|
+
}, index?: number, options?: {
|
|
1031
|
+
useSelection?: boolean;
|
|
1032
|
+
}): SmartFilter;
|
|
1033
|
+
/**
|
|
1034
|
+
* After adding a smart filter: with `useSelection` and a selection, sets the filter mask from
|
|
1035
|
+
* it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
|
|
1036
|
+
*/
|
|
1037
|
+
private maskFiltersWithSelection;
|
|
982
1038
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
983
1039
|
updateSmartFilter(id: string, filterId: string, changes: Record<string, unknown>, commitToHistory?: boolean): SmartFilter;
|
|
984
1040
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
@@ -1182,6 +1238,59 @@ export declare class ImageEditorController {
|
|
|
1182
1238
|
* whole canvas. One undo step. Returns the changed bounds.
|
|
1183
1239
|
*/
|
|
1184
1240
|
clearPixels(options?: Omit<FillOptions, 'color' | 'blend'>): PaintStrokeResult;
|
|
1241
|
+
/**
|
|
1242
|
+
* Edit › Stroke: paints a band `width` px wide along the selection's edge, `inside` it, on the
|
|
1243
|
+
* `center` of the edge or `outside` it (default), with `color` (default the foreground),
|
|
1244
|
+
* `opacity` and `blend`, on a layer's pixels or mask. One undo step. Returns the changed bounds.
|
|
1245
|
+
*/
|
|
1246
|
+
strokeSelection(options: StrokeSelectionOptions): PaintStrokeResult;
|
|
1247
|
+
/**
|
|
1248
|
+
* Image › Crop to the selection's bounds (one undo step). Returns the crop box (natural
|
|
1249
|
+
* pixels). Throws without a selection.
|
|
1250
|
+
*/
|
|
1251
|
+
cropToSelection(): CropBox;
|
|
1252
|
+
/**
|
|
1253
|
+
* Edit › Content-Aware Fill: fills the selection with texture synthesised from around it
|
|
1254
|
+
* (PatchMatch, as the Spot Healing Brush's content-aware mode), blended by the selection's
|
|
1255
|
+
* coverage. `output` `current` paints into the layer; `new-layer` puts the fill on a new layer
|
|
1256
|
+
* above it. Samples within `sampleRadius` px of the selection (default its larger side, at
|
|
1257
|
+
* least 32). Deterministic for a `seed`. One undo step. 8-bit documents only for now.
|
|
1258
|
+
*/
|
|
1259
|
+
contentAwareFill(options?: ContentAwareFillOptions): {
|
|
1260
|
+
layerId: string;
|
|
1261
|
+
bounds: CropBox;
|
|
1262
|
+
output: 'current' | 'new-layer';
|
|
1263
|
+
};
|
|
1264
|
+
/** The pixel clipboard (Copy / Cut), or null. */
|
|
1265
|
+
private clipboard;
|
|
1266
|
+
/** What Copy or Cut last put on the editor's clipboard, or null. */
|
|
1267
|
+
getClipboard(): ClipboardImage | null;
|
|
1268
|
+
/** Puts pixels on the editor's clipboard (e.g. an image pasted from the system clipboard). */
|
|
1269
|
+
setClipboard(image: ClipboardImage | null): void;
|
|
1270
|
+
/**
|
|
1271
|
+
* Edit › Copy (or Copy Merged with `merged`): the selected pixels of a pixel layer (default the
|
|
1272
|
+
* active one) or of the whole visible image, cropped to the selection's bounds, with the
|
|
1273
|
+
* selection's soft edge in their alpha. Without a selection, the whole canvas. Not an undo step.
|
|
1274
|
+
*/
|
|
1275
|
+
copyPixels(options?: {
|
|
1276
|
+
layerId?: string;
|
|
1277
|
+
merged?: boolean;
|
|
1278
|
+
}): ClipboardImage;
|
|
1279
|
+
/** Edit › Cut: Copy, then clear the selected pixels, as one undo step. */
|
|
1280
|
+
cutPixels(options?: {
|
|
1281
|
+
layerId?: string;
|
|
1282
|
+
}): ClipboardImage;
|
|
1283
|
+
/**
|
|
1284
|
+
* Edit › Paste as a new pixel layer above the active one (one undo step): `new-layer` centred
|
|
1285
|
+
* on the selection (or the canvas), `in-place` where it was copied, `into` centred in the
|
|
1286
|
+
* selection with the selection as its mask (Paste Into), or `outside` with the inverse
|
|
1287
|
+
* (Paste Outside). Returns the new layer id and where it went.
|
|
1288
|
+
*/
|
|
1289
|
+
pastePixels(mode?: PasteMode, image?: ClipboardImage | null): {
|
|
1290
|
+
layerId: string;
|
|
1291
|
+
bounds: CropBox;
|
|
1292
|
+
masked: boolean;
|
|
1293
|
+
};
|
|
1185
1294
|
private fillOrClear;
|
|
1186
1295
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
1187
1296
|
private developLayer;
|
|
@@ -1265,6 +1374,27 @@ export declare class ImageEditorController {
|
|
|
1265
1374
|
selectAll(): boolean;
|
|
1266
1375
|
/** Select › Deselect. */
|
|
1267
1376
|
deselect(): boolean;
|
|
1377
|
+
/** The selection a Deselect cleared, for `reselect` (not saved, not part of history). */
|
|
1378
|
+
private lastSelection;
|
|
1379
|
+
/** Whether `reselect` has a selection to bring back. */
|
|
1380
|
+
canReselect(): boolean;
|
|
1381
|
+
/** Select › Reselect: brings back the last selection a Deselect cleared, as one undo step. */
|
|
1382
|
+
reselect(): boolean;
|
|
1383
|
+
/**
|
|
1384
|
+
* Single Row / Single Column Marquee: a 1 px line across the whole image at `position`
|
|
1385
|
+
* (natural pixels; y for a row, x for a column).
|
|
1386
|
+
*/
|
|
1387
|
+
selectLine(orientation: 'row' | 'column', position: number, options?: SelectionCommandOptions): boolean;
|
|
1388
|
+
/** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
|
|
1389
|
+
growSelection(options?: GrowSimilarOptions & SampleOptions): Promise<boolean>;
|
|
1390
|
+
/** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
|
|
1391
|
+
selectSimilar(options?: GrowSimilarOptions & SampleOptions): Promise<boolean>;
|
|
1392
|
+
/**
|
|
1393
|
+
* Load Selection from a layer's transparency (Ctrl/⌘-click its thumbnail): its alpha in
|
|
1394
|
+
* document space, combined by `mode`. Works on pixel, shape, type and smart object layers.
|
|
1395
|
+
*/
|
|
1396
|
+
selectLayerTransparency(id: string, options?: SelectionCommandOptions): boolean;
|
|
1397
|
+
private layerTransparency;
|
|
1268
1398
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
1269
1399
|
invertSelection(): boolean;
|
|
1270
1400
|
private shapeCommand;
|
|
@@ -1294,6 +1424,13 @@ export declare class ImageEditorController {
|
|
|
1294
1424
|
magicWand(point: ImagePoint, options?: MagicWandOptions & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1295
1425
|
/** Select › Color Range with colour samples (`#rrggbb` or `[r, g, b]`, optionally where they were picked). */
|
|
1296
1426
|
selectColorRange(samples: ColorRangeSample[], options?: ColorRangeOptions & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Select › Color Range with a preset: `reds` … `magentas`, `highlights` / `midtones` /
|
|
1429
|
+
* `shadows` (with `falloff` levels, default 20) or `skinTones`. One undo step.
|
|
1430
|
+
*/
|
|
1431
|
+
selectColorRangePreset(preset: ColorRangePreset, options?: {
|
|
1432
|
+
falloff?: number;
|
|
1433
|
+
} & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1297
1434
|
/** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
|
|
1298
1435
|
modifySelection(op: SelectionModifyOp, radius: number): boolean;
|
|
1299
1436
|
/**
|
|
@@ -1333,6 +1470,66 @@ export declare class ImageEditorController {
|
|
|
1333
1470
|
}>;
|
|
1334
1471
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
1335
1472
|
setQuickMask(on: boolean): void;
|
|
1473
|
+
/** How the canvas shows the selection (`state.selectionDisplay`). */
|
|
1474
|
+
getSelectionDisplay(): SelectionDisplay;
|
|
1475
|
+
/**
|
|
1476
|
+
* Shows the selection as marching ants, as a Quick Mask tint over the unselected area, or hides
|
|
1477
|
+
* it (the selection still applies). View state: no undo step, not saved.
|
|
1478
|
+
*/
|
|
1479
|
+
setSelectionDisplay(display: SelectionDisplay): void;
|
|
1480
|
+
/** The alpha channels (saved selections), in panel order. */
|
|
1481
|
+
getChannels(): readonly AlphaChannel[];
|
|
1482
|
+
getChannel(id: string): AlphaChannel | null;
|
|
1483
|
+
private requireChannel;
|
|
1484
|
+
private setChannels;
|
|
1485
|
+
private newChannelId;
|
|
1486
|
+
/**
|
|
1487
|
+
* Select › Save Selection: a new alpha channel (`name`, default "Alpha n") holding the
|
|
1488
|
+
* selection, or with `channelId` the selection combined into that channel by `mode` (replace,
|
|
1489
|
+
* add, subtract, intersect). One undo step. Throws without a selection.
|
|
1490
|
+
*/
|
|
1491
|
+
saveSelection(options?: {
|
|
1492
|
+
channelId?: string;
|
|
1493
|
+
name?: string;
|
|
1494
|
+
mode?: SelectionMode;
|
|
1495
|
+
}): AlphaChannel;
|
|
1496
|
+
/**
|
|
1497
|
+
* Select › Load Selection from an alpha channel (inverted with `invert`), combined with the
|
|
1498
|
+
* selection by `mode`. One undo step.
|
|
1499
|
+
*/
|
|
1500
|
+
loadSelectionFromChannel(id: string, options?: {
|
|
1501
|
+
mode?: SelectionMode;
|
|
1502
|
+
invert?: boolean;
|
|
1503
|
+
}): boolean;
|
|
1504
|
+
/** Changes a channel's name, overlay colour, opacity, what it indicates or visibility (one undo step). */
|
|
1505
|
+
setChannelProperties(id: string, props: Partial<Pick<AlphaChannel, 'name' | 'color' | 'opacity' | 'indicates' | 'visible'>>): AlphaChannel;
|
|
1506
|
+
/** Deletes an alpha channel (one undo step). */
|
|
1507
|
+
deleteChannel(id: string): void;
|
|
1508
|
+
/** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
|
|
1509
|
+
duplicateChannel(id: string, name?: string): AlphaChannel;
|
|
1510
|
+
/** Channel summaries (no pixels) for panels and agents. */
|
|
1511
|
+
describeChannels(): {
|
|
1512
|
+
bounds: CropBox | null;
|
|
1513
|
+
percent: number;
|
|
1514
|
+
id: string;
|
|
1515
|
+
name: string;
|
|
1516
|
+
color: string;
|
|
1517
|
+
opacity: number;
|
|
1518
|
+
indicates: "masked" | "selected";
|
|
1519
|
+
visible: boolean;
|
|
1520
|
+
}[];
|
|
1521
|
+
/** Whether Quick Mask mode is on (painting edits the selection). */
|
|
1522
|
+
get quickMaskEditing(): boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* Quick Mask mode (Q): on, the selection shows as a tint and painting, fills and strokes that
|
|
1525
|
+
* name no layer edit the selection itself (white selects, black deselects, grey partly);
|
|
1526
|
+
* off, it shows as marching ants again. View state: no undo step (the edits are).
|
|
1527
|
+
*/
|
|
1528
|
+
setQuickMaskMode(on: boolean): void;
|
|
1529
|
+
/** The selection as a 1-channel surface to paint in Quick Mask mode. */
|
|
1530
|
+
private quickMaskSurface;
|
|
1531
|
+
/** The selection a painted Quick Mask surface stands for (`rects` changed since `base`). */
|
|
1532
|
+
private selectionFromSurface;
|
|
1336
1533
|
private maskFromSelection;
|
|
1337
1534
|
/**
|
|
1338
1535
|
* Adds the selection as the layer's mask (Reveal Selection), replacing any mask, as one undo
|
|
@@ -1344,8 +1541,11 @@ export declare class ImageEditorController {
|
|
|
1344
1541
|
setAdjustmentLayerMask(layerId: string, mask: SelectionMask | null, props?: LayerMaskProps): boolean;
|
|
1345
1542
|
/** Changes a layer mask's density (0..1), feather (px) or enabled flag; the mask pixels are kept. */
|
|
1346
1543
|
setAdjustmentLayerMaskProps(layerId: string, props: LayerMaskProps, commitToHistory?: boolean): boolean;
|
|
1347
|
-
/**
|
|
1348
|
-
|
|
1544
|
+
/**
|
|
1545
|
+
* Load Selection from a layer mask (its pixels; density and feather are not applied), inverted
|
|
1546
|
+
* with `invert`. False without a painted mask (a depth mask is computed, not painted).
|
|
1547
|
+
*/
|
|
1548
|
+
selectionFromLayerMask(layerId: string, mode?: SelectionMode, invert?: boolean): boolean;
|
|
1349
1549
|
/**
|
|
1350
1550
|
* Histogram of the last rendered preview (after adjustments and layers, before annotations),
|
|
1351
1551
|
* or `null` before the first render or without canvas pixel access.
|
|
@@ -4,11 +4,12 @@ import { type BlendMode } from './blend.js';
|
|
|
4
4
|
import type { ImageHistogram } from './histogram.js';
|
|
5
5
|
import { type PixelBuffer, type SelectionChannel, type SelectionMask, type SelectionMode } from './selection/mask.js';
|
|
6
6
|
import { type ShapeSelectionOptions } from './selection/shapes.js';
|
|
7
|
-
import { type ColorRangeOptions, type ColorRangeSample, type MagicWandOptions } from './selection/wand.js';
|
|
7
|
+
import { type GrowSimilarOptions, type ColorRangeOptions, type ColorRangePreset, type ColorRangeSample, type MagicWandOptions } from './selection/wand.js';
|
|
8
8
|
import { type SelectionModifyOp } from './selection/modify.js';
|
|
9
9
|
import { type SegmentationProvider } from './selection/segmentation.js';
|
|
10
10
|
import { type RefineEdgeParams } from './selection/refine.js';
|
|
11
|
-
import type
|
|
11
|
+
import { type LayerMaskProps } from './selection/layer-mask.js';
|
|
12
|
+
import { type AlphaChannel } from './selection/channels.js';
|
|
12
13
|
import type { AdjustmentLayerMask } from './types.js';
|
|
13
14
|
import { type LayerBlendMode, type ImageLayer, type LayerFilter, type LayerTarget, type PixelLayer, type RasterMask, type SmartContents, type SmartFilter, type SmartPlacement, type LiveShape, type ShapeFillRule, type ShapeOperation, type ShapePaint, type ShapeStroke, type ParagraphStyle, type TextStyle, type TypeLayer, type ImageEffectAnimation } from './layers/model.js';
|
|
14
15
|
import { type TextLayout, type TextShaper } from './layers/text.js';
|
|
@@ -107,7 +108,11 @@ export interface SelectionCommandOptions {
|
|
|
107
108
|
mode?: SelectionMode;
|
|
108
109
|
/** Feather the new shape by this many pixels before combining (default 0). */
|
|
109
110
|
feather?: number;
|
|
111
|
+
/** Invert the new shape before combining (Color Range › Invert; default false). */
|
|
112
|
+
invert?: boolean;
|
|
110
113
|
}
|
|
114
|
+
/** How the canvas shows the selection: marching ants, a Quick Mask tint, or not at all. */
|
|
115
|
+
export type SelectionDisplay = 'ants' | 'quickMask' | 'none';
|
|
111
116
|
/** Where an AI result goes (see `applyInpaintedImage`, `applyBackgroundRemovedImage`). */
|
|
112
117
|
export interface AIResultOptions {
|
|
113
118
|
/** `new-layer`: a new layer (inpainting) or a mask (background removal); `replace`: the Background's pixels. Default: by `isMultiLayer`. */
|
|
@@ -133,6 +138,11 @@ export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind>
|
|
|
133
138
|
aboveId?: string;
|
|
134
139
|
/** Put the new layer at the top of this group. */
|
|
135
140
|
parentId?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Mask the new layer with the selection when there is one and no `mask` is given (Photoshop's
|
|
143
|
+
* behaviour). Default false here, for compatibility; the agent tool and the panels pass true.
|
|
144
|
+
*/
|
|
145
|
+
useSelection?: boolean;
|
|
136
146
|
}
|
|
137
147
|
/** A new pixel layer: empty, a solid colour over the canvas, or given pixels, plus its properties and position. */
|
|
138
148
|
export interface PixelLayerInit extends LayerPlacement {
|
|
@@ -345,6 +355,33 @@ export interface FillOptions {
|
|
|
345
355
|
/** Limit to the selection when there is one (default true). */
|
|
346
356
|
useSelection?: boolean;
|
|
347
357
|
}
|
|
358
|
+
/** The `layerId` paint results report for Quick Mask edits (the selection, not a layer). */
|
|
359
|
+
export declare const QUICK_MASK_TARGET = "quick-mask";
|
|
360
|
+
/** Edit › Stroke (see `strokeSelection`). */
|
|
361
|
+
export interface StrokeSelectionOptions extends Omit<FillOptions, 'useSelection'> {
|
|
362
|
+
/** Width of the band in pixels (0 < width ≤ 250). */
|
|
363
|
+
width: number;
|
|
364
|
+
/** Where the band lies against the selection edge (default `outside`). */
|
|
365
|
+
location?: 'inside' | 'center' | 'outside';
|
|
366
|
+
}
|
|
367
|
+
/** Edit › Content-Aware Fill (see `contentAwareFill`). */
|
|
368
|
+
export interface ContentAwareFillOptions {
|
|
369
|
+
/** The pixel layer to sample and fill (default the active layer). */
|
|
370
|
+
layerId?: string;
|
|
371
|
+
/** `current` (default) paints into the layer; `new-layer` puts the fill on a new layer above it. */
|
|
372
|
+
output?: 'current' | 'new-layer';
|
|
373
|
+
/** How far around the selection to sample, in pixels (default its larger side, at least 32). */
|
|
374
|
+
sampleRadius?: number;
|
|
375
|
+
/** Random seed: the same seed gives the same fill (default 0). */
|
|
376
|
+
seed?: number;
|
|
377
|
+
}
|
|
378
|
+
/** Pixels on the editor's clipboard: RGBA, and where they were copied from (document pixels). */
|
|
379
|
+
export interface ClipboardImage extends PixelBuffer {
|
|
380
|
+
x?: number;
|
|
381
|
+
y?: number;
|
|
382
|
+
}
|
|
383
|
+
export type PasteMode = 'new-layer' | 'in-place' | 'into' | 'outside';
|
|
384
|
+
export declare const PASTE_MODES: readonly PasteMode[];
|
|
348
385
|
/** What a stroke, fill or clear changed. */
|
|
349
386
|
export interface PaintStrokeResult {
|
|
350
387
|
layerId: string;
|
|
@@ -595,10 +632,13 @@ export declare class ImageEditorController {
|
|
|
595
632
|
enabled?: boolean;
|
|
596
633
|
blend?: string;
|
|
597
634
|
opacity?: number;
|
|
635
|
+
/** Limit the filter to the selection (sets the filter mask from it, same undo step). Default false. */
|
|
636
|
+
useSelection?: boolean;
|
|
598
637
|
}): Promise<{
|
|
599
638
|
layerId: string;
|
|
600
639
|
filter: SmartFilter;
|
|
601
640
|
converted: boolean;
|
|
641
|
+
masked: boolean;
|
|
602
642
|
}>;
|
|
603
643
|
/**
|
|
604
644
|
* Changes an effect smart filter: `values` merged over its own (`null` resets a control to the
|
|
@@ -668,6 +708,14 @@ export declare class ImageEditorController {
|
|
|
668
708
|
private stack;
|
|
669
709
|
private captureHistoryEntry;
|
|
670
710
|
private restoreHistoryEntry;
|
|
711
|
+
/** Set while `asOneStep` runs: the step is already recorded, so nested commands add none. */
|
|
712
|
+
private historyGrouped;
|
|
713
|
+
/**
|
|
714
|
+
* Runs `fn` as one undo step: history is recorded once, before it, and the commands it calls
|
|
715
|
+
* record none. If `fn` throws, the step is dropped and the state goes back to before it, so a
|
|
716
|
+
* failure never leaves half a change.
|
|
717
|
+
*/
|
|
718
|
+
private asOneStep;
|
|
671
719
|
private recordHistory;
|
|
672
720
|
/**
|
|
673
721
|
* Bytes of pixel tiles held only by undo / redo steps (not by the current state). The oldest
|
|
@@ -824,11 +872,12 @@ export declare class ImageEditorController {
|
|
|
824
872
|
bounds: CropBox | null;
|
|
825
873
|
};
|
|
826
874
|
/**
|
|
827
|
-
* Adds a mask to a layer (one undo step): `reveal-all` (white), `hide-all` (black)
|
|
828
|
-
* `selection` (the selection's coverage)
|
|
875
|
+
* Adds a mask to a layer (one undo step): `reveal-all` (white), `hide-all` (black),
|
|
876
|
+
* `selection` (the selection's coverage), `hide-selection` (its inverse) or `transparency`
|
|
877
|
+
* (the layer's own alpha, so the pixels can then be made opaque and edited). Replaces an existing mask. Makes the mask the paint
|
|
829
878
|
* target when the layer is active.
|
|
830
879
|
*/
|
|
831
|
-
addLayerMask(id: string, from?: 'reveal-all' | 'hide-all' | 'selection', props?: LayerMaskProps): RasterMask;
|
|
880
|
+
addLayerMask(id: string, from?: 'reveal-all' | 'hide-all' | 'selection' | 'hide-selection' | 'transparency', props?: LayerMaskProps): RasterMask;
|
|
832
881
|
/** Removes a layer's mask (one undo step). */
|
|
833
882
|
removeLayerMask(id: string): void;
|
|
834
883
|
/** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
|
|
@@ -978,7 +1027,14 @@ export declare class ImageEditorController {
|
|
|
978
1027
|
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
979
1028
|
addSmartFilter(id: string, filter: Record<string, unknown> & {
|
|
980
1029
|
kind: string;
|
|
981
|
-
}, index?: number
|
|
1030
|
+
}, index?: number, options?: {
|
|
1031
|
+
useSelection?: boolean;
|
|
1032
|
+
}): SmartFilter;
|
|
1033
|
+
/**
|
|
1034
|
+
* After adding a smart filter: with `useSelection` and a selection, sets the filter mask from
|
|
1035
|
+
* it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
|
|
1036
|
+
*/
|
|
1037
|
+
private maskFiltersWithSelection;
|
|
982
1038
|
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
983
1039
|
updateSmartFilter(id: string, filterId: string, changes: Record<string, unknown>, commitToHistory?: boolean): SmartFilter;
|
|
984
1040
|
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
@@ -1182,6 +1238,59 @@ export declare class ImageEditorController {
|
|
|
1182
1238
|
* whole canvas. One undo step. Returns the changed bounds.
|
|
1183
1239
|
*/
|
|
1184
1240
|
clearPixels(options?: Omit<FillOptions, 'color' | 'blend'>): PaintStrokeResult;
|
|
1241
|
+
/**
|
|
1242
|
+
* Edit › Stroke: paints a band `width` px wide along the selection's edge, `inside` it, on the
|
|
1243
|
+
* `center` of the edge or `outside` it (default), with `color` (default the foreground),
|
|
1244
|
+
* `opacity` and `blend`, on a layer's pixels or mask. One undo step. Returns the changed bounds.
|
|
1245
|
+
*/
|
|
1246
|
+
strokeSelection(options: StrokeSelectionOptions): PaintStrokeResult;
|
|
1247
|
+
/**
|
|
1248
|
+
* Image › Crop to the selection's bounds (one undo step). Returns the crop box (natural
|
|
1249
|
+
* pixels). Throws without a selection.
|
|
1250
|
+
*/
|
|
1251
|
+
cropToSelection(): CropBox;
|
|
1252
|
+
/**
|
|
1253
|
+
* Edit › Content-Aware Fill: fills the selection with texture synthesised from around it
|
|
1254
|
+
* (PatchMatch, as the Spot Healing Brush's content-aware mode), blended by the selection's
|
|
1255
|
+
* coverage. `output` `current` paints into the layer; `new-layer` puts the fill on a new layer
|
|
1256
|
+
* above it. Samples within `sampleRadius` px of the selection (default its larger side, at
|
|
1257
|
+
* least 32). Deterministic for a `seed`. One undo step. 8-bit documents only for now.
|
|
1258
|
+
*/
|
|
1259
|
+
contentAwareFill(options?: ContentAwareFillOptions): {
|
|
1260
|
+
layerId: string;
|
|
1261
|
+
bounds: CropBox;
|
|
1262
|
+
output: 'current' | 'new-layer';
|
|
1263
|
+
};
|
|
1264
|
+
/** The pixel clipboard (Copy / Cut), or null. */
|
|
1265
|
+
private clipboard;
|
|
1266
|
+
/** What Copy or Cut last put on the editor's clipboard, or null. */
|
|
1267
|
+
getClipboard(): ClipboardImage | null;
|
|
1268
|
+
/** Puts pixels on the editor's clipboard (e.g. an image pasted from the system clipboard). */
|
|
1269
|
+
setClipboard(image: ClipboardImage | null): void;
|
|
1270
|
+
/**
|
|
1271
|
+
* Edit › Copy (or Copy Merged with `merged`): the selected pixels of a pixel layer (default the
|
|
1272
|
+
* active one) or of the whole visible image, cropped to the selection's bounds, with the
|
|
1273
|
+
* selection's soft edge in their alpha. Without a selection, the whole canvas. Not an undo step.
|
|
1274
|
+
*/
|
|
1275
|
+
copyPixels(options?: {
|
|
1276
|
+
layerId?: string;
|
|
1277
|
+
merged?: boolean;
|
|
1278
|
+
}): ClipboardImage;
|
|
1279
|
+
/** Edit › Cut: Copy, then clear the selected pixels, as one undo step. */
|
|
1280
|
+
cutPixels(options?: {
|
|
1281
|
+
layerId?: string;
|
|
1282
|
+
}): ClipboardImage;
|
|
1283
|
+
/**
|
|
1284
|
+
* Edit › Paste as a new pixel layer above the active one (one undo step): `new-layer` centred
|
|
1285
|
+
* on the selection (or the canvas), `in-place` where it was copied, `into` centred in the
|
|
1286
|
+
* selection with the selection as its mask (Paste Into), or `outside` with the inverse
|
|
1287
|
+
* (Paste Outside). Returns the new layer id and where it went.
|
|
1288
|
+
*/
|
|
1289
|
+
pastePixels(mode?: PasteMode, image?: ClipboardImage | null): {
|
|
1290
|
+
layerId: string;
|
|
1291
|
+
bounds: CropBox;
|
|
1292
|
+
masked: boolean;
|
|
1293
|
+
};
|
|
1185
1294
|
private fillOrClear;
|
|
1186
1295
|
/** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
|
|
1187
1296
|
private developLayer;
|
|
@@ -1265,6 +1374,27 @@ export declare class ImageEditorController {
|
|
|
1265
1374
|
selectAll(): boolean;
|
|
1266
1375
|
/** Select › Deselect. */
|
|
1267
1376
|
deselect(): boolean;
|
|
1377
|
+
/** The selection a Deselect cleared, for `reselect` (not saved, not part of history). */
|
|
1378
|
+
private lastSelection;
|
|
1379
|
+
/** Whether `reselect` has a selection to bring back. */
|
|
1380
|
+
canReselect(): boolean;
|
|
1381
|
+
/** Select › Reselect: brings back the last selection a Deselect cleared, as one undo step. */
|
|
1382
|
+
reselect(): boolean;
|
|
1383
|
+
/**
|
|
1384
|
+
* Single Row / Single Column Marquee: a 1 px line across the whole image at `position`
|
|
1385
|
+
* (natural pixels; y for a row, x for a column).
|
|
1386
|
+
*/
|
|
1387
|
+
selectLine(orientation: 'row' | 'column', position: number, options?: SelectionCommandOptions): boolean;
|
|
1388
|
+
/** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
|
|
1389
|
+
growSelection(options?: GrowSimilarOptions & SampleOptions): Promise<boolean>;
|
|
1390
|
+
/** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
|
|
1391
|
+
selectSimilar(options?: GrowSimilarOptions & SampleOptions): Promise<boolean>;
|
|
1392
|
+
/**
|
|
1393
|
+
* Load Selection from a layer's transparency (Ctrl/⌘-click its thumbnail): its alpha in
|
|
1394
|
+
* document space, combined by `mode`. Works on pixel, shape, type and smart object layers.
|
|
1395
|
+
*/
|
|
1396
|
+
selectLayerTransparency(id: string, options?: SelectionCommandOptions): boolean;
|
|
1397
|
+
private layerTransparency;
|
|
1268
1398
|
/** Select › Inverse (with nothing selected, selects everything). */
|
|
1269
1399
|
invertSelection(): boolean;
|
|
1270
1400
|
private shapeCommand;
|
|
@@ -1294,6 +1424,13 @@ export declare class ImageEditorController {
|
|
|
1294
1424
|
magicWand(point: ImagePoint, options?: MagicWandOptions & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1295
1425
|
/** Select › Color Range with colour samples (`#rrggbb` or `[r, g, b]`, optionally where they were picked). */
|
|
1296
1426
|
selectColorRange(samples: ColorRangeSample[], options?: ColorRangeOptions & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1427
|
+
/**
|
|
1428
|
+
* Select › Color Range with a preset: `reds` … `magentas`, `highlights` / `midtones` /
|
|
1429
|
+
* `shadows` (with `falloff` levels, default 20) or `skinTones`. One undo step.
|
|
1430
|
+
*/
|
|
1431
|
+
selectColorRangePreset(preset: ColorRangePreset, options?: {
|
|
1432
|
+
falloff?: number;
|
|
1433
|
+
} & SelectionCommandOptions & SampleOptions): Promise<SelectionMask | null>;
|
|
1297
1434
|
/** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
|
|
1298
1435
|
modifySelection(op: SelectionModifyOp, radius: number): boolean;
|
|
1299
1436
|
/**
|
|
@@ -1333,6 +1470,66 @@ export declare class ImageEditorController {
|
|
|
1333
1470
|
}>;
|
|
1334
1471
|
/** Quick Mask view (tints the unselected area). View state: no undo step. */
|
|
1335
1472
|
setQuickMask(on: boolean): void;
|
|
1473
|
+
/** How the canvas shows the selection (`state.selectionDisplay`). */
|
|
1474
|
+
getSelectionDisplay(): SelectionDisplay;
|
|
1475
|
+
/**
|
|
1476
|
+
* Shows the selection as marching ants, as a Quick Mask tint over the unselected area, or hides
|
|
1477
|
+
* it (the selection still applies). View state: no undo step, not saved.
|
|
1478
|
+
*/
|
|
1479
|
+
setSelectionDisplay(display: SelectionDisplay): void;
|
|
1480
|
+
/** The alpha channels (saved selections), in panel order. */
|
|
1481
|
+
getChannels(): readonly AlphaChannel[];
|
|
1482
|
+
getChannel(id: string): AlphaChannel | null;
|
|
1483
|
+
private requireChannel;
|
|
1484
|
+
private setChannels;
|
|
1485
|
+
private newChannelId;
|
|
1486
|
+
/**
|
|
1487
|
+
* Select › Save Selection: a new alpha channel (`name`, default "Alpha n") holding the
|
|
1488
|
+
* selection, or with `channelId` the selection combined into that channel by `mode` (replace,
|
|
1489
|
+
* add, subtract, intersect). One undo step. Throws without a selection.
|
|
1490
|
+
*/
|
|
1491
|
+
saveSelection(options?: {
|
|
1492
|
+
channelId?: string;
|
|
1493
|
+
name?: string;
|
|
1494
|
+
mode?: SelectionMode;
|
|
1495
|
+
}): AlphaChannel;
|
|
1496
|
+
/**
|
|
1497
|
+
* Select › Load Selection from an alpha channel (inverted with `invert`), combined with the
|
|
1498
|
+
* selection by `mode`. One undo step.
|
|
1499
|
+
*/
|
|
1500
|
+
loadSelectionFromChannel(id: string, options?: {
|
|
1501
|
+
mode?: SelectionMode;
|
|
1502
|
+
invert?: boolean;
|
|
1503
|
+
}): boolean;
|
|
1504
|
+
/** Changes a channel's name, overlay colour, opacity, what it indicates or visibility (one undo step). */
|
|
1505
|
+
setChannelProperties(id: string, props: Partial<Pick<AlphaChannel, 'name' | 'color' | 'opacity' | 'indicates' | 'visible'>>): AlphaChannel;
|
|
1506
|
+
/** Deletes an alpha channel (one undo step). */
|
|
1507
|
+
deleteChannel(id: string): void;
|
|
1508
|
+
/** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
|
|
1509
|
+
duplicateChannel(id: string, name?: string): AlphaChannel;
|
|
1510
|
+
/** Channel summaries (no pixels) for panels and agents. */
|
|
1511
|
+
describeChannels(): {
|
|
1512
|
+
bounds: CropBox | null;
|
|
1513
|
+
percent: number;
|
|
1514
|
+
id: string;
|
|
1515
|
+
name: string;
|
|
1516
|
+
color: string;
|
|
1517
|
+
opacity: number;
|
|
1518
|
+
indicates: "masked" | "selected";
|
|
1519
|
+
visible: boolean;
|
|
1520
|
+
}[];
|
|
1521
|
+
/** Whether Quick Mask mode is on (painting edits the selection). */
|
|
1522
|
+
get quickMaskEditing(): boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* Quick Mask mode (Q): on, the selection shows as a tint and painting, fills and strokes that
|
|
1525
|
+
* name no layer edit the selection itself (white selects, black deselects, grey partly);
|
|
1526
|
+
* off, it shows as marching ants again. View state: no undo step (the edits are).
|
|
1527
|
+
*/
|
|
1528
|
+
setQuickMaskMode(on: boolean): void;
|
|
1529
|
+
/** The selection as a 1-channel surface to paint in Quick Mask mode. */
|
|
1530
|
+
private quickMaskSurface;
|
|
1531
|
+
/** The selection a painted Quick Mask surface stands for (`rects` changed since `base`). */
|
|
1532
|
+
private selectionFromSurface;
|
|
1336
1533
|
private maskFromSelection;
|
|
1337
1534
|
/**
|
|
1338
1535
|
* Adds the selection as the layer's mask (Reveal Selection), replacing any mask, as one undo
|
|
@@ -1344,8 +1541,11 @@ export declare class ImageEditorController {
|
|
|
1344
1541
|
setAdjustmentLayerMask(layerId: string, mask: SelectionMask | null, props?: LayerMaskProps): boolean;
|
|
1345
1542
|
/** Changes a layer mask's density (0..1), feather (px) or enabled flag; the mask pixels are kept. */
|
|
1346
1543
|
setAdjustmentLayerMaskProps(layerId: string, props: LayerMaskProps, commitToHistory?: boolean): boolean;
|
|
1347
|
-
/**
|
|
1348
|
-
|
|
1544
|
+
/**
|
|
1545
|
+
* Load Selection from a layer mask (its pixels; density and feather are not applied), inverted
|
|
1546
|
+
* with `invert`. False without a painted mask (a depth mask is computed, not painted).
|
|
1547
|
+
*/
|
|
1548
|
+
selectionFromLayerMask(layerId: string, mode?: SelectionMode, invert?: boolean): boolean;
|
|
1349
1549
|
/**
|
|
1350
1550
|
* Histogram of the last rendered preview (after adjustments and layers, before annotations),
|
|
1351
1551
|
* or `null` before the first render or without canvas pixel access.
|