@scrypted/nvr 0.1.217 → 0.1.218
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/CHANGELOG.md +8 -0
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/test.rgb +0 -0
- package/test2.rgba +0 -0
- package/ts/release.js +90 -3
package/CHANGELOG.md
CHANGED
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/test.rgb
ADDED
|
Binary file
|
package/test2.rgba
CHANGED
|
Binary file
|
package/ts/release.js
CHANGED
|
@@ -20,10 +20,66 @@ async function instantiate(module, imports = {}) {
|
|
|
20
20
|
const { exports } = await WebAssembly.instantiate(module, adaptedImports);
|
|
21
21
|
const memory = exports.memory || imports.env.memory;
|
|
22
22
|
const adaptedExports = Object.setPrototypeOf({
|
|
23
|
-
|
|
24
|
-
// assembly/index/
|
|
23
|
+
blurRGBAOne(buffer, width, height, storeRGBABlurPixelOffset4) {
|
|
24
|
+
// assembly/index/blurRGBAOne(~lib/typedarray/Uint8Array, i32, i32, (usize, u32, v128) => void) => ~lib/typedarray/Uint8Array
|
|
25
|
+
buffer = __retain(__lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull());
|
|
26
|
+
storeRGBABlurPixelOffset4 = __lowerInternref(storeRGBABlurPixelOffset4) || __notnull();
|
|
27
|
+
try {
|
|
28
|
+
return __liftTypedArray(Uint8Array, exports.blurRGBAOne(buffer, width, height, storeRGBABlurPixelOffset4) >>> 0);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
__release(buffer);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
blurRGBOne(buffer, width, height, storeRGBABlurPixelOffset4) {
|
|
35
|
+
// assembly/index/blurRGBOne(~lib/typedarray/Uint8Array, i32, i32, (usize, u32, v128) => void) => ~lib/typedarray/Uint8Array
|
|
36
|
+
buffer = __retain(__lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull());
|
|
37
|
+
storeRGBABlurPixelOffset4 = __lowerInternref(storeRGBABlurPixelOffset4) || __notnull();
|
|
38
|
+
try {
|
|
39
|
+
return __liftTypedArray(Uint8Array, exports.blurRGBOne(buffer, width, height, storeRGBABlurPixelOffset4) >>> 0);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
__release(buffer);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
blur(buffer, width, height, count, rgb) {
|
|
46
|
+
// assembly/index/blur(~lib/typedarray/Uint8Array, u32, u32, i32?, bool?) => ~lib/typedarray/Uint8Array
|
|
47
|
+
buffer = __lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull();
|
|
48
|
+
rgb = rgb ? 1 : 0;
|
|
49
|
+
exports.__setArgumentsLength(arguments.length);
|
|
50
|
+
return __liftTypedArray(Uint8Array, exports.blur(buffer, width, height, count, rgb) >>> 0);
|
|
51
|
+
},
|
|
52
|
+
blurDiff(buffer, width, height, count, rgb, t) {
|
|
53
|
+
// assembly/index/blurDiff(~lib/typedarray/Uint8Array, u32, u32, i32?, bool?, u8?) => ~lib/typedarray/Uint8Array
|
|
54
|
+
buffer = __lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull();
|
|
55
|
+
rgb = rgb ? 1 : 0;
|
|
56
|
+
exports.__setArgumentsLength(arguments.length);
|
|
57
|
+
return __liftTypedArray(Uint8Array, exports.blurDiff(buffer, width, height, count, rgb, t) >>> 0);
|
|
58
|
+
},
|
|
59
|
+
diffThreshLine(l1, l2, t) {
|
|
60
|
+
// assembly/index/diffThreshLine(~lib/typedarray/Uint8Array, ~lib/typedarray/Uint8Array, u8?) => ~lib/typedarray/Uint8Array
|
|
61
|
+
l1 = __retain(__lowerTypedArray(Uint8Array, 4, 0, l1) || __notnull());
|
|
62
|
+
l2 = __lowerTypedArray(Uint8Array, 4, 0, l2) || __notnull();
|
|
63
|
+
try {
|
|
64
|
+
exports.__setArgumentsLength(arguments.length);
|
|
65
|
+
return __liftTypedArray(Uint8Array, exports.diffThreshLine(l1, l2, t) >>> 0);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
__release(l1);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
diffThresh(buffer, width, height, t) {
|
|
72
|
+
// assembly/index/diffThresh(~lib/typedarray/Uint8Array, i32, i32, u8?) => ~lib/typedarray/Uint8Array
|
|
73
|
+
buffer = __lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull();
|
|
74
|
+
exports.__setArgumentsLength(arguments.length);
|
|
75
|
+
return __liftTypedArray(Uint8Array, exports.diffThresh(buffer, width, height, t) >>> 0);
|
|
76
|
+
},
|
|
77
|
+
blurDiffThresh(buffer, width, height, count, rgb, t) {
|
|
78
|
+
// assembly/index/blurDiffThresh(~lib/typedarray/Uint8Array, u32, u32, u32?, bool?, u8?) => ~lib/typedarray/Uint8Array
|
|
25
79
|
buffer = __lowerTypedArray(Uint8Array, 4, 0, buffer) || __notnull();
|
|
26
|
-
|
|
80
|
+
rgb = rgb ? 1 : 0;
|
|
81
|
+
exports.__setArgumentsLength(arguments.length);
|
|
82
|
+
return __liftTypedArray(Uint8Array, exports.blurDiffThresh(buffer, width, height, count, rgb, t) >>> 0);
|
|
27
83
|
},
|
|
28
84
|
}, exports);
|
|
29
85
|
function __liftString(pointer) {
|
|
@@ -51,6 +107,37 @@ async function instantiate(module, imports = {}) {
|
|
|
51
107
|
exports.__unpin(buffer);
|
|
52
108
|
return header;
|
|
53
109
|
}
|
|
110
|
+
class Internref extends Number {
|
|
111
|
+
}
|
|
112
|
+
function __lowerInternref(value) {
|
|
113
|
+
if (value == null)
|
|
114
|
+
return 0;
|
|
115
|
+
if (value instanceof Internref)
|
|
116
|
+
return value.valueOf();
|
|
117
|
+
throw TypeError("internref expected");
|
|
118
|
+
}
|
|
119
|
+
const refcounts = new Map();
|
|
120
|
+
function __retain(pointer) {
|
|
121
|
+
if (pointer) {
|
|
122
|
+
const refcount = refcounts.get(pointer);
|
|
123
|
+
if (refcount)
|
|
124
|
+
refcounts.set(pointer, refcount + 1);
|
|
125
|
+
else
|
|
126
|
+
refcounts.set(exports.__pin(pointer), 1);
|
|
127
|
+
}
|
|
128
|
+
return pointer;
|
|
129
|
+
}
|
|
130
|
+
function __release(pointer) {
|
|
131
|
+
if (pointer) {
|
|
132
|
+
const refcount = refcounts.get(pointer);
|
|
133
|
+
if (refcount === 1)
|
|
134
|
+
exports.__unpin(pointer), refcounts.delete(pointer);
|
|
135
|
+
else if (refcount)
|
|
136
|
+
refcounts.set(pointer, refcount - 1);
|
|
137
|
+
else
|
|
138
|
+
throw Error(`invalid refcount '${refcount}' for reference '${pointer}'`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
54
141
|
function __notnull() {
|
|
55
142
|
throw TypeError("value must not be null");
|
|
56
143
|
}
|