@pixerate/editor 0.98.0 → 0.100.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.
|
@@ -4,8 +4,7 @@ import { P as PixelSurface, T as TiledSurface, B as BlendMode } from '../surface
|
|
|
4
4
|
export { a as BLEND_MODES, b as BlendModeInfo, M as MaskSurface, R as RasterRect, 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
5
|
import { BrushSettings, MixerSettings, MixerLoad, StrokeCoverage, MixerTarget, MixerStroke, StrokeApply, StrokePoint } from '../paint/index.cjs';
|
|
6
6
|
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 } from '../types-CwMPoRMU.cjs';
|
|
8
|
-
export { W as WarpStyle } from '../types-CwMPoRMU.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';
|
|
9
8
|
import { b as WarpPreset } from '../warp-nYs2DPrx.cjs';
|
|
10
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';
|
|
11
10
|
import { b as LoadReport, J as JsonObject, f as MigrationStep } from '../migrate-iTlm3a8h.cjs';
|
|
@@ -472,6 +471,21 @@ interface RenderOptions {
|
|
|
472
471
|
y: number;
|
|
473
472
|
diameter: number;
|
|
474
473
|
} | null;
|
|
474
|
+
/** Free Transform's frame, handles and reference point in natural pixels (`FreeTransformTool.overlay()`). */
|
|
475
|
+
freeTransform?: {
|
|
476
|
+
outline: ImagePoint[];
|
|
477
|
+
handles: ImagePoint[];
|
|
478
|
+
reference: ImagePoint;
|
|
479
|
+
/** Warp mode: the mesh's grid lines as cubics, its anchors, and handles with their anchors. */
|
|
480
|
+
warp?: {
|
|
481
|
+
curves: ImagePoint[][];
|
|
482
|
+
anchors: ImagePoint[];
|
|
483
|
+
handles: Array<{
|
|
484
|
+
point: ImagePoint;
|
|
485
|
+
anchor: ImagePoint;
|
|
486
|
+
}>;
|
|
487
|
+
};
|
|
488
|
+
} | null;
|
|
475
489
|
}
|
|
476
490
|
/**
|
|
477
491
|
* Image Cache to avoid refetching HTMLImageElement objects repeatedly during re-renders.
|
|
@@ -3536,7 +3550,7 @@ type DropZone = 'above' | 'below' | 'inside';
|
|
|
3536
3550
|
declare function dropZone(fraction: number, isGroup: boolean): DropZone;
|
|
3537
3551
|
/** The placement for `move_layer` when `dragId` is dropped on row `targetId` in `zone`, or `null` for a no-op. */
|
|
3538
3552
|
declare function dropPlacement(layers: readonly ImageLayer[], dragId: string, targetId: string, zone: DropZone): LayerPlacement | null;
|
|
3539
|
-
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-clip' | 'rasterize';
|
|
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';
|
|
3540
3554
|
interface LayerMenuItem {
|
|
3541
3555
|
action: LayerMenuAction;
|
|
3542
3556
|
label: string;
|
|
@@ -3956,4 +3970,226 @@ declare function psdBytesFromBase64(data: unknown): Uint8Array;
|
|
|
3956
3970
|
*/
|
|
3957
3971
|
declare function createImagePsdTools(controller: ImageEditorController): AgentTool[];
|
|
3958
3972
|
|
|
3959
|
-
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_MODES, type FillOptions, type FreeTransformContent, type FreeTransformGeometry, type FreeTransformHost, type FreeTransformInit, type FreeTransformMode, type FreeTransformPreview, type FreeTransformResult, FreeTransformSession, 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 TransformParams, type TransformReadout, type UnitLevels, VIBRANCE_GREY, Vec2, type VibranceParams, type ViewportMetrics, WarpMesh, WarpPreset, 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 };
|
|
3973
|
+
/**
|
|
3974
|
+
* Free Transform's view model, shared by the React and Svelte editors: the overlay (outline,
|
|
3975
|
+
* eight handles, the reference point), what a pointer is over, Photoshop's drags and modifiers,
|
|
3976
|
+
* the options bar's readout and fields, and the keyboard (Enter commits, Esc cancels, arrows
|
|
3977
|
+
* nudge). It drives a `FreeTransformSession`; the bindings forward pointer and key events and draw
|
|
3978
|
+
* `overlay()` through the renderer's `freeTransform` option.
|
|
3979
|
+
*
|
|
3980
|
+
* Drags (as Photoshop CC, where a corner scales proportionally by default):
|
|
3981
|
+
* - corner: scale from the opposite corner (Alt: from the reference point); Shift toggles
|
|
3982
|
+
* proportional; side: scale one axis;
|
|
3983
|
+
* - Mod (Ctrl / Cmd) + corner: distort that corner; Mod + side: skew along the side (Alt: about
|
|
3984
|
+
* the centre); Mod + Alt + Shift + corner: perspective;
|
|
3985
|
+
* - outside the box: rotate about the reference point (Shift: 15° steps); inside: move (Shift:
|
|
3986
|
+
* along one axis); the reference point: move it;
|
|
3987
|
+
* - the mode switch (rotate, skew, distort, perspective) makes every handle do that;
|
|
3988
|
+
* - Warp: drag a mesh anchor or handle (the grid stays smooth across its lines), or anywhere
|
|
3989
|
+
* inside to pull the surface; presets and the grid size come from the options bar. The warp is
|
|
3990
|
+
* applied in the frame's own space before the corner map, so both can be used together.
|
|
3991
|
+
*/
|
|
3992
|
+
|
|
3993
|
+
/** What a pointer is over (`mesh:<index>`: a warp mesh control point). */
|
|
3994
|
+
type TransformHandle = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'reference' | 'inside' | 'outside' | `mesh:${number}`;
|
|
3995
|
+
interface TransformModifiers {
|
|
3996
|
+
shiftKey?: boolean;
|
|
3997
|
+
altKey?: boolean;
|
|
3998
|
+
/** Ctrl or Cmd. */
|
|
3999
|
+
ctrlKey?: boolean;
|
|
4000
|
+
metaKey?: boolean;
|
|
4001
|
+
}
|
|
4002
|
+
/** The modes of the options bar's switch (Warp comes with its own mesh UI). */
|
|
4003
|
+
declare const FREE_TRANSFORM_MODE_OPTIONS: readonly {
|
|
4004
|
+
id: FreeTransformMode;
|
|
4005
|
+
label: string;
|
|
4006
|
+
title: string;
|
|
4007
|
+
}[];
|
|
4008
|
+
/** The Warp style menu: Custom (the mesh as dragged) and Photoshop's fifteen presets. */
|
|
4009
|
+
declare const WARP_STYLE_OPTIONS: readonly {
|
|
4010
|
+
id: WarpStyle | 'custom';
|
|
4011
|
+
label: string;
|
|
4012
|
+
}[];
|
|
4013
|
+
/** The Warp grid menu: patches across and down. */
|
|
4014
|
+
declare const WARP_GRID_OPTIONS: readonly {
|
|
4015
|
+
id: string;
|
|
4016
|
+
label: string;
|
|
4017
|
+
columns: number;
|
|
4018
|
+
rows: number;
|
|
4019
|
+
}[];
|
|
4020
|
+
/** Warp preset settings as the options bar shows them (percent). */
|
|
4021
|
+
interface WarpBar {
|
|
4022
|
+
style: WarpStyle | 'custom';
|
|
4023
|
+
bend: number;
|
|
4024
|
+
horizontal: number;
|
|
4025
|
+
vertical: number;
|
|
4026
|
+
orientation: 'horizontal' | 'vertical';
|
|
4027
|
+
columns: number;
|
|
4028
|
+
rows: number;
|
|
4029
|
+
}
|
|
4030
|
+
/** The options bar's numeric fields (Photoshop's X, Y, W, H, angle and skews). */
|
|
4031
|
+
declare const FREE_TRANSFORM_FIELDS: readonly [{
|
|
4032
|
+
readonly id: "x";
|
|
4033
|
+
readonly label: "X";
|
|
4034
|
+
readonly unit: "px";
|
|
4035
|
+
readonly title: "Reference point X (document pixels)";
|
|
4036
|
+
}, {
|
|
4037
|
+
readonly id: "y";
|
|
4038
|
+
readonly label: "Y";
|
|
4039
|
+
readonly unit: "px";
|
|
4040
|
+
readonly title: "Reference point Y (document pixels)";
|
|
4041
|
+
}, {
|
|
4042
|
+
readonly id: "scaleX";
|
|
4043
|
+
readonly label: "W";
|
|
4044
|
+
readonly unit: "%";
|
|
4045
|
+
readonly title: "Width in percent of the original";
|
|
4046
|
+
}, {
|
|
4047
|
+
readonly id: "scaleY";
|
|
4048
|
+
readonly label: "H";
|
|
4049
|
+
readonly unit: "%";
|
|
4050
|
+
readonly title: "Height in percent of the original";
|
|
4051
|
+
}, {
|
|
4052
|
+
readonly id: "rotate";
|
|
4053
|
+
readonly label: "∠";
|
|
4054
|
+
readonly unit: "°";
|
|
4055
|
+
readonly title: "Rotation in degrees, clockwise";
|
|
4056
|
+
}, {
|
|
4057
|
+
readonly id: "skewX";
|
|
4058
|
+
readonly label: "H skew";
|
|
4059
|
+
readonly unit: "°";
|
|
4060
|
+
readonly title: "Horizontal skew in degrees";
|
|
4061
|
+
}, {
|
|
4062
|
+
readonly id: "skewY";
|
|
4063
|
+
readonly label: "V skew";
|
|
4064
|
+
readonly unit: "°";
|
|
4065
|
+
readonly title: "Vertical skew in degrees";
|
|
4066
|
+
}];
|
|
4067
|
+
type FreeTransformField = (typeof FREE_TRANSFORM_FIELDS)[number]['id'];
|
|
4068
|
+
/** What the options bar shows. */
|
|
4069
|
+
interface FreeTransformBar extends Record<FreeTransformField, number> {
|
|
4070
|
+
/** False after Distort or Perspective: the numbers no longer describe the shape. */
|
|
4071
|
+
affine: boolean;
|
|
4072
|
+
}
|
|
4073
|
+
interface TransformOverlay {
|
|
4074
|
+
/** The transformed frame, corner to corner (document pixels). */
|
|
4075
|
+
outline: ImagePoint[];
|
|
4076
|
+
/** The eight handles (none in Warp mode). */
|
|
4077
|
+
handles: Array<{
|
|
4078
|
+
id: 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w';
|
|
4079
|
+
x: number;
|
|
4080
|
+
y: number;
|
|
4081
|
+
}>;
|
|
4082
|
+
reference: ImagePoint;
|
|
4083
|
+
/** In Warp mode: the mesh's grid lines as cubics, its anchors, and its handles with the anchor each belongs to. */
|
|
4084
|
+
warp?: {
|
|
4085
|
+
curves: ImagePoint[][];
|
|
4086
|
+
anchors: ImagePoint[];
|
|
4087
|
+
handles: Array<{
|
|
4088
|
+
point: ImagePoint;
|
|
4089
|
+
anchor: ImagePoint;
|
|
4090
|
+
}>;
|
|
4091
|
+
};
|
|
4092
|
+
}
|
|
4093
|
+
interface FreeTransformToolOptions {
|
|
4094
|
+
/** Defers preview resampling to the next frame (pass `requestAnimationFrame`; default: at once). */
|
|
4095
|
+
schedule?: (run: () => void) => void;
|
|
4096
|
+
/** Called whenever the overlay, readout or error changes. */
|
|
4097
|
+
onChange?: () => void;
|
|
4098
|
+
}
|
|
4099
|
+
/**
|
|
4100
|
+
* The interactive Free Transform (see the module comment). `begin` opens a session on the
|
|
4101
|
+
* controller; pointer and key methods drive it; `commit` / `cancel` close it.
|
|
4102
|
+
*/
|
|
4103
|
+
declare class FreeTransformTool {
|
|
4104
|
+
private readonly controller;
|
|
4105
|
+
private readonly options;
|
|
4106
|
+
private sessionRef;
|
|
4107
|
+
private modeValue;
|
|
4108
|
+
/** The reference point in the untransformed frame's space (follows the transform). */
|
|
4109
|
+
private refBox;
|
|
4110
|
+
private corners;
|
|
4111
|
+
private drag;
|
|
4112
|
+
/** The warp mesh in the frame's own space (null: no warp). */
|
|
4113
|
+
private mesh;
|
|
4114
|
+
private warpSettings;
|
|
4115
|
+
private pending;
|
|
4116
|
+
private viewScale;
|
|
4117
|
+
private viewClip;
|
|
4118
|
+
/** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
|
|
4119
|
+
private typed;
|
|
4120
|
+
/** Width and height scale together when typed (the chain icon). */
|
|
4121
|
+
proportional: boolean;
|
|
4122
|
+
error: string | null;
|
|
4123
|
+
lastResult: FreeTransformResult | null;
|
|
4124
|
+
constructor(controller: ImageEditorController, options?: FreeTransformToolOptions);
|
|
4125
|
+
get active(): boolean;
|
|
4126
|
+
get session(): FreeTransformSession | null;
|
|
4127
|
+
get mode(): FreeTransformMode;
|
|
4128
|
+
get interpolation(): Interpolation;
|
|
4129
|
+
private readonly listeners;
|
|
4130
|
+
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
4131
|
+
subscribe(listener: () => void): () => void;
|
|
4132
|
+
private changed;
|
|
4133
|
+
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
4134
|
+
begin(init?: FreeTransformInit): string | null;
|
|
4135
|
+
setMode(mode: FreeTransformMode): void;
|
|
4136
|
+
/** The Warp options bar's settings. */
|
|
4137
|
+
warpBar(): WarpBar;
|
|
4138
|
+
/** The warp mesh (frame space), or null. */
|
|
4139
|
+
get warp(): WarpMesh | null;
|
|
4140
|
+
/**
|
|
4141
|
+
* Applies Warp options: a preset `style` with `bend` / `horizontal` / `vertical` (percent) and
|
|
4142
|
+
* `orientation` replaces the mesh; `custom` keeps it; the grid size re-splits it (exactly when it
|
|
4143
|
+
* can). Switches to Warp mode.
|
|
4144
|
+
*/
|
|
4145
|
+
setWarp(changes: Partial<WarpBar>): void;
|
|
4146
|
+
/** Sets the reference point to an anchor of the frame (the options bar's locator). */
|
|
4147
|
+
setReference(anchor: TransformAnchor): void;
|
|
4148
|
+
setInterpolation(interpolation: Interpolation): void;
|
|
4149
|
+
/** Screen pixels per document pixel and the visible document area, for previews. */
|
|
4150
|
+
setView(scale: number, clip?: {
|
|
4151
|
+
x: number;
|
|
4152
|
+
y: number;
|
|
4153
|
+
width: number;
|
|
4154
|
+
height: number;
|
|
4155
|
+
}): void;
|
|
4156
|
+
private homography;
|
|
4157
|
+
/** The reference point in document pixels. */
|
|
4158
|
+
referencePoint(): Vec2 | null;
|
|
4159
|
+
/** The outline, handles and reference point to draw, or `null` when no transform is open. */
|
|
4160
|
+
overlay(): TransformOverlay | null;
|
|
4161
|
+
/** The mesh's border anchors, clockwise (for the inside test). */
|
|
4162
|
+
private meshOutline;
|
|
4163
|
+
/** What a document point is over (`tolerance` in document pixels: a few screen pixels / scale). */
|
|
4164
|
+
hit(p: ImagePoint, tolerance: number): TransformHandle | null;
|
|
4165
|
+
/** The CSS cursor for a handle. */
|
|
4166
|
+
cursor(handle: TransformHandle | null): string;
|
|
4167
|
+
/** Starts a drag on what `p` is over. */
|
|
4168
|
+
down(p: ImagePoint, tolerance: number): TransformHandle | null;
|
|
4169
|
+
/** A document point in the frame's own space under `corners`. */
|
|
4170
|
+
private toFrame;
|
|
4171
|
+
/** Continues the drag to `p` with the modifiers held now. */
|
|
4172
|
+
move(p: ImagePoint, m?: TransformModifiers): void;
|
|
4173
|
+
/** Ends the drag (the transform stays open). */
|
|
4174
|
+
up(): void;
|
|
4175
|
+
private dragCorners;
|
|
4176
|
+
/** Sets new corners and refreshes the preview (scheduled). Invalid shapes keep the last good one. */
|
|
4177
|
+
setCorners(corners: Quad): void;
|
|
4178
|
+
private preview;
|
|
4179
|
+
private run;
|
|
4180
|
+
/** The options bar's numbers for the current shape. */
|
|
4181
|
+
bar(): FreeTransformBar | null;
|
|
4182
|
+
/** Applies a typed options-bar value (W and H together while `proportional`). */
|
|
4183
|
+
setField(field: FreeTransformField, value: number): void;
|
|
4184
|
+
/** Finishes with full-quality resampling (one undo step). */
|
|
4185
|
+
commit(): FreeTransformResult | null;
|
|
4186
|
+
/** Abandons the transform and restores everything. */
|
|
4187
|
+
cancel(): void;
|
|
4188
|
+
/**
|
|
4189
|
+
* Keyboard: Enter commits, Escape cancels, arrows nudge by 1 px (Shift: 10). Ctrl/Cmd+T opens a
|
|
4190
|
+
* Free Transform when none is open. Returns true when the key was used (prevent its default).
|
|
4191
|
+
*/
|
|
4192
|
+
key(e: ShortcutEvent): boolean;
|
|
4193
|
+
}
|
|
4194
|
+
|
|
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 };
|
|
@@ -4,8 +4,7 @@ import { P as PixelSurface, T as TiledSurface, B as BlendMode } from '../surface
|
|
|
4
4
|
export { a as BLEND_MODES, b as BlendModeInfo, M as MaskSurface, R as RasterRect, 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.js';
|
|
5
5
|
import { BrushSettings, MixerSettings, MixerLoad, StrokeCoverage, MixerTarget, MixerStroke, StrokeApply, StrokePoint } from '../paint/index.js';
|
|
6
6
|
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.js';
|
|
7
|
-
import { Q as Quad, a as WarpMesh, V as Vec2, A as AffineMatrix, H as Homography } from '../types-CwMPoRMU.js';
|
|
8
|
-
export { W as WarpStyle } from '../types-CwMPoRMU.js';
|
|
7
|
+
import { Q as Quad, a as WarpMesh, V as Vec2, A as AffineMatrix, H as Homography, W as WarpStyle } from '../types-CwMPoRMU.js';
|
|
9
8
|
import { b as WarpPreset } from '../warp-B8rAguzs.js';
|
|
10
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-B8rAguzs.js';
|
|
11
10
|
import { b as LoadReport, J as JsonObject, f as MigrationStep } from '../migrate-iTlm3a8h.js';
|
|
@@ -472,6 +471,21 @@ interface RenderOptions {
|
|
|
472
471
|
y: number;
|
|
473
472
|
diameter: number;
|
|
474
473
|
} | null;
|
|
474
|
+
/** Free Transform's frame, handles and reference point in natural pixels (`FreeTransformTool.overlay()`). */
|
|
475
|
+
freeTransform?: {
|
|
476
|
+
outline: ImagePoint[];
|
|
477
|
+
handles: ImagePoint[];
|
|
478
|
+
reference: ImagePoint;
|
|
479
|
+
/** Warp mode: the mesh's grid lines as cubics, its anchors, and handles with their anchors. */
|
|
480
|
+
warp?: {
|
|
481
|
+
curves: ImagePoint[][];
|
|
482
|
+
anchors: ImagePoint[];
|
|
483
|
+
handles: Array<{
|
|
484
|
+
point: ImagePoint;
|
|
485
|
+
anchor: ImagePoint;
|
|
486
|
+
}>;
|
|
487
|
+
};
|
|
488
|
+
} | null;
|
|
475
489
|
}
|
|
476
490
|
/**
|
|
477
491
|
* Image Cache to avoid refetching HTMLImageElement objects repeatedly during re-renders.
|
|
@@ -3536,7 +3550,7 @@ type DropZone = 'above' | 'below' | 'inside';
|
|
|
3536
3550
|
declare function dropZone(fraction: number, isGroup: boolean): DropZone;
|
|
3537
3551
|
/** The placement for `move_layer` when `dragId` is dropped on row `targetId` in `zone`, or `null` for a no-op. */
|
|
3538
3552
|
declare function dropPlacement(layers: readonly ImageLayer[], dragId: string, targetId: string, zone: DropZone): LayerPlacement | null;
|
|
3539
|
-
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-clip' | 'rasterize';
|
|
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';
|
|
3540
3554
|
interface LayerMenuItem {
|
|
3541
3555
|
action: LayerMenuAction;
|
|
3542
3556
|
label: string;
|
|
@@ -3956,4 +3970,226 @@ declare function psdBytesFromBase64(data: unknown): Uint8Array;
|
|
|
3956
3970
|
*/
|
|
3957
3971
|
declare function createImagePsdTools(controller: ImageEditorController): AgentTool[];
|
|
3958
3972
|
|
|
3959
|
-
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_MODES, type FillOptions, type FreeTransformContent, type FreeTransformGeometry, type FreeTransformHost, type FreeTransformInit, type FreeTransformMode, type FreeTransformPreview, type FreeTransformResult, FreeTransformSession, 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 TransformParams, type TransformReadout, type UnitLevels, VIBRANCE_GREY, Vec2, type VibranceParams, type ViewportMetrics, WarpMesh, WarpPreset, 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 };
|
|
3973
|
+
/**
|
|
3974
|
+
* Free Transform's view model, shared by the React and Svelte editors: the overlay (outline,
|
|
3975
|
+
* eight handles, the reference point), what a pointer is over, Photoshop's drags and modifiers,
|
|
3976
|
+
* the options bar's readout and fields, and the keyboard (Enter commits, Esc cancels, arrows
|
|
3977
|
+
* nudge). It drives a `FreeTransformSession`; the bindings forward pointer and key events and draw
|
|
3978
|
+
* `overlay()` through the renderer's `freeTransform` option.
|
|
3979
|
+
*
|
|
3980
|
+
* Drags (as Photoshop CC, where a corner scales proportionally by default):
|
|
3981
|
+
* - corner: scale from the opposite corner (Alt: from the reference point); Shift toggles
|
|
3982
|
+
* proportional; side: scale one axis;
|
|
3983
|
+
* - Mod (Ctrl / Cmd) + corner: distort that corner; Mod + side: skew along the side (Alt: about
|
|
3984
|
+
* the centre); Mod + Alt + Shift + corner: perspective;
|
|
3985
|
+
* - outside the box: rotate about the reference point (Shift: 15° steps); inside: move (Shift:
|
|
3986
|
+
* along one axis); the reference point: move it;
|
|
3987
|
+
* - the mode switch (rotate, skew, distort, perspective) makes every handle do that;
|
|
3988
|
+
* - Warp: drag a mesh anchor or handle (the grid stays smooth across its lines), or anywhere
|
|
3989
|
+
* inside to pull the surface; presets and the grid size come from the options bar. The warp is
|
|
3990
|
+
* applied in the frame's own space before the corner map, so both can be used together.
|
|
3991
|
+
*/
|
|
3992
|
+
|
|
3993
|
+
/** What a pointer is over (`mesh:<index>`: a warp mesh control point). */
|
|
3994
|
+
type TransformHandle = 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'reference' | 'inside' | 'outside' | `mesh:${number}`;
|
|
3995
|
+
interface TransformModifiers {
|
|
3996
|
+
shiftKey?: boolean;
|
|
3997
|
+
altKey?: boolean;
|
|
3998
|
+
/** Ctrl or Cmd. */
|
|
3999
|
+
ctrlKey?: boolean;
|
|
4000
|
+
metaKey?: boolean;
|
|
4001
|
+
}
|
|
4002
|
+
/** The modes of the options bar's switch (Warp comes with its own mesh UI). */
|
|
4003
|
+
declare const FREE_TRANSFORM_MODE_OPTIONS: readonly {
|
|
4004
|
+
id: FreeTransformMode;
|
|
4005
|
+
label: string;
|
|
4006
|
+
title: string;
|
|
4007
|
+
}[];
|
|
4008
|
+
/** The Warp style menu: Custom (the mesh as dragged) and Photoshop's fifteen presets. */
|
|
4009
|
+
declare const WARP_STYLE_OPTIONS: readonly {
|
|
4010
|
+
id: WarpStyle | 'custom';
|
|
4011
|
+
label: string;
|
|
4012
|
+
}[];
|
|
4013
|
+
/** The Warp grid menu: patches across and down. */
|
|
4014
|
+
declare const WARP_GRID_OPTIONS: readonly {
|
|
4015
|
+
id: string;
|
|
4016
|
+
label: string;
|
|
4017
|
+
columns: number;
|
|
4018
|
+
rows: number;
|
|
4019
|
+
}[];
|
|
4020
|
+
/** Warp preset settings as the options bar shows them (percent). */
|
|
4021
|
+
interface WarpBar {
|
|
4022
|
+
style: WarpStyle | 'custom';
|
|
4023
|
+
bend: number;
|
|
4024
|
+
horizontal: number;
|
|
4025
|
+
vertical: number;
|
|
4026
|
+
orientation: 'horizontal' | 'vertical';
|
|
4027
|
+
columns: number;
|
|
4028
|
+
rows: number;
|
|
4029
|
+
}
|
|
4030
|
+
/** The options bar's numeric fields (Photoshop's X, Y, W, H, angle and skews). */
|
|
4031
|
+
declare const FREE_TRANSFORM_FIELDS: readonly [{
|
|
4032
|
+
readonly id: "x";
|
|
4033
|
+
readonly label: "X";
|
|
4034
|
+
readonly unit: "px";
|
|
4035
|
+
readonly title: "Reference point X (document pixels)";
|
|
4036
|
+
}, {
|
|
4037
|
+
readonly id: "y";
|
|
4038
|
+
readonly label: "Y";
|
|
4039
|
+
readonly unit: "px";
|
|
4040
|
+
readonly title: "Reference point Y (document pixels)";
|
|
4041
|
+
}, {
|
|
4042
|
+
readonly id: "scaleX";
|
|
4043
|
+
readonly label: "W";
|
|
4044
|
+
readonly unit: "%";
|
|
4045
|
+
readonly title: "Width in percent of the original";
|
|
4046
|
+
}, {
|
|
4047
|
+
readonly id: "scaleY";
|
|
4048
|
+
readonly label: "H";
|
|
4049
|
+
readonly unit: "%";
|
|
4050
|
+
readonly title: "Height in percent of the original";
|
|
4051
|
+
}, {
|
|
4052
|
+
readonly id: "rotate";
|
|
4053
|
+
readonly label: "∠";
|
|
4054
|
+
readonly unit: "°";
|
|
4055
|
+
readonly title: "Rotation in degrees, clockwise";
|
|
4056
|
+
}, {
|
|
4057
|
+
readonly id: "skewX";
|
|
4058
|
+
readonly label: "H skew";
|
|
4059
|
+
readonly unit: "°";
|
|
4060
|
+
readonly title: "Horizontal skew in degrees";
|
|
4061
|
+
}, {
|
|
4062
|
+
readonly id: "skewY";
|
|
4063
|
+
readonly label: "V skew";
|
|
4064
|
+
readonly unit: "°";
|
|
4065
|
+
readonly title: "Vertical skew in degrees";
|
|
4066
|
+
}];
|
|
4067
|
+
type FreeTransformField = (typeof FREE_TRANSFORM_FIELDS)[number]['id'];
|
|
4068
|
+
/** What the options bar shows. */
|
|
4069
|
+
interface FreeTransformBar extends Record<FreeTransformField, number> {
|
|
4070
|
+
/** False after Distort or Perspective: the numbers no longer describe the shape. */
|
|
4071
|
+
affine: boolean;
|
|
4072
|
+
}
|
|
4073
|
+
interface TransformOverlay {
|
|
4074
|
+
/** The transformed frame, corner to corner (document pixels). */
|
|
4075
|
+
outline: ImagePoint[];
|
|
4076
|
+
/** The eight handles (none in Warp mode). */
|
|
4077
|
+
handles: Array<{
|
|
4078
|
+
id: 'nw' | 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w';
|
|
4079
|
+
x: number;
|
|
4080
|
+
y: number;
|
|
4081
|
+
}>;
|
|
4082
|
+
reference: ImagePoint;
|
|
4083
|
+
/** In Warp mode: the mesh's grid lines as cubics, its anchors, and its handles with the anchor each belongs to. */
|
|
4084
|
+
warp?: {
|
|
4085
|
+
curves: ImagePoint[][];
|
|
4086
|
+
anchors: ImagePoint[];
|
|
4087
|
+
handles: Array<{
|
|
4088
|
+
point: ImagePoint;
|
|
4089
|
+
anchor: ImagePoint;
|
|
4090
|
+
}>;
|
|
4091
|
+
};
|
|
4092
|
+
}
|
|
4093
|
+
interface FreeTransformToolOptions {
|
|
4094
|
+
/** Defers preview resampling to the next frame (pass `requestAnimationFrame`; default: at once). */
|
|
4095
|
+
schedule?: (run: () => void) => void;
|
|
4096
|
+
/** Called whenever the overlay, readout or error changes. */
|
|
4097
|
+
onChange?: () => void;
|
|
4098
|
+
}
|
|
4099
|
+
/**
|
|
4100
|
+
* The interactive Free Transform (see the module comment). `begin` opens a session on the
|
|
4101
|
+
* controller; pointer and key methods drive it; `commit` / `cancel` close it.
|
|
4102
|
+
*/
|
|
4103
|
+
declare class FreeTransformTool {
|
|
4104
|
+
private readonly controller;
|
|
4105
|
+
private readonly options;
|
|
4106
|
+
private sessionRef;
|
|
4107
|
+
private modeValue;
|
|
4108
|
+
/** The reference point in the untransformed frame's space (follows the transform). */
|
|
4109
|
+
private refBox;
|
|
4110
|
+
private corners;
|
|
4111
|
+
private drag;
|
|
4112
|
+
/** The warp mesh in the frame's own space (null: no warp). */
|
|
4113
|
+
private mesh;
|
|
4114
|
+
private warpSettings;
|
|
4115
|
+
private pending;
|
|
4116
|
+
private viewScale;
|
|
4117
|
+
private viewClip;
|
|
4118
|
+
/** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
|
|
4119
|
+
private typed;
|
|
4120
|
+
/** Width and height scale together when typed (the chain icon). */
|
|
4121
|
+
proportional: boolean;
|
|
4122
|
+
error: string | null;
|
|
4123
|
+
lastResult: FreeTransformResult | null;
|
|
4124
|
+
constructor(controller: ImageEditorController, options?: FreeTransformToolOptions);
|
|
4125
|
+
get active(): boolean;
|
|
4126
|
+
get session(): FreeTransformSession | null;
|
|
4127
|
+
get mode(): FreeTransformMode;
|
|
4128
|
+
get interpolation(): Interpolation;
|
|
4129
|
+
private readonly listeners;
|
|
4130
|
+
/** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
|
|
4131
|
+
subscribe(listener: () => void): () => void;
|
|
4132
|
+
private changed;
|
|
4133
|
+
/** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
|
|
4134
|
+
begin(init?: FreeTransformInit): string | null;
|
|
4135
|
+
setMode(mode: FreeTransformMode): void;
|
|
4136
|
+
/** The Warp options bar's settings. */
|
|
4137
|
+
warpBar(): WarpBar;
|
|
4138
|
+
/** The warp mesh (frame space), or null. */
|
|
4139
|
+
get warp(): WarpMesh | null;
|
|
4140
|
+
/**
|
|
4141
|
+
* Applies Warp options: a preset `style` with `bend` / `horizontal` / `vertical` (percent) and
|
|
4142
|
+
* `orientation` replaces the mesh; `custom` keeps it; the grid size re-splits it (exactly when it
|
|
4143
|
+
* can). Switches to Warp mode.
|
|
4144
|
+
*/
|
|
4145
|
+
setWarp(changes: Partial<WarpBar>): void;
|
|
4146
|
+
/** Sets the reference point to an anchor of the frame (the options bar's locator). */
|
|
4147
|
+
setReference(anchor: TransformAnchor): void;
|
|
4148
|
+
setInterpolation(interpolation: Interpolation): void;
|
|
4149
|
+
/** Screen pixels per document pixel and the visible document area, for previews. */
|
|
4150
|
+
setView(scale: number, clip?: {
|
|
4151
|
+
x: number;
|
|
4152
|
+
y: number;
|
|
4153
|
+
width: number;
|
|
4154
|
+
height: number;
|
|
4155
|
+
}): void;
|
|
4156
|
+
private homography;
|
|
4157
|
+
/** The reference point in document pixels. */
|
|
4158
|
+
referencePoint(): Vec2 | null;
|
|
4159
|
+
/** The outline, handles and reference point to draw, or `null` when no transform is open. */
|
|
4160
|
+
overlay(): TransformOverlay | null;
|
|
4161
|
+
/** The mesh's border anchors, clockwise (for the inside test). */
|
|
4162
|
+
private meshOutline;
|
|
4163
|
+
/** What a document point is over (`tolerance` in document pixels: a few screen pixels / scale). */
|
|
4164
|
+
hit(p: ImagePoint, tolerance: number): TransformHandle | null;
|
|
4165
|
+
/** The CSS cursor for a handle. */
|
|
4166
|
+
cursor(handle: TransformHandle | null): string;
|
|
4167
|
+
/** Starts a drag on what `p` is over. */
|
|
4168
|
+
down(p: ImagePoint, tolerance: number): TransformHandle | null;
|
|
4169
|
+
/** A document point in the frame's own space under `corners`. */
|
|
4170
|
+
private toFrame;
|
|
4171
|
+
/** Continues the drag to `p` with the modifiers held now. */
|
|
4172
|
+
move(p: ImagePoint, m?: TransformModifiers): void;
|
|
4173
|
+
/** Ends the drag (the transform stays open). */
|
|
4174
|
+
up(): void;
|
|
4175
|
+
private dragCorners;
|
|
4176
|
+
/** Sets new corners and refreshes the preview (scheduled). Invalid shapes keep the last good one. */
|
|
4177
|
+
setCorners(corners: Quad): void;
|
|
4178
|
+
private preview;
|
|
4179
|
+
private run;
|
|
4180
|
+
/** The options bar's numbers for the current shape. */
|
|
4181
|
+
bar(): FreeTransformBar | null;
|
|
4182
|
+
/** Applies a typed options-bar value (W and H together while `proportional`). */
|
|
4183
|
+
setField(field: FreeTransformField, value: number): void;
|
|
4184
|
+
/** Finishes with full-quality resampling (one undo step). */
|
|
4185
|
+
commit(): FreeTransformResult | null;
|
|
4186
|
+
/** Abandons the transform and restores everything. */
|
|
4187
|
+
cancel(): void;
|
|
4188
|
+
/**
|
|
4189
|
+
* Keyboard: Enter commits, Escape cancels, arrows nudge by 1 px (Shift: 10). Ctrl/Cmd+T opens a
|
|
4190
|
+
* Free Transform when none is open. Returns true when the key was used (prevent its default).
|
|
4191
|
+
*/
|
|
4192
|
+
key(e: ShortcutEvent): boolean;
|
|
4193
|
+
}
|
|
4194
|
+
|
|
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 };
|