libpag 4.4.35 → 4.5.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/README.md +33 -27
- package/README.zh_CN.md +2 -8
- package/lib/libpag.cjs.js +769 -610
- package/lib/libpag.cjs.js.map +1 -1
- package/lib/libpag.esm.js +769 -610
- package/lib/libpag.esm.js.map +1 -1
- package/lib/libpag.min.js +1 -1
- package/lib/libpag.min.js.map +1 -1
- package/lib/libpag.umd.js +769 -610
- package/lib/libpag.umd.js.map +1 -1
- package/lib/libpag.wasm +0 -0
- package/lib/libpag.worker.cjs.js +1 -1
- package/lib/libpag.worker.esm.js +1 -1
- package/lib/libpag.worker.js +1 -1
- package/lib/libpag.worker.min.js +1 -1
- package/lib/libpag.worker.min.js.map +1 -1
- package/package.json +4 -4
- package/src/.pag.wasm.md5 +1 -1
- package/src/pag-file.ts +2 -4
- package/src/pag-image.ts +1 -4
- package/src/pag-layer.ts +4 -2
- package/src/pag-surface.ts +2 -9
- package/src/types.ts +2 -2
- package/src/wasm/libpag.js +7 -8
- package/src/wasm/libpag.wasm +0 -0
- package/src/wechat/pag-view.ts +7 -0
- package/types/third_party/tgfx/web/src/core/scaler-context.d.ts +2 -0
- package/types/third_party/tgfx/web/src/tgfx.d.ts +2 -10
- package/types/web/src/pag-layer.d.ts +4 -2
- package/types/web/src/types.d.ts +2 -2
- package/LICENSE.txt +0 -1589
- package/types/third_party/tgfx/web/src/utils/buffer.d.ts +0 -10
package/src/wasm/libpag.wasm
CHANGED
|
Binary file
|
package/src/wechat/pag-view.ts
CHANGED
|
@@ -98,6 +98,13 @@ export class PAGView extends NativePAGView {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
/**
|
|
102
|
+
* WeChat Mini Programs do not support capturing screenshots of WebGL Canvas.
|
|
103
|
+
*/
|
|
104
|
+
public override makeSnapshot(): never {
|
|
105
|
+
throw new Error('WeChat Mini Programs do not support capturing screenshots of WebGL Canvas');
|
|
106
|
+
}
|
|
107
|
+
|
|
101
108
|
protected override async flushLoop(force = false) {
|
|
102
109
|
if (!this.isPlaying) return;
|
|
103
110
|
this.setTimer();
|
|
@@ -2,10 +2,12 @@ import type { Rect } from '../types';
|
|
|
2
2
|
export declare class ScalerContext {
|
|
3
3
|
static canvas: HTMLCanvasElement | OffscreenCanvas;
|
|
4
4
|
static context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
5
|
+
private static hasMeasureBoundsAPI;
|
|
5
6
|
static setCanvas(canvas: HTMLCanvasElement | OffscreenCanvas): void;
|
|
6
7
|
static setContext(context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D): void;
|
|
7
8
|
static isUnicodePropertyEscapeSupported(): boolean;
|
|
8
9
|
static isEmoji(text: string): boolean;
|
|
10
|
+
private static measureDirectly;
|
|
9
11
|
private readonly fontName;
|
|
10
12
|
private readonly fontStyle;
|
|
11
13
|
private readonly size;
|
|
@@ -3,11 +3,7 @@ import { BitmapImage } from './core/bitmap-image';
|
|
|
3
3
|
import type { EmscriptenGL, TGFX } from './types';
|
|
4
4
|
export declare const createImage: (source: string) => Promise<HTMLImageElement>;
|
|
5
5
|
export declare const createImageFromBytes: (bytes: ArrayBuffer) => Promise<HTMLImageElement>;
|
|
6
|
-
export declare const readImagePixels: (module: TGFX, image: CanvasImageSource, width: number, height: number) =>
|
|
7
|
-
byteOffset: number;
|
|
8
|
-
length: number;
|
|
9
|
-
free: () => void;
|
|
10
|
-
};
|
|
6
|
+
export declare const readImagePixels: (module: TGFX, image: CanvasImageSource, width: number, height: number) => Uint8Array;
|
|
11
7
|
export declare const hasWebpSupport: () => boolean;
|
|
12
8
|
export declare const getSourceSize: (source: TexImageSource | OffscreenCanvas) => {
|
|
13
9
|
width: number;
|
|
@@ -16,9 +12,5 @@ export declare const getSourceSize: (source: TexImageSource | OffscreenCanvas) =
|
|
|
16
12
|
export declare const uploadToTexture: (GL: EmscriptenGL, source: TexImageSource | OffscreenCanvas | BitmapImage, textureID: number, alphaOnly: boolean) => void;
|
|
17
13
|
export declare const isAndroidMiniprogram: () => boolean;
|
|
18
14
|
export declare const releaseNativeImage: (source: TexImageSource | OffscreenCanvas) => void;
|
|
19
|
-
export declare const getBytesFromPath: (module: TGFX, path: string) => Promise<
|
|
20
|
-
byteOffset: number;
|
|
21
|
-
length: number;
|
|
22
|
-
free: () => void;
|
|
23
|
-
}>;
|
|
15
|
+
export declare const getBytesFromPath: (module: TGFX, path: string) => Promise<Uint8Array>;
|
|
24
16
|
export { getCanvas2D as createCanvas2D };
|
|
@@ -29,8 +29,10 @@ export declare class PAGLayer {
|
|
|
29
29
|
*/
|
|
30
30
|
resetMatrix(): void;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* matrix from
|
|
32
|
+
* Returns the layer's display matrix by combining its matrix) property with the current animation
|
|
33
|
+
* matrix from the AE timeline. This does not include the parent layer's matrix.
|
|
34
|
+
* To calculate the final bounds relative to the PAGSurface, use the PAGPlayer::getBounds(PAGLayer layer)
|
|
35
|
+
* method directly.
|
|
34
36
|
*/
|
|
35
37
|
getTotalMatrix(): Matrix;
|
|
36
38
|
/**
|
package/types/web/src/types.d.ts
CHANGED
|
@@ -26,12 +26,12 @@ declare global {
|
|
|
26
26
|
}
|
|
27
27
|
export interface PAG extends EmscriptenModule {
|
|
28
28
|
_PAGFile: {
|
|
29
|
-
_Load: (
|
|
29
|
+
_Load: (buffer: Uint8Array) => any;
|
|
30
30
|
_MaxSupportedTagLevel: () => number;
|
|
31
31
|
};
|
|
32
32
|
_PAGImage: {
|
|
33
33
|
_FromNativeImage: (source: TexImageSource | ArrayBufferImage) => any;
|
|
34
|
-
_FromPixels: (pixels:
|
|
34
|
+
_FromPixels: (pixels: Uint8Array, width: number, height: number, rowBytes: number, colorType: ColorType, alphaType: AlphaType) => any;
|
|
35
35
|
_FromTexture: (textureID: number, width: number, height: number, flipY: boolean) => any;
|
|
36
36
|
};
|
|
37
37
|
_PAGPlayer: any;
|