@pixerate/editor 0.96.0 → 0.97.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.
@@ -60,7 +60,8 @@
60
60
 
61
61
 
62
62
 
63
- var _chunkT422YCHRcjs = require('../chunk-T422YCHR.cjs');
63
+
64
+ var _chunk4AB5BHYKcjs = require('../chunk-4AB5BHYK.cjs');
64
65
 
65
66
 
66
67
 
@@ -197,5 +198,6 @@ var _chunkCRMAXIUVcjs = require('../chunk-CRMAXIUV.cjs');
197
198
 
198
199
 
199
200
 
200
- exports.BLEND_MODES = _chunkCRMAXIUVcjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunkT422YCHRcjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunkT422YCHRcjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkT422YCHRcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.LAYER_EFFECT_KINDS = _chunkT422YCHRcjs.LAYER_EFFECT_KINDS; exports.LayerEffectError = _chunkT422YCHRcjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunkT422YCHRcjs.MAX_EFFECT_REACH; exports.PatternPlacement = _chunkT422YCHRcjs.PatternPlacement; exports.PatternTile = _chunkT422YCHRcjs.PatternTile; exports.RasterCompositor = _chunkT422YCHRcjs.RasterCompositor; exports.STROKE_CHAMFER_MAX = _chunkT422YCHRcjs.STROKE_CHAMFER_MAX; exports.SurfaceDraft = _chunkCRMAXIUVcjs.SurfaceDraft; exports.TILE = _chunkCRMAXIUVcjs.TILE; exports.TILE_SHIFT = _chunkCRMAXIUVcjs.TILE_SHIFT; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.ZlibError = _chunkT422YCHRcjs.ZlibError; exports.activeEffectItems = _chunkT422YCHRcjs.activeEffectItems; exports.adler32 = _chunkT422YCHRcjs.adler32; exports.base64ToBytes = _chunkT422YCHRcjs.base64ToBytes; exports.blendChannel = _chunkCRMAXIUVcjs.blendChannel; exports.blendImageData = _chunkCRMAXIUVcjs.blendImageData; exports.blendLum = _chunkCRMAXIUVcjs.blendLum; exports.blendPixel = _chunkCRMAXIUVcjs.blendPixel; exports.blendRgb = _chunkCRMAXIUVcjs.blendRgb; exports.blendTile = _chunkT422YCHRcjs.blendTile; exports.buildEffectMaps = _chunkT422YCHRcjs.buildEffectMaps; exports.builtinPattern = _chunkT422YCHRcjs.builtinPattern; exports.builtinPatternIds = _chunkT422YCHRcjs.builtinPatternIds; exports.bytesToBase64 = _chunkT422YCHRcjs.bytesToBase64; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.changedTiles = _chunkT422YCHRcjs.changedTiles; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.compositeLayerEffects = _chunkT422YCHRcjs.compositeLayerEffects; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contourLut = _chunkT422YCHRcjs.contourLut; exports.curveLut = _chunkT422YCHRcjs.curveLut; exports.decodePng = _chunkT422YCHRcjs.decodePng; exports.defaultEffectGradient = _chunkT422YCHRcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkT422YCHRcjs.defaultLayerEffect; exports.deflate = _chunkT422YCHRcjs.deflate; exports.deflateRaw = _chunkT422YCHRcjs.deflateRaw; exports.effectColorHex = _chunkT422YCHRcjs.effectColorHex; exports.effectReach = _chunkT422YCHRcjs.effectReach; exports.effectsAreLocal = _chunkT422YCHRcjs.effectsAreLocal; exports.effectsFingerprint = _chunkT422YCHRcjs.effectsFingerprint; exports.effectsMargin = _chunkT422YCHRcjs.effectsMargin; exports.effectsScale = _chunkT422YCHRcjs.effectsScale; exports.emptySurface = _chunkCRMAXIUVcjs.emptySurface; exports.encodePng = _chunkT422YCHRcjs.encodePng; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.findLayer = _chunkT422YCHRcjs.findLayer; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunkT422YCHRcjs.flattenLayers; exports.gaussianBlur = _chunkT422YCHRcjs.gaussianBlur; exports.gradientT = _chunkT422YCHRcjs.gradientT; exports.hasActiveEffects = _chunkT422YCHRcjs.hasActiveEffects; exports.hashNoise = _chunkT422YCHRcjs.hashNoise; exports.inflate = _chunkT422YCHRcjs.inflate; exports.inflateRaw = _chunkT422YCHRcjs.inflateRaw; exports.insertLayer = _chunkT422YCHRcjs.insertLayer; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isLayerEffectKind = _chunkT422YCHRcjs.isLayerEffectKind; exports.isLayerLocked = _chunkT422YCHRcjs.isLayerLocked; exports.isPng = _chunkT422YCHRcjs.isPng; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.layerEffectFields = _chunkT422YCHRcjs.layerEffectFields; exports.layerEffectLabel = _chunkT422YCHRcjs.layerEffectLabel; exports.mapLayer = _chunkT422YCHRcjs.mapLayer; exports.mergeLayerEffect = _chunkT422YCHRcjs.mergeLayerEffect; exports.mixPigment8 = _chunkCRMAXIUVcjs.mixPigment8; exports.mixPigmentRgb = _chunkCRMAXIUVcjs.mixPigmentRgb; exports.newEffectId = _chunkT422YCHRcjs.newEffectId; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunkT422YCHRcjs.normalizeLayerEffects; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseDataUrl = _chunkT422YCHRcjs.parseDataUrl; exports.parseEffectColor = _chunkT422YCHRcjs.parseEffectColor; exports.pngDataUrl = _chunkT422YCHRcjs.pngDataUrl; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.renderLayerEffects = _chunkT422YCHRcjs.renderLayerEffects; exports.scaleLayerEffect = _chunkT422YCHRcjs.scaleLayerEffect; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tileCoord = _chunkCRMAXIUVcjs.tileCoord; exports.tileKey = _chunkCRMAXIUVcjs.tileKey; exports.tileRect = _chunkCRMAXIUVcjs.tileRect; exports.tilesInRect = _chunkCRMAXIUVcjs.tilesInRect; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.validateEffectGradient = _chunkT422YCHRcjs.validateEffectGradient; exports.validateLayerEffect = _chunkT422YCHRcjs.validateLayerEffect; exports.validateLayerEffects = _chunkT422YCHRcjs.validateLayerEffects; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion;
201
+
202
+ exports.BLEND_MODES = _chunkCRMAXIUVcjs.BLEND_MODES; exports.CURVE_LUT_SIZE = _chunk4AB5BHYKcjs.CURVE_LUT_SIZE; exports.DEFAULT_GLOBAL_LIGHT = _chunk4AB5BHYKcjs.DEFAULT_GLOBAL_LIGHT; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunk4AB5BHYKcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.LAYER_EFFECT_KINDS = _chunk4AB5BHYKcjs.LAYER_EFFECT_KINDS; exports.LayerEffectError = _chunk4AB5BHYKcjs.LayerEffectError; exports.MAX_EFFECT_REACH = _chunk4AB5BHYKcjs.MAX_EFFECT_REACH; exports.PatternPlacement = _chunk4AB5BHYKcjs.PatternPlacement; exports.PatternTile = _chunk4AB5BHYKcjs.PatternTile; exports.RasterCompositor = _chunk4AB5BHYKcjs.RasterCompositor; exports.STROKE_CHAMFER_MAX = _chunk4AB5BHYKcjs.STROKE_CHAMFER_MAX; exports.SurfaceDraft = _chunkCRMAXIUVcjs.SurfaceDraft; exports.TILE = _chunkCRMAXIUVcjs.TILE; exports.TILE_SHIFT = _chunkCRMAXIUVcjs.TILE_SHIFT; exports.TiledSurface = _chunkCRMAXIUVcjs.TiledSurface; exports.ZlibError = _chunk4AB5BHYKcjs.ZlibError; exports.activeEffectItems = _chunk4AB5BHYKcjs.activeEffectItems; exports.adler32 = _chunk4AB5BHYKcjs.adler32; exports.base64ToBytes = _chunk4AB5BHYKcjs.base64ToBytes; exports.blendChannel = _chunkCRMAXIUVcjs.blendChannel; exports.blendImageData = _chunkCRMAXIUVcjs.blendImageData; exports.blendLum = _chunkCRMAXIUVcjs.blendLum; exports.blendPixel = _chunkCRMAXIUVcjs.blendPixel; exports.blendRgb = _chunkCRMAXIUVcjs.blendRgb; exports.blendTile = _chunk4AB5BHYKcjs.blendTile; exports.buildEffectMaps = _chunk4AB5BHYKcjs.buildEffectMaps; exports.builtinPattern = _chunk4AB5BHYKcjs.builtinPattern; exports.builtinPatternIds = _chunk4AB5BHYKcjs.builtinPatternIds; exports.bytesToBase64 = _chunk4AB5BHYKcjs.bytesToBase64; exports.canvasCompositeOperation = _chunkCRMAXIUVcjs.canvasCompositeOperation; exports.changedTiles = _chunk4AB5BHYKcjs.changedTiles; exports.collectTiles = _chunkCRMAXIUVcjs.collectTiles; exports.compositeLayerEffects = _chunk4AB5BHYKcjs.compositeLayerEffects; exports.contentBounds = _chunkCRMAXIUVcjs.contentBounds; exports.contourLut = _chunk4AB5BHYKcjs.contourLut; exports.curveLut = _chunk4AB5BHYKcjs.curveLut; exports.decodePng = _chunk4AB5BHYKcjs.decodePng; exports.defaultEffectGradient = _chunk4AB5BHYKcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunk4AB5BHYKcjs.defaultLayerEffect; exports.deflate = _chunk4AB5BHYKcjs.deflate; exports.deflateRaw = _chunk4AB5BHYKcjs.deflateRaw; exports.effectColorHex = _chunk4AB5BHYKcjs.effectColorHex; exports.effectReach = _chunk4AB5BHYKcjs.effectReach; exports.effectsAreLocal = _chunk4AB5BHYKcjs.effectsAreLocal; exports.effectsFingerprint = _chunk4AB5BHYKcjs.effectsFingerprint; exports.effectsMargin = _chunk4AB5BHYKcjs.effectsMargin; exports.effectsScale = _chunk4AB5BHYKcjs.effectsScale; exports.emptySurface = _chunkCRMAXIUVcjs.emptySurface; exports.encodePng = _chunk4AB5BHYKcjs.encodePng; exports.fillRect = _chunkCRMAXIUVcjs.fillRect; exports.findLayer = _chunk4AB5BHYKcjs.findLayer; exports.finishTile = _chunkCRMAXIUVcjs.finishTile; exports.flattenLayers = _chunk4AB5BHYKcjs.flattenLayers; exports.gaussianBlur = _chunk4AB5BHYKcjs.gaussianBlur; exports.gradientT = _chunk4AB5BHYKcjs.gradientT; exports.hasActiveEffects = _chunk4AB5BHYKcjs.hasActiveEffects; exports.hashNoise = _chunk4AB5BHYKcjs.hashNoise; exports.inflate = _chunk4AB5BHYKcjs.inflate; exports.inflateRaw = _chunk4AB5BHYKcjs.inflateRaw; exports.insertLayer = _chunk4AB5BHYKcjs.insertLayer; exports.isBlendMode = _chunkCRMAXIUVcjs.isBlendMode; exports.isLayerEffectKind = _chunk4AB5BHYKcjs.isLayerEffectKind; exports.isLayerLocked = _chunk4AB5BHYKcjs.isLayerLocked; exports.isPng = _chunk4AB5BHYKcjs.isPng; exports.isSeparableBlendMode = _chunkCRMAXIUVcjs.isSeparableBlendMode; exports.layerEffectFields = _chunk4AB5BHYKcjs.layerEffectFields; exports.layerEffectLabel = _chunk4AB5BHYKcjs.layerEffectLabel; exports.mapLayer = _chunk4AB5BHYKcjs.mapLayer; exports.mergeLayerEffect = _chunk4AB5BHYKcjs.mergeLayerEffect; exports.mixPigment8 = _chunkCRMAXIUVcjs.mixPigment8; exports.mixPigmentRgb = _chunkCRMAXIUVcjs.mixPigmentRgb; exports.newEffectId = _chunk4AB5BHYKcjs.newEffectId; exports.normalizeBlendMode = _chunkCRMAXIUVcjs.normalizeBlendMode; exports.normalizeLayerEffects = _chunk4AB5BHYKcjs.normalizeLayerEffects; exports.packRgba = _chunkCRMAXIUVcjs.packRgba; exports.parseDataUrl = _chunk4AB5BHYKcjs.parseDataUrl; exports.parseEffectColor = _chunk4AB5BHYKcjs.parseEffectColor; exports.patchEffectMaps = _chunk4AB5BHYKcjs.patchEffectMaps; exports.pngDataUrl = _chunk4AB5BHYKcjs.pngDataUrl; exports.readPixel = _chunkCRMAXIUVcjs.readPixel; exports.readRegion = _chunkCRMAXIUVcjs.readRegion; exports.renderLayerEffects = _chunk4AB5BHYKcjs.renderLayerEffects; exports.scaleLayerEffect = _chunk4AB5BHYKcjs.scaleLayerEffect; exports.setLum = _chunkCRMAXIUVcjs.setLum; exports.solidSurface = _chunkCRMAXIUVcjs.solidSurface; exports.surfaceBytes = _chunkCRMAXIUVcjs.surfaceBytes; exports.surfaceFromPixels = _chunkCRMAXIUVcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCRMAXIUVcjs.surfacesEqual; exports.tileCoord = _chunkCRMAXIUVcjs.tileCoord; exports.tileKey = _chunkCRMAXIUVcjs.tileKey; exports.tileRect = _chunkCRMAXIUVcjs.tileRect; exports.tilesInRect = _chunkCRMAXIUVcjs.tilesInRect; exports.translateSurface = _chunkCRMAXIUVcjs.translateSurface; exports.uniformTile = _chunkCRMAXIUVcjs.uniformTile; exports.validateEffectGradient = _chunk4AB5BHYKcjs.validateEffectGradient; exports.validateLayerEffect = _chunk4AB5BHYKcjs.validateLayerEffect; exports.validateLayerEffects = _chunk4AB5BHYKcjs.validateLayerEffects; exports.writeRegion = _chunkCRMAXIUVcjs.writeRegion;
201
203
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,k5KAAC","file":"/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,+8KAAC","file":"/home/runner/work/editor/editor/packages/core/dist/raster/index.cjs"}
@@ -485,6 +485,8 @@ declare function isLayerLocked(layer: {
485
485
  * - Layer effects: a layer's effect maps (shadow, glow, bevel, stroke distance fields) are built
486
486
  * once over the layer's region (its bounds grown by the effects' margin, within the canvas grown
487
487
  * the same) and cached by the identity of every surface tile the shape reads; tiles crop them.
488
+ * When only some of those tiles changed and every effect is local, the maps are rebuilt only
489
+ * within the margin of the change (narrowed by `dirty` when it covers the change) and patched in.
488
490
  * A tile's signature then reads the layer within the margin around it (or the whole region when
489
491
  * an effect is laid out over the layer's bounds), and `dirty` rectangles grow by the margin.
490
492
  */
@@ -560,8 +562,9 @@ interface CompositeCallOptions {
560
562
  checkpointLayerId?: string | null;
561
563
  /**
562
564
  * Where the layers changed since the previous call, when the caller knows (a stroke's dabs).
563
- * Changed tiles are then recomposited only inside these rectangles. Changes outside them would
564
- * be missed, so pass nothing when unsure.
565
+ * Changed tiles are then recomposited only inside these rectangles (grown by the effects' reach),
566
+ * tiles they miss keep their pixels, and effect maps are rebuilt only around them. Changes outside
567
+ * them would be missed, so pass nothing when unsure.
565
568
  */
566
569
  dirty?: RasterRect[];
567
570
  }
@@ -578,6 +581,10 @@ interface CompositeStats {
578
581
  cached: number;
579
582
  /** Steps actually run, summed over tiles. */
580
583
  stepsRun: number;
584
+ /** Layers whose effect maps were built over their whole region. */
585
+ effectsBuilt: number;
586
+ /** Layers whose effect maps were rebuilt only around a change and patched in. */
587
+ effectsPatched: number;
581
588
  }
582
589
  declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S extends RasterSources = RasterSources> {
583
590
  private readonly profile;
@@ -603,6 +610,9 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
603
610
  private fxContext;
604
611
  lastStats: CompositeStats;
605
612
  private hint;
613
+ /** The `dirty` rectangles of the current call, as passed. */
614
+ private callDirty;
615
+ private callStats;
606
616
  constructor(profile?: CompositorProfile<L, S>, options?: CompositorOptions);
607
617
  /** Drops every cached tile and plane. */
608
618
  clear(): void;
@@ -633,6 +643,12 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
633
643
  /** Properties of a layer that change pixels, minus its surfaces (memoised per object). */
634
644
  private propsKey;
635
645
  private compositeTile;
646
+ /**
647
+ * Whether a tile with no part in this call's (grown) `dirty` rectangles changed only in what local
648
+ * effects read beyond it: every changed step is a pixel layer with local effects whose changes stay
649
+ * inside `dirty` (and so are farther than its margin), which leaves the tile's pixels as they were.
650
+ */
651
+ private changedOnlyNearby;
636
652
  private entryBytes;
637
653
  private evict;
638
654
  private stepSig;
@@ -650,6 +666,8 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
650
666
  * the effects' margin, within the canvas grown the same.
651
667
  */
652
668
  private effectRegion;
669
+ /** The signature of a layer's shape (its surface tiles and mask refs) per tile of `region`. */
670
+ private shapeSigs;
653
671
  /** The surface tiles (and mask refs) a layer's shape reads over `region`. */
654
672
  private shapeRefs;
655
673
  private lightKey;
@@ -661,6 +679,17 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
661
679
  private effectSig;
662
680
  /** A layer's effect maps over its region (cached; see the module comment). */
663
681
  private effectMapsOf;
682
+ /**
683
+ * Where a layer's shape may differ from the one `prev` was built from: the tiles whose signature
684
+ * changed (a tile new to the region that reads nothing did not), narrowed to this call's `dirty`
685
+ * rectangles when `prev` is from the previous call and they cover every change of the shape.
686
+ */
687
+ private shapeChanges;
688
+ /**
689
+ * Whether a change to a layer stays inside the `dirty` rectangles that name it: a pixel layer
690
+ * without filters or a feathered or parametric mask (those spread a change beyond it).
691
+ */
692
+ private dirtyCoversShape;
664
693
  /** A layer's alpha over `r` after its mask (0..1, quantised to bytes as tiles see it). */
665
694
  private layerShape;
666
695
  /** A content or group layer's own pixels over `r` with its mask applied to alpha, or `null` when empty. */
@@ -803,6 +832,20 @@ declare function effectsAreLocal(items: readonly LayerEffect[]): boolean;
803
832
  * `rect` should cover the layer's shape plus the effects' margin.
804
833
  */
805
834
  declare function buildEffectMaps(items: LayerEffect[], shape: Float32Array, rect: EffectRect, ctx: EffectContext): EffectMaps;
835
+ /**
836
+ * `prev` brought up to date for a shape over `rect` that differs from the one it was built from only
837
+ * inside `changed` (document rects), or `null` when a full {@link buildEffectMaps} is the better
838
+ * deal (the change covers much of the region) or the effects are not local
839
+ * ({@link effectsAreLocal}). `items` must be the ones `prev` was built with, reaching at most
840
+ * `margin` px, and `shapeOver(r)` returns the new shape over `r`.
841
+ *
842
+ * Every map pixel within `margin` of a change, or outside `prev.rect`, is rebuilt from the shape
843
+ * within `margin` of it (a window of the change grown by twice the margin) and pasted in; the rest
844
+ * is kept. A local map pixel depends only on the shape within the margin and the blur sums exactly,
845
+ * so the result paints exactly what a full build over `rect` would. `prev`'s buffers are reused
846
+ * when `rect` is unchanged.
847
+ */
848
+ declare function patchEffectMaps(prev: EffectMaps, items: LayerEffect[], rect: EffectRect, changed: readonly EffectRect[], margin: number, shapeOver: (r: EffectRect) => Float32Array, ctx: EffectContext): EffectMaps | null;
806
849
  /** Gradient parameter `t` (0..1) at pixel centre `(x, y)` of a gradient laid out in `frame`. */
807
850
  declare function gradientT(style: GradientStyle, angle: number, scale: number, reverse: boolean, offset: {
808
851
  x: number;
@@ -904,4 +947,4 @@ declare function deflateRaw(data: Uint8Array, level?: 0 | 1): Uint8Array;
904
947
  /** zlib stream: header, raw deflate, Adler-32. */
905
948
  declare function deflate(data: Uint8Array, level?: 0 | 1): Uint8Array;
906
949
 
907
- export { type BevelContour, type BevelEmbossEffect, type BevelStyle, type BevelTechnique, type BevelTexture, BlendMode, type BlurEdge, CURVE_LUT_SIZE, type ColorOverlayEffect, type CompositeCallOptions, type CompositeStats, type CompositorLayer, type CompositorOptions, type CompositorProfile, type ContourPoint, DEFAULT_GLOBAL_LIGHT, DIRECT_GAUSSIAN_MAX_SIGMA, type DecodedPng, type DropShadowEffect, type EffectCompositeInput, type EffectContext, type EffectContour, type EffectFill, type EffectGradient, type EffectMaps, type EffectPattern, type EffectPatternRef, type EffectRect, type GlobalLight, type GlowTechnique, type GradientColorStop, type GradientOpacityStop, type GradientOverlayEffect, type GradientStyle, type GroupBlendMode, type GroupIn, type InnerGlowEffect, type InnerShadowEffect, LAYER_EFFECT_KINDS, type LayerEffect, LayerEffectError, type LayerEffectKind, type LayerEffects, type LayerLocation, type LayerLocks, MAX_EFFECT_REACH, MaskSurface, type OuterGlowEffect, type PatternOverlayEffect, PatternPlacement, PatternTile, type PixelFilterSpec, PixelSurface, RasterCompositor, type RasterGroupLayer, type RasterLayer, type RasterLayerBase, type RasterMask, type RasterNode, type RasterPixelLayer, RasterRect, type RasterSources, STROKE_CHAMFER_MAX, type SatinEffect, type StrokeEffect, type StrokePosition, TileKey, TiledSurface, ZlibError, activeEffectItems, adler32, base64ToBytes, blendTile, buildEffectMaps, builtinPattern, builtinPatternIds, bytesToBase64, changedTiles, compositeLayerEffects, contourLut, curveLut, decodePng, defaultEffectGradient, defaultLayerEffect, deflate, deflateRaw, effectColorHex, effectReach, effectsAreLocal, effectsFingerprint, effectsMargin, effectsScale, encodePng, findLayer, flattenLayers, gaussianBlur, gradientT, hasActiveEffects, hashNoise, inflate, inflateRaw, insertLayer, isLayerEffectKind, isLayerLocked, isPng, layerEffectFields, layerEffectLabel, mapLayer, mergeLayerEffect, newEffectId, normalizeLayerEffects, parseDataUrl, parseEffectColor, pngDataUrl, renderLayerEffects, scaleLayerEffect, validateEffectGradient, validateLayerEffect, validateLayerEffects };
950
+ export { type BevelContour, type BevelEmbossEffect, type BevelStyle, type BevelTechnique, type BevelTexture, BlendMode, type BlurEdge, CURVE_LUT_SIZE, type ColorOverlayEffect, type CompositeCallOptions, type CompositeStats, type CompositorLayer, type CompositorOptions, type CompositorProfile, type ContourPoint, DEFAULT_GLOBAL_LIGHT, DIRECT_GAUSSIAN_MAX_SIGMA, type DecodedPng, type DropShadowEffect, type EffectCompositeInput, type EffectContext, type EffectContour, type EffectFill, type EffectGradient, type EffectMaps, type EffectPattern, type EffectPatternRef, type EffectRect, type GlobalLight, type GlowTechnique, type GradientColorStop, type GradientOpacityStop, type GradientOverlayEffect, type GradientStyle, type GroupBlendMode, type GroupIn, type InnerGlowEffect, type InnerShadowEffect, LAYER_EFFECT_KINDS, type LayerEffect, LayerEffectError, type LayerEffectKind, type LayerEffects, type LayerLocation, type LayerLocks, MAX_EFFECT_REACH, MaskSurface, type OuterGlowEffect, type PatternOverlayEffect, PatternPlacement, PatternTile, type PixelFilterSpec, PixelSurface, RasterCompositor, type RasterGroupLayer, type RasterLayer, type RasterLayerBase, type RasterMask, type RasterNode, type RasterPixelLayer, RasterRect, type RasterSources, STROKE_CHAMFER_MAX, type SatinEffect, type StrokeEffect, type StrokePosition, TileKey, TiledSurface, ZlibError, activeEffectItems, adler32, base64ToBytes, blendTile, buildEffectMaps, builtinPattern, builtinPatternIds, bytesToBase64, changedTiles, compositeLayerEffects, contourLut, curveLut, decodePng, defaultEffectGradient, defaultLayerEffect, deflate, deflateRaw, effectColorHex, effectReach, effectsAreLocal, effectsFingerprint, effectsMargin, effectsScale, encodePng, findLayer, flattenLayers, gaussianBlur, gradientT, hasActiveEffects, hashNoise, inflate, inflateRaw, insertLayer, isLayerEffectKind, isLayerLocked, isPng, layerEffectFields, layerEffectLabel, mapLayer, mergeLayerEffect, newEffectId, normalizeLayerEffects, parseDataUrl, parseEffectColor, patchEffectMaps, pngDataUrl, renderLayerEffects, scaleLayerEffect, validateEffectGradient, validateLayerEffect, validateLayerEffects };
@@ -485,6 +485,8 @@ declare function isLayerLocked(layer: {
485
485
  * - Layer effects: a layer's effect maps (shadow, glow, bevel, stroke distance fields) are built
486
486
  * once over the layer's region (its bounds grown by the effects' margin, within the canvas grown
487
487
  * the same) and cached by the identity of every surface tile the shape reads; tiles crop them.
488
+ * When only some of those tiles changed and every effect is local, the maps are rebuilt only
489
+ * within the margin of the change (narrowed by `dirty` when it covers the change) and patched in.
488
490
  * A tile's signature then reads the layer within the margin around it (or the whole region when
489
491
  * an effect is laid out over the layer's bounds), and `dirty` rectangles grow by the margin.
490
492
  */
@@ -560,8 +562,9 @@ interface CompositeCallOptions {
560
562
  checkpointLayerId?: string | null;
561
563
  /**
562
564
  * Where the layers changed since the previous call, when the caller knows (a stroke's dabs).
563
- * Changed tiles are then recomposited only inside these rectangles. Changes outside them would
564
- * be missed, so pass nothing when unsure.
565
+ * Changed tiles are then recomposited only inside these rectangles (grown by the effects' reach),
566
+ * tiles they miss keep their pixels, and effect maps are rebuilt only around them. Changes outside
567
+ * them would be missed, so pass nothing when unsure.
565
568
  */
566
569
  dirty?: RasterRect[];
567
570
  }
@@ -578,6 +581,10 @@ interface CompositeStats {
578
581
  cached: number;
579
582
  /** Steps actually run, summed over tiles. */
580
583
  stepsRun: number;
584
+ /** Layers whose effect maps were built over their whole region. */
585
+ effectsBuilt: number;
586
+ /** Layers whose effect maps were rebuilt only around a change and patched in. */
587
+ effectsPatched: number;
581
588
  }
582
589
  declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S extends RasterSources = RasterSources> {
583
590
  private readonly profile;
@@ -603,6 +610,9 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
603
610
  private fxContext;
604
611
  lastStats: CompositeStats;
605
612
  private hint;
613
+ /** The `dirty` rectangles of the current call, as passed. */
614
+ private callDirty;
615
+ private callStats;
606
616
  constructor(profile?: CompositorProfile<L, S>, options?: CompositorOptions);
607
617
  /** Drops every cached tile and plane. */
608
618
  clear(): void;
@@ -633,6 +643,12 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
633
643
  /** Properties of a layer that change pixels, minus its surfaces (memoised per object). */
634
644
  private propsKey;
635
645
  private compositeTile;
646
+ /**
647
+ * Whether a tile with no part in this call's (grown) `dirty` rectangles changed only in what local
648
+ * effects read beyond it: every changed step is a pixel layer with local effects whose changes stay
649
+ * inside `dirty` (and so are farther than its margin), which leaves the tile's pixels as they were.
650
+ */
651
+ private changedOnlyNearby;
636
652
  private entryBytes;
637
653
  private evict;
638
654
  private stepSig;
@@ -650,6 +666,8 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
650
666
  * the effects' margin, within the canvas grown the same.
651
667
  */
652
668
  private effectRegion;
669
+ /** The signature of a layer's shape (its surface tiles and mask refs) per tile of `region`. */
670
+ private shapeSigs;
653
671
  /** The surface tiles (and mask refs) a layer's shape reads over `region`. */
654
672
  private shapeRefs;
655
673
  private lightKey;
@@ -661,6 +679,17 @@ declare class RasterCompositor<L extends CompositorLayer = CompositorLayer, S ex
661
679
  private effectSig;
662
680
  /** A layer's effect maps over its region (cached; see the module comment). */
663
681
  private effectMapsOf;
682
+ /**
683
+ * Where a layer's shape may differ from the one `prev` was built from: the tiles whose signature
684
+ * changed (a tile new to the region that reads nothing did not), narrowed to this call's `dirty`
685
+ * rectangles when `prev` is from the previous call and they cover every change of the shape.
686
+ */
687
+ private shapeChanges;
688
+ /**
689
+ * Whether a change to a layer stays inside the `dirty` rectangles that name it: a pixel layer
690
+ * without filters or a feathered or parametric mask (those spread a change beyond it).
691
+ */
692
+ private dirtyCoversShape;
664
693
  /** A layer's alpha over `r` after its mask (0..1, quantised to bytes as tiles see it). */
665
694
  private layerShape;
666
695
  /** A content or group layer's own pixels over `r` with its mask applied to alpha, or `null` when empty. */
@@ -803,6 +832,20 @@ declare function effectsAreLocal(items: readonly LayerEffect[]): boolean;
803
832
  * `rect` should cover the layer's shape plus the effects' margin.
804
833
  */
805
834
  declare function buildEffectMaps(items: LayerEffect[], shape: Float32Array, rect: EffectRect, ctx: EffectContext): EffectMaps;
835
+ /**
836
+ * `prev` brought up to date for a shape over `rect` that differs from the one it was built from only
837
+ * inside `changed` (document rects), or `null` when a full {@link buildEffectMaps} is the better
838
+ * deal (the change covers much of the region) or the effects are not local
839
+ * ({@link effectsAreLocal}). `items` must be the ones `prev` was built with, reaching at most
840
+ * `margin` px, and `shapeOver(r)` returns the new shape over `r`.
841
+ *
842
+ * Every map pixel within `margin` of a change, or outside `prev.rect`, is rebuilt from the shape
843
+ * within `margin` of it (a window of the change grown by twice the margin) and pasted in; the rest
844
+ * is kept. A local map pixel depends only on the shape within the margin and the blur sums exactly,
845
+ * so the result paints exactly what a full build over `rect` would. `prev`'s buffers are reused
846
+ * when `rect` is unchanged.
847
+ */
848
+ declare function patchEffectMaps(prev: EffectMaps, items: LayerEffect[], rect: EffectRect, changed: readonly EffectRect[], margin: number, shapeOver: (r: EffectRect) => Float32Array, ctx: EffectContext): EffectMaps | null;
806
849
  /** Gradient parameter `t` (0..1) at pixel centre `(x, y)` of a gradient laid out in `frame`. */
807
850
  declare function gradientT(style: GradientStyle, angle: number, scale: number, reverse: boolean, offset: {
808
851
  x: number;
@@ -904,4 +947,4 @@ declare function deflateRaw(data: Uint8Array, level?: 0 | 1): Uint8Array;
904
947
  /** zlib stream: header, raw deflate, Adler-32. */
905
948
  declare function deflate(data: Uint8Array, level?: 0 | 1): Uint8Array;
906
949
 
907
- export { type BevelContour, type BevelEmbossEffect, type BevelStyle, type BevelTechnique, type BevelTexture, BlendMode, type BlurEdge, CURVE_LUT_SIZE, type ColorOverlayEffect, type CompositeCallOptions, type CompositeStats, type CompositorLayer, type CompositorOptions, type CompositorProfile, type ContourPoint, DEFAULT_GLOBAL_LIGHT, DIRECT_GAUSSIAN_MAX_SIGMA, type DecodedPng, type DropShadowEffect, type EffectCompositeInput, type EffectContext, type EffectContour, type EffectFill, type EffectGradient, type EffectMaps, type EffectPattern, type EffectPatternRef, type EffectRect, type GlobalLight, type GlowTechnique, type GradientColorStop, type GradientOpacityStop, type GradientOverlayEffect, type GradientStyle, type GroupBlendMode, type GroupIn, type InnerGlowEffect, type InnerShadowEffect, LAYER_EFFECT_KINDS, type LayerEffect, LayerEffectError, type LayerEffectKind, type LayerEffects, type LayerLocation, type LayerLocks, MAX_EFFECT_REACH, MaskSurface, type OuterGlowEffect, type PatternOverlayEffect, PatternPlacement, PatternTile, type PixelFilterSpec, PixelSurface, RasterCompositor, type RasterGroupLayer, type RasterLayer, type RasterLayerBase, type RasterMask, type RasterNode, type RasterPixelLayer, RasterRect, type RasterSources, STROKE_CHAMFER_MAX, type SatinEffect, type StrokeEffect, type StrokePosition, TileKey, TiledSurface, ZlibError, activeEffectItems, adler32, base64ToBytes, blendTile, buildEffectMaps, builtinPattern, builtinPatternIds, bytesToBase64, changedTiles, compositeLayerEffects, contourLut, curveLut, decodePng, defaultEffectGradient, defaultLayerEffect, deflate, deflateRaw, effectColorHex, effectReach, effectsAreLocal, effectsFingerprint, effectsMargin, effectsScale, encodePng, findLayer, flattenLayers, gaussianBlur, gradientT, hasActiveEffects, hashNoise, inflate, inflateRaw, insertLayer, isLayerEffectKind, isLayerLocked, isPng, layerEffectFields, layerEffectLabel, mapLayer, mergeLayerEffect, newEffectId, normalizeLayerEffects, parseDataUrl, parseEffectColor, pngDataUrl, renderLayerEffects, scaleLayerEffect, validateEffectGradient, validateLayerEffect, validateLayerEffects };
950
+ export { type BevelContour, type BevelEmbossEffect, type BevelStyle, type BevelTechnique, type BevelTexture, BlendMode, type BlurEdge, CURVE_LUT_SIZE, type ColorOverlayEffect, type CompositeCallOptions, type CompositeStats, type CompositorLayer, type CompositorOptions, type CompositorProfile, type ContourPoint, DEFAULT_GLOBAL_LIGHT, DIRECT_GAUSSIAN_MAX_SIGMA, type DecodedPng, type DropShadowEffect, type EffectCompositeInput, type EffectContext, type EffectContour, type EffectFill, type EffectGradient, type EffectMaps, type EffectPattern, type EffectPatternRef, type EffectRect, type GlobalLight, type GlowTechnique, type GradientColorStop, type GradientOpacityStop, type GradientOverlayEffect, type GradientStyle, type GroupBlendMode, type GroupIn, type InnerGlowEffect, type InnerShadowEffect, LAYER_EFFECT_KINDS, type LayerEffect, LayerEffectError, type LayerEffectKind, type LayerEffects, type LayerLocation, type LayerLocks, MAX_EFFECT_REACH, MaskSurface, type OuterGlowEffect, type PatternOverlayEffect, PatternPlacement, PatternTile, type PixelFilterSpec, PixelSurface, RasterCompositor, type RasterGroupLayer, type RasterLayer, type RasterLayerBase, type RasterMask, type RasterNode, type RasterPixelLayer, RasterRect, type RasterSources, STROKE_CHAMFER_MAX, type SatinEffect, type StrokeEffect, type StrokePosition, TileKey, TiledSurface, ZlibError, activeEffectItems, adler32, base64ToBytes, blendTile, buildEffectMaps, builtinPattern, builtinPatternIds, bytesToBase64, changedTiles, compositeLayerEffects, contourLut, curveLut, decodePng, defaultEffectGradient, defaultLayerEffect, deflate, deflateRaw, effectColorHex, effectReach, effectsAreLocal, effectsFingerprint, effectsMargin, effectsScale, encodePng, findLayer, flattenLayers, gaussianBlur, gradientT, hasActiveEffects, hashNoise, inflate, inflateRaw, insertLayer, isLayerEffectKind, isLayerLocked, isPng, layerEffectFields, layerEffectLabel, mapLayer, mergeLayerEffect, newEffectId, normalizeLayerEffects, parseDataUrl, parseEffectColor, patchEffectMaps, pngDataUrl, renderLayerEffects, scaleLayerEffect, validateEffectGradient, validateLayerEffect, validateLayerEffects };
@@ -54,13 +54,14 @@ import {
54
54
  normalizeLayerEffects,
55
55
  parseDataUrl,
56
56
  parseEffectColor,
57
+ patchEffectMaps,
57
58
  pngDataUrl,
58
59
  renderLayerEffects,
59
60
  scaleLayerEffect,
60
61
  validateEffectGradient,
61
62
  validateLayerEffect,
62
63
  validateLayerEffects
63
- } from "../chunk-KFTQ2PKP.js";
64
+ } from "../chunk-OEVSVA6V.js";
64
65
  import {
65
66
  BLEND_MODES,
66
67
  SurfaceDraft,
@@ -177,6 +178,7 @@ export {
177
178
  packRgba,
178
179
  parseDataUrl,
179
180
  parseEffectColor,
181
+ patchEffectMaps,
180
182
  pngDataUrl,
181
183
  readPixel,
182
184
  readRegion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixerate/editor",
3
- "version": "0.96.0",
3
+ "version": "0.97.0",
4
4
  "description": "UI-agnostic rich text and media editing core library",
5
5
  "author": "Pixerate",
6
6
  "license": "MIT",