pixel-data-js 0.36.0 → 0.37.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.
Files changed (72) hide show
  1. package/dist/index.prod.cjs +372 -303
  2. package/dist/index.prod.cjs.map +1 -1
  3. package/dist/index.prod.d.ts +109 -67
  4. package/dist/index.prod.js +368 -302
  5. package/dist/index.prod.js.map +1 -1
  6. package/package.json +2 -2
  7. package/src/Algorithm/floodFillSelection.ts +3 -2
  8. package/src/BlendModes/blend-modes-fast.ts +2 -1
  9. package/src/BlendModes/blend-modes-perfect.ts +2 -1
  10. package/src/Canvas/ReusableCanvas.ts +0 -5
  11. package/src/Color/_color-types.ts +8 -0
  12. package/src/Color/colorDistance.ts +9 -0
  13. package/src/Color/convert-color.ts +43 -0
  14. package/src/Color/lerpColor32.ts +44 -0
  15. package/src/Color/pack-color.ts +38 -0
  16. package/src/History/HistoryAction.ts +2 -2
  17. package/src/History/PixelAccumulator.ts +13 -15
  18. package/src/History/PixelMutator/mutatorBlendColor.ts +2 -1
  19. package/src/History/PixelMutator/mutatorBlendColorPaintAlphaMask.ts +1 -1
  20. package/src/History/PixelMutator/mutatorBlendColorPaintBinaryMask.ts +1 -1
  21. package/src/History/PixelMutator/mutatorBlendColorPaintMask.ts +23 -8
  22. package/src/History/PixelMutator/mutatorBlendColorPaintRect.ts +2 -1
  23. package/src/History/PixelMutator/mutatorBlendPixel.ts +2 -1
  24. package/src/History/PixelMutator/mutatorClear.ts +1 -1
  25. package/src/History/PixelMutator/mutatorFill.ts +1 -1
  26. package/src/History/PixelMutator/mutatorFillBinaryMask.ts +1 -1
  27. package/src/History/PixelWriter.ts +5 -5
  28. package/src/IndexedImage/IndexedImage.ts +1 -1
  29. package/src/IndexedImage/indexedImageToAverageColor.ts +3 -2
  30. package/src/Mask/_mask-types.ts +9 -0
  31. package/src/Paint/AlphaMaskPaintBuffer.ts +26 -26
  32. package/src/Paint/BinaryMaskPaintBuffer.ts +19 -19
  33. package/src/Paint/ColorPaintBuffer.ts +40 -42
  34. package/src/Paint/Commit/AlphaMaskPaintBufferCommitter.ts +1 -1
  35. package/src/Paint/Commit/AlphaMaskPaintBufferManager.ts +6 -7
  36. package/src/Paint/Commit/BinaryMaskPaintBufferCommitter.ts +1 -1
  37. package/src/Paint/Commit/BinaryMaskPaintBufferManager.ts +6 -7
  38. package/src/Paint/Commit/ColorPaintBufferManager.ts +6 -7
  39. package/src/Paint/Commit/commitColorPaintBuffer.ts +2 -6
  40. package/src/Paint/Commit/commitMaskPaintBuffer.ts +3 -7
  41. package/src/Paint/Render/AlphaMaskPaintBufferCanvasRenderer.ts +42 -25
  42. package/src/Paint/Render/BinaryMaskPaintBufferCanvasRenderer.ts +40 -24
  43. package/src/Paint/Render/ColorPaintBufferCanvasRenderer.ts +21 -21
  44. package/src/Paint/Render/PaintCursorRenderer.ts +3 -2
  45. package/src/Paint/eachTileInBounds.ts +9 -10
  46. package/src/PixelData/blendColorPixelData.ts +2 -1
  47. package/src/PixelData/blendColorPixelDataAlphaMask.ts +2 -1
  48. package/src/PixelData/blendColorPixelDataBinaryMask.ts +2 -1
  49. package/src/PixelData/blendColorPixelDataMask.ts +2 -1
  50. package/src/PixelData/blendColorPixelDataPaintAlphaMask.ts +1 -1
  51. package/src/PixelData/blendColorPixelDataPaintBinaryMask.ts +1 -1
  52. package/src/PixelData/blendColorPixelDataPaintMask.ts +19 -8
  53. package/src/PixelData/blendPixel.ts +2 -1
  54. package/src/PixelData/blendPixelData.ts +2 -1
  55. package/src/PixelData/blendPixelDataAlphaMask.ts +2 -1
  56. package/src/PixelData/blendPixelDataBinaryMask.ts +2 -1
  57. package/src/PixelData/blendPixelDataPaintBuffer.ts +2 -3
  58. package/src/PixelData/clearPixelDataFast.ts +1 -1
  59. package/src/PixelData/fillPixelData.ts +1 -1
  60. package/src/PixelData/fillPixelDataBinaryMask.ts +1 -1
  61. package/src/PixelData/fillPixelDataFast.ts +1 -1
  62. package/src/PixelData/writePaintBufferToPixelData.ts +1 -5
  63. package/src/Tile/MaskTile.ts +4 -0
  64. package/src/Tile/PixelTile.ts +2 -0
  65. package/src/Tile/TilePool.ts +9 -8
  66. package/src/Tile/TileTargetConfig.ts +27 -0
  67. package/src/Tile/_tile-types.ts +16 -0
  68. package/src/_types.ts +1 -6
  69. package/src/index.ts +7 -3
  70. package/src/History/PixelEngineConfig.ts +0 -28
  71. package/src/Internal/_constants.ts +0 -3
  72. package/src/color.ts +0 -112
