libpag 4.5.0 → 4.5.2
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/LICENSE.txt +1589 -0
- package/README.md +172 -10
- package/README.zh_CN.md +114 -15
- package/lib/libpag.cjs.js +5420 -6176
- package/lib/libpag.cjs.js.map +1 -1
- package/lib/libpag.esm.js +5420 -6176
- 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 +5420 -6176
- package/lib/libpag.umd.js.map +1 -1
- package/lib/libpag.wasm +0 -0
- package/package.json +23 -11
- package/src/.pag.wasm-mt.md5 +1 -0
- package/src/.pag.wasm.md5 +1 -1
- package/src/core/matrix.ts +1 -2
- package/src/core/video-reader.ts +73 -94
- package/src/interfaces.ts +8 -17
- package/src/pag-composition.ts +12 -5
- package/src/pag-file.ts +146 -129
- package/src/pag-font.ts +1 -3
- package/src/pag-image-layer.ts +1 -2
- package/src/pag-image.ts +1 -3
- package/src/pag-layer.ts +2 -3
- package/src/pag-player.ts +7 -6
- package/src/pag-solid-layer.ts +1 -2
- package/src/pag-surface.ts +1 -2
- package/src/pag-text-layer.ts +1 -2
- package/src/pag-view.ts +3 -14
- package/src/pag.ts +0 -6
- package/src/types.ts +46 -3
- package/src/utils/decorators.ts +0 -42
- package/src/utils/type-utils.ts +1 -9
- package/src/utils/ua.ts +0 -1
- package/src/wasm/libpag.js +7 -6
- package/src/wasm/libpag.wasm +0 -0
- package/src/wasm-mt/libpag.js +2 -0
- package/src/wasm-mt/libpag.wasm +0 -0
- package/src/wechat/pag-file.ts +1 -2
- package/src/wechat/pag-image.ts +0 -2
- package/src/wechat/pag-view.ts +1 -2
- package/types/third_party/tgfx/web/src/core/path-rasterizer.d.ts +4 -0
- package/types/third_party/tgfx/web/src/core/scaler-context.d.ts +9 -2
- package/types/third_party/tgfx/web/src/utils/decorators.d.ts +0 -2
- package/types/web/src/core/video-reader.d.ts +4 -3
- package/types/web/src/interfaces.d.ts +8 -15
- package/types/web/src/pag-composition.d.ts +3 -3
- package/types/web/src/pag-file.d.ts +4 -4
- package/types/web/src/pag-player.d.ts +2 -2
- package/types/web/src/pag-view.d.ts +1 -1
- package/types/web/src/types.d.ts +12 -3
- package/types/web/src/utils/decorators.d.ts +0 -2
- package/types/web/src/utils/ua.d.ts +0 -1
- package/types/web/tsconfig.json +19 -0
- package/lib/libpag.worker.cjs.js +0 -794
- package/lib/libpag.worker.cjs.js.map +0 -1
- package/lib/libpag.worker.esm.js +0 -789
- package/lib/libpag.worker.esm.js.map +0 -1
- package/lib/libpag.worker.js +0 -800
- package/lib/libpag.worker.js.map +0 -1
- package/lib/libpag.worker.min.js +0 -2
- package/lib/libpag.worker.min.js.map +0 -1
- package/src/worker/client.ts +0 -76
- package/src/worker/events.ts +0 -41
- package/src/worker/pag-file.ts +0 -90
- package/src/worker/pag-image.ts +0 -43
- package/src/worker/pag-view.ts +0 -171
- package/src/worker/utils.ts +0 -29
- package/src/worker/video-reader.ts +0 -62
- package/src/worker/worker.ts +0 -169
- package/types/third_party/tgfx/web/src/core/web-mask.d.ts +0 -26
- package/types/web/src/utils/canvas.d.ts +0 -4
- package/types/web/src/worker/client.d.ts +0 -16
- package/types/web/src/worker/events.d.ts +0 -32
- package/types/web/src/worker/pag-file.d.ts +0 -33
- package/types/web/src/worker/pag-image.d.ts +0 -8
- package/types/web/src/worker/pag-view.d.ts +0 -67
- package/types/web/src/worker/utils.d.ts +0 -7
- package/types/web/src/worker/video-reader.d.ts +0 -16
- package/types/web/src/worker/worker.d.ts +0 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PAGComposition } from './pag-composition';
|
|
2
2
|
import type { PAGImage } from './pag-image';
|
|
3
|
-
import { LayerType, PAGTimeStretchMode, TextDocument } from './types';
|
|
3
|
+
import { LayerType, PAGTimeStretchMode, TextDocument, VecArray } from './types';
|
|
4
4
|
export declare class PAGFile extends PAGComposition {
|
|
5
5
|
/**
|
|
6
6
|
* Load pag file from file.
|
|
@@ -49,7 +49,7 @@ export declare class PAGFile extends PAGComposition {
|
|
|
49
49
|
/**
|
|
50
50
|
* Return an array of layers by specified editable index and layer type.
|
|
51
51
|
*/
|
|
52
|
-
getLayersByEditableIndex(editableIndex: Number, layerType: LayerType):
|
|
52
|
+
getLayersByEditableIndex(editableIndex: Number, layerType: LayerType): VecArray;
|
|
53
53
|
/**
|
|
54
54
|
* Returns the indices of the editable layers in this PAGFile.
|
|
55
55
|
* If the editableIndex of a PAGLayer is not present in the returned indices, the PAGLayer should
|
|
@@ -71,8 +71,8 @@ export declare class PAGFile extends PAGComposition {
|
|
|
71
71
|
*/
|
|
72
72
|
setDuration(duration: number): void;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
74
|
+
* Make a copy of the original file, any modification to current file has no effect on the result
|
|
75
|
+
* file.
|
|
76
76
|
*/
|
|
77
77
|
copyOriginal(): PAGFile;
|
|
78
78
|
}
|
|
@@ -2,7 +2,7 @@ import { PAGSurface } from './pag-surface';
|
|
|
2
2
|
import { Matrix } from './core/matrix';
|
|
3
3
|
import { PAGComposition } from './pag-composition';
|
|
4
4
|
import type { PAGLayer } from './pag-layer';
|
|
5
|
-
import
|
|
5
|
+
import { PAGScaleMode, Rect, VecArray } from './types';
|
|
6
6
|
import type { VideoReader } from './interfaces';
|
|
7
7
|
export declare class PAGPlayer {
|
|
8
8
|
static create(): PAGPlayer;
|
|
@@ -140,7 +140,7 @@ export declare class PAGPlayer {
|
|
|
140
140
|
*
|
|
141
141
|
* this PAGComposition's local coordinates.
|
|
142
142
|
*/
|
|
143
|
-
getLayersUnderPoint(localX: number, localY: number):
|
|
143
|
+
getLayersUnderPoint(localX: number, localY: number): VecArray;
|
|
144
144
|
/**
|
|
145
145
|
* Evaluates the PAGLayer to see if it overlaps or intersects with the specified point. The point
|
|
146
146
|
*
|
|
@@ -182,7 +182,7 @@ export declare class PAGView {
|
|
|
182
182
|
* will be set to PAGScaleMode::None when this method is called.
|
|
183
183
|
*/
|
|
184
184
|
setMatrix(matrix: Matrix): void;
|
|
185
|
-
getLayersUnderPoint(localX: number, localY: number): import("
|
|
185
|
+
getLayersUnderPoint(localX: number, localY: number): import("./types").VecArray;
|
|
186
186
|
/**
|
|
187
187
|
* Update size when changed canvas size.
|
|
188
188
|
*/
|
package/types/web/src/types.d.ts
CHANGED
|
@@ -15,8 +15,8 @@ import { PAGImageLayer } from './pag-image-layer';
|
|
|
15
15
|
import { PAGSolidLayer } from './pag-solid-layer';
|
|
16
16
|
import { Matrix as ClassMatrix } from './core/matrix';
|
|
17
17
|
import { RenderCanvas } from './core/render-canvas';
|
|
18
|
-
import type { ScalerContextConstructor, VideoDecoderConstructor
|
|
19
|
-
import type { ArrayBufferImage } from '@tgfx
|
|
18
|
+
import type { ScalerContextConstructor, VideoDecoderConstructor } from './interfaces';
|
|
19
|
+
import type { ArrayBufferImage } from '@tgfx/wechat/array-buffer-image';
|
|
20
20
|
import type { TGFXPathFillType, TGFXLineCap, TGFXLineJoin, EmscriptenGL, ctor, Point, Vector, Rect } from '@tgfx/types';
|
|
21
21
|
export type { EmscriptenGL, ctor, Point, Vector, Rect };
|
|
22
22
|
declare global {
|
|
@@ -81,7 +81,6 @@ export interface PAG extends EmscriptenModule {
|
|
|
81
81
|
PAGTextLayer: typeof PAGTextLayer;
|
|
82
82
|
PAGImageLayer: typeof PAGImageLayer;
|
|
83
83
|
PAGSolidLayer: typeof PAGSolidLayer;
|
|
84
|
-
WebMask: WebMaskConstructor;
|
|
85
84
|
ScalerContext: ScalerContextConstructor;
|
|
86
85
|
VideoReader: VideoDecoderConstructor;
|
|
87
86
|
GlobalCanvas: typeof GlobalCanvas;
|
|
@@ -468,3 +467,13 @@ export declare class SoftwareDecoder {
|
|
|
468
467
|
export declare class SoftwareDecoderFactory {
|
|
469
468
|
createSoftwareDecoder(pag: PAG): SoftwareDecoder | null;
|
|
470
469
|
}
|
|
470
|
+
export declare class VecArray extends Array {
|
|
471
|
+
private isDeleted;
|
|
472
|
+
private constructor();
|
|
473
|
+
static create(): VecArray;
|
|
474
|
+
get(index: number): any;
|
|
475
|
+
push_back(value: any): void;
|
|
476
|
+
size(): number;
|
|
477
|
+
delete(): void;
|
|
478
|
+
private ensureNotDeleted;
|
|
479
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["ES5", "ES6", "DOM", "DOM.Iterable"],
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"moduleResolution": "Node",
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"outDir": "./lib",
|
|
12
|
+
"baseUrl": ".",
|
|
13
|
+
"paths": {
|
|
14
|
+
"@tgfx/*": ["../third_party/tgfx/web/src/*"],
|
|
15
|
+
},
|
|
16
|
+
"resolveJsonModule": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*.ts", "demo/**/*.ts"]
|
|
19
|
+
}
|