pixel-data-js 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.prod.cjs +6 -6
- package/dist/index.prod.cjs.map +1 -1
- package/dist/index.prod.d.ts +9 -9
- package/dist/index.prod.js +5 -5
- package/dist/index.prod.js.map +1 -1
- package/package.json +1 -1
- package/src/History/PixelMutator/{mutatorBlendPaintRect.ts → mutatorBlendColorPaintRect.ts} +2 -2
- package/src/History/PixelMutator.ts +2 -2
- package/src/index.ts +1 -1
package/dist/index.prod.d.ts
CHANGED
|
@@ -813,8 +813,8 @@ declare function makeFullPixelMutator(writer: PixelWriter<any>): {
|
|
|
813
813
|
clear(rect?: Partial<Rect>): boolean;
|
|
814
814
|
blendPixelData(src: IPixelData32, opts?: PixelBlendOptions): boolean;
|
|
815
815
|
blendPixel(x: number, y: number, color: Color32, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
816
|
-
blendPaintRect(color: Color32, centerX: number, centerY: number, brushWidth: number, brushHeight: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
817
816
|
blendMask(src: IPixelData32, mask: Mask, opts?: PixelBlendMaskOptions): boolean;
|
|
817
|
+
blendColorPaintRect(color: Color32, centerX: number, centerY: number, brushWidth: number, brushHeight: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
818
818
|
blendColorPaintMask(color: Color32, mask: PaintMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
819
819
|
blendColorPaintBinaryMask(color: Color32, mask: PaintBinaryMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
820
820
|
blendColorPaintAlphaMask(color: Color32, mask: PaintAlphaMask, x: number, y: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
@@ -982,26 +982,26 @@ declare const mutatorBlendColorPaintMask: (writer: PixelWriter<any>, deps?: Part
|
|
|
982
982
|
};
|
|
983
983
|
|
|
984
984
|
declare const defaults$7: {
|
|
985
|
-
|
|
986
|
-
blendPixelDataBinaryMask: typeof blendPixelDataBinaryMask;
|
|
985
|
+
blendColorPixelData: typeof blendColorPixelData;
|
|
987
986
|
};
|
|
988
987
|
type Deps$7 = Partial<typeof defaults$7>;
|
|
989
988
|
/**
|
|
990
989
|
* @param deps - @hidden
|
|
991
990
|
*/
|
|
992
|
-
declare const
|
|
993
|
-
|
|
991
|
+
declare const mutatorBlendColorPaintRect: (writer: PixelWriter<any>, deps?: Deps$7) => {
|
|
992
|
+
blendColorPaintRect(color: Color32, centerX: number, centerY: number, brushWidth: number, brushHeight: number, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
994
993
|
};
|
|
995
994
|
|
|
996
995
|
declare const defaults$6: {
|
|
997
|
-
|
|
996
|
+
blendPixelDataAlphaMask: typeof blendPixelDataAlphaMask;
|
|
997
|
+
blendPixelDataBinaryMask: typeof blendPixelDataBinaryMask;
|
|
998
998
|
};
|
|
999
999
|
type Deps$6 = Partial<typeof defaults$6>;
|
|
1000
1000
|
/**
|
|
1001
1001
|
* @param deps - @hidden
|
|
1002
1002
|
*/
|
|
1003
|
-
declare const
|
|
1004
|
-
|
|
1003
|
+
declare const mutatorBlendMask: (writer: PixelWriter<any>, deps?: Partial<Deps$6>) => {
|
|
1004
|
+
blendMask(src: IPixelData32, mask: Mask, opts?: PixelBlendMaskOptions): boolean;
|
|
1005
1005
|
};
|
|
1006
1006
|
|
|
1007
1007
|
declare function blendPixel(target: IPixelData32, x: number, y: number, color: Color32, alpha?: number, blendFn?: BlendColor32): boolean;
|
|
@@ -1755,4 +1755,4 @@ declare function color32ToHex(color: Color32): string;
|
|
|
1755
1755
|
*/
|
|
1756
1756
|
declare function color32ToCssRGBA(color: Color32): string;
|
|
1757
1757
|
|
|
1758
|
-
export { type AlphaMask, type AlphaMaskRect, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BinaryMask, type BinaryMaskRect, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type ClippedBlit, type ClippedRect, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, type ColorBlendPaintMaskOptions, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type IPixelData, type IPixelData32, type ImageDataLike, type ImageDataLikeConstructor, IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, PaintBuffer, type PaintBufferCanvasRenderer, type PaintMask, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, PixelData, PixelEngineConfig, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, PixelTile, PixelTilePool, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableImageData, type SerializedImageData, UnsupportedFormatError, 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, copyImageData, copyImageDataLike, copyMask, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, differenceFast, differencePerfect, divideFast, dividePerfect, exclusionFast, exclusionPerfect, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColorCounts, 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, makeBinaryMask, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeClippedBlit, makeClippedRect, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makePaintAlphaMask, makePaintBinaryMask, makePaintBufferCanvasRenderer, makePerfectBlendModeRegistry, makePixelCanvas, makeRectFalloffPaintAlphaMask, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask,
|
|
1758
|
+
export { type AlphaMask, type AlphaMaskRect, type ApplyMaskToPixelDataOptions, BASE_FAST_BLEND_MODE_FUNCTIONS, BASE_PERFECT_BLEND_MODE_FUNCTIONS, type Base64EncodedUInt8Array, BaseBlendMode, type BaseBlendModes, type BaseMask, type BasePixelBlendOptions, type BinaryMask, type BinaryMaskRect, type BlendColor32, type BlendModeRegistry, CANVAS_COMPOSITE_MAP, type CanvasBlendModeIndex, type CanvasCompositeOperation, type CanvasContext, type CanvasFrameRenderer, type ClippedBlit, type ClippedRect, type Color32, type ColorBlendMaskOptions, type ColorBlendOptions, type ColorBlendPaintMaskOptions, type DidChangeFn, type DrawPixelLayer, type DrawScreenLayer, type FloodFillResult, type HistoryAction, type HistoryActionFactory, HistoryManager, type HistoryMutator, type IPixelData, type IPixelData32, type ImageDataLike, type ImageDataLikeConstructor, IndexedImage, type InvertMask, type Mask, type MaskOffset, type MaskRect, MaskType, type MergeAlphaMasksOptions, type NullableBinaryMaskRect, type NullableMaskRect, type PaintAlphaMask, type PaintBinaryMask, PaintBuffer, type PaintBufferCanvasRenderer, type PaintMask, PixelAccumulator, type PixelBlendMaskOptions, type PixelBlendOptions, type PixelCanvas, PixelData, PixelEngineConfig, type PixelMutateOptions, type PixelPatchTiles, type PixelRect, PixelTile, PixelTilePool, PixelWriter, type PixelWriterOptions, type RGBA, type Rect, type RequiredBlendModes, type ReusableCanvas, type ReusableImageData, type SerializedImageData, UnsupportedFormatError, 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, copyImageData, copyImageDataLike, copyMask, darkenFast, darkenPerfect, darkerFast, darkerPerfect, deserializeImageData, deserializeNullableImageData, deserializeRawImageData, differenceFast, differencePerfect, divideFast, dividePerfect, exclusionFast, exclusionPerfect, extractImageDataBuffer, extractMask, extractMaskBuffer, extractPixelData, extractPixelDataBuffer, fileInputChangeToImageData, fileToImageData, fillPixelData, fillPixelDataBinaryMask, fillPixelDataFast, floodFillSelection, forEachLinePoint, getImageDataFromClipboard, getIndexedImageColorCounts, 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, makeBinaryMask, makeBlendModeRegistry, makeCanvasFrameRenderer, makeCirclePaintAlphaMask, makeCirclePaintBinaryMask, makeClippedBlit, makeClippedRect, makeFastBlendModeRegistry, makeFullPixelMutator, makeHistoryAction, makeImageDataLike, makePaintAlphaMask, makePaintBinaryMask, makePaintBufferCanvasRenderer, makePerfectBlendModeRegistry, makePixelCanvas, makeRectFalloffPaintAlphaMask, makeReusableCanvas, makeReusableImageData, makeReusableOffscreenCanvas, merge2BinaryMaskRects, mergeAlphaMasks, mergeBinaryMaskRects, mergeBinaryMasks, multiplyFast, multiplyPerfect, mutatorApplyAlphaMask, mutatorApplyBinaryMask, mutatorApplyMask, mutatorBlendAlphaMask, mutatorBlendBinaryMask, mutatorBlendColor, mutatorBlendColorPaintAlphaMask, mutatorBlendColorPaintBinaryMask, mutatorBlendColorPaintMask, mutatorBlendColorPaintRect, mutatorBlendMask, mutatorBlendPixel, mutatorBlendPixelData, mutatorClear, mutatorFill, mutatorFillBinaryMask, mutatorFillRect, mutatorInvert, overlayFast, overlayPerfect, overwriteBase, overwriteFast, overwritePerfect, packColor, packRGBA, pinLightFast, pinLightPerfect, pixelDataToAlphaMask, reflectPixelDataHorizontal, reflectPixelDataVertical, resample32, resampleImageData, resampleIndexedImage, resamplePixelData, resizeImageData, resolveBlitClipping, resolveRectClipping, rotatePixelData, screenFast, screenPerfect, serializeImageData, serializeNullableImageData, setMaskData, softLightFast, softLightPerfect, sourceOverFast, sourceOverPerfect, subtractBinaryMaskRects, subtractFast, subtractPerfect, toBlendModeIndexAndName, trimMaskRectBounds, trimRectBounds, uInt32ArrayToImageData, uInt32ArrayToImageDataLike, unpackAlpha, unpackBlue, unpackColor, unpackColorTo, unpackGreen, unpackRed, vividLightFast, vividLightPerfect, writeImageData, writeImageDataBuffer, writeImageDataToClipboard, writeImgBlobToClipboard, writePaintBufferToPixelData, writePixelDataBuffer };
|
package/dist/index.prod.js
CHANGED
|
@@ -3320,11 +3320,11 @@ var mutatorBlendMask = ((writer, deps = defaults11) => {
|
|
|
3320
3320
|
};
|
|
3321
3321
|
});
|
|
3322
3322
|
|
|
3323
|
-
// src/History/PixelMutator/
|
|
3323
|
+
// src/History/PixelMutator/mutatorBlendColorPaintRect.ts
|
|
3324
3324
|
var defaults12 = {
|
|
3325
3325
|
blendColorPixelData
|
|
3326
3326
|
};
|
|
3327
|
-
var
|
|
3327
|
+
var mutatorBlendColorPaintRect = ((writer, deps = defaults12) => {
|
|
3328
3328
|
const {
|
|
3329
3329
|
blendColorPixelData: blendColorPixelData2 = defaults12.blendColorPixelData
|
|
3330
3330
|
} = deps;
|
|
@@ -3337,7 +3337,7 @@ var mutatorBlendPaintRect = ((writer, deps = defaults12) => {
|
|
|
3337
3337
|
alpha: 255
|
|
3338
3338
|
};
|
|
3339
3339
|
return {
|
|
3340
|
-
|
|
3340
|
+
blendColorPaintRect(color, centerX, centerY, brushWidth, brushHeight, alpha = 255, blendFn = sourceOverPerfect) {
|
|
3341
3341
|
const target = writer.config.target;
|
|
3342
3342
|
const topLeftX = centerX + -(brushWidth - 1 >> 1);
|
|
3343
3343
|
const topLeftY = centerY + -(brushHeight - 1 >> 1);
|
|
@@ -3656,8 +3656,8 @@ function makeFullPixelMutator(writer) {
|
|
|
3656
3656
|
...mutatorBlendColorPaintAlphaMask(writer),
|
|
3657
3657
|
...mutatorBlendColorPaintBinaryMask(writer),
|
|
3658
3658
|
...mutatorBlendColorPaintMask(writer),
|
|
3659
|
+
...mutatorBlendColorPaintRect(writer),
|
|
3659
3660
|
...mutatorBlendMask(writer),
|
|
3660
|
-
...mutatorBlendPaintRect(writer),
|
|
3661
3661
|
...mutatorBlendPixel(writer),
|
|
3662
3662
|
...mutatorBlendPixelData(writer),
|
|
3663
3663
|
...mutatorClear(writer),
|
|
@@ -5301,8 +5301,8 @@ export {
|
|
|
5301
5301
|
mutatorBlendColorPaintAlphaMask,
|
|
5302
5302
|
mutatorBlendColorPaintBinaryMask,
|
|
5303
5303
|
mutatorBlendColorPaintMask,
|
|
5304
|
+
mutatorBlendColorPaintRect,
|
|
5304
5305
|
mutatorBlendMask,
|
|
5305
|
-
mutatorBlendPaintRect,
|
|
5306
5306
|
mutatorBlendPixel,
|
|
5307
5307
|
mutatorBlendPixelData,
|
|
5308
5308
|
mutatorClear,
|