@@ -7,6 +7,27 @@ declare namespace _errors {
7
7
  export { _errors_CANVAS_CTX_FAILED as CANVAS_CTX_FAILED, _errors_OFFSCREEN_CANVAS_CTX_FAILED as OFFSCREEN_CANVAS_CTX_FAILED };
8
8
  }
9
9
 
10
+ /** Represents a 32-bit color in 0xAABBGGRR (Little endian) */
11
+ type Color32 = number & {
12
+ readonly __brandColor32: unique symbol;
13
+ };
14
+ /** ALL values are 0-255 */
15
+ type RGBA = {
16
+ r: number;
17
+ g: number;
18
+ b: number;
19
+ a: number;
20
+ };
21
+ /** r, g, b are 0-255. a is 0-1 for css use */
22
+ type CssRGBA = {
23
+ r: number;
24
+ g: number;
25
+ b: number;
26
+ a: number;
27
+ } & {
28
+ readonly __brandCssRGBA: unique symbol;
29
+ };
30
+
10
31
  /** Rectangle definition */
11
32
  type Rect = {
12
33
  x: number;
@@ -68,6 +89,13 @@ type NullableBinaryMaskRect = Rect & ({
68
89
  type?: null;
69
90
  data?: null;
70
91
  });
92
+ type NullableAlphaMaskRect = Rect & ({
93
+ type: MaskType.ALPHA;
94
+ data: Uint8Array;
95
+ } | {
96
+ type?: null;
97
+ data?: null;
98
+ });
71
99
  type NullableMaskRect = Rect & ({
72
100
  type: MaskType;
73
101
  data: Uint8Array;
@@ -76,17 +104,6 @@ type NullableMaskRect = Rect & ({
76
104
  data?: null;
77
105
  });
78
106
 
79
- /** ALL values are 0-255 (including alpha which in CSS is 0-1) */
80
- type RGBA = {
81
- r: number;
82
- g: number;
83
- b: number;
84
- a: number;
85
- };
86
- /** Represents a 32-bit color in 0xAABBGGRR (Little endian) */
87
- type Color32 = number & {
88
- readonly __brandColor32: unique symbol;
89
- };
90
107
  /**
91
108
  * A function that defines how to combine a source color with a destination color.
92
109
  * @param src - The incoming color (source).
@@ -364,12 +381,12 @@ declare function makeFastBlendModeRegistry(name?: string): {
364
381
  readonly destinationAtop: BlendColor32;
365
382
  readonly xor: BlendColor32;
366
383
  };
367
- nameToIndex: Record<"overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor", 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
368
- blendToIndex: Map<BlendColor32, 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
384
+ nameToIndex: Record<"overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor", 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
385
+ blendToIndex: Map<BlendColor32, 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
369
386
  blendToName: Map<BlendColor32, "overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor">;
370
387
  indexToBlend: BlendColor32[];
371
388
  indexToName: ("overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor")[];
372
- indexType: 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30;
389
+ indexType: 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30;
373
390
  nameType: "overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor";
374
391
  };
375
392
 
@@ -463,12 +480,12 @@ declare function makePerfectBlendModeRegistry(name?: string): {
463
480
  readonly destinationAtop: BlendColor32;
464
481
  readonly xor: BlendColor32;
465
482
  };
466
- nameToIndex: Record<"overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor", 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
467
- blendToIndex: Map<BlendColor32, 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
483
+ nameToIndex: Record<"overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor", 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
484
+ blendToIndex: Map<BlendColor32, 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30>;
468
485
  blendToName: Map<BlendColor32, "overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor">;
469
486
  indexToBlend: BlendColor32[];
470
487
  indexToName: ("overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor")[];
471
- indexType: 0 | 24 | 16 | 8 | 2 | 3 | 4 | 1 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30;
488
+ indexType: 0 | 8 | 16 | 24 | 2 | 4 | 1 | 3 | 5 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30;
472
489
  nameType: "overwrite" | "sourceOver" | "darken" | "multiply" | "colorBurn" | "linearBurn" | "darkerColor" | "lighten" | "screen" | "colorDodge" | "linearDodge" | "lighterColor" | "overlay" | "softLight" | "hardLight" | "vividLight" | "linearLight" | "pinLight" | "hardMix" | "difference" | "exclusion" | "subtract" | "divide" | "sourceIn" | "sourceOut" | "sourceAtop" | "destinationOver" | "destinationIn" | "destinationOut" | "destinationAtop" | "xor";
473
490
  };
474
491
 
@@ -645,19 +662,6 @@ declare function writeImageDataToClipboard(imageData: ImageData): Promise<void>;
645
662
  */
646
663
  declare function writeImgBlobToClipboard(blob: Blob): Promise<void>;
647
664
 
648
- /**
649
- * Packs RGBA into a 32-bit integer compatible with
650
- * Little-Endian Uint32Array views on ImageData.
651
- */
652
- declare function packColor(r: number, g: number, b: number, a: number): Color32;
653
- declare function packRGBA({ r, g, b, a }: RGBA): Color32;
654
- declare const unpackRed: (packed: Color32) => number;
655
- declare const unpackGreen: (packed: Color32) => number;
656
- declare const unpackBlue: (packed: Color32) => number;
657
- declare const unpackAlpha: (packed: Color32) => number;
658
- declare function unpackColor(packed: Color32): RGBA;
659
- declare function unpackColorTo(packed: Color32, scratch?: RGBA): RGBA;
660
- declare function colorDistance(a: Color32, b: Color32): number;
661
665
  /**
662
666
  * Linearly interpolates between two 32-bit colors using a floating-point weight.
663
667
  * * This is the preferred method for UI animations or scenarios where high
@@ -678,13 +682,30 @@ declare function lerpColor32(a: Color32, b: Color32, t: number): Color32;
678
682
  * @param dst - The destination (background) color as a 32-bit integer.
679
683
  * @param w - The blend weight as a byte value from 0 to 255. Where 0 is 100% dst and 255 is 100% src
680
684
  * @returns The blended 32-bit color.
681
- */ declare function lerpColor32Fast(src: Color32, dst: Color32, w: number): Color32;
685
+ */
686
+ declare function lerpColor32Fast(src: Color32, dst: Color32, w: number): Color32;
687
+
682
688
  declare function color32ToHex(color: Color32): string;
683
689
  /**
684
690
  * Converts a 32-bit integer (0xAABBGGRR) to a CSS rgba() string.
685
691
  * Example: 0xFF0000FF -> "rgba(255,0,0,1)"
686
692
  */
687
- declare function color32ToCssRGBA(color: Color32): string;
693
+ declare function color32ToCssRGBAString(color: Color32): string;
694
+ declare function color32ToCssRGBA(color: Color32): CssRGBA;
695
+ declare function cssRGBAToColor32({ r, g, b, a }: CssRGBA): Color32;
696
+
697
+ /**
698
+ * Packs RGBA into a 32-bit integer compatible with
699
+ * Little-Endian Uint32Array views on ImageData.
700
+ */
701
+ declare function packColor(r: number, g: number, b: number, a: number): Color32;
702
+ declare function packRGBA({ r, g, b, a }: RGBA): Color32;
703
+ declare const unpackRed: (packed: Color32) => number;
704
+ declare const unpackGreen: (packed: Color32) => number;
705
+ declare const unpackBlue: (packed: Color32) => number;
706
+ declare const unpackAlpha: (packed: Color32) => number;
707
+ declare function unpackColor(packed: Color32): RGBA;
708
+ declare function unpackColorTo(packed: Color32, scratch?: RGBA): RGBA;
688
709
 
689
710
  type BatchedQueueFn = (fn: () => void) => void;
690
711
  type BatchedQueue = ReturnType<typeof makeBatchedQueue>;
@@ -754,6 +775,8 @@ interface BaseTile {
754
775
  id: number;
755
776
  tx: number;
756
777
  ty: number;
778
+ x: number;
779
+ y: number;
757
780
  }
758
781
  interface PixelTile extends PixelData, BaseTile {
759
782
  }
@@ -763,24 +786,25 @@ interface BinaryMaskTile extends BinaryMask, BaseTile {
763
786
  }
764
787
  type Tile = PixelTile | AlphaMaskTile | BinaryMaskTile;
765
788
  type TileFactory<T extends Tile> = (id: number, tx: number, ty: number, tileSize: number, tileArea: number) => T;
766
-
767
- declare class PixelEngineConfig {
768
- readonly tileSize: number;
769
- readonly tileShift: number;
770
- readonly tileMask: number;
789
+ interface TileTargetMeta {
771
790
  readonly tileArea: number;
772
- readonly target: PixelData;
773
791
  readonly targetColumns: number;
774
792
  readonly targetRows: number;
775
- constructor(tileSize: number, target: PixelData);
793
+ readonly targetWidth: number;
794
+ readonly targetHeight: number;
795
+ readonly tileSize: number;
796
+ readonly invTileSize: number;
797
+ }
798
+ interface TileTargetConfig extends TileTargetMeta {
799
+ readonly target: PixelData;
776
800
  }
777
801
 
778
802
  declare class TilePool<T extends Tile> {
779
- private tileFactory;
803
+ protected tileSize: number;
804
+ protected tileFactory: TileFactory<T>;
780
805
  pool: T[];
781
- private tileSize;
782
- private tileArea;
783
- constructor(config: PixelEngineConfig, tileFactory: TileFactory<T>);
806
+ protected tileArea: number;
807
+ constructor(tileSize: number, tileFactory: TileFactory<T>);
784
808
  getTile(id: number, tx: number, ty: number): T;
785
809
  releaseTile(tile: T): void;
786
810
  releaseTiles(tiles: (T | undefined)[]): void;
@@ -794,11 +818,11 @@ declare function applyPatchTiles(target: PixelData32, tiles: PixelTile[], tileSi
794
818
 
795
819
  type DidChangeFn = (didChange: boolean) => boolean;
796
820
  declare class PixelAccumulator {
797
- readonly config: PixelEngineConfig;
821
+ readonly config: TileTargetConfig;
798
822
  readonly pixelTilePool: TilePool<PixelTile>;
799
823
  lookup: (PixelTile | undefined)[];
800
824
  beforeTiles: PixelTile[];
801
- constructor(config: PixelEngineConfig, pixelTilePool: TilePool<PixelTile>);
825
+ constructor(config: TileTargetConfig, pixelTilePool: TilePool<PixelTile>);
802
826
  recyclePatch(patch: PixelPatchTiles): void;
803
827
  /**
804
828
  * @param x pixel x coordinate
@@ -824,7 +848,7 @@ interface HistoryAction {
824
848
  dispose?: () => void;
825
849
  }
826
850
  type HistoryActionFactory = typeof makeHistoryAction;
827
- declare function makeHistoryAction(config: PixelEngineConfig, accumulator: PixelAccumulator, patch: PixelPatchTiles, afterUndo?: (patch: PixelPatchTiles) => void, afterRedo?: (patch: PixelPatchTiles) => void, applyPatchTilesFn?: typeof applyPatchTiles): HistoryAction;
851
+ declare function makeHistoryAction(config: TileTargetConfig, accumulator: PixelAccumulator, patch: PixelPatchTiles, afterUndo?: (patch: PixelPatchTiles) => void, afterRedo?: (patch: PixelPatchTiles) => void, applyPatchTilesFn?: typeof applyPatchTiles): HistoryAction;
828
852
 
829
853
  declare class HistoryManager {
830
854
  maxSteps: number;
@@ -906,7 +930,7 @@ declare class PixelWriter<M> {
906
930
  readonly historyManager: HistoryManager;
907
931
  readonly accumulator: PixelAccumulator;
908
932
  readonly historyActionFactory: HistoryActionFactory;
909
- readonly config: PixelEngineConfig;
933
+ readonly config: TileTargetConfig;
910
934
  readonly pixelTilePool: TilePool<PixelTile>;
911
935
  readonly mutator: M;
912
936
  private _inProgress;
@@ -942,7 +966,7 @@ declare function makeFullPixelMutator(writer: PixelWriter<any>): {
942
966
  blendPixel(x: number, y: number, color: Color32, alpha?: number, blendFn?: BlendColor32): boolean;
943
967
  blendMask(src: PixelData32, mask: Mask, opts?: PixelBlendMaskOptions): boolean;
944
968
  blendColorPaintRect(color: Color32, centerX: number, centerY: number, brushWidth: number, brushHeight: number, alpha?: number, blendFn?: BlendColor32): boolean;
945
- blendColorPaintMask(color: Color32, mask: PaintMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
969
+ blendColorPaintMask(color: Color32, mask: PaintMask | PaintRect, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
946
970
  blendColorPaintBinaryMask(color: Color32, mask: PaintBinaryMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
947
971
  blendColorPaintAlphaMask(color: Color32, mask: PaintAlphaMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
948
972
  blendColor(color: Color32, opts?: ColorBlendOptions): boolean;
@@ -1125,13 +1149,14 @@ declare const mutatorBlendColorPaintBinaryMask: (writer: PixelWriter<any>, deps?
1125
1149
  declare const defaults$8: {
1126
1150
  blendColorPixelDataAlphaMask: typeof blendColorPixelDataAlphaMask;
1127
1151
  blendColorPixelDataBinaryMask: typeof blendColorPixelDataBinaryMask;
1152
+ blendColorPixelData: typeof blendColorPixelData;
1128
1153
  };
1129
1154
  type Deps$8 = Partial<typeof defaults$8>;
1130
1155
  /**
1131
1156
  * @param deps - @hidden
1132
1157
  */
1133
1158
  declare const mutatorBlendColorPaintMask: (writer: PixelWriter<any>, deps?: Partial<Deps$8>) => {
1134
- blendColorPaintMask(color: Color32, mask: PaintMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
1159
+ blendColorPaintMask(color: Color32, mask: PaintMask | PaintRect, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
1135
1160
  };
1136
1161
 
1137
1162
  declare const defaults$7: {
@@ -1710,14 +1735,14 @@ declare function mergeBinaryMaskRects(current: NullableBinaryMaskRect[], adding:
1710
1735
  declare function subtractBinaryMaskRects(current: NullableBinaryMaskRect[], subtracting: NullableBinaryMaskRect[]): NullableBinaryMaskRect[];
1711
1736
 
1712
1737
  declare class AlphaMaskPaintBuffer {
1713
- readonly config: PixelEngineConfig;
1738
+ readonly config: TileTargetMeta;
1714
1739
  readonly tilePool: TilePool<AlphaMaskTile>;
1715
1740
  readonly lookup: (AlphaMaskTile | undefined)[];
1716
1741
  private readonly scratchBounds;
1717
1742
  private forEachLinePointFn;
1718
1743
  private trimRectBoundsFn;
1719
1744
  private eachTileInBoundsFn;
1720
- constructor(config: PixelEngineConfig, tilePool: TilePool<AlphaMaskTile>);
1745
+ constructor(config: TileTargetMeta, tilePool?: TilePool<AlphaMaskTile>);
1721
1746
  paintAlphaMask(brush: PaintAlphaMask, x: number, y: number): boolean;
1722
1747
  paintAlphaMask(brush: PaintAlphaMask, startX: number, startY: number, endX: number, endY: number): boolean;
1723
1748
  paintBinaryMask(brush: PaintBinaryMask, alpha: number, x: number, y: number): boolean;
@@ -1728,14 +1753,14 @@ declare class AlphaMaskPaintBuffer {
1728
1753
  }
1729
1754
 
1730
1755
  declare class BinaryMaskPaintBuffer {
1731
- readonly config: PixelEngineConfig;
1756
+ readonly config: TileTargetMeta;
1732
1757
  readonly tilePool: TilePool<BinaryMaskTile>;
1733
1758
  readonly lookup: (BinaryMaskTile | undefined)[];
1734
1759
  private readonly scratchBounds;
1735
1760
  private forEachLinePointFn;
1736
1761
  private trimRectBoundsFn;
1737
1762
  private eachTileInBoundsFn;
1738
- constructor(config: PixelEngineConfig, tilePool: TilePool<BinaryMaskTile>);
1763
+ constructor(config: TileTargetMeta, tilePool?: TilePool<BinaryMaskTile>);
1739
1764
  paintBinaryMask(brush: PaintBinaryMask, x: number, y: number): boolean;
1740
1765
  paintBinaryMask(brush: PaintBinaryMask, startX: number, startY: number, endX: number, endY: number): boolean;
1741
1766
  paintRect(brush: PaintRect, x: number, y: number): boolean;
@@ -1744,11 +1769,11 @@ declare class BinaryMaskPaintBuffer {
1744
1769
  }
1745
1770
 
1746
1771
  declare class ColorPaintBuffer {
1747
- readonly config: PixelEngineConfig;
1772
+ readonly config: TileTargetMeta;
1748
1773
  readonly tilePool: TilePool<PixelTile>;
1749
1774
  readonly lookup: (PixelTile | undefined)[];
1750
1775
  private readonly scratchBounds;
1751
- constructor(config: PixelEngineConfig, tilePool: TilePool<PixelTile>);
1776
+ constructor(config: TileTargetMeta, tilePool: TilePool<PixelTile>);
1752
1777
  paintAlphaMask(color: Color32, brush: PaintAlphaMask, x: number, y: number): boolean;
1753
1778
  paintAlphaMask(color: Color32, brush: PaintAlphaMask, startX: number, startY: number, endX: number, endY: number): boolean;
1754
1779
  paintBinaryMask(color: Color32, brush: PaintBinaryMask, x: number, y: number): boolean;
@@ -1761,45 +1786,54 @@ declare class ColorPaintBuffer {
1761
1786
  declare function makeAlphaMaskPaintBufferCommitter(accumulator: PixelAccumulator, paintBuffer: AlphaMaskPaintBuffer): (color: Color32, alpha?: number, blendFn?: BlendColor32) => void;
1762
1787
 
1763
1788
  type AlphaMaskPaintBufferCanvasRenderer = ReturnType<typeof makeAlphaMaskPaintBufferCanvasRenderer>;
1764
- declare function makeAlphaMaskPaintBufferCanvasRenderer(paintBuffer: AlphaMaskPaintBuffer, canvasFactory?: CanvasObjectFactory<any>): (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, color: Color32, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1789
+ declare function makeAlphaMaskPaintBufferCanvasRenderer<T extends HTMLCanvasElement | OffscreenCanvas>(paintBuffer: AlphaMaskPaintBuffer, reusableCanvasFactory?: () => ReusableCanvasFactory<T>): {
1790
+ draw: (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, color: Color32, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1791
+ setBuffer: (value: AlphaMaskPaintBuffer) => void;
1792
+ };
1765
1793
 
1766
1794
  type AlphaMaskPaintBufferManager = Pick<AlphaMaskPaintBuffer, 'paintAlphaMask' | 'paintBinaryMask' | 'paintRect'> & {
1767
1795
  commit: ReturnType<typeof makeAlphaMaskPaintBufferCommitter>;
1768
- draw: ReturnType<typeof makeAlphaMaskPaintBufferCanvasRenderer>;
1796
+ renderer: ReturnType<typeof makeAlphaMaskPaintBufferCanvasRenderer>;
1769
1797
  clear: () => void;
1770
1798
  };
1771
- declare function makeAlphaMaskPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, canvasFactory?: CanvasObjectFactory<any>): AlphaMaskPaintBufferManager;
1799
+ declare function makeAlphaMaskPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, reusableCanvasFactory?: () => ReusableCanvasFactory<any>): AlphaMaskPaintBufferManager;
1772
1800
 
1773
1801
  declare function makeBinaryMaskPaintBufferCommitter(accumulator: PixelAccumulator, paintBuffer: BinaryMaskPaintBuffer): (color: Color32, alpha?: number, blendFn?: BlendColor32) => void;
1774
1802
 
1775
1803
  type BinaryMaskPaintBufferCanvasRenderer = ReturnType<typeof makeBinaryMaskPaintBufferCanvasRenderer>;
1776
- declare function makeBinaryMaskPaintBufferCanvasRenderer(paintBuffer: BinaryMaskPaintBuffer, canvasFactory?: CanvasObjectFactory<any>): (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, color: Color32, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1804
+ declare function makeBinaryMaskPaintBufferCanvasRenderer<T extends HTMLCanvasElement | OffscreenCanvas>(paintBuffer: BinaryMaskPaintBuffer, reusableCanvasFactory?: () => ReusableCanvasFactory<T>): {
1805
+ draw: (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, color: Color32, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1806
+ setBuffer: (value: BinaryMaskPaintBuffer) => void;
1807
+ };
1777
1808
 
1778
1809
  type BinaryMaskPaintBufferManager = Pick<BinaryMaskPaintBuffer, 'paintBinaryMask' | 'paintRect'> & {
1779
1810
  commit: ReturnType<typeof makeBinaryMaskPaintBufferCommitter>;
1780
- draw: ReturnType<typeof makeBinaryMaskPaintBufferCanvasRenderer>;
1811
+ renderer: ReturnType<typeof makeBinaryMaskPaintBufferCanvasRenderer>;
1781
1812
  clear: () => void;
1782
1813
  };
1783
- declare function makeBinaryMaskPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, canvasFactory?: CanvasObjectFactory<any>): BinaryMaskPaintBufferManager;
1814
+ declare function makeBinaryMaskPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, reusableCanvasFactory?: () => ReusableCanvasFactory<any>): BinaryMaskPaintBufferManager;
1784
1815
 
1785
1816
  declare function makeColorPaintBufferCommitter(accumulator: PixelAccumulator, paintBuffer: ColorPaintBuffer): (alpha?: number, blendFn?: BlendColor32) => void;
1786
1817
 
1787
1818
  type ColorPaintBufferCanvasRenderer = ReturnType<typeof makeColorPaintBufferCanvasRenderer>;
1788
- declare function makeColorPaintBufferCanvasRenderer(paintBuffer: ColorPaintBuffer, canvasFactory?: CanvasObjectFactory<any>): (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1819
+ declare function makeColorPaintBufferCanvasRenderer<T extends HTMLCanvasElement | OffscreenCanvas>(paintBuffer: ColorPaintBuffer, reusableCanvasFactory?: () => ReusableCanvasFactory<T>): {
1820
+ draw: (targetCtx: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D, alpha?: number, compOperation?: GlobalCompositeOperation) => void;
1821
+ setBuffer(value: ColorPaintBuffer): void;
1822
+ };
1789
1823
 
1790
1824
  type ColorPaintBufferManager = Pick<ColorPaintBuffer, 'paintAlphaMask' | 'paintBinaryMask' | 'paintRect'> & {
1791
1825
  commit: ReturnType<typeof makeColorPaintBufferCommitter>;
1792
- draw: ReturnType<typeof makeColorPaintBufferCanvasRenderer>;
1826
+ renderer: ReturnType<typeof makeColorPaintBufferCanvasRenderer>;
1793
1827
  clear: () => void;
1794
1828
  };
1795
- declare function makeColorPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, canvasFactory?: CanvasObjectFactory<any>): ColorPaintBufferManager;
1829
+ declare function makeColorPaintBufferManager(writer: Pick<PixelWriter<any>, 'accumulator' | 'config'>, reusableCanvasFactory?: () => ReusableCanvasFactory<any>): ColorPaintBufferManager;
1796
1830
 
1797
1831
  declare function commitColorPaintBuffer(accumulator: PixelAccumulator, paintBuffer: ColorPaintBuffer, alpha?: number, blendFn?: BlendColor32, blendPixelDataFn?: typeof blendPixelData): void;
1798
1832
 
1799
1833
  declare function commitMaskPaintBuffer(accumulator: PixelAccumulator, paintBuffer: BinaryMaskPaintBuffer, color: Color32, alpha: number | undefined, blendFn: typeof sourceOverPerfect | undefined, blendColorPixelDataMaskFn: typeof blendColorPixelDataBinaryMask): void;
1800
1834
  declare function commitMaskPaintBuffer(accumulator: PixelAccumulator, paintBuffer: AlphaMaskPaintBuffer, color: Color32, alpha: number | undefined, blendFn: typeof sourceOverPerfect | undefined, blendColorPixelDataMaskFn: typeof blendColorPixelDataAlphaMask): void;
1801
1835
 
1802
- declare function eachTileInBounds<T extends Tile>(config: PixelEngineConfig, lookup: (T | undefined)[], tilePool: TilePool<T>, bounds: Rect, callback: (tile: T, bX: number, bY: number, bW: number, bH: number) => void): void;
1836
+ declare function eachTileInBounds<T extends Tile>(config: TileTargetMeta, lookup: (T | undefined)[], tilePool: TilePool<T>, bounds: Rect, callback: (tile: T, bX: number, bY: number, bW: number, bH: number) => void): void;
1803
1837
 
1804
1838
  declare function makeCirclePaintAlphaMask(size: number, fallOff?: (d: number) => number): PaintAlphaMask;
1805
1839
  declare function makeCirclePaintBinaryMask(size: number): PaintBinaryMask;
@@ -1833,7 +1867,7 @@ declare function blendColorPixelDataPaintAlphaMask(dst: PixelData32, color: Colo
1833
1867
 
1834
1868
  declare function blendColorPixelDataPaintBinaryMask(dst: PixelData32, color: Color32, mask: PaintBinaryMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
1835
1869
 
1836
- declare function blendColorPixelDataPaintMask(dst: PixelData32, color: Color32, mask: PaintMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
1870
+ declare function blendColorPixelDataPaintMask(target: PixelData32, color: Color32, mask: PaintMask | PaintRect, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
1837
1871
 
1838
1872
  declare function blendPixelDataMask(target: PixelData32, src: PixelData32, mask: Mask, opts?: PixelBlendMaskOptions): boolean;
1839
1873
 
@@ -1997,4 +2031,12 @@ declare const makeBinaryMaskTile: TileFactory<BinaryMaskTile>;
1997
2031
 
1998
2032
  declare function makePixelTile(id: number, tx: number, ty: number, tileSize: number, tileArea: number): PixelTile;
1999
2033
 
2000
- export { type AlphaMask, AlphaMaskPaintBuffer, type AlphaMaskPaintBufferCanvasRenderer, type AlphaMaskPaintBufferManager, type AlphaMaskRect, type AlphaMaskTile, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BatchedQueue, type BatchedQueueFn, type BinaryMask, BinaryMaskPaintBuffer, type BinaryMaskPaintBufferCanvasRenderer, type BinaryMaskPaintBufferManager, type BinaryMaskRect, type BinaryMaskTile, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type CanvasObjectFactory, type CanvasPixelDataRenderer, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, ColorPaintBuffer, type ColorPaintBufferCanvasRenderer, type ColorPaintBufferManager, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, _errors as ERRORS, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type ImageDataLike, type IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type MutableAlphaMask, type MutableBinaryMask, type MutableMask, type MutablePixelData, type MutablePixelData32, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, type PaintBrush, type PaintCursorRenderer, type PaintMask, PaintMaskOutline, type PaintRect, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, type PixelData, type PixelData32, PixelEngineConfig, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, type PixelTile, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableCanvasFactory, type ReusableImageData, type ReusablePixelData, type SerializedImageData, type Tile, type TileFactory, TilePool, TileType, UnsupportedFormatError, _macro_imageDataToUint32Array, applyAlphaMaskToPixelData, applyBinaryMaskToAlphaMask, applyBinaryMaskToPixelData, applyMaskToPixelData, applyPatchTiles, base64DecodeArrayBuffer, base64EncodeArrayBuffer, blendColorPixelData, blendColorPixelDataAlphaMask, blendColorPixelDataBinaryMask, blendColorPixelDataMask, blendColorPixelDataPaintAlphaMask, blendColorPixelDataPaintBinaryMask, blendColorPixelDataPaintMask, blendPixel, blendPixelData, blendPixelDataAlphaMask, blendPixelDataBinaryMask, blendPixelDataMask, blendPixelDataPaintBuffer, clearPixelDataFast, color32ToCssRGBA, color32ToHex, colorBurnFast, colorBurnPerfect, colorDistance, colorDodgeFast, colorDodgePerfect, commitColorPaintBuffer, commitMaskPaintBuffer, copyImageData, copyImageDataLike, copyMask, copyPixelData, cropPixelData, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, destinationAtopFast, destinationAtopPerfect, destinationInFast, destinationInPerfect, destinationOutFast, destinationOutPerfect, destinationOverFast, destinationOverPerfect, differenceFast, differencePerfect, divideFast, dividePerfect, eachTileInBounds, exclusionFast, exclusionPerfect, extractImageData, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColor, getIndexedImageColorCounts, getPixelDataTransparentTrimmedBounds, getRectsBounds, getSupportedPixelFormats, hardLightFast, hardLightPerfect, hardMixFast, hardMixPerfect, imageDataToAlphaMaskBuffer, imageDataToDataUrl, imageDataToImgBlob, imageDataToUint32Array, imgBlobToImageData, indexedImageToAverageColor, indexedImageToImageData, invertAlphaMask, invertBinaryMask, invertImageData, invertPixelData, lerpColor32, lerpColor32Fast, lightenFast, lightenPerfect, lighterFast, lighterPerfect, linearBurnFast, linearBurnPerfect, linearDodgeFast, linearDodgePerfect, linearLightFast, linearLightPerfect, makeAlphaMask, makeAlphaMaskPaintBufferCanvasRenderer, makeAlphaMaskPaintBufferCommitter, makeAlphaMaskPaintBufferManager, makeAlphaMaskTile, makeBatchedQueue, makeBinaryMask, makeBinaryMaskFromAlphaMask, makeBinaryMaskOutline, makeBinaryMaskPaintBufferCanvasRenderer, makeBinaryMaskPaintBufferCommitter, makeBinaryMaskPaintBufferManager, makeBinaryMaskTile, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCanvasPixelDataRenderer, makeCircleBinaryMaskOutline, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeColorPaintBufferCanvasRenderer, makeColorPaintBufferCommitter, makeColorPaintBufferManager, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makeIndexedImage, makeIndexedImageFromImageData, makeIndexedImageFromImageDataRaw, makePaintAlphaMask, makePaintBinaryMask, makePaintCursorRenderer, makePaintRect, makePerfectBlendModeRegistry, makePixelCanvas, makePixelData, makePixelTile, makeRectBinaryMaskOutline, makeRectFalloffPaintAlphaMask, makeRenderQueue, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, makeReusablePixelData, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask, mutatorBlendColorPaintRect, mutatorBlendMask, mutatorBlendPixel, mutatorBlendPixelData, mutatorClear, mutatorFill, mutatorFillBinaryMask, mutatorInvert, overlayFast, overlayPerfect, overwriteBase, overwriteFast, overwritePerfect, packColor, packRGBA, pinLightFast, pinLightPerfect, pixelDataToAlphaMask, reflectPixelDataHorizontal, reflectPixelDataVertical, resampleImageData, resampleIndexedImage, resamplePixelData, resamplePixelDataInPlace, resampleUint32Array, resizeImageData, resizePixelData, rotatePixelData, screenFast, screenPerfect, serializeImageData, serializeNullableImageData, setMaskData, setPixelData, softLightFast, softLightPerfect, sourceAtopFast, sourceAtopPerfect, sourceInFast, sourceInPerfect, sourceOutFast, sourceOutPerfect, sourceOverFast, sourceOverPerfect, subtractBinaryMaskRects, subtractFast, subtractPerfect, toBlendModeIndexAndName, trimMaskRectBounds, trimRectBounds, trimTransparentPixelData, trimTransparentPixelDataInPlace, uInt32ArrayToImageData, uInt32ArrayToImageDataLike, uInt32ArrayToPixelData, unpackAlpha, unpackBlue, unpackColor, unpackColorTo, unpackGreen, unpackRed, vividLightFast, vividLightPerfect, writeImageData, writeImageDataBuffer, writeImageDataToClipboard, writeImgBlobToClipboard, writePaintBufferToPixelData, writePixelData, writePixelDataBuffer, xorFast, xorPerfect };
2034
+ declare function makeTileTargetConfig(tileSize: number, target: PixelData): TileTargetConfig;
2035
+ declare function makeTileTargetMeta(tileSize: number, target: {
2036
+ w: number;
2037
+ h: number;
2038
+ }): TileTargetMeta;
2039
+
2040
+ declare function colorDistance(a: Color32, b: Color32): number;
2041
+
2042
+ export { type AlphaMask, AlphaMaskPaintBuffer, type AlphaMaskPaintBufferCanvasRenderer, type AlphaMaskPaintBufferManager, type AlphaMaskRect, type AlphaMaskTile, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BatchedQueue, type BatchedQueueFn, type BinaryMask, BinaryMaskPaintBuffer, type BinaryMaskPaintBufferCanvasRenderer, type BinaryMaskPaintBufferManager, type BinaryMaskRect, type BinaryMaskTile, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type CanvasObjectFactory, type CanvasPixelDataRenderer, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, ColorPaintBuffer, type ColorPaintBufferCanvasRenderer, type ColorPaintBufferManager, type CssRGBA, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, _errors as ERRORS, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type ImageDataLike, type IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type MutableAlphaMask, type MutableBinaryMask, type MutableMask, type MutablePixelData, type MutablePixelData32, type NullableAlphaMaskRect, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, type PaintBrush, type PaintCursorRenderer, type PaintMask, PaintMaskOutline, type PaintRect, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, type PixelData, type PixelData32, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, type PixelTile, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableCanvasFactory, type ReusableImageData, type ReusablePixelData, type SerializedImageData, type Tile, type TileFactory, TilePool, type TileTargetConfig, type TileTargetMeta, TileType, UnsupportedFormatError, _macro_imageDataToUint32Array, applyAlphaMaskToPixelData, applyBinaryMaskToAlphaMask, applyBinaryMaskToPixelData, applyMaskToPixelData, applyPatchTiles, base64DecodeArrayBuffer, base64EncodeArrayBuffer, blendColorPixelData, blendColorPixelDataAlphaMask, blendColorPixelDataBinaryMask, blendColorPixelDataMask, blendColorPixelDataPaintAlphaMask, blendColorPixelDataPaintBinaryMask, blendColorPixelDataPaintMask, blendPixel, blendPixelData, blendPixelDataAlphaMask, blendPixelDataBinaryMask, blendPixelDataMask, blendPixelDataPaintBuffer, clearPixelDataFast, color32ToCssRGBA, color32ToCssRGBAString, color32ToHex, colorBurnFast, colorBurnPerfect, colorDistance, colorDodgeFast, colorDodgePerfect, commitColorPaintBuffer, commitMaskPaintBuffer, copyImageData, copyImageDataLike, copyMask, copyPixelData, cropPixelData, cssRGBAToColor32, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, destinationAtopFast, destinationAtopPerfect, destinationInFast, destinationInPerfect, destinationOutFast, destinationOutPerfect, destinationOverFast, destinationOverPerfect, differenceFast, differencePerfect, divideFast, dividePerfect, eachTileInBounds, exclusionFast, exclusionPerfect, extractImageData, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColor, getIndexedImageColorCounts, getPixelDataTransparentTrimmedBounds, getRectsBounds, getSupportedPixelFormats, hardLightFast, hardLightPerfect, hardMixFast, hardMixPerfect, imageDataToAlphaMaskBuffer, imageDataToDataUrl, imageDataToImgBlob, imageDataToUint32Array, imgBlobToImageData, indexedImageToAverageColor, indexedImageToImageData, invertAlphaMask, invertBinaryMask, invertImageData, invertPixelData, lerpColor32, lerpColor32Fast, lightenFast, lightenPerfect, lighterFast, lighterPerfect, linearBurnFast, linearBurnPerfect, linearDodgeFast, linearDodgePerfect, linearLightFast, linearLightPerfect, makeAlphaMask, makeAlphaMaskPaintBufferCanvasRenderer, makeAlphaMaskPaintBufferCommitter, makeAlphaMaskPaintBufferManager, makeAlphaMaskTile, makeBatchedQueue, makeBinaryMask, makeBinaryMaskFromAlphaMask, makeBinaryMaskOutline, makeBinaryMaskPaintBufferCanvasRenderer, makeBinaryMaskPaintBufferCommitter, makeBinaryMaskPaintBufferManager, makeBinaryMaskTile, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCanvasPixelDataRenderer, makeCircleBinaryMaskOutline, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeColorPaintBufferCanvasRenderer, makeColorPaintBufferCommitter, makeColorPaintBufferManager, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makeIndexedImage, makeIndexedImageFromImageData, makeIndexedImageFromImageDataRaw, makePaintAlphaMask, makePaintBinaryMask, makePaintCursorRenderer, makePaintRect, makePerfectBlendModeRegistry, makePixelCanvas, makePixelData, makePixelTile, makeRectBinaryMaskOutline, makeRectFalloffPaintAlphaMask, makeRenderQueue, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, makeReusablePixelData, makeTileTargetConfig, makeTileTargetMeta, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask, mutatorBlendColorPaintRect, mutatorBlendMask, mutatorBlendPixel, mutatorBlendPixelData, mutatorClear, mutatorFill, mutatorFillBinaryMask, mutatorInvert, overlayFast, overlayPerfect, overwriteBase, overwriteFast, overwritePerfect, packColor, packRGBA, pinLightFast, pinLightPerfect, pixelDataToAlphaMask, reflectPixelDataHorizontal, reflectPixelDataVertical, resampleImageData, resampleIndexedImage, resamplePixelData, resamplePixelDataInPlace, resampleUint32Array, resizeImageData, resizePixelData, rotatePixelData, screenFast, screenPerfect, serializeImageData, serializeNullableImageData, setMaskData, setPixelData, softLightFast, softLightPerfect, sourceAtopFast, sourceAtopPerfect, sourceInFast, sourceInPerfect, sourceOutFast, sourceOutPerfect, sourceOverFast, sourceOverPerfect, subtractBinaryMaskRects, subtractFast, subtractPerfect, toBlendModeIndexAndName, trimMaskRectBounds, trimRectBounds, trimTransparentPixelData, trimTransparentPixelDataInPlace, uInt32ArrayToImageData, uInt32ArrayToImageDataLike, uInt32ArrayToPixelData, unpackAlpha, unpackBlue, unpackColor, unpackColorTo, unpackGreen, unpackRed, vividLightFast, vividLightPerfect, writeImageData, writeImageDataBuffer, writeImageDataToClipboard, writeImgBlobToClipboard, writePaintBufferToPixelData, writePixelData, writePixelDataBuffer, xorFast, xorPerfect };