@pixerate/editor 0.101.0 → 0.102.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/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/{chunk-WIR377F6.js → chunk-67FRIOPZ.js} +15 -12
- package/dist/chunk-67FRIOPZ.js.map +1 -0
- package/dist/{chunk-WT6ZAWJP.cjs → chunk-WSTEXEKD.cjs} +27 -24
- package/dist/chunk-WSTEXEKD.cjs.map +1 -0
- package/dist/image-editor/index.cjs +2843 -1050
- package/dist/image-editor/index.cjs.map +1 -1
- package/dist/image-editor/index.d.cts +644 -16
- package/dist/image-editor/index.d.ts +644 -16
- package/dist/image-editor/index.js +2487 -694
- package/dist/image-editor/index.js.map +1 -1
- package/dist/raster/index.cjs +2 -2
- package/dist/raster/index.d.cts +99 -91
- package/dist/raster/index.d.ts +99 -91
- package/dist/raster/index.js +1 -1
- package/package.json +1 -1
- package/skills/pixerate-image-editor/SKILL.md +69 -11
- package/dist/chunk-WIR377F6.js.map +0 -1
- package/dist/chunk-WT6ZAWJP.cjs.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { RasterLayerBase, RasterMask as RasterMask$1, RasterPixelLayer, GroupBlendMode, LayerLocation as LayerLocation$1, LayerLocks, LayerEffect,
|
|
1
|
+
import { RasterLayerBase, RasterMask as RasterMask$1, RasterPixelLayer, GroupBlendMode, GlobalLight, EffectPattern, Interpolation, LayerLocation as LayerLocation$1, LayerLocks, LayerEffect, LayerEffects, RasterSources, RasterCompositor, CompositorOptions, LayerEffectKind } from '../raster/index.cjs';
|
|
2
2
|
export { BevelContour, BevelEmbossEffect, BevelStyle, BevelTechnique, BevelTexture, ColorOverlayEffect, CompositeCallOptions, CompositeStats, ContourPoint, DEFAULT_GLOBAL_LIGHT, DIRECT_GAUSSIAN_MAX_SIGMA, DecodedPng, DropShadowEffect, EffectContour, EffectFill, EffectGradient, EffectPatternRef, EffectRect, GlowTechnique, GradientColorStop, GradientOpacityStop, GradientOverlayEffect, GradientStyle, INTERPOLATIONS, InnerGlowEffect, InnerShadowEffect, LAYER_EFFECT_KINDS, LayerEffectError, MAX_EFFECT_REACH, MAX_TRANSFORM_PIXELS, OuterGlowEffect, PatternOverlayEffect, PatternPlacement, PatternTile, ResampleOptions, SatinEffect, StrokeEffect, StrokePosition, TransformTooLargeError, ZlibError, adler32, base64ToBytes, blendTile, builtinPattern, builtinPatternIds, bytesToBase64, changedTiles, compositeSurfaceOver, curveLut, decodePng, defaultEffectGradient, defaultLayerEffect, deflate, deflateRaw, effectColorHex, effectReach, effectsFingerprint, effectsMargin, effectsScale, encodePng, findLayer, flattenLayers, gaussianBlur, hasActiveEffects, hashNoise, inflate, inflateRaw, insertLayer, isInterpolation, isLayerEffectKind, isLayerLocked, isPng, keysWeight, layerEffectFields, layerEffectLabel, mapLayer, mergeLayerEffect, newEffectId, normalizeLayerEffects, parseDataUrl, parseEffectColor, pngDataUrl, reduceSurface, renderLayerEffects, scaleLayerEffect, transformSurface, transformedBounds, validateEffectGradient, validateLayerEffect, validateLayerEffects, warpSurface } from '../raster/index.cjs';
|
|
3
|
-
import { P as PixelSurface, T as TiledSurface,
|
|
4
|
-
export { a as BLEND_MODES, b as BlendModeInfo, M as MaskSurface,
|
|
3
|
+
import { P as PixelSurface, B as BlendMode, T as TiledSurface, R as RasterRect } from '../surface-DIA-XatS.cjs';
|
|
4
|
+
export { a as BLEND_MODES, b as BlendModeInfo, M as MaskSurface, c as Rgb, d as Rgba, S as SurfaceDraft, e as TILE, f as TILE_SHIFT, g as Tile, h as TileKey, i as blendChannel, j as blendImageData, k as blendLum, l as blendPixel, m as blendRgb, n as canvasCompositeOperation, o as collectTiles, p as contentBounds, q as emptySurface, r as fillRect, s as finishTile, t as isBlendMode, u as isSeparableBlendMode, v as mixPigment8, w as mixPigmentRgb, x as normalizeBlendMode, y as packRgba, z as readPixel, A as readRegion, C as setLum, D as solidSurface, E as surfaceBytes, F as surfaceFromPixels, G as surfacesEqual, H as tileCoord, I as tileKey, J as tileRect, K as tilesInRect, L as translateSurface, N as uniformTile, O as writeRegion } from '../surface-DIA-XatS.cjs';
|
|
5
|
+
import { Q as Quad, a as WarpMesh, V as Vec2, A as AffineMatrix, H as Homography, W as WarpStyle } from '../types-CwMPoRMU.cjs';
|
|
5
6
|
import { BrushSettings, MixerSettings, MixerLoad, StrokeCoverage, MixerTarget, MixerStroke, StrokeApply, StrokePoint } from '../paint/index.cjs';
|
|
6
7
|
export { CoverageMap, DEFAULT_BRUSH, DEFAULT_MIXER, Dab, DabWalker, EMPTY_MIXER_LOAD, MAX_BRUSH_SIZE, MIXER_DRAIN, MIXER_PICKUP_RATE, MIXING_MODELS, MixingModel, PIGMENT_BANDS, PIGMENT_LAMBDA_MIN, PIGMENT_LAMBDA_STEP, PIGMENT_WAVELENGTHS, Pigment, PigmentOptions, PigmentRgb, applyStrokeToTile, cleanMixer, coverageTileCoord, createPigment, createPigmentTools, dabCoverage, dabRect, lerpPigment, lerpPigmentInto, loadMixer, mixPigments, normalizeBrush, normalizeMixer, rasterizeDab, reflectanceToRgb, rgbToReflectance, setPigmentColor, smoothPoints, tipFalloff, tipReach, tipShape, walkDabs } from '../paint/index.cjs';
|
|
7
|
-
import { Q as Quad, a as WarpMesh, V as Vec2, A as AffineMatrix, H as Homography, W as WarpStyle } from '../types-CwMPoRMU.cjs';
|
|
8
8
|
import { b as WarpPreset } from '../warp-nYs2DPrx.cjs';
|
|
9
9
|
export { W as WARP_STYLES, a as WARP_STYLE_LABELS, c as applyHomography, B as boxQuad, d as dragWarpMeshPoint, e as evalWarpMesh, C as homographyFromAffine, l as homographyFromPoints, q as identityWarpMesh, D as invertHomography, p as pullWarpMesh, E as rectToQuad, h as resizeWarpMesh, u as warpMeshEditPoints, v as warpMeshGridCurves, x as warpMeshParamAt, A as warpPresetMesh } from '../warp-nYs2DPrx.cjs';
|
|
10
10
|
import { b as LoadReport, J as JsonObject, f as MigrationStep } from '../migrate-iTlm3a8h.cjs';
|
|
@@ -175,10 +175,125 @@ interface AnnotationLayer extends LayerBase {
|
|
|
175
175
|
type: 'annotation';
|
|
176
176
|
annotation: Annotation;
|
|
177
177
|
}
|
|
178
|
-
|
|
178
|
+
/** A nested layer document: the contents of a smart object made from layers (or an embedded PSD). */
|
|
179
|
+
interface SmartDocument {
|
|
180
|
+
/** Bottom to top, on a canvas of the contents' `width × height`. */
|
|
181
|
+
layers: ImageLayer[];
|
|
182
|
+
globalLight?: GlobalLight;
|
|
183
|
+
patterns?: EffectPattern[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* What a smart object places: raster pixels or a nested layer document, at their own pixel size.
|
|
187
|
+
* Immutable and shared: every instance placed from the same contents (duplicates, linked
|
|
188
|
+
* instances) holds the same `id`, and replacing or editing the contents updates them all.
|
|
189
|
+
*/
|
|
190
|
+
interface SmartContents {
|
|
191
|
+
/** Shared by linked instances; independent copies get a fresh one. */
|
|
192
|
+
id: string;
|
|
193
|
+
/** File name shown in the UI and written to PSD (`Layer 1.psb`, `photo.png`). */
|
|
194
|
+
name: string;
|
|
195
|
+
/** Pixel size of the contents (the placement maps `0..width × 0..height` into the document). */
|
|
196
|
+
width: number;
|
|
197
|
+
height: number;
|
|
198
|
+
/** `raster`: `raster` holds the pixels at (0, 0); `document`: `document` holds the layers. */
|
|
199
|
+
kind: 'raster' | 'document';
|
|
200
|
+
raster?: PixelSurface;
|
|
201
|
+
document?: SmartDocument;
|
|
202
|
+
/**
|
|
203
|
+
* The file the contents came from (a PSD's embedded file), written back by Export Contents and
|
|
204
|
+
* PSD export while the contents are unedited. Without `raster` / `document` the file could not
|
|
205
|
+
* be decoded here (a JPEG outside a browser): the layer keeps its rendered pixels, and changes
|
|
206
|
+
* that re-render it are refused until `prepareSmartObjects` decodes it.
|
|
207
|
+
*/
|
|
208
|
+
file?: {
|
|
209
|
+
bytes: Uint8Array;
|
|
210
|
+
type: string;
|
|
211
|
+
};
|
|
212
|
+
/** Linked to an external file (Photoshop `liFE`): only the embedded preview is held. */
|
|
213
|
+
linked?: {
|
|
214
|
+
path: string;
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Where a smart object's contents land, non-destructively: a warp in the contents' own pixels
|
|
219
|
+
* (optional) and then the map of the contents' rectangle onto `corners`. Every change re-renders
|
|
220
|
+
* from the contents, so repeated transforms never degrade.
|
|
221
|
+
*/
|
|
222
|
+
interface SmartPlacement {
|
|
223
|
+
/** Where the contents' corners land (top-left, top-right, bottom-right, bottom-left), document pixels. */
|
|
224
|
+
corners: Quad;
|
|
225
|
+
/** A Bézier warp over the contents' rectangle, control points in contents pixels (missing = none). */
|
|
226
|
+
warp?: WarpMesh | null;
|
|
227
|
+
/** Resampling (default bicubic). */
|
|
228
|
+
interpolation?: Interpolation;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* A Photoshop smart filter we do not model (Gaussian Blur, Camera Raw, …), kept from a PSD so it
|
|
232
|
+
* is listed, can be hidden, reordered or deleted, and is written back unchanged. It draws nothing.
|
|
233
|
+
*/
|
|
234
|
+
interface PsdSmartFilter {
|
|
235
|
+
id: string;
|
|
236
|
+
kind: 'psd';
|
|
237
|
+
enabled: boolean;
|
|
238
|
+
/** Photoshop's menu name (`Gaussian Blur...`). */
|
|
239
|
+
name: string;
|
|
240
|
+
/** The filter's `filterFX` item descriptor (versioned descriptor bytes), as read. */
|
|
241
|
+
data: Uint8Array;
|
|
242
|
+
}
|
|
243
|
+
/** One smart filter: a layer filter (or a kept PSD filter) with its own blending over the result below it. */
|
|
244
|
+
type SmartFilter = (LayerFilter | PsdSmartFilter) & {
|
|
245
|
+
/** How the filter's result blends with the result below it (Photoshop's Blending Options). */
|
|
246
|
+
blend: BlendMode;
|
|
247
|
+
/** 0..1 */
|
|
248
|
+
opacity: number;
|
|
249
|
+
};
|
|
250
|
+
type SmartFilterKind = SmartFilter['kind'];
|
|
251
|
+
/** The smart filter stack of a smart object. */
|
|
252
|
+
interface SmartFilterStack {
|
|
253
|
+
/** Layer › Smart Filter › Disable Smart Filters (each filter keeps its own `enabled`). */
|
|
254
|
+
enabled: boolean;
|
|
255
|
+
/** Bottom (applied first) to top. */
|
|
256
|
+
filters: SmartFilter[];
|
|
257
|
+
/**
|
|
258
|
+
* The one filter mask (document space): where the filtered result shows over the unfiltered
|
|
259
|
+
* contents. Missing reveals everywhere.
|
|
260
|
+
*/
|
|
261
|
+
mask?: RasterMask;
|
|
262
|
+
}
|
|
263
|
+
/** PSD data of a smart object kept for round trips (see the PSD module). */
|
|
264
|
+
interface SmartPsdData {
|
|
265
|
+
/** The placed-layer block as read (`SoLd`, `SoLE` or `PlLd`) and its key. */
|
|
266
|
+
key: string;
|
|
267
|
+
data: Uint8Array;
|
|
268
|
+
/** The instance id (`placed`), which keys the filter-effects cache. */
|
|
269
|
+
placed?: string;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* A smart object: `contents` placed through `placement`, then the smart filters. `surface` is the
|
|
273
|
+
* rendered result in document space (offset 0), rebuilt by every change to the contents,
|
|
274
|
+
* placement or filters; the compositor draws it like a pixel layer's pixels, and masks, effects,
|
|
275
|
+
* clipping and blend apply on top. Never paint into it: rasterize the layer first.
|
|
276
|
+
*/
|
|
277
|
+
interface SmartObjectLayer extends LayerBase {
|
|
278
|
+
type: 'smart';
|
|
279
|
+
contents: SmartContents;
|
|
280
|
+
placement: SmartPlacement;
|
|
281
|
+
smartFilters?: SmartFilterStack;
|
|
282
|
+
/** The rendered pixels (a cache of contents → placement → filters), document space. */
|
|
283
|
+
surface: PixelSurface;
|
|
284
|
+
/** Always (0, 0): a smart object moves through its placement. */
|
|
285
|
+
offset: {
|
|
286
|
+
x: number;
|
|
287
|
+
y: number;
|
|
288
|
+
};
|
|
289
|
+
/** 0..1, PSD "Fill" (missing = 1). */
|
|
290
|
+
fillOpacity?: number;
|
|
291
|
+
psd?: SmartPsdData;
|
|
292
|
+
}
|
|
293
|
+
type ImageLayer = PixelLayer | AdjustmentLayerNode | GroupLayer | AnnotationLayer | SmartObjectLayer;
|
|
179
294
|
type ImageLayerType = ImageLayer['type'];
|
|
180
|
-
/** Which part of the active layer painting targets. */
|
|
181
|
-
type LayerTarget = 'pixels' | 'mask';
|
|
295
|
+
/** Which part of the active layer painting targets (`filter-mask`: a smart object's filter mask). */
|
|
296
|
+
type LayerTarget = 'pixels' | 'mask' | 'filter-mask';
|
|
182
297
|
/** A fresh id with `prefix` (`layer`, `flt`, …). */
|
|
183
298
|
declare function newLayerId(prefix?: string): string;
|
|
184
299
|
type LayerLocation = LayerLocation$1<ImageLayer>;
|
|
@@ -196,6 +311,10 @@ declare function isSpatialFilter(f: LayerFilter): boolean;
|
|
|
196
311
|
declare function pixelLayerBounds(layer: PixelLayer, surface?: PixelSurface): CropBox | null;
|
|
197
312
|
/** Human label of a layer kind. */
|
|
198
313
|
declare function layerTypeLabel(type: ImageLayerType): string;
|
|
314
|
+
/** Layers whose pixels are a surface the compositor draws (pixel layers and smart objects). */
|
|
315
|
+
declare function hasSurface(layer: ImageLayer): layer is PixelLayer | SmartObjectLayer;
|
|
316
|
+
/** Every smart object in the stack (nested contents not included). */
|
|
317
|
+
declare function smartObjectLayers(layers: readonly ImageLayer[]): SmartObjectLayer[];
|
|
199
318
|
|
|
200
319
|
/**
|
|
201
320
|
* Schema version 3 of the image editor document: the layer tree, with pixel layers and painted
|
|
@@ -270,7 +389,65 @@ interface SerializedAnnotationLayer extends SerializedLayerBase {
|
|
|
270
389
|
type: 'annotation';
|
|
271
390
|
annotation: Annotation;
|
|
272
391
|
}
|
|
273
|
-
|
|
392
|
+
/** A smart filter as stored (a Photoshop filter keeps its descriptor as base64). */
|
|
393
|
+
type SerializedSmartFilter = (LayerFilter | (Omit<PsdSmartFilter, 'data'> & {
|
|
394
|
+
data: string;
|
|
395
|
+
})) & {
|
|
396
|
+
blend: string;
|
|
397
|
+
opacity: number;
|
|
398
|
+
};
|
|
399
|
+
interface SerializedSmartObjectLayer extends SerializedLayerBase {
|
|
400
|
+
type: 'smart';
|
|
401
|
+
/** Id of its entry in the document's `smartContents` (shared by linked instances). */
|
|
402
|
+
contents: string;
|
|
403
|
+
placement: {
|
|
404
|
+
corners: Array<{
|
|
405
|
+
x: number;
|
|
406
|
+
y: number;
|
|
407
|
+
}>;
|
|
408
|
+
warp?: WarpMesh;
|
|
409
|
+
interpolation?: string;
|
|
410
|
+
};
|
|
411
|
+
smartFilters?: {
|
|
412
|
+
enabled: boolean;
|
|
413
|
+
filters: SerializedSmartFilter[];
|
|
414
|
+
mask?: SerializedRasterMask;
|
|
415
|
+
};
|
|
416
|
+
/** The rendered pixels (RGBA PNG) at `x`, `y` in document space, so a load does not re-render. */
|
|
417
|
+
asset?: string;
|
|
418
|
+
x?: number;
|
|
419
|
+
y?: number;
|
|
420
|
+
fillOpacity?: number;
|
|
421
|
+
/** The PSD placed-layer block kept for round trips (base64). */
|
|
422
|
+
psd?: {
|
|
423
|
+
key: string;
|
|
424
|
+
data: string;
|
|
425
|
+
placed?: string;
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
/** Smart object contents as stored once per document, referenced by id from every instance. */
|
|
429
|
+
interface SerializedSmartContents {
|
|
430
|
+
id: string;
|
|
431
|
+
name: string;
|
|
432
|
+
width: number;
|
|
433
|
+
height: number;
|
|
434
|
+
kind: 'raster' | 'document';
|
|
435
|
+
/** Raster contents: RGBA PNG asset at (0, 0). */
|
|
436
|
+
asset?: string;
|
|
437
|
+
/** Document contents: the nested layers (their assets are in the document's `assets`). */
|
|
438
|
+
layers?: SerializedLayer[];
|
|
439
|
+
globalLight?: GlobalLight;
|
|
440
|
+
patterns?: SerializedPattern[];
|
|
441
|
+
/** The file the contents came from (base64), written back while unedited. */
|
|
442
|
+
file?: {
|
|
443
|
+
type: string;
|
|
444
|
+
data: string;
|
|
445
|
+
};
|
|
446
|
+
linked?: {
|
|
447
|
+
path: string;
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
type SerializedLayer = SerializedPixelLayer | SerializedAdjustmentLayer | SerializedGroupLayer | SerializedAnnotationLayer | SerializedSmartObjectLayer;
|
|
274
451
|
/** A version 3 document (layers). */
|
|
275
452
|
interface SerializedLayeredImageEditorState {
|
|
276
453
|
version: 3;
|
|
@@ -293,6 +470,8 @@ interface SerializedLayeredImageEditorState {
|
|
|
293
470
|
globalLight?: GlobalLight;
|
|
294
471
|
/** The document's patterns for pattern effects, each an RGBA PNG data URL. */
|
|
295
472
|
patterns?: SerializedPattern[];
|
|
473
|
+
/** Contents of the smart objects (nested ones included), each stored once. */
|
|
474
|
+
smartContents?: SerializedSmartContents[];
|
|
296
475
|
}
|
|
297
476
|
interface SerializedPattern {
|
|
298
477
|
id: string;
|
|
@@ -312,15 +491,23 @@ declare function encodeSurface(surface: TiledSurface): EncodedSurface | null;
|
|
|
312
491
|
interface SerializeContext {
|
|
313
492
|
/** Adds an asset and returns its id. */
|
|
314
493
|
addAsset(url: string, hint: string): string;
|
|
494
|
+
/** Stores a smart object's contents (once per id). Without it, smart objects cannot be written. */
|
|
495
|
+
addContents?(contents: SmartContents): void;
|
|
315
496
|
}
|
|
316
497
|
declare function serializeEffects(effects: LayerEffects): SerializedLayerEffects;
|
|
317
498
|
/** Reads stored effects (leniently: broken effects are dropped), or `undefined`. */
|
|
318
499
|
declare function deserializeEffects(raw: unknown): LayerEffects | undefined;
|
|
319
500
|
declare function serializeLayer(layer: ImageLayer, ctx: SerializeContext): SerializedLayer;
|
|
320
|
-
/**
|
|
501
|
+
/** Writes one contents entry (nested layers add their own assets and contents to `ctx`). */
|
|
502
|
+
declare function serializeContents(c: SmartContents, ctx: SerializeContext): SerializedSmartContents;
|
|
503
|
+
/**
|
|
504
|
+
* Serializes a layer tree with inline assets (asset ids are derived from layer ids). Smart object
|
|
505
|
+
* contents go to `smartContents`, once each (present only when there are smart objects).
|
|
506
|
+
*/
|
|
321
507
|
declare function serializeLayers(layers: readonly ImageLayer[]): {
|
|
322
508
|
layers: SerializedLayer[];
|
|
323
509
|
assets: Record<string, string>;
|
|
510
|
+
smartContents?: SerializedSmartContents[];
|
|
324
511
|
};
|
|
325
512
|
/**
|
|
326
513
|
* Where a host keeps layer pixels outside the JSON (`toJSON({ assets: 'external', store })`):
|
|
@@ -341,6 +528,7 @@ interface ImageEditorAssetStore {
|
|
|
341
528
|
declare function serializeLayersExternal(layers: readonly ImageLayer[], store: ImageEditorAssetStore): Promise<{
|
|
342
529
|
layers: SerializedLayer[];
|
|
343
530
|
assets: Record<string, string>;
|
|
531
|
+
smartContents?: SerializedSmartContents[];
|
|
344
532
|
}>;
|
|
345
533
|
/**
|
|
346
534
|
* Turns external asset references back into data URLs through `store.get` (data URLs pass through),
|
|
@@ -349,6 +537,15 @@ declare function serializeLayersExternal(layers: readonly ImageLayer[], store: I
|
|
|
349
537
|
declare function resolveExternalAssets(assets: Record<string, string>, store: ImageEditorAssetStore | undefined, problems: string[]): Promise<Record<string, string>>;
|
|
350
538
|
interface DeserializeContext {
|
|
351
539
|
assets: Record<string, string>;
|
|
540
|
+
/** The stored `smartContents` table (smart objects reference it by id). */
|
|
541
|
+
smartContents?: unknown[];
|
|
542
|
+
/** Canvas size, for re-rendering a smart object stored without its pixels (default 1 × 1). */
|
|
543
|
+
canvas?: {
|
|
544
|
+
width: number;
|
|
545
|
+
height: number;
|
|
546
|
+
};
|
|
547
|
+
/** @internal Contents read so far by id (`null` while being read). */
|
|
548
|
+
contentsMemo?: Map<string, SmartContents | null>;
|
|
352
549
|
/** Decodes an asset (PNG data URL by default). Throw for an unusable asset. */
|
|
353
550
|
decodeAsset?(ref: string, channels: 1 | 4): {
|
|
354
551
|
width: number;
|
|
@@ -419,8 +616,8 @@ declare function histogramPath(histogram: ImageHistogram, channel: HistogramChan
|
|
|
419
616
|
|
|
420
617
|
/** What the compositor needs from its host besides the layers. */
|
|
421
618
|
interface CompositorSources extends RasterSources {
|
|
422
|
-
/** The pixels of a pixel layer (resolves layers whose pixels are the document source). */
|
|
423
|
-
surfaceOf?(layer: PixelLayer): PixelSurface;
|
|
619
|
+
/** The pixels of a pixel layer or smart object (resolves layers whose pixels are the document source). */
|
|
620
|
+
surfaceOf?(layer: PixelLayer | SmartObjectLayer): PixelSurface;
|
|
424
621
|
/**
|
|
425
622
|
* A parametric mask's depth map as RGBA at canvas size (the red channel is the depth), or
|
|
426
623
|
* `null` while it is unavailable (the mask then reveals everything).
|
|
@@ -437,6 +634,8 @@ interface CompositorSources extends RasterSources {
|
|
|
437
634
|
declare function adjustmentNodeAsLayer(node: AdjustmentLayerNode): AdjustmentLayer;
|
|
438
635
|
/** Evaluates a depth mask (see `applyDepthMask`) into one coverage byte per depth sample. */
|
|
439
636
|
declare function depthMaskAlpha(depth: number, options: DepthMaskOptions): number;
|
|
637
|
+
/** Runs layer filters (develop, blur) over RGBA `data` (`width × height`) in place, bottom first. */
|
|
638
|
+
declare function runLayerFilters(data: Uint8ClampedArray, width: number, height: number, filters: readonly LayerFilter[]): void;
|
|
440
639
|
/** The per-tile compositor for image editor layer stacks (see the raster module for the caches). */
|
|
441
640
|
declare class LayerCompositor extends RasterCompositor<ImageLayer, CompositorSources> {
|
|
442
641
|
constructor(options?: CompositorOptions);
|
|
@@ -1413,8 +1612,8 @@ interface FreeTransformHost {
|
|
|
1413
1612
|
width: number;
|
|
1414
1613
|
height: number;
|
|
1415
1614
|
};
|
|
1416
|
-
/** The pixels a pixel layer composites (the decoded source for the Background). */
|
|
1417
|
-
pixelsOf(layer: PixelLayer): TiledSurface;
|
|
1615
|
+
/** The pixels a pixel layer or smart object composites (the decoded source for the Background). */
|
|
1616
|
+
pixelsOf(layer: PixelLayer | SmartObjectLayer): TiledSurface;
|
|
1418
1617
|
/** Opaque pre-transform snapshot. */
|
|
1419
1618
|
capture(): unknown;
|
|
1420
1619
|
/** Shows a live state (no history). */
|
|
@@ -1442,7 +1641,19 @@ declare class FreeTransformSession {
|
|
|
1442
1641
|
readonly box: CropBox;
|
|
1443
1642
|
/** What moves. */
|
|
1444
1643
|
readonly moves: ReadonlyArray<'pixels' | 'mask' | 'selection'>;
|
|
1644
|
+
/**
|
|
1645
|
+
* The geometry the transform starts from: the identity over `box`, or for a smart object its
|
|
1646
|
+
* placement (`box` is then the contents' rectangle in contents pixels, and the transform edits
|
|
1647
|
+
* the placement without resampling anything twice).
|
|
1648
|
+
*/
|
|
1649
|
+
readonly startGeometry: FreeTransformGeometry;
|
|
1650
|
+
/** True when the layer is a smart object (the transform sets its placement). */
|
|
1651
|
+
readonly smartObject: boolean;
|
|
1445
1652
|
private geometryValue;
|
|
1653
|
+
private readonly smart;
|
|
1654
|
+
private readonly smartReduced;
|
|
1655
|
+
private readonly startInterp;
|
|
1656
|
+
private smartMasksMoved;
|
|
1446
1657
|
private interp;
|
|
1447
1658
|
private readonly parts;
|
|
1448
1659
|
private readonly before;
|
|
@@ -1469,6 +1680,10 @@ declare class FreeTransformSession {
|
|
|
1469
1680
|
}, preview?: FreeTransformPreview | false): FreeTransformGeometry;
|
|
1470
1681
|
/** Resamples every part for the current geometry and shows it (or returns it, for commit). */
|
|
1471
1682
|
private resample;
|
|
1683
|
+
/** A smart object re-rendered from its contents for the current geometry (previews leave the smart filters out). */
|
|
1684
|
+
private resampleSmart;
|
|
1685
|
+
/** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
|
|
1686
|
+
private isChanged;
|
|
1472
1687
|
private render;
|
|
1473
1688
|
/** Finishes the transform with full-quality resampling, as one undo step. */
|
|
1474
1689
|
commit(): FreeTransformResult;
|
|
@@ -1477,6 +1692,65 @@ declare class FreeTransformSession {
|
|
|
1477
1692
|
private result;
|
|
1478
1693
|
}
|
|
1479
1694
|
|
|
1695
|
+
/** What `getSmartObject` reports. */
|
|
1696
|
+
interface SmartObjectInfo {
|
|
1697
|
+
layerId: string;
|
|
1698
|
+
contents: {
|
|
1699
|
+
/** Shared by linked instances. */
|
|
1700
|
+
id: string;
|
|
1701
|
+
name: string;
|
|
1702
|
+
kind: 'raster' | 'document';
|
|
1703
|
+
/** Pixel size of the contents. */
|
|
1704
|
+
width: number;
|
|
1705
|
+
height: number;
|
|
1706
|
+
/** False for a file that could not be decoded here (the layer shows its stored pixels). */
|
|
1707
|
+
decoded: boolean;
|
|
1708
|
+
/** The type of the file the contents came from (`psb`, `png`, `jpg`, …), or `null`. */
|
|
1709
|
+
fileType: string | null;
|
|
1710
|
+
/** The external file of linked contents, or `null` for embedded ones. */
|
|
1711
|
+
linkedPath: string | null;
|
|
1712
|
+
/** Every smart object placed from these contents (this one included), bottom first. */
|
|
1713
|
+
instances: string[];
|
|
1714
|
+
/** Layers in a nested document (0 for raster contents). */
|
|
1715
|
+
layerCount: number;
|
|
1716
|
+
};
|
|
1717
|
+
placement: {
|
|
1718
|
+
/** Where the contents' corners land: top-left, top-right, bottom-right, bottom-left (document pixels). */
|
|
1719
|
+
corners: Quad;
|
|
1720
|
+
/** The warp mesh in contents pixels, or `null`. */
|
|
1721
|
+
warp: WarpMesh | null;
|
|
1722
|
+
interpolation: Interpolation;
|
|
1723
|
+
/** False for distort, perspective and warp (then only corners and bounds describe it). */
|
|
1724
|
+
affine: boolean;
|
|
1725
|
+
/** Percent of the contents' own size. */
|
|
1726
|
+
scaleX: number;
|
|
1727
|
+
scaleY: number;
|
|
1728
|
+
rotate: number;
|
|
1729
|
+
skewX: number;
|
|
1730
|
+
/** Where the contents' centre is (document pixels). */
|
|
1731
|
+
center: {
|
|
1732
|
+
x: number;
|
|
1733
|
+
y: number;
|
|
1734
|
+
};
|
|
1735
|
+
/** Bounds of the placed outline. */
|
|
1736
|
+
bounds: CropBox | null;
|
|
1737
|
+
};
|
|
1738
|
+
smartFilters: {
|
|
1739
|
+
enabled: boolean;
|
|
1740
|
+
/** Bottom (applied first) to top. Photoshop filters we keep but do not draw have kind `psd`. */
|
|
1741
|
+
filters: Array<Record<string, unknown>>;
|
|
1742
|
+
mask: {
|
|
1743
|
+
enabled: boolean;
|
|
1744
|
+
linked: boolean;
|
|
1745
|
+
density: number;
|
|
1746
|
+
feather: number;
|
|
1747
|
+
bounds: CropBox | null;
|
|
1748
|
+
defaultValue: number;
|
|
1749
|
+
} | null;
|
|
1750
|
+
};
|
|
1751
|
+
/** Document bounds of the rendered pixels. */
|
|
1752
|
+
bounds: CropBox | null;
|
|
1753
|
+
}
|
|
1480
1754
|
/** Latest serialized schema version (`3`: layers). Documents with the old shape still write 1 or 2. */
|
|
1481
1755
|
declare const IMAGE_EDITOR_SCHEMA_VERSION: 3;
|
|
1482
1756
|
/** Changes to an adjustment layer; `params` is merged into the current parameters. */
|
|
@@ -1780,7 +2054,7 @@ declare class ImageEditorController {
|
|
|
1780
2054
|
private nextSourceId;
|
|
1781
2055
|
/** Changes whenever the Background's source pixels can have changed. */
|
|
1782
2056
|
private sourceVersion;
|
|
1783
|
-
/** The pixels a pixel layer composites (the decoded source for the Background). */
|
|
2057
|
+
/** The pixels a pixel layer or smart object composites (the decoded source for the Background). */
|
|
1784
2058
|
private surfaceOf;
|
|
1785
2059
|
/**
|
|
1786
2060
|
* The source image as a surface (cached): host-supplied sample pixels first, then the decoded
|
|
@@ -1912,6 +2186,152 @@ declare class ImageEditorController {
|
|
|
1912
2186
|
updateLayerFilter(id: string, filterId: string, changes: Record<string, unknown>, commitToHistory?: boolean): LayerFilter[];
|
|
1913
2187
|
/** Removes one filter (one undo step). Returns the remaining filters. */
|
|
1914
2188
|
removeLayerFilter(id: string, filterId: string): LayerFilter[];
|
|
2189
|
+
private get canvasSize();
|
|
2190
|
+
/**
|
|
2191
|
+
* Layer › Smart Objects › Convert to Smart Object (one undo step): sibling layers (default the
|
|
2192
|
+
* active one) become one smart object at the topmost one's position. A single pixel layer keeps
|
|
2193
|
+
* its id and properties and its filters become smart filters (it renders exactly as before);
|
|
2194
|
+
* anything else nests as a layer document. Returns the smart object's id.
|
|
2195
|
+
*/
|
|
2196
|
+
convertToSmartObject(ids?: string[], options?: {
|
|
2197
|
+
name?: string;
|
|
2198
|
+
}): string;
|
|
2199
|
+
/** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
|
|
2200
|
+
rasterizeSmartObject(id: string): string;
|
|
2201
|
+
/** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
|
|
2202
|
+
getSmartObject(id: string): SmartObjectInfo;
|
|
2203
|
+
/**
|
|
2204
|
+
* Sets a smart object's placement (one undo step, or none with `commitToHistory = false` during a
|
|
2205
|
+
* drag): where the contents' corners land, an optional warp in contents pixels and the
|
|
2206
|
+
* interpolation. The contents render again from the source; a linked mask follows a warp-free
|
|
2207
|
+
* change. Returns the new placement summary.
|
|
2208
|
+
*/
|
|
2209
|
+
setSmartObjectPlacement(id: string, placement: SmartPlacement, commitToHistory?: boolean): SmartObjectInfo['placement'] & {
|
|
2210
|
+
masksMoved: boolean;
|
|
2211
|
+
};
|
|
2212
|
+
/**
|
|
2213
|
+
* Sets a smart object's transform absolutely (one undo step): exactly one of `corners` (where the
|
|
2214
|
+
* contents' corners land), `matrix` (contents pixels → document) or the numbers (`scaleX`,
|
|
2215
|
+
* `scaleY` in percent of the contents' own size, `rotate`, `skewX`, `skewY`, and `x`, `y` where
|
|
2216
|
+
* the contents' centre goes, default where it is now); plus, optionally, a warp (a preset, a mesh
|
|
2217
|
+
* in contents pixels, or `null` to remove it) and the interpolation. Unlike `transformLayer`,
|
|
2218
|
+
* nothing is relative to the current transform.
|
|
2219
|
+
*/
|
|
2220
|
+
setSmartObjectTransform(id: string, spec: {
|
|
2221
|
+
corners?: Quad;
|
|
2222
|
+
matrix?: AffineMatrix;
|
|
2223
|
+
scaleX?: number;
|
|
2224
|
+
scaleY?: number;
|
|
2225
|
+
rotate?: number;
|
|
2226
|
+
skewX?: number;
|
|
2227
|
+
skewY?: number;
|
|
2228
|
+
x?: number;
|
|
2229
|
+
y?: number;
|
|
2230
|
+
warp?: WarpMesh | WarpPreset | null;
|
|
2231
|
+
interpolation?: Interpolation;
|
|
2232
|
+
}): SmartObjectInfo['placement'] & {
|
|
2233
|
+
masksMoved: boolean;
|
|
2234
|
+
};
|
|
2235
|
+
/**
|
|
2236
|
+
* Layer › Smart Objects › Replace Contents (one undo step): new contents for the smart object and
|
|
2237
|
+
* every instance linked to it, from RGBA pixels, PSD bytes (a layer document) or contents. Each
|
|
2238
|
+
* instance keeps its scale and rotation about the contents' centre. Returns the contents id and
|
|
2239
|
+
* the layers that changed.
|
|
2240
|
+
*/
|
|
2241
|
+
replaceSmartObjectContents(id: string, source: {
|
|
2242
|
+
pixels: PixelBuffer;
|
|
2243
|
+
name?: string;
|
|
2244
|
+
} | {
|
|
2245
|
+
psd: Uint8Array;
|
|
2246
|
+
name?: string;
|
|
2247
|
+
} | {
|
|
2248
|
+
contents: SmartContents;
|
|
2249
|
+
}): {
|
|
2250
|
+
contentsId: string;
|
|
2251
|
+
width: number;
|
|
2252
|
+
height: number;
|
|
2253
|
+
layerIds: string[];
|
|
2254
|
+
};
|
|
2255
|
+
/** `replaceSmartObjectContents` from an image (PNG data URL or base64 decodes anywhere; other formats need a browser). */
|
|
2256
|
+
replaceSmartObjectContentsFromImage(id: string, image: string, name?: string): Promise<{
|
|
2257
|
+
contentsId: string;
|
|
2258
|
+
width: number;
|
|
2259
|
+
height: number;
|
|
2260
|
+
layerIds: string[];
|
|
2261
|
+
}>;
|
|
2262
|
+
/**
|
|
2263
|
+
* Layer › Smart Objects › Export Contents: the file the contents came from while unedited, else a
|
|
2264
|
+
* PNG (raster contents) or a PSD / PSB of the nested document. Returns the file name, MIME type
|
|
2265
|
+
* and bytes.
|
|
2266
|
+
*/
|
|
2267
|
+
exportSmartObjectContents(id: string): {
|
|
2268
|
+
name: string;
|
|
2269
|
+
mimeType: string;
|
|
2270
|
+
bytes: Uint8Array;
|
|
2271
|
+
};
|
|
2272
|
+
/**
|
|
2273
|
+
* Layer › Smart Objects › New Smart Object via Copy (`linked: false`: independent contents) or a
|
|
2274
|
+
* linked duplicate (`linked: true`: edits to the contents show in both), directly above, as one
|
|
2275
|
+
* undo step. Returns the copy's id.
|
|
2276
|
+
*/
|
|
2277
|
+
copySmartObject(id: string, linked?: boolean, name?: string): string;
|
|
2278
|
+
/** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
|
|
2279
|
+
addSmartFilter(id: string, filter: Record<string, unknown> & {
|
|
2280
|
+
kind: string;
|
|
2281
|
+
}, index?: number): SmartFilter;
|
|
2282
|
+
/** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
|
|
2283
|
+
updateSmartFilter(id: string, filterId: string, changes: Record<string, unknown>, commitToHistory?: boolean): SmartFilter;
|
|
2284
|
+
/** Removes one smart filter (one undo step). Returns the remaining filters. */
|
|
2285
|
+
removeSmartFilter(id: string, filterId: string): SmartFilter[];
|
|
2286
|
+
/** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
|
|
2287
|
+
moveSmartFilter(id: string, filterId: string, index: number): SmartFilter[];
|
|
2288
|
+
/** Turns a smart object's whole filter stack on or off (one undo step). */
|
|
2289
|
+
setSmartFiltersEnabled(id: string, enabled: boolean): boolean;
|
|
2290
|
+
/**
|
|
2291
|
+
* Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
|
|
2292
|
+
* selection's coverage), or `none` to remove it; `props` sets density, feather, enabled and linked.
|
|
2293
|
+
* Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
|
|
2294
|
+
*/
|
|
2295
|
+
setSmartFilterMask(id: string, from: 'reveal-all' | 'hide-all' | 'selection' | 'none' | 'keep', props?: LayerMaskProps, commitToHistory?: boolean): RasterMask | null;
|
|
2296
|
+
/**
|
|
2297
|
+
* Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
|
|
2298
|
+
* or TIFF embedded in a PSD), through the browser's image decoder. No undo step: the pixels on
|
|
2299
|
+
* screen do not change. Returns the contents ids still undecoded.
|
|
2300
|
+
*/
|
|
2301
|
+
prepareSmartObjects(): Promise<string[]>;
|
|
2302
|
+
private contentsStack;
|
|
2303
|
+
/** The smart objects whose contents are open (outermost first); empty when the document itself is shown. */
|
|
2304
|
+
getEditingContents(): Array<{
|
|
2305
|
+
layerId: string;
|
|
2306
|
+
name: string;
|
|
2307
|
+
}>;
|
|
2308
|
+
/**
|
|
2309
|
+
* Layer › Smart Objects › Edit Contents: shows the smart object's contents as a document of their
|
|
2310
|
+
* own (a layer document, or raster contents as one pixel layer), with their own undo history.
|
|
2311
|
+
* Every editor operation and tool then works on the contents until `closeSmartObjectContents`.
|
|
2312
|
+
* Contents can nest. Returns the contents' size and layer ids.
|
|
2313
|
+
*/
|
|
2314
|
+
editSmartObjectContents(id: string): {
|
|
2315
|
+
layerId: string;
|
|
2316
|
+
depth: number;
|
|
2317
|
+
width: number;
|
|
2318
|
+
height: number;
|
|
2319
|
+
layerIds: string[];
|
|
2320
|
+
};
|
|
2321
|
+
/**
|
|
2322
|
+
* Closes the innermost open contents: with `save` (default) the edited layers become the smart
|
|
2323
|
+
* object's contents, and it and every linked instance render again (one undo step in the
|
|
2324
|
+
* document); without, the edits are dropped. Returns the smart object and the layers that changed.
|
|
2325
|
+
*/
|
|
2326
|
+
closeSmartObjectContents(save?: boolean): {
|
|
2327
|
+
layerId: string;
|
|
2328
|
+
changed: boolean;
|
|
2329
|
+
layerIds: string[];
|
|
2330
|
+
};
|
|
2331
|
+
/** The document's own layers (not the contents open for editing). */
|
|
2332
|
+
private rootLayers;
|
|
2333
|
+
/** Drops every open contents edit (loading another document). */
|
|
2334
|
+
private abandonContents;
|
|
1915
2335
|
/** A layer's effects (an empty, enabled list when it has none). */
|
|
1916
2336
|
getLayerEffects(id: string): LayerEffects;
|
|
1917
2337
|
/**
|
|
@@ -2640,6 +3060,15 @@ interface ImageEditorState {
|
|
|
2640
3060
|
* built-in ones. Recorded in undo history and saved in `toJSON()`.
|
|
2641
3061
|
*/
|
|
2642
3062
|
patterns?: EffectPattern[];
|
|
3063
|
+
/**
|
|
3064
|
+
* While a smart object's contents are open for editing (Edit Contents), the smart objects
|
|
3065
|
+
* being edited, outermost first: the state shows the contents as a document of their own until
|
|
3066
|
+
* `closeSmartObjectContents`. Missing when the document itself is shown.
|
|
3067
|
+
*/
|
|
3068
|
+
editingContents?: Array<{
|
|
3069
|
+
layerId: string;
|
|
3070
|
+
name: string;
|
|
3071
|
+
}>;
|
|
2643
3072
|
}
|
|
2644
3073
|
/**
|
|
2645
3074
|
* A stored editor state in the document-level schema (versions 1 and 2). Documents whose layer
|
|
@@ -3141,6 +3570,12 @@ interface ImageEditorToolProviderOptions {
|
|
|
3141
3570
|
* `flip_image`, `undo_image`, `redo_image` (see `createImageEditTools`).
|
|
3142
3571
|
* - Free Transform: `get_transform_frame`, `transform_layer`, `warp_layer`, `transform_selection`,
|
|
3143
3572
|
* `flip_layer`, `rotate_layer_90` (see `createImageTransformTools`).
|
|
3573
|
+
* - Smart objects and smart filters: `get_smart_object`, `convert_to_smart_object`,
|
|
3574
|
+
* `rasterize_smart_object`, `set_smart_object_transform`, `replace_smart_object_contents`,
|
|
3575
|
+
* `export_smart_object_contents`, `copy_smart_object`, `edit_smart_object_contents`,
|
|
3576
|
+
* `close_smart_object_contents`, `add_smart_filter`, `update_smart_filter`, `remove_smart_filter`,
|
|
3577
|
+
* `move_smart_filter`, `set_smart_filters_enabled`, `set_smart_filter_mask` (see
|
|
3578
|
+
* `createImageSmartObjectTools`).
|
|
3144
3579
|
*/
|
|
3145
3580
|
declare function createImageEditorToolProvider(controller: ImageEditorController, options?: ImageEditorToolProviderOptions): AgentToolProvider;
|
|
3146
3581
|
|
|
@@ -3520,6 +3955,187 @@ declare function addToHistogram(h: ImageHistogram, data: ArrayLike<number>, stri
|
|
|
3520
3955
|
/** Sums histograms (and recomputes `max`). */
|
|
3521
3956
|
declare function sumHistograms(parts: Iterable<ImageHistogram>): ImageHistogram;
|
|
3522
3957
|
|
|
3958
|
+
/**
|
|
3959
|
+
* How far beyond the canvas a smart object is rendered (document pixels): enough for any layer
|
|
3960
|
+
* effect to see the parts just outside the canvas. Further out a smart object is not drawn.
|
|
3961
|
+
*/
|
|
3962
|
+
declare const SMART_RENDER_MARGIN = 512;
|
|
3963
|
+
/** The document canvas a smart object renders for. */
|
|
3964
|
+
interface SmartCanvas {
|
|
3965
|
+
width: number;
|
|
3966
|
+
height: number;
|
|
3967
|
+
}
|
|
3968
|
+
/** A fresh contents id (independent contents). */
|
|
3969
|
+
declare function newContentsId(): string;
|
|
3970
|
+
/** The contents' rectangle in its own pixels. */
|
|
3971
|
+
declare function contentsBox(contents: SmartContents): CropBox;
|
|
3972
|
+
/** A smart object's placement as Free Transform geometry (the frame is the contents' rectangle). */
|
|
3973
|
+
declare function placementGeometry(layer: Pick<SmartObjectLayer, 'contents' | 'placement'>): FreeTransformGeometry;
|
|
3974
|
+
/** The placement that draws the contents 1:1 with their top-left corner at (`x`, `y`). */
|
|
3975
|
+
declare function placementAt(contents: Pick<SmartContents, 'width' | 'height'>, x: number, y: number): SmartPlacement;
|
|
3976
|
+
/** Whether the contents can be rendered here (decoded pixels or a layer document). */
|
|
3977
|
+
declare function isContentsDecoded(contents: SmartContents): boolean;
|
|
3978
|
+
/** The layer with `id`, which must be a smart object. */
|
|
3979
|
+
declare function requireSmartObject(layers: readonly ImageLayer[], id: string): SmartObjectLayer;
|
|
3980
|
+
/**
|
|
3981
|
+
* The contents as pixels at (0, 0) in their own space: the raster, or the nested document
|
|
3982
|
+
* composited at its size (annotation layers inside need a canvas and are left out). Memoised.
|
|
3983
|
+
*/
|
|
3984
|
+
declare function contentsSurface(contents: SmartContents): PixelSurface;
|
|
3985
|
+
/** Raster contents from RGBA pixels. */
|
|
3986
|
+
declare function rasterContents(pixels: {
|
|
3987
|
+
width: number;
|
|
3988
|
+
height: number;
|
|
3989
|
+
data: ArrayLike<number>;
|
|
3990
|
+
}, name: string, id?: string): SmartContents;
|
|
3991
|
+
/** Document contents from layers on a `width × height` canvas. */
|
|
3992
|
+
declare function documentContents(document: SmartDocument, width: number, height: number, name: string, id?: string): SmartContents;
|
|
3993
|
+
/** How a render runs: full quality (default), or a fast preview. */
|
|
3994
|
+
interface SmartRenderOptions {
|
|
3995
|
+
/** Preview block size (a power of two): sample a reduced copy of the contents once per block. */
|
|
3996
|
+
step?: number;
|
|
3997
|
+
/** Only this part of the document (the visible area). */
|
|
3998
|
+
clip?: RasterRect;
|
|
3999
|
+
/** Leave the smart filters out (previews while transforming). */
|
|
4000
|
+
skipFilters?: boolean;
|
|
4001
|
+
/** Reduced copies of the contents by factor, kept by the caller between previews. */
|
|
4002
|
+
reduced?: Map<number, PixelSurface>;
|
|
4003
|
+
}
|
|
4004
|
+
/** The contents placed in the document (no filters), clipped to the canvas grown by the render margin. */
|
|
4005
|
+
declare function placeContents(layer: Pick<SmartObjectLayer, 'contents' | 'placement'>, canvas: SmartCanvas, options?: SmartRenderOptions): PixelSurface;
|
|
4006
|
+
/** The filters of a stack that change pixels (the stack enabled, each filter active, a modelled kind). */
|
|
4007
|
+
declare function activeSmartFilters(stack: SmartFilterStack | undefined): Array<SmartFilter & LayerFilter>;
|
|
4008
|
+
/** A filter mask's coverage over the canvas (0..1), after density and feather; `null` reveals all. */
|
|
4009
|
+
declare function filterMaskCoverage(mask: RasterMask | undefined, canvas: SmartCanvas): Float32Array | null;
|
|
4010
|
+
/**
|
|
4011
|
+
* Runs a smart filter stack over the placed contents, over the canvas (spatial filters clamp at
|
|
4012
|
+
* its edges, as a pixel layer's filters do): each filter filters the result below it, and its own
|
|
4013
|
+
* blend mode and opacity mix its result with that input. The filter mask then mixes the filtered
|
|
4014
|
+
* result with the unfiltered contents. Returns `placed` itself when no filter is active.
|
|
4015
|
+
*/
|
|
4016
|
+
declare function applySmartFilters(placed: PixelSurface, stack: SmartFilterStack | undefined, canvas: SmartCanvas): PixelSurface;
|
|
4017
|
+
/** A smart object's pixels: the contents through the placement, then the smart filters. */
|
|
4018
|
+
declare function renderSmartObject(layer: Pick<SmartObjectLayer, 'contents' | 'placement' | 'smartFilters'>, canvas: SmartCanvas, options?: SmartRenderOptions): PixelSurface;
|
|
4019
|
+
/** The layer with its pixels rendered again (refused when the contents are not decoded). */
|
|
4020
|
+
declare function rerender(layer: SmartObjectLayer, canvas: SmartCanvas, action?: string): SmartObjectLayer;
|
|
4021
|
+
/** Validates a placement for contents of `width × height`; returns a clean copy. */
|
|
4022
|
+
declare function normalizePlacement(raw: SmartPlacement, contents: Pick<SmartContents, 'width' | 'height'>): SmartPlacement;
|
|
4023
|
+
/**
|
|
4024
|
+
* Sets a smart object's placement (corners, warp, interpolation) and renders it again from its
|
|
4025
|
+
* contents. A linked layer mask and filter mask follow a warp-free change. Returns the stack and
|
|
4026
|
+
* whether the masks moved.
|
|
4027
|
+
*/
|
|
4028
|
+
declare function setSmartPlacement(layers: readonly ImageLayer[], id: string, placement: SmartPlacement, canvas: SmartCanvas): {
|
|
4029
|
+
layers: ImageLayer[];
|
|
4030
|
+
layer: SmartObjectLayer;
|
|
4031
|
+
masksMoved: boolean;
|
|
4032
|
+
};
|
|
4033
|
+
/**
|
|
4034
|
+
* Moves a smart object by whole pixels (the move tool): its corners, a linked mask and filter mask
|
|
4035
|
+
* move with it. Without spatial smart filters the rendered pixels are shifted, not resampled.
|
|
4036
|
+
*/
|
|
4037
|
+
declare function offsetSmartObject(layers: readonly ImageLayer[], id: string, dx: number, dy: number, canvas: SmartCanvas): ImageLayer[];
|
|
4038
|
+
interface ConvertOptions {
|
|
4039
|
+
/** The pixels of a pixel layer (resolves the Background's document source). */
|
|
4040
|
+
surfaceOf(layer: PixelLayer): PixelSurface;
|
|
4041
|
+
/** Name of the new layer (default: the top layer's name). */
|
|
4042
|
+
name?: string;
|
|
4043
|
+
}
|
|
4044
|
+
/**
|
|
4045
|
+
* Layer › Smart Objects › Convert to Smart Object: sibling layers become one smart object at the
|
|
4046
|
+
* position of the topmost one.
|
|
4047
|
+
*
|
|
4048
|
+
* - One pixel layer becomes raster contents (its pixels, cropped to their bounds) and keeps its
|
|
4049
|
+
* id, name, visibility, opacity, fill, blend, clipping, mask and effects; its filters become
|
|
4050
|
+
* smart filters. It renders exactly as before.
|
|
4051
|
+
* - Anything else (several layers, a group, an adjustment, a smart object) becomes a nested
|
|
4052
|
+
* document holding the layers as they were, sized to their bounds (effects included), and the
|
|
4053
|
+
* new layer is a plain Normal layer named after the top one, rendering the isolated composite.
|
|
4054
|
+
*
|
|
4055
|
+
* Returns the stack, the new layer and its contents.
|
|
4056
|
+
*/
|
|
4057
|
+
declare function convertToSmartObject(layers: readonly ImageLayer[], ids: readonly string[], canvas: SmartCanvas, options: ConvertOptions): {
|
|
4058
|
+
layers: ImageLayer[];
|
|
4059
|
+
layer: SmartObjectLayer;
|
|
4060
|
+
};
|
|
4061
|
+
/**
|
|
4062
|
+
* Layer › Smart Objects › Rasterize: the smart object becomes a pixel layer holding what it
|
|
4063
|
+
* renders (filters baked), with its mask, effects, blend, opacity and fill. Same id.
|
|
4064
|
+
*/
|
|
4065
|
+
declare function rasterizeSmartObject(layers: readonly ImageLayer[], id: string): {
|
|
4066
|
+
layers: ImageLayer[];
|
|
4067
|
+
layer: PixelLayer;
|
|
4068
|
+
};
|
|
4069
|
+
/**
|
|
4070
|
+
* Layer › Smart Objects › New Smart Object via Copy (`linked: false`, fresh contents that edit
|
|
4071
|
+
* independently) or a linked duplicate (`linked: true`, shared contents), directly above.
|
|
4072
|
+
*/
|
|
4073
|
+
declare function copySmartObject(layers: readonly ImageLayer[], id: string, linked: boolean, name?: string): {
|
|
4074
|
+
layers: ImageLayer[];
|
|
4075
|
+
layer: SmartObjectLayer;
|
|
4076
|
+
};
|
|
4077
|
+
/** Ids of the smart objects in the stack placed from contents `contentsId` (linked instances), bottom first. */
|
|
4078
|
+
declare function instancesOf(layers: readonly ImageLayer[], contentsId: string): string[];
|
|
4079
|
+
/**
|
|
4080
|
+
* Puts new contents into every instance of `contentsId` and renders them again. With
|
|
4081
|
+
* `keepPlacement` false (Replace Contents of a different size), each instance keeps its scale and
|
|
4082
|
+
* rotation about the contents' centre, and a warp is stretched to the new size.
|
|
4083
|
+
*/
|
|
4084
|
+
declare function replaceContents(layers: readonly ImageLayer[], contentsId: string, contents: SmartContents, canvas: SmartCanvas): {
|
|
4085
|
+
layers: ImageLayer[];
|
|
4086
|
+
ids: string[];
|
|
4087
|
+
};
|
|
4088
|
+
/** A clean smart filter from loose input: a `develop` or `blur` filter plus blend and opacity. */
|
|
4089
|
+
declare function normalizeSmartFilter(raw: Record<string, unknown> & {
|
|
4090
|
+
kind: string;
|
|
4091
|
+
}, id?: string): SmartFilter;
|
|
4092
|
+
/** Adds a smart filter at `index` (default the top). Returns the stack and the filter. */
|
|
4093
|
+
declare function addSmartFilter(layers: readonly ImageLayer[], id: string, filter: SmartFilter, canvas: SmartCanvas, index?: number): {
|
|
4094
|
+
layers: ImageLayer[];
|
|
4095
|
+
layer: SmartObjectLayer;
|
|
4096
|
+
filter: SmartFilter;
|
|
4097
|
+
};
|
|
4098
|
+
/** Changes one smart filter (settings, enabled, blend, opacity; validated). */
|
|
4099
|
+
declare function updateSmartFilter(layers: readonly ImageLayer[], id: string, filterId: string, changes: Record<string, unknown>, canvas: SmartCanvas): {
|
|
4100
|
+
layers: ImageLayer[];
|
|
4101
|
+
layer: SmartObjectLayer;
|
|
4102
|
+
filter: SmartFilter;
|
|
4103
|
+
};
|
|
4104
|
+
/** Removes one smart filter. */
|
|
4105
|
+
declare function removeSmartFilter(layers: readonly ImageLayer[], id: string, filterId: string, canvas: SmartCanvas): {
|
|
4106
|
+
layers: ImageLayer[];
|
|
4107
|
+
layer: SmartObjectLayer;
|
|
4108
|
+
};
|
|
4109
|
+
/** Moves one smart filter to `index` (0 = bottom, applied first). */
|
|
4110
|
+
declare function moveSmartFilter(layers: readonly ImageLayer[], id: string, filterId: string, index: number, canvas: SmartCanvas): {
|
|
4111
|
+
layers: ImageLayer[];
|
|
4112
|
+
layer: SmartObjectLayer;
|
|
4113
|
+
};
|
|
4114
|
+
/** Turns the whole smart filter stack on or off (each filter keeps its own switch). */
|
|
4115
|
+
declare function setSmartFiltersEnabled(layers: readonly ImageLayer[], id: string, enabled: boolean, canvas: SmartCanvas): {
|
|
4116
|
+
layers: ImageLayer[];
|
|
4117
|
+
layer: SmartObjectLayer;
|
|
4118
|
+
};
|
|
4119
|
+
/** Sets or removes (`null`) the smart filter mask. */
|
|
4120
|
+
declare function setSmartFilterMask(layers: readonly ImageLayer[], id: string, mask: RasterMask | null, canvas: SmartCanvas): {
|
|
4121
|
+
layers: ImageLayer[];
|
|
4122
|
+
layer: SmartObjectLayer;
|
|
4123
|
+
};
|
|
4124
|
+
/** A smart object's filter mask surface replaced (painting it), rendered again. */
|
|
4125
|
+
declare function withFilterMaskSurface(layer: SmartObjectLayer, surface: PixelSurface, canvas: SmartCanvas): SmartObjectLayer;
|
|
4126
|
+
/** The transformed outline of a smart object's contents (document bounds, warp included). */
|
|
4127
|
+
declare function placementBounds(layer: Pick<SmartObjectLayer, 'contents' | 'placement'>): CropBox | null;
|
|
4128
|
+
|
|
4129
|
+
/**
|
|
4130
|
+
* Agent tools for smart objects in the image editor: `get_smart_object`, `convert_to_smart_object`,
|
|
4131
|
+
* `rasterize_smart_object`, `set_smart_object_transform`, `replace_smart_object_contents`,
|
|
4132
|
+
* `export_smart_object_contents`, `copy_smart_object`, `edit_smart_object_contents`,
|
|
4133
|
+
* `close_smart_object_contents`, and the smart filter stack: `add_smart_filter`,
|
|
4134
|
+
* `update_smart_filter`, `remove_smart_filter`, `move_smart_filter`, `set_smart_filters_enabled`,
|
|
4135
|
+
* `set_smart_filter_mask`. Every write is one undo step, validates first and returns what changed.
|
|
4136
|
+
*/
|
|
4137
|
+
declare function createImageSmartObjectTools(controller: ImageEditorController): AgentTool[];
|
|
4138
|
+
|
|
3523
4139
|
/**
|
|
3524
4140
|
* The layers panel's view model, shared by the React and Svelte panels: the rows to show (top of
|
|
3525
4141
|
* the stack first, groups indented, collapsed groups hiding their children), where a drop lands,
|
|
@@ -3550,7 +4166,7 @@ type DropZone = 'above' | 'below' | 'inside';
|
|
|
3550
4166
|
declare function dropZone(fraction: number, isGroup: boolean): DropZone;
|
|
3551
4167
|
/** The placement for `move_layer` when `dragId` is dropped on row `targetId` in `zone`, or `null` for a no-op. */
|
|
3552
4168
|
declare function dropPlacement(layers: readonly ImageLayer[], dragId: string, targetId: string, zone: DropZone): LayerPlacement | null;
|
|
3553
|
-
type LayerMenuAction = 'new-layer' | 'new-group' | 'duplicate' | 'delete' | 'group-selected' | 'ungroup' | 'merge-down' | 'merge-visible' | 'flatten' | 'via-copy' | 'via-cut' | 'add-mask' | 'add-mask-selection' | 'apply-mask' | 'delete-mask' | 'toggle-mask' | 'toggle-mask-link' | 'toggle-clip' | 'rasterize';
|
|
4169
|
+
type LayerMenuAction = 'new-layer' | 'new-group' | 'duplicate' | 'delete' | 'group-selected' | 'ungroup' | 'merge-down' | 'merge-visible' | 'flatten' | 'via-copy' | 'via-cut' | 'add-mask' | 'add-mask-selection' | 'apply-mask' | 'delete-mask' | 'toggle-mask' | 'toggle-mask-link' | 'toggle-clip' | 'rasterize' | 'convert-smart' | 'edit-contents' | 'smart-via-copy' | 'add-filter-mask';
|
|
3554
4170
|
interface LayerMenuItem {
|
|
3555
4171
|
action: LayerMenuAction;
|
|
3556
4172
|
label: string;
|
|
@@ -3560,6 +4176,18 @@ interface LayerMenuItem {
|
|
|
3560
4176
|
declare function layerMenu(controller: ImageEditorController): LayerMenuItem[];
|
|
3561
4177
|
/** Runs a menu action on the active layer. Resolves to the error message when it was refused. */
|
|
3562
4178
|
declare function runLayerMenuAction(controller: ImageEditorController, action: LayerMenuAction): Promise<string | null>;
|
|
4179
|
+
/** One row of a smart object's filter list (Photoshop shows them under the layer, top filter first). */
|
|
4180
|
+
interface SmartFilterRow {
|
|
4181
|
+
filter: SmartFilter;
|
|
4182
|
+
/** Display name: Develop, Blur (radius), or the Photoshop filter's name. */
|
|
4183
|
+
label: string;
|
|
4184
|
+
/** Index in the stack, 0 = bottom (applied first). */
|
|
4185
|
+
index: number;
|
|
4186
|
+
/** False for Photoshop filters we keep but do not draw. */
|
|
4187
|
+
drawn: boolean;
|
|
4188
|
+
}
|
|
4189
|
+
/** The filter rows of a smart object, top filter first (empty when it has none). */
|
|
4190
|
+
declare function smartFilterRows(layer: ImageLayer): SmartFilterRow[];
|
|
3563
4191
|
|
|
3564
4192
|
/**
|
|
3565
4193
|
* The layer effects section's view model, shared by the React and Svelte panels: whether a layer
|
|
@@ -4192,4 +4820,4 @@ declare class FreeTransformTool {
|
|
|
4192
4820
|
key(e: ShortcutEvent): boolean;
|
|
4193
4821
|
}
|
|
4194
4822
|
|
|
4195
|
-
export { ADJUSTMENT_KEYS, ADJUSTMENT_KINDS, ADJUSTMENT_LAYER_CONTROLS, ADJUSTMENT_LAYER_OPACITY_CONTROL, ADJUSTMENT_LUT_SIZE, type AIResultOptions, AS_SHOT_KELVIN, type AdjustmentKind, type AdjustmentKindInfo, type AdjustmentLayer, type AdjustmentLayerBase, type AdjustmentLayerInit, type AdjustmentLayerMask, type AdjustmentLayerNode, type AdjustmentLayerOf, type AdjustmentLayerUpdate, type AdjustmentParamsMap, AffineMatrix, type Annotation, type AnnotationLayer, type AnnotationPlacement, type AnnotationType, type ArrowAnnotation, type AspectRatio, BACKGROUND_LAYER_ID, BACKGROUND_LAYER_NAME, BLUR_FILTER_ID, BRUSH_OPTION_CONTROLS, type BaseAnnotation, type BlackWhiteParams, BlendMode, type BlurFilter, BrushSettings, type Chromaticity, type CircleAnnotation, type ColorBalanceParams, type ColorBalanceTone, type ColorDistance, type ColorRangeOptions, type ColorRangeSample, CompositorOptions, type CompositorSources, type ControlSection, type ControlSpec, type ControlTrack, type CreateAnnotationPayload, type CropBox, type CropHandle, type CurvePoint, type CurvesParams, D50, D65, DEFAULT_ADJUSTMENTS, DEFAULT_DEPTH_MASK, DEFAULT_REFINE_EDGE_PARAMS, DEFAULT_SELECTION_TOOL_OPTIONS, DEFAULT_TRANSFORM, DEVELOP_FILTER_ID, type DepthMaskOptions, type DescValue, type Descriptor, type DeserializeContext, type DevelopFilter, type DevelopSettings, type DropZone, EMPTY_DISTANCE, type EffectControl, EffectPattern, type ExportOptions, FREE_TRANSFORM_CONTENTS, FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODES, FREE_TRANSFORM_MODE_OPTIONS, type FillOptions, type FreeTransformBar, type FreeTransformContent, type FreeTransformField, type FreeTransformGeometry, type FreeTransformHost, type FreeTransformInit, type FreeTransformMode, type FreeTransformPreview, type FreeTransformResult, FreeTransformSession, FreeTransformTool, type FreeTransformToolOptions, GUIDED_FILTER_EPS, type GestureModifiers, GlobalLight, type GroupLayer, HISTOGRAM_BINS, HUE_RANGE_LABELS, type HistogramChannel, type HistoryEntryHandle, Homography, type HueRange, type HueSaturationParams, IDENTITY_MATRIX3, IMAGE_ADJUSTMENT_CONTROLS, IMAGE_EDITOR_SCHEMA_VERSION, IMAGE_EDITOR_STATE_VERSION, type ImageAdjustments, type ImageAnnotation, type ImageDimensions, type ImageEditorAIHooks, type ImageEditorAssetStore, ImageEditorController, type ImageEditorDocumentLoad, type ImageEditorFit, type ImageEditorOptions, ImageEditorRenderer, type ImageEditorState, type ImageEditorTool, type ImageEditorToolProviderOptions, type ImageHistogram, type ImageLayer, type ImageLayerType, type ImagePoint, type ImageProcessVersion, type ImageProjection, type ImageTransform, type InpaintHook, type InpaintOptions, Interpolation, type InvertParams, LATEST_PROCESS_VERSION, LAYERED_SCHEMA_VERSION, LAYER_EFFECT_MENU, LEGACY_PROCESS_VERSION, LUMA_709, type LayerBase, type LayerBlendMode, LayerCompositor, LayerEffect, LayerEffectKind, type LayerEffectRow, LayerEffects, type LayerEffectsPanelModel, type LayerFilter, type LayerFilterKind, type LayerLocation, LayerLocks, type LayerMaskProps, type LayerMenuAction, type LayerMenuItem, LayerOperationError, type LayerPanelRow, type LayerPlacement, type LayerProperties, type LayerSourcesHost, type LayerStack, type LayerTarget, type LegacyParts, type LegacySerializedImageEditorState, type LegacyViewResult, type LevelsChannel, type LevelsParams, type LineAnnotation, MAX_KELVIN, MIN_KELVIN, MIRED_PER_TEMPERATURE_UNIT, MIXER_MIXING_OPTIONS, MIXER_OPTION_CONTROLS, type MagicWandOptions, type Matrix3, MixerLoad, MixerSettings, MixerStroke, type MixerStrokeInit, MixerTarget, type MosaicImageDataLike, type MosaicRegion, PAINT_TOOLS, PATTERN_BLOCK_KEYS, PSD_BLEND_KEYS, PSD_FILE_ACCEPT, PaintGesture, type PaintOptions, type PaintPointerSample, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type ParsedAdjustment, type ParsedLayerEffects, type PenAnnotation, type PhotoFilterParams, type PixelBuffer, type PixelLayer, type PixelLayerInit, type PixelOp, PixelSurface, type PlaneLayout, type PosterizeParams, type PsdChannel, PsdError, type PsdExportInput, type PsdExportResult, type PsdFile, type PsdHeader, type PsdImportOptions, type PsdImportResult, type PsdLayerMask, type PsdLayerRecord, type PsdLayerSummary, type PsdPattern, type PsdRect, type PsdResource, type PsdTaggedBlock, type PsdTreeNode, Quad, type QuickMaskStyle, REFINE_EDGE_CONTROLS, type RasterMask, type RectAnnotation, type ReferenceItem, type RefineEdgeControl, type RefineEdgeParams, type RemoveBackgroundHook, type RemoveBackgroundOptions, type RenderOptions, type RouteInput, SELECTION_MODES, SELECTION_MODE_LABELS, SELECTION_MODIFY_OPS, SELECTION_TOOLS, SUPPORTED_ADJUSTMENT_KEYS, type SampleOptions, type SelectionChannel, type SelectionCommandOptions, SelectionGesture, type SelectionMask, type SelectionMode, type SelectionModifyOp, type SelectionToolKind, type SelectionToolOptions, type SerializeContext, type SerializedAdjustmentLayer, type SerializedAnnotationLayer, type SerializedGroupLayer, type SerializedImageEditorState, type SerializedLayer, type SerializedLayerEffects, type SerializedLayeredImageEditorState, type SerializedPattern, type SerializedPixelLayer, type SerializedRasterMask, type SerializedSelection, type ShapeSelectionOptions, type ShortcutEvent, StrokeApply, StrokeCoverage, type StrokeInit, StrokePoint, type StrokeTool, TINT_SCALE, TONE_LUT_SIZE, TONE_RANGE_PRESETS, TRANSFORM_ANCHORS, type TextAnnotation, type ThresholdParams, TiledSurface, type ToneRangePreset, type TransformAnchor, type TransformHandle, type TransformModifiers, type TransformOverlay, type TransformParams, type TransformReadout, type UnitLevels, VIBRANCE_GREY, Vec2, type VibranceParams, type ViewportMetrics, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS, type WarpBar, WarpMesh, WarpPreset, WarpStyle, XYZ_D50_TO_SRGB, activeAdjustmentLayers, addLayerEffect, addLayerFilter, addToHistogram, adjustmentKindLabel, adjustmentLayersKey, adjustmentNodeAsLayer, adjustmentNodeFromLegacy, anchorPoint, annotationLayerFor, annotationLayerName, applyAdjustmentLayers, applyAdjustments, applyBoxBlur, applyDepthMask, applyImageProjectionToContext, applyLegacyAdjustments, applyMatrix3, applyOutputStage, applyParams, applyProcess2Adjustments, applyRegionBlur, applyRegionMosaic, backgroundLayer, baseProjection, blackWhiteGray, blurFilter, borderCoverage, boxMean, boxPointOf, boxToCurvePoint, bradfordAdaptation, buildLayerMaskPlanes, buildToneLut, calculateCropDrag, canvasToImagePoint, clampControlValue, clampCropToImage, colorBalanceChannel, colorRange, combineSelections, compileAdjustmentLayer, computeHistogram, computeSelectionBounds, contractCoverage, controlPosition, controlTrackBackground, cornersFromMatrix, coverageToByte, coveringRect, createAdjustmentLayer, createImageCaptureSurface, createImageEditTools, createImageEditorToolProvider, createImageEffectTools, createImageLayerTools, createImagePaintTools, createImagePsdTools, createImageSelectionTools, createImageTransformTools, createSelectionMask, curveLutFromLevels, curvePointToBox, curveSvgPath, decodeLayerChannel, decodeLayerMask, decodeMergedImage, decodePlanes, decodePngDataUrl, decodeSelectionRle, defaultAdjustmentParams, depthMaskAlpha, depthRasterMask, describeLayer, describeLayerEffects, describeSelection, describeTransform, deserializeEffects, deserializeLayer, deserializeLayers, deserializePatterns, deserializeSelection, developFilter, developFromAdjustments, developTarget, distanceTransform, downloadPsd, dropPlacement, dropZone, duplicateLayer, edgeWidth, effectControlChange, ellipsePoints, ellipseSelection, emptyHistogram, encodeRle, encodeSelectionRle, encodeSurface, evaluateAdjustmentLayers, expandCoverage, exportPsd, featherCoverage, findAdjustmentControl, findLayerControl, flipCorners, formatControlValue, fullSelection, geometryHomography, getAnnotationBounds, getControlPath, getCropCursor, getRotatedSize, getViewportMetrics, getViewportProjection, globalImageCache, greyMorphology, groupLayers, guidePlanes, guidedFilterColor, handlePaintShortcut, hasResampledLegacyMask, hasWarp, hashMaskContent, hexToRgb, histogramPath, hitTestAnnotation, hitTestCrop, hitTestCurvePoint, hslToRgb, hueRange, hueRangeTables, hueRangeWeight, hueSaturation, identityCurve, identityLevels, identityTransform, imageEditorStateMigrations, imageToCanvasPoint, importPsd, insertCurvePoint, invertMatrix3, invertSelection, isActiveFilter, isAdjustmentKind, isDefaultDepthMask, isIdentityTransform, isLegacyShape, isPaintTool, isQuarterTurn, isQuarterTurnSwapped, isSelectionEmpty, isSelectionMode, isSpatialFilter, isTransformAnchor, isValidWarp, kelvinToTemperature, layerBadge, layerEffectControls, layerEffectsBadge, layerEffectsOf, layerEffectsPanel, layerLabel, layerMaskCoverage, layerMaskFromSelection, layerMaskKey, layerMenu, layerName, layerPanelRows, layerTree, layerTypeLabel, layersFromLegacy, legacyAdjustmentLayer, legacyMaskOf, legacyView, levelsValue, linearSrgbToXy, linearToSrgb, loadImageEditorDocument, magicWand, mapCropHandle, maskSummary, matrixFromCorners, matrixFromParams, migrateSerializedImageEditorState, migrateToLayeredState, mixerLoadResult, modifySelection, moveCurvePoint, moveLayer, mulMatrix3, needsLegacyBase, neutralHueRange, newLayerId, normalizeAdjustmentLayer, normalizeAdjustmentLayers, normalizeAngle, normalizeFilter, normalizeLayerMask, normalizeProcessVersion, normalizeRect, normalizeRefineEdgeParams, normalizeStoredAdjustments, offsetLayer, openPsdFile, parseAdjustmentBlock, parseBlend, parseColor, parseLfx2, parseLrfx, parsePatternBlock, parseSelectionMode, parseVersionedDescriptor, photoFilterMatrix, pixelLayerBounds, pixelLayers, placeLayer, pointerPressure, polygonCoverage, polygonSelection, posterizeValue, presetWarp, previewStep, projectImagePoint, projectImageRect, projectMaskCoverage, projectQuarterTurn, psdBytesFromBase64, psdFileName, psdPatternToEffectPattern, psdToLayers, quickMaskPixels, rangeLightness, rasterMaskFromLegacy, readAdjustmentControls, readPsd, rectSelection, referencePoint, refineCoverage, refineEdgeHalo, refineSelection, removeAlpha, removeCurvePoint, removeLayer, removeLayerEffect, removeLayerFilter, renderLayeredBase, requireLayer, requireUnlocked, resizePixels, resizeSelection, resolveExternalAssets, resolveMosaicRegionBounds, rgbToGray, rgbToHsl, rgbUnitToHex, runLayerMenuAction, sampleLut, sampleToneLut, selectionArea, selectionFromCoverage, selectionFromPixels, selectionModeFromModifiers, selectionOutline, selectionToCoverage, selectionToPixels, selectionValueAt, serializeEffects, serializeLayer, serializeLayers, serializeLayersExternal, serializePatterns, serializeSelection, setControlPath, setLayerEffects, setLayerEffectsEnabled, setLayerMask, setLayerProperties, shiftCoverage, smoothCoverage, splitOverlayAnnotations, srgb8ToLab, srgbToLinear, sumHistograms, tempTintToXy, temperatureToKelvin, toHex, toneCurve, toneLuts, toneRange, transformHomography, transformMap, transformedBox, transformedPoint, ungroupLayer, unionRect, unprojectCanvasPoint, updateLayerEffect, updateLayerFilter, updateLayerMaskProps, uvToXy, versionedDescriptorBytes, vibranceLinear, vibrancePixel, wbMatrix, whiteBalanceFromSample, whiteBalanceMatrix, withNewIds, writeAdjustmentBlock, writeLfx2, writePatternBlock, writePsd, xyToTempTint, xyToUv };
|
|
4823
|
+
export { ADJUSTMENT_KEYS, ADJUSTMENT_KINDS, ADJUSTMENT_LAYER_CONTROLS, ADJUSTMENT_LAYER_OPACITY_CONTROL, ADJUSTMENT_LUT_SIZE, type AIResultOptions, AS_SHOT_KELVIN, type AdjustmentKind, type AdjustmentKindInfo, type AdjustmentLayer, type AdjustmentLayerBase, type AdjustmentLayerInit, type AdjustmentLayerMask, type AdjustmentLayerNode, type AdjustmentLayerOf, type AdjustmentLayerUpdate, type AdjustmentParamsMap, AffineMatrix, type Annotation, type AnnotationLayer, type AnnotationPlacement, type AnnotationType, type ArrowAnnotation, type AspectRatio, BACKGROUND_LAYER_ID, BACKGROUND_LAYER_NAME, BLUR_FILTER_ID, BRUSH_OPTION_CONTROLS, type BaseAnnotation, type BlackWhiteParams, BlendMode, type BlurFilter, BrushSettings, type Chromaticity, type CircleAnnotation, type ColorBalanceParams, type ColorBalanceTone, type ColorDistance, type ColorRangeOptions, type ColorRangeSample, CompositorOptions, type CompositorSources, type ControlSection, type ControlSpec, type ControlTrack, type ConvertOptions, type CreateAnnotationPayload, type CropBox, type CropHandle, type CurvePoint, type CurvesParams, D50, D65, DEFAULT_ADJUSTMENTS, DEFAULT_DEPTH_MASK, DEFAULT_REFINE_EDGE_PARAMS, DEFAULT_SELECTION_TOOL_OPTIONS, DEFAULT_TRANSFORM, DEVELOP_FILTER_ID, type DepthMaskOptions, type DescValue, type Descriptor, type DeserializeContext, type DevelopFilter, type DevelopSettings, type DropZone, EMPTY_DISTANCE, type EffectControl, EffectPattern, type ExportOptions, FREE_TRANSFORM_CONTENTS, FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODES, FREE_TRANSFORM_MODE_OPTIONS, type FillOptions, type FreeTransformBar, type FreeTransformContent, type FreeTransformField, type FreeTransformGeometry, type FreeTransformHost, type FreeTransformInit, type FreeTransformMode, type FreeTransformPreview, type FreeTransformResult, FreeTransformSession, FreeTransformTool, type FreeTransformToolOptions, GUIDED_FILTER_EPS, type GestureModifiers, GlobalLight, type GroupLayer, HISTOGRAM_BINS, HUE_RANGE_LABELS, type HistogramChannel, type HistoryEntryHandle, Homography, type HueRange, type HueSaturationParams, IDENTITY_MATRIX3, IMAGE_ADJUSTMENT_CONTROLS, IMAGE_EDITOR_SCHEMA_VERSION, IMAGE_EDITOR_STATE_VERSION, type ImageAdjustments, type ImageAnnotation, type ImageDimensions, type ImageEditorAIHooks, type ImageEditorAssetStore, ImageEditorController, type ImageEditorDocumentLoad, type ImageEditorFit, type ImageEditorOptions, ImageEditorRenderer, type ImageEditorState, type ImageEditorTool, type ImageEditorToolProviderOptions, type ImageHistogram, type ImageLayer, type ImageLayerType, type ImagePoint, type ImageProcessVersion, type ImageProjection, type ImageTransform, type InpaintHook, type InpaintOptions, Interpolation, type InvertParams, LATEST_PROCESS_VERSION, LAYERED_SCHEMA_VERSION, LAYER_EFFECT_MENU, LEGACY_PROCESS_VERSION, LUMA_709, type LayerBase, type LayerBlendMode, LayerCompositor, LayerEffect, LayerEffectKind, type LayerEffectRow, LayerEffects, type LayerEffectsPanelModel, type LayerFilter, type LayerFilterKind, type LayerLocation, LayerLocks, type LayerMaskProps, type LayerMenuAction, type LayerMenuItem, LayerOperationError, type LayerPanelRow, type LayerPlacement, type LayerProperties, type LayerSourcesHost, type LayerStack, type LayerTarget, type LegacyParts, type LegacySerializedImageEditorState, type LegacyViewResult, type LevelsChannel, type LevelsParams, type LineAnnotation, MAX_KELVIN, MIN_KELVIN, MIRED_PER_TEMPERATURE_UNIT, MIXER_MIXING_OPTIONS, MIXER_OPTION_CONTROLS, type MagicWandOptions, type Matrix3, MixerLoad, MixerSettings, MixerStroke, type MixerStrokeInit, MixerTarget, type MosaicImageDataLike, type MosaicRegion, PAINT_TOOLS, PATTERN_BLOCK_KEYS, PSD_BLEND_KEYS, PSD_FILE_ACCEPT, PaintGesture, type PaintOptions, type PaintPointerSample, type PaintStrokeResult, PaintStrokeSession, type PaintTool, type ParsedAdjustment, type ParsedLayerEffects, type PenAnnotation, type PhotoFilterParams, type PixelBuffer, type PixelLayer, type PixelLayerInit, type PixelOp, PixelSurface, type PlaneLayout, type PosterizeParams, type PsdChannel, PsdError, type PsdExportInput, type PsdExportResult, type PsdFile, type PsdHeader, type PsdImportOptions, type PsdImportResult, type PsdLayerMask, type PsdLayerRecord, type PsdLayerSummary, type PsdPattern, type PsdRect, type PsdResource, type PsdSmartFilter, type PsdTaggedBlock, type PsdTreeNode, Quad, type QuickMaskStyle, REFINE_EDGE_CONTROLS, type RasterMask, RasterRect, type RectAnnotation, type ReferenceItem, type RefineEdgeControl, type RefineEdgeParams, type RemoveBackgroundHook, type RemoveBackgroundOptions, type RenderOptions, type RouteInput, SELECTION_MODES, SELECTION_MODE_LABELS, SELECTION_MODIFY_OPS, SELECTION_TOOLS, SMART_RENDER_MARGIN, SUPPORTED_ADJUSTMENT_KEYS, type SampleOptions, type SelectionChannel, type SelectionCommandOptions, SelectionGesture, type SelectionMask, type SelectionMode, type SelectionModifyOp, type SelectionToolKind, type SelectionToolOptions, type SerializeContext, type SerializedAdjustmentLayer, type SerializedAnnotationLayer, type SerializedGroupLayer, type SerializedImageEditorState, type SerializedLayer, type SerializedLayerEffects, type SerializedLayeredImageEditorState, type SerializedPattern, type SerializedPixelLayer, type SerializedRasterMask, type SerializedSelection, type SerializedSmartContents, type SerializedSmartFilter, type SerializedSmartObjectLayer, type ShapeSelectionOptions, type ShortcutEvent, type SmartCanvas, type SmartContents, type SmartDocument, type SmartFilter, type SmartFilterKind, type SmartFilterRow, type SmartFilterStack, type SmartObjectInfo, type SmartObjectLayer, type SmartPlacement, type SmartPsdData, type SmartRenderOptions, StrokeApply, StrokeCoverage, type StrokeInit, StrokePoint, type StrokeTool, TINT_SCALE, TONE_LUT_SIZE, TONE_RANGE_PRESETS, TRANSFORM_ANCHORS, type TextAnnotation, type ThresholdParams, TiledSurface, type ToneRangePreset, type TransformAnchor, type TransformHandle, type TransformModifiers, type TransformOverlay, type TransformParams, type TransformReadout, type UnitLevels, VIBRANCE_GREY, Vec2, type VibranceParams, type ViewportMetrics, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS, type WarpBar, WarpMesh, WarpPreset, WarpStyle, XYZ_D50_TO_SRGB, activeAdjustmentLayers, activeSmartFilters, addLayerEffect, addLayerFilter, addSmartFilter, addToHistogram, adjustmentKindLabel, adjustmentLayersKey, adjustmentNodeAsLayer, adjustmentNodeFromLegacy, anchorPoint, annotationLayerFor, annotationLayerName, applyAdjustmentLayers, applyAdjustments, applyBoxBlur, applyDepthMask, applyImageProjectionToContext, applyLegacyAdjustments, applyMatrix3, applyOutputStage, applyParams, applyProcess2Adjustments, applyRegionBlur, applyRegionMosaic, applySmartFilters, backgroundLayer, baseProjection, blackWhiteGray, blurFilter, borderCoverage, boxMean, boxPointOf, boxToCurvePoint, bradfordAdaptation, buildLayerMaskPlanes, buildToneLut, calculateCropDrag, canvasToImagePoint, clampControlValue, clampCropToImage, colorBalanceChannel, colorRange, combineSelections, compileAdjustmentLayer, computeHistogram, computeSelectionBounds, contentsBox, contentsSurface, contractCoverage, controlPosition, controlTrackBackground, convertToSmartObject, copySmartObject, cornersFromMatrix, coverageToByte, coveringRect, createAdjustmentLayer, createImageCaptureSurface, createImageEditTools, createImageEditorToolProvider, createImageEffectTools, createImageLayerTools, createImagePaintTools, createImagePsdTools, createImageSelectionTools, createImageSmartObjectTools, createImageTransformTools, createSelectionMask, curveLutFromLevels, curvePointToBox, curveSvgPath, decodeLayerChannel, decodeLayerMask, decodeMergedImage, decodePlanes, decodePngDataUrl, decodeSelectionRle, defaultAdjustmentParams, depthMaskAlpha, depthRasterMask, describeLayer, describeLayerEffects, describeSelection, describeTransform, deserializeEffects, deserializeLayer, deserializeLayers, deserializePatterns, deserializeSelection, developFilter, developFromAdjustments, developTarget, distanceTransform, documentContents, downloadPsd, dropPlacement, dropZone, duplicateLayer, edgeWidth, effectControlChange, ellipsePoints, ellipseSelection, emptyHistogram, encodeRle, encodeSelectionRle, encodeSurface, evaluateAdjustmentLayers, expandCoverage, exportPsd, featherCoverage, filterMaskCoverage, findAdjustmentControl, findLayerControl, flipCorners, formatControlValue, fullSelection, geometryHomography, getAnnotationBounds, getControlPath, getCropCursor, getRotatedSize, getViewportMetrics, getViewportProjection, globalImageCache, greyMorphology, groupLayers, guidePlanes, guidedFilterColor, handlePaintShortcut, hasResampledLegacyMask, hasSurface, hasWarp, hashMaskContent, hexToRgb, histogramPath, hitTestAnnotation, hitTestCrop, hitTestCurvePoint, hslToRgb, hueRange, hueRangeTables, hueRangeWeight, hueSaturation, identityCurve, identityLevels, identityTransform, imageEditorStateMigrations, imageToCanvasPoint, importPsd, insertCurvePoint, instancesOf, invertMatrix3, invertSelection, isActiveFilter, isAdjustmentKind, isContentsDecoded, isDefaultDepthMask, isIdentityTransform, isLegacyShape, isPaintTool, isQuarterTurn, isQuarterTurnSwapped, isSelectionEmpty, isSelectionMode, isSpatialFilter, isTransformAnchor, isValidWarp, kelvinToTemperature, layerBadge, layerEffectControls, layerEffectsBadge, layerEffectsOf, layerEffectsPanel, layerLabel, layerMaskCoverage, layerMaskFromSelection, layerMaskKey, layerMenu, layerName, layerPanelRows, layerTree, layerTypeLabel, layersFromLegacy, legacyAdjustmentLayer, legacyMaskOf, legacyView, levelsValue, linearSrgbToXy, linearToSrgb, loadImageEditorDocument, magicWand, mapCropHandle, maskSummary, matrixFromCorners, matrixFromParams, migrateSerializedImageEditorState, migrateToLayeredState, mixerLoadResult, modifySelection, moveCurvePoint, moveLayer, moveSmartFilter, mulMatrix3, needsLegacyBase, neutralHueRange, newContentsId, newLayerId, normalizeAdjustmentLayer, normalizeAdjustmentLayers, normalizeAngle, normalizeFilter, normalizeLayerMask, normalizePlacement, normalizeProcessVersion, normalizeRect, normalizeRefineEdgeParams, normalizeSmartFilter, normalizeStoredAdjustments, offsetLayer, offsetSmartObject, openPsdFile, parseAdjustmentBlock, parseBlend, parseColor, parseLfx2, parseLrfx, parsePatternBlock, parseSelectionMode, parseVersionedDescriptor, photoFilterMatrix, pixelLayerBounds, pixelLayers, placeContents, placeLayer, placementAt, placementBounds, placementGeometry, pointerPressure, polygonCoverage, polygonSelection, posterizeValue, presetWarp, previewStep, projectImagePoint, projectImageRect, projectMaskCoverage, projectQuarterTurn, psdBytesFromBase64, psdFileName, psdPatternToEffectPattern, psdToLayers, quickMaskPixels, rangeLightness, rasterContents, rasterMaskFromLegacy, rasterizeSmartObject, readAdjustmentControls, readPsd, rectSelection, referencePoint, refineCoverage, refineEdgeHalo, refineSelection, removeAlpha, removeCurvePoint, removeLayer, removeLayerEffect, removeLayerFilter, removeSmartFilter, renderLayeredBase, renderSmartObject, replaceContents, requireLayer, requireSmartObject, requireUnlocked, rerender, resizePixels, resizeSelection, resolveExternalAssets, resolveMosaicRegionBounds, rgbToGray, rgbToHsl, rgbUnitToHex, runLayerFilters, runLayerMenuAction, sampleLut, sampleToneLut, selectionArea, selectionFromCoverage, selectionFromPixels, selectionModeFromModifiers, selectionOutline, selectionToCoverage, selectionToPixels, selectionValueAt, serializeContents, serializeEffects, serializeLayer, serializeLayers, serializeLayersExternal, serializePatterns, serializeSelection, setControlPath, setLayerEffects, setLayerEffectsEnabled, setLayerMask, setLayerProperties, setSmartFilterMask, setSmartFiltersEnabled, setSmartPlacement, shiftCoverage, smartFilterRows, smartObjectLayers, smoothCoverage, splitOverlayAnnotations, srgb8ToLab, srgbToLinear, sumHistograms, tempTintToXy, temperatureToKelvin, toHex, toneCurve, toneLuts, toneRange, transformHomography, transformMap, transformedBox, transformedPoint, ungroupLayer, unionRect, unprojectCanvasPoint, updateLayerEffect, updateLayerFilter, updateLayerMaskProps, updateSmartFilter, uvToXy, versionedDescriptorBytes, vibranceLinear, vibrancePixel, wbMatrix, whiteBalanceFromSample, whiteBalanceMatrix, withFilterMaskSurface, withNewIds, writeAdjustmentBlock, writeLfx2, writePatternBlock, writePsd, xyToTempTint, xyToUv };
|