@stream-io/video-filters-web 0.1.6 → 0.2.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/CHANGELOG.md +22 -19
- package/dist/index.cjs.js +5 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5 -13
- package/dist/index.es.js.map +1 -1
- package/dist/src/helpers/webglHelper.d.ts +2 -2
- package/package.json +8 -9
- package/src/webgl2/backgroundBlurStage.ts +2 -2
package/dist/index.es.js
CHANGED
|
@@ -144,8 +144,8 @@ function buildBlurPass(gl, vertexShader, positionBuffer, texCoordBuffer, personM
|
|
|
144
144
|
const offset = new Array(windowSize).fill(0).map((v, index) => index);
|
|
145
145
|
const variance = sigma ** 2;
|
|
146
146
|
const weights = offset.map((x) => {
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
const m = sigma * Math.sqrt(2 * Math.PI);
|
|
148
|
+
const e = Math.exp(-(x ** 2) / (2 * variance));
|
|
149
149
|
return e / m;
|
|
150
150
|
});
|
|
151
151
|
const fragmentShaderSource = glsl `#version 300 es
|
|
@@ -696,7 +696,7 @@ function buildWebGL2Pipeline(videoSource, backgroundImage, blurLevel, background
|
|
|
696
696
|
gl.bindVertexArray(vertexArray);
|
|
697
697
|
const positionBuffer = gl.createBuffer();
|
|
698
698
|
gl.bindBuffer(gl.ARRAY_BUFFER, positionBuffer);
|
|
699
|
-
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1
|
|
699
|
+
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1.0, -1, -1, 1.0, 1.0, 1.0]), gl.STATIC_DRAW);
|
|
700
700
|
const texCoordBuffer = gl.createBuffer();
|
|
701
701
|
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
|
|
702
702
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0]), gl.STATIC_DRAW);
|
|
@@ -860,7 +860,7 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
860
860
|
if (Module['quit']) quit_ = Module['quit'];
|
|
861
861
|
var wasmBinary;
|
|
862
862
|
if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];
|
|
863
|
-
|
|
863
|
+
Module['noExitRuntime'] || true;
|
|
864
864
|
if (typeof WebAssembly != 'object') {
|
|
865
865
|
abort('no native wasm support detected');
|
|
866
866
|
}
|
|
@@ -925,10 +925,6 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
925
925
|
var __ATINIT__ = [];
|
|
926
926
|
var __ATPOSTRUN__ = [];
|
|
927
927
|
|
|
928
|
-
function keepRuntimeAlive() {
|
|
929
|
-
return noExitRuntime;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
928
|
function preRun() {
|
|
933
929
|
if (Module['preRun']) {
|
|
934
930
|
if (typeof Module['preRun'] == 'function')
|
|
@@ -1286,10 +1282,6 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
1286
1282
|
}
|
|
1287
1283
|
|
|
1288
1284
|
function _proc_exit(code) {
|
|
1289
|
-
if (!keepRuntimeAlive()) {
|
|
1290
|
-
if (Module['onExit']) Module['onExit'](code);
|
|
1291
|
-
ABORT = true;
|
|
1292
|
-
}
|
|
1293
1285
|
quit_(code, new ExitStatus(code));
|
|
1294
1286
|
}
|
|
1295
1287
|
|
|
@@ -1539,7 +1531,7 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
1539
1531
|
return __Module.ready;
|
|
1540
1532
|
};
|
|
1541
1533
|
|
|
1542
|
-
const version = "0.
|
|
1534
|
+
const version = "0.2.0";
|
|
1543
1535
|
const packageName = "@stream-io/video-filters-web";
|
|
1544
1536
|
|
|
1545
1537
|
// @ts-expect-error - module is not declared
|