react-native-webrtc-kaleidoscope 2.7.9 → 2.7.10
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuning.d.ts","sourceRoot":"","sources":["../../web-driver/tuning.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,cAAM,iBAAiB;IACrB,SAAS,
|
|
1
|
+
{"version":3,"file":"tuning.d.ts","sourceRoot":"","sources":["../../web-driver/tuning.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAI3D,cAAM,iBAAiB;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IAGtB,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,OAAO,CAAC;IAKrB,cAMC;IAED,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEhC;IAED,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEnC;IAED,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEpC;IAED,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAElD;IAED,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAEnC;IAED,KAAK,IAAI,IAAI,CAMZ;CACF;AAED,eAAO,MAAM,MAAM,mBAA0B,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,SAAU,SAAS,KAAG,IAG/C,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,aACpB,MAAM,aACL,MAAM,KAChB,SAAS,CAAC,MAAM,EAAE,MAAM,CAK1B,CAAC"}
|
|
@@ -12,13 +12,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.maskSmoothstepRange = exports.setMaskTuning = exports.tuning = void 0;
|
|
13
13
|
const clamp = (value, lo, hi) => Math.min(Math.max(value, lo), hi);
|
|
14
14
|
class EffectTuningState {
|
|
15
|
-
blurSigma
|
|
16
|
-
maskHardness
|
|
17
|
-
maskThreshold
|
|
15
|
+
blurSigma;
|
|
16
|
+
maskHardness;
|
|
17
|
+
maskThreshold;
|
|
18
18
|
// Native-only knobs stored here for cross-platform API parity; the web
|
|
19
19
|
// MediaPipe pipeline does not currently consume them.
|
|
20
|
-
segmentationTargetShortSide
|
|
21
|
-
debugTiming
|
|
20
|
+
segmentationTargetShortSide;
|
|
21
|
+
debugTiming;
|
|
22
|
+
// Defaults are assigned in the constructor rather than as field initializers;
|
|
23
|
+
// Bun 1.4 counts field initializers as a function that coverage never marks
|
|
24
|
+
// hit, which fails the 100% function threshold.
|
|
25
|
+
constructor() {
|
|
26
|
+
this.blurSigma = 5;
|
|
27
|
+
this.maskHardness = 0.5;
|
|
28
|
+
this.maskThreshold = 0.5;
|
|
29
|
+
this.segmentationTargetShortSide = 384;
|
|
30
|
+
this.debugTiming = false;
|
|
31
|
+
}
|
|
22
32
|
setBlurSigma(value) {
|
|
23
33
|
this.blurSigma = clamp(value, 0.5, 7);
|
|
24
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tuning.js","sourceRoot":"","sources":["../../web-driver/tuning.ts"],"names":[],"mappings":";AAAA,0DAA0D;AAC1D,8DAA8D;AAC9D,EAAE;AACF,yEAAyE;AACzE,8EAA8E;AAC9E,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,kDAAkD;;;AAIlD,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAU,EAAE,EAAU,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AAEnG,MA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Q9B","sourcesContent":["// Mutable runtime state for the web GLSL effects. Mirrors\n// android/.../EffectTuning.kt and ios/.../EffectTuning.swift.\n//\n// The mask edge (hardness/threshold) is written here through exactly two\n// doors: the setMask closure that `bindKaleidoscope` (src/index.web.ts) wires\n// up, and `setMaskTuning` below (re-exported by the `/livekit` subpath for the\n// processor path, where LiveKit owns the sender and there is no binding). The\n// composite compositor in `web-driver/effects/*.ts` reads it when uploading\n// uniforms. Writes take effect on the next frame.\n\nimport type { MaskInput } from '../src/kaleidoscope/types';\n\nconst clamp = (value: number, lo: number, hi: number): number => Math.min(Math.max(value, lo), hi);\n\nclass EffectTuningState {\n blurSigma: number;\n maskHardness: number;\n maskThreshold: number;\n // Native-only knobs stored here for cross-platform API parity; the web\n // MediaPipe pipeline does not currently consume them.\n segmentationTargetShortSide: number;\n debugTiming: boolean;\n\n // Defaults are assigned in the constructor rather than as field initializers;\n // Bun 1.4 counts field initializers as a function that coverage never marks\n // hit, which fails the 100% function threshold.\n constructor() {\n this.blurSigma = 5;\n this.maskHardness = 0.5;\n this.maskThreshold = 0.5;\n this.segmentationTargetShortSide = 384;\n this.debugTiming = false;\n }\n\n setBlurSigma(value: number): void {\n this.blurSigma = clamp(value, 0.5, 7);\n }\n\n setMaskHardness(value: number): void {\n this.maskHardness = clamp(value, 0, 1);\n }\n\n setMaskThreshold(value: number): void {\n this.maskThreshold = clamp(value, 0.05, 0.95);\n }\n\n setSegmentationTargetShortSide(value: number): void {\n this.segmentationTargetShortSide = clamp(value, 128, 1080);\n }\n\n setDebugTiming(value: boolean): void {\n this.debugTiming = value;\n }\n\n reset(): void {\n this.blurSigma = 5;\n this.maskHardness = 0.5;\n this.maskThreshold = 0.5;\n this.segmentationTargetShortSide = 384;\n this.debugTiming = false;\n }\n}\n\nexport const tuning = new EffectTuningState();\n\n/**\n * Write the segmentation mask edge (`hardness`, `threshold`) that every\n * running composite reads each frame. This is the processor-path twin of the\n * `mask` verb on a `bindKaleidoscope` binding: the mask edge is page-shared\n * state (one value every kaleidoscope pipeline on the page reads), so a write\n * here reaches every active pipeline on the next frame with no rebuild.\n * Values clamp to the `mask` verb's ranges (hardness 0..1, threshold\n * 0.05..0.95).\n *\n * Module-level rather than per-instance because that is the true scope today;\n * a per-pipeline mask would be a different (future) API, not this one.\n */\nexport const setMaskTuning = (mask: MaskInput): void => {\n tuning.setMaskHardness(mask.hardness);\n tuning.setMaskThreshold(mask.threshold);\n};\n\n/**\n * Derive a smoothstep (lo, hi) range from a hardness factor in [0, 1] and\n * a threshold in [0.05, 0.95]. Matches `MaskTuning.smoothstepRange` on the\n * Android side; keep in sync.\n *\n * hardness controls width: 0 = soft halo (wide transition), 1 = near-step.\n * threshold controls the center: 0.5 = neutral, higher = reject low-\n * confidence pixels (rejects chair-edge regions), lower = more inclusive.\n */\nexport const maskSmoothstepRange = (\n hardness: number,\n threshold: number,\n): readonly [number, number] => {\n const clampedHardness = clamp(hardness, 0, 1);\n const clampedThreshold = clamp(threshold, 0.05, 0.95);\n const width = 0.6 * (1 - clampedHardness) + 0.02;\n return [clampedThreshold - width * 0.5, clampedThreshold + width * 0.5] as const;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-webrtc-kaleidoscope",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.10",
|
|
4
4
|
"description": "Live video effects (blur, background replacement, generative backgrounds, flip/rotate) for react-native-webrtc, packaged as a managed-Expo-friendly Expo Module. Working on web, Android, and iOS. Active development.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -634,31 +634,31 @@
|
|
|
634
634
|
"@mediapipe/selfie_segmentation": "^0.1.1675465747"
|
|
635
635
|
},
|
|
636
636
|
"devDependencies": {
|
|
637
|
-
"@biomejs/biome": "^2.
|
|
638
|
-
"@expo/config-plugins": "~56.0.
|
|
639
|
-
"@react-native-async-storage/async-storage": "1.
|
|
640
|
-
"@react-native-community/slider": "5.2.
|
|
641
|
-
"@semantic-release/changelog": "^
|
|
642
|
-
"@semantic-release/git": "^
|
|
637
|
+
"@biomejs/biome": "^2.5.14",
|
|
638
|
+
"@expo/config-plugins": "~56.0.16",
|
|
639
|
+
"@react-native-async-storage/async-storage": "1.24.0",
|
|
640
|
+
"@react-native-community/slider": "5.2.1",
|
|
641
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
642
|
+
"@semantic-release/git": "^11.0.1",
|
|
643
643
|
"@semantic-release/npm": "^13.1.5",
|
|
644
|
-
"@types/bun": "^1.
|
|
644
|
+
"@types/bun": "^1.4.2",
|
|
645
645
|
"@types/react": "~18.2.79",
|
|
646
|
-
"@typescript-eslint/parser": "^8.
|
|
646
|
+
"@typescript-eslint/parser": "^8.70.0",
|
|
647
647
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
648
|
-
"eslint": "^10.
|
|
648
|
+
"eslint": "^10.11.0",
|
|
649
649
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
650
|
-
"expo": "^51.0.
|
|
651
|
-
"expo-modules-core": "^56.0.
|
|
652
|
-
"knip": "^6.
|
|
653
|
-
"lefthook": "^2.1.
|
|
654
|
-
"livekit-client": "^2.
|
|
650
|
+
"expo": "^51.0.39",
|
|
651
|
+
"expo-modules-core": "^56.0.26",
|
|
652
|
+
"knip": "^6.37.0",
|
|
653
|
+
"lefthook": "^2.1.14",
|
|
654
|
+
"livekit-client": "^2.22.3",
|
|
655
655
|
"nativewind": "4.2.x",
|
|
656
|
-
"playwright": "1.
|
|
657
|
-
"publint": "^0.3.
|
|
656
|
+
"playwright": "1.63.0",
|
|
657
|
+
"publint": "^0.3.24",
|
|
658
658
|
"react": "18.2.0",
|
|
659
659
|
"react-native": "0.74.5",
|
|
660
|
-
"react-native-webrtc": "^124.0.
|
|
661
|
-
"semantic-release": "^25.0.
|
|
660
|
+
"react-native-webrtc": "^124.0.8",
|
|
661
|
+
"semantic-release": "^25.0.9",
|
|
662
662
|
"typescript": "^6.0.3"
|
|
663
663
|
},
|
|
664
664
|
"publishConfig": {
|