@vincentt-xr/sdk 2.0.0-alpha.7 → 2.0.0-alpha.9
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/GROUNDING.md +5651 -82
- package/README.md +1 -0
- package/dist/CanonicalHeadFrame-BHcWyaiK.js +1506 -0
- package/dist/CanonicalHeadFrame-D-_T1OMU.cjs +1 -0
- package/dist/DebuggerUI-7ngnJsBe.js +275 -0
- package/dist/DebuggerUI-CoglgKdO.cjs +1 -0
- package/dist/FaceRetouch-CLoTfrcs.js +1071 -0
- package/dist/FaceRetouch-J1lC1WbS.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SegmentationOverlay-D_FWkcyP.cjs +35 -0
- package/dist/SegmentationOverlay-vn5x_knv.js +6237 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +69 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +23 -0
- package/dist/components/BodyTracker/index.d.ts +17 -0
- package/dist/components/BodyTrigger/index.d.ts +49 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +37 -5
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +21 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +2 -2
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandOccluder.d.ts +55 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +101 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +69 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +10 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +64 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LipEffect/LipEffect.d.ts +27 -1
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +95 -7
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +46 -4
- package/dist/components/LipEffect/index.d.ts +11 -3
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +128 -9
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +50 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +1 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +6 -0
- package/dist/components/ScreenImage/types.d.ts +18 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/ShoulderOccluder/index.d.ts +43 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +24 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +11 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-BH7PdKFS.cjs +1 -0
- package/dist/contexts-jak8-tND.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +18 -3
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +1 -1
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +1 -1
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2695 -2547
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +20 -2
- package/dist/entries/face-effects.d.ts +123 -9
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +2 -1
- package/dist/entries/low-level.d.ts +49 -3
- package/dist/entries/particles.d.ts +11 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +60 -2
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2324 -1
- package/dist/face-effects.js +14208 -2268
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-B1otSDMX.cjs +1 -0
- package/dist/getFaceInfo-Cu4xDWiL.js +62 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +178 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/selectors.d.ts +76 -1
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +32 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +6 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +7 -0
- package/dist/hooks/useXRSession/facade.d.ts +42 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +3 -1
- package/dist/hooks/useXRSession/registry.d.ts +14 -0
- package/dist/hooks/useXRSession/store.d.ts +52 -3
- package/dist/index-B1_TzJaI.js +1104 -0
- package/dist/index-BavF06C6.js +190 -0
- package/dist/index-BfFmpddl.cjs +21 -0
- package/dist/index-BuBzneeW.cjs +46 -0
- package/dist/index-CGsQWodV.cjs +1 -0
- package/dist/index-CIe7eCMH.js +3200 -0
- package/dist/index-CfSF8LXa.cjs +1 -0
- package/dist/index-D5GTzOzD.cjs +1 -0
- package/dist/index-DBhQzvVa.js +314 -0
- package/dist/index-DE17y0ZI.cjs +1 -0
- package/dist/index-JII7huPk.js +442 -0
- package/dist/index-tpCr9CLj.cjs +1 -0
- package/dist/index-w1S7fI2B.js +1432 -0
- package/dist/index-zGaqrz_K.js +188 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1507 -0
- package/dist/{internal-Dmk1cTXq.js → internal-B90P-clC.js} +138 -119
- package/dist/internal-Cjinca64.cjs +1 -0
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +15 -10
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-BFDyBnKM.js +224 -0
- package/dist/landmarkMask-u7es2k4X.cjs +1 -0
- package/dist/landmarks-BlUqf5MZ.cjs +1 -0
- package/dist/landmarks-bftdwq6Z.js +76 -0
- package/dist/loaders-BGAUACsd.js +363 -0
- package/dist/loaders-BJ1_QCHt.cjs +1 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1190 -675
- package/dist/main.cjs +1 -1
- package/dist/main.js +1190 -452
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +3 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +2 -0
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +60 -0
- package/dist/particles/system.d.ts +64 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +774 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-C8rE26Uf.js +366 -0
- package/dist/providers-DHsrhDI2.cjs +62 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-KZk6eRiY.js → renderGroups-B38pUaX2.js} +1 -1
- package/dist/{renderGroups-80H3DpTl.cjs → renderGroups-Cb_4Ar1Q.cjs} +1 -1
- package/dist/renderPasses-B6l8IpJv.js +1290 -0
- package/dist/renderPasses-dqmkft4P.cjs +158 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/segmentation-Cb3ouK6Z.js +1758 -0
- package/dist/segmentation-D9pYO6aR.cjs +1 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/select-Ck5LGz-J.cjs +1 -0
- package/dist/select-pYRo_win.js +233 -0
- package/dist/selectors-C4X71aoD.cjs +1 -0
- package/dist/selectors-DmNaKIwE.js +196 -0
- package/dist/session-BrH8G7iJ.cjs +31 -0
- package/dist/session-DgA_z6O1.js +418 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +62 -0
- package/dist/subjects/types.d.ts +55 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1326 -506
- package/dist/trigger-D0Pm9noT.cjs +49 -0
- package/dist/trigger-IQeys0oS.js +2128 -0
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +20 -1
- package/dist/types/hand-tracking.d.ts +9 -0
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +47 -3
- package/dist/types/segmentation.d.ts +24 -0
- package/dist/types/session.d.ts +41 -3
- package/dist/updateThrottle-BseecYag.js +4 -0
- package/dist/updateThrottle-Of5Y4SVa.cjs +1 -0
- package/dist/useFaceInfo-BHDNCvsJ.cjs +1 -0
- package/dist/useFaceInfo-J4x7LsqL.js +76 -0
- package/dist/useFaceResultReader-BvEo5REG.js +61 -0
- package/dist/useFaceResultReader-DuaL1KJG.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-Cr3RzuAW.cjs +1 -0
- package/dist/useXRCapabilities-Cxmlmpbd.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-ByoNj0QP.js → uv-DJU_XfmN.js} +15 -247
- package/docs/SDK_DOCUMENTATION.md +1 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/body-instructions.mdx +285 -0
- package/docs/api/body-triggers.mdx +234 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +17 -11
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +8 -9
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +209 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +535 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/multi-subject.mdx +98 -0
- package/docs/api/particles.mdx +155 -0
- package/docs/api/person-cutout.mdx +136 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/screen-space-coordinates.mdx +4 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/trackers.mdx +5 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +51 -1
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +4 -4
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/introduction.mdx +1 -2
- package/package.json +23 -1
- package/dist/DebuggerUI-B6bP6P9r.cjs +0 -1
- package/dist/DebuggerUI-BjOMr8q_.js +0 -269
- package/dist/FaceMeshRenderer-C5l6VLdO.cjs +0 -155
- package/dist/FaceMeshRenderer-wjAHrJzP.js +0 -1270
- package/dist/FaceRetouch-BkJzoA79.cjs +0 -134
- package/dist/FaceRetouch-DwbKQJAN.js +0 -551
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-ByhzppYl.js +0 -663
- package/dist/contexts-Dr62It_K.cjs +0 -1
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/getFaceInfo-C4QpCQIY.js +0 -118
- package/dist/getFaceInfo-fA1bFBub.cjs +0 -1
- package/dist/index-9dlAQAhy.js +0 -1462
- package/dist/index-BjmTe9eM.cjs +0 -1
- package/dist/index-BpEf2BBb.cjs +0 -1
- package/dist/index-CyUUurQT.cjs +0 -1
- package/dist/index-DCiMbxC3.cjs +0 -1
- package/dist/index-DXT3WccE.js +0 -2089
- package/dist/index-DpI-qo5X.cjs +0 -17
- package/dist/index-DyVF4vEW.js +0 -111
- package/dist/index-VJ0SJwmG.js +0 -214
- package/dist/internal-Cq-TEQ5Y.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-BOoBSr8z.cjs +0 -21
- package/dist/renderPasses-BcquyVtu.js +0 -1500
- package/dist/selectors-B8H97CKA.js +0 -59
- package/dist/selectors-CZLKT2Iv.cjs +0 -1
- package/dist/session-CpkiK5YA.cjs +0 -31
- package/dist/session-DLFN_VII.js +0 -363
- package/dist/useFaceInfo-BJ8-_MOs.cjs +0 -1
- package/dist/useFaceInfo-Dk426LTu.js +0 -62
- package/dist/useFaceResults-CtetsO9M.js +0 -19
- package/dist/useFaceResults-wBJF3zyp.cjs +0 -1
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { FaceLandmarkerResult } from '@mediapipe/tasks-vision';
|
|
2
|
+
import { FaceImageDetection, FacePhotoPick, FacePhotoWarning } from './facePhoto';
|
|
3
|
+
/** Most faces one still image reports (MediaPipe finds at most this many in a group photo). */
|
|
4
|
+
export declare const FACE_IMAGE_MAX_FACES = 4;
|
|
5
|
+
/** The still-image detector closes this long after its last use, freeing its WASM heap. */
|
|
6
|
+
export declare const FACE_IMAGE_LANDMARKER_IDLE_MS = 30000;
|
|
7
|
+
/** An image `detectFaceImage` reads, already decoded and upright. */
|
|
8
|
+
export type FaceImageSource = HTMLCanvasElement | OffscreenCanvas | HTMLImageElement | ImageBitmap;
|
|
9
|
+
/** MediaPipe's result → plain detections, in MediaPipe's order. */
|
|
10
|
+
export declare const toFaceImageDetections: (result: FaceLandmarkerResult) => FaceImageDetection[];
|
|
11
|
+
/**
|
|
12
|
+
* Closes the still-image detector now (it starts again on the next photo).
|
|
13
|
+
* A detection still waiting for it rejects with `aborted`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const disposeFaceImageLandmarker: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* The `numFaces` largest (widest) faces (a whole number from 1 to
|
|
18
|
+
* `FACE_IMAGE_MAX_FACES`; anything else, NaN included, means the maximum),
|
|
19
|
+
* ordered left to right (`faceImageOrderLeftToRight`).
|
|
20
|
+
*/
|
|
21
|
+
export declare const limitFaceImageDetections: (detections: ReadonlyArray<FaceImageDetection>, numFaces?: number) => FaceImageDetection[];
|
|
22
|
+
/**
|
|
23
|
+
* Every face in a still image: the `numFaces` largest (default and maximum
|
|
24
|
+
* `FACE_IMAGE_MAX_FACES`), ordered left to right as the image is stored
|
|
25
|
+
* (box centre x; 0 = leftmost); `[]` when there is none.
|
|
26
|
+
* The image must be decoded and upright (`loadFacePhoto` does both).
|
|
27
|
+
* Rejects with a `FaceTextureLoadError`: `model` (the detector could not
|
|
28
|
+
* start), `cors` (a cross-origin image taints the read) or `aborted`.
|
|
29
|
+
*/
|
|
30
|
+
export declare const detectFaceImage: (image: FaceImageSource, options?: {
|
|
31
|
+
numFaces?: number;
|
|
32
|
+
signal?: AbortSignal;
|
|
33
|
+
}) => Promise<FaceImageDetection[]>;
|
|
34
|
+
/** A photo: a URL, a File or Blob, or an image that is already decoded. */
|
|
35
|
+
export type FacePhotoSource = string | Blob | HTMLImageElement | HTMLCanvasElement | OffscreenCanvas | ImageBitmap;
|
|
36
|
+
/** The one canvas a photo is analysed and baked from. */
|
|
37
|
+
export type FacePhotoCanvas = HTMLCanvasElement | OffscreenCanvas;
|
|
38
|
+
/**
|
|
39
|
+
* Decodes a photo (fetching a URL; EXIF orientation applied) and draws it
|
|
40
|
+
* upright into one new canvas whose longest side is at most `maxSize`
|
|
41
|
+
* (default `FACE_PHOTO_MAX_SIZE`, never upscaled). The same canvas feeds the
|
|
42
|
+
* detector and the bake, so landmarks and pixels agree by construction. A
|
|
43
|
+
* URL or Blob is decoded straight at the canvas size where the browser can,
|
|
44
|
+
* so a large phone photo is never held at full resolution. The caller owns
|
|
45
|
+
* the canvas; nothing is stored. A bitmap decoded here is closed here; an
|
|
46
|
+
* image you pass in is left as it is.
|
|
47
|
+
*/
|
|
48
|
+
export declare const loadFacePhoto: (src: FacePhotoSource, options?: {
|
|
49
|
+
maxSize?: number;
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
}) => Promise<{
|
|
52
|
+
canvas: FacePhotoCanvas;
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
}>;
|
|
56
|
+
/** A photo, analysed: its canvas, the face in use, every face found and the warnings. */
|
|
57
|
+
export type FacePhotoDetection = {
|
|
58
|
+
/** The upright photo, at most `maxSize` on its longest side. Landmarks are in its space. */
|
|
59
|
+
canvas: FacePhotoCanvas;
|
|
60
|
+
width: number;
|
|
61
|
+
height: number;
|
|
62
|
+
/** The face in use: the largest, or the one `pick` named. */
|
|
63
|
+
detection: FaceImageDetection;
|
|
64
|
+
/** Its index in `detections`, so its place from the left (0 = leftmost). Not a live face index. */
|
|
65
|
+
pickedIndex: number;
|
|
66
|
+
/** Every face found, left to right (box centre x; 0 = leftmost). */
|
|
67
|
+
detections: FaceImageDetection[];
|
|
68
|
+
/** In `FACE_PHOTO_WARNINGS` order; empty for a good photo. */
|
|
69
|
+
warnings: FacePhotoWarning[];
|
|
70
|
+
/**
|
|
71
|
+
* The photo itself is mirrored (some phones save selfies mirrored), as the
|
|
72
|
+
* caller said: canonical +X (landmark 263) is then the person's own RIGHT.
|
|
73
|
+
* Pixels cannot tell (a face is near-symmetric and no metadata records it),
|
|
74
|
+
* so it is never detected and never a warning; the canvas is not flipped.
|
|
75
|
+
*/
|
|
76
|
+
mirrored: boolean;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* `loadFacePhoto` + `detectFaceImage` + the face to use + its warnings, the
|
|
80
|
+
* whole still-photo step of a photo face swap. `pick` (a `FaceTextureSource`'s
|
|
81
|
+
* `pick`) chooses the photo's face: `"largest"` (default) or the n-th from the
|
|
82
|
+
* left (0 = leftmost). It is not the live target face (`FaceSwap`'s
|
|
83
|
+
* `faceIndex`): never pass that here. Rejects with a `FaceTextureLoadError`:
|
|
84
|
+
* `noFace`, `decode`, `cors`, `model` or `aborted`.
|
|
85
|
+
*/
|
|
86
|
+
export declare const detectFacePhoto: (src: FacePhotoSource, options?: {
|
|
87
|
+
maxSize?: number;
|
|
88
|
+
/** Which face of the photo: `"largest"` (default) or n-th from the left (0 = leftmost). */
|
|
89
|
+
pick?: FacePhotoPick;
|
|
90
|
+
/** The photo is a mirrored selfie. Default false. */
|
|
91
|
+
mirrored?: boolean;
|
|
92
|
+
signal?: AbortSignal;
|
|
93
|
+
}) => Promise<FacePhotoDetection>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an external mesh's vertices find their place on the tracked face:
|
|
3
|
+
* - `"uv"` — by UV, for a mesh whose face UVs follow the canonical layout
|
|
4
|
+
* (exact, even where the shape differs);
|
|
5
|
+
* - `"surface"` — the closest point on the canonical face surface in 3D (any
|
|
6
|
+
* topology and UV layout);
|
|
7
|
+
* - `"auto"` (default) — UV where a vertex's UV lands on the canonical face
|
|
8
|
+
* AND agrees with its 3D position, the surface everywhere else.
|
|
9
|
+
*/
|
|
10
|
+
export type FaceMeshBindingMode = "auto" | "uv" | "surface";
|
|
11
|
+
export type FaceMeshBindingOptions = {
|
|
12
|
+
mode?: FaceMeshBindingMode;
|
|
13
|
+
/**
|
|
14
|
+
* How far from the canonical face surface a vertex still follows the face's
|
|
15
|
+
* expression, in centimetres: fully up to `inner`, fading to rigid at
|
|
16
|
+
* `outer` (the back of the head, the ears and the neck stay rigid). Default
|
|
17
|
+
* `[0.8, 2.5]`.
|
|
18
|
+
*/
|
|
19
|
+
falloff?: readonly [number, number];
|
|
20
|
+
/** UV binding is trusted only when it lands within this distance of the vertex (cm). Default 1.5. */
|
|
21
|
+
uvTolerance?: number;
|
|
22
|
+
};
|
|
23
|
+
/** Where each vertex of one mesh is bound. Arrays are per vertex. */
|
|
24
|
+
export type FaceMeshBinding = {
|
|
25
|
+
/** The canonical triangle (index into `CANONICAL_FACE_TRIANGLES / 3`), or -1 when unbound. */
|
|
26
|
+
triangle: Int32Array;
|
|
27
|
+
/** Barycentric weights of the three triangle corners (flat, 3 per vertex). */
|
|
28
|
+
weights: Float32Array;
|
|
29
|
+
/** How much the vertex follows the face's expression, 0 (rigid) … 1. */
|
|
30
|
+
influence: Float32Array;
|
|
31
|
+
/** Signed distance from the bound surface point, cm (+ = in front of the face). */
|
|
32
|
+
distance: Float32Array;
|
|
33
|
+
/** How it was bound: 0 none, 1 UV, 2 surface. */
|
|
34
|
+
source: Uint8Array;
|
|
35
|
+
/** For `"auto"` / `"uv"`: whether the model's UV v runs down (glTF) instead of up. */
|
|
36
|
+
uvFlipped: boolean;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Binds the vertices of one mesh to the canonical face surface. `positions`
|
|
40
|
+
* are the vertices in the canonical head frame (centimetres — the frame the
|
|
41
|
+
* model is authored in); `uvs` are its UVs (optional, for `"uv"` / `"auto"`).
|
|
42
|
+
* Pure; run once per mesh at load (≈ tens of milliseconds for a few thousand
|
|
43
|
+
* vertices).
|
|
44
|
+
*/
|
|
45
|
+
export declare const bindFaceMesh: (positions: ArrayLike<number>, uvs?: ArrayLike<number> | null, { mode, falloff, uvTolerance }?: FaceMeshBindingOptions) => FaceMeshBinding;
|
|
46
|
+
/**
|
|
47
|
+
* The expression offset at a bound point: the barycentric blend of the three
|
|
48
|
+
* corner landmarks' offsets (`residual`: flat per landmark, canonical cm — the
|
|
49
|
+
* live face minus the canonical rest, see `FaceRigState.residual`).
|
|
50
|
+
*/
|
|
51
|
+
export declare const sampleResidual: (binding: FaceMeshBinding, vertex: number, residual: ArrayLike<number>, out: [number, number, number]) => [number, number, number];
|
|
52
|
+
/**
|
|
53
|
+
* Deforms one mesh by the face's expression: `out = rest + influence ×
|
|
54
|
+
* residual at the bound point`, with the offset turned into the mesh's own
|
|
55
|
+
* frame by `toLocal` (a row-major 3×3, canonical cm → mesh units; identity
|
|
56
|
+
* when the mesh is authored directly in canonical cm). `amount` scales the
|
|
57
|
+
* whole expression (0 = rigid, 1 = the tracked face). Allocation-free; call it
|
|
58
|
+
* per frame.
|
|
59
|
+
*/
|
|
60
|
+
export declare const deformFaceMesh: (binding: FaceMeshBinding, rest: ArrayLike<number>, residual: ArrayLike<number>, out: Float32Array | number[], amount?: number, toLocal?: ArrayLike<number>) => number[] | Float32Array<ArrayBufferLike>;
|
|
61
|
+
/** Number of canonical face landmarks a residual array covers. */
|
|
62
|
+
export declare const FACE_RESIDUAL_LENGTH: number;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { FaceReprojectionBinding } from './faceReprojection';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Face morph (Snap-style "External Face Mesh" morph): the person's live face
|
|
5
|
+
* mesh morphs into another shape — a sphere, a cube, a character — wearing
|
|
6
|
+
* the person's camera face all the way. `weight` 0 is the live face itself;
|
|
7
|
+
* 1 is the shape, still moving with the expression.
|
|
8
|
+
*
|
|
9
|
+
* Every vertex of the shape is bound to a point of the (filled) canonical
|
|
10
|
+
* face through its BASE pose — where the vertex sits on a face. Per frame it
|
|
11
|
+
* blends between that point on the live face and its place on the shape.
|
|
12
|
+
*/
|
|
13
|
+
/** A built-in morph shape. */
|
|
14
|
+
export type FaceMorphShapeName = "sphere" | "cube";
|
|
15
|
+
/** A built-in shape's geometry plus its base pose (the same vertices on the canonical face). */
|
|
16
|
+
export type FaceMorphShape = {
|
|
17
|
+
/**
|
|
18
|
+
* Shape positions (canonical cm), `uv` in the canonical face layout, an
|
|
19
|
+
* RGBA `color` whose alpha fades the shape out at the edge of the face
|
|
20
|
+
* (render it with `vertexColors` + `transparent`), indexed.
|
|
21
|
+
*/
|
|
22
|
+
geometry: THREE.BufferGeometry;
|
|
23
|
+
/** The vertices on the canonical face (cm, flat): the base pose that binds them. */
|
|
24
|
+
base: Float32Array;
|
|
25
|
+
};
|
|
26
|
+
/** The filled canonical face, subdivided: canonical positions, UVs, edge feather (0 on the outer edge), triangles. */
|
|
27
|
+
export type SubdividedFace = {
|
|
28
|
+
positions: Float32Array;
|
|
29
|
+
uvs: Float32Array;
|
|
30
|
+
feather: Float32Array;
|
|
31
|
+
index: number[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* The filled canonical face subdivided `levels` times (cached: the arrays are
|
|
35
|
+
* shared, do not mutate them).
|
|
36
|
+
*/
|
|
37
|
+
export declare const subdivideFaceUnwrap: (levels: number) => SubdividedFace;
|
|
38
|
+
/**
|
|
39
|
+
* A built-in morph shape: the filled canonical face (eyes and mouth closed
|
|
40
|
+
* over), subdivided `subdivisions` times, pushed out onto a sphere or a cube
|
|
41
|
+
* around the head's centre. Its `uv` is the canonical face layout.
|
|
42
|
+
*/
|
|
43
|
+
export declare const createFaceMorphShape: (name: FaceMorphShapeName, { subdivisions, size }?: {
|
|
44
|
+
subdivisions?: number;
|
|
45
|
+
size?: number;
|
|
46
|
+
}) => FaceMorphShape;
|
|
47
|
+
/**
|
|
48
|
+
* The live face on the filled canonical face's vertices (the landmarks, then
|
|
49
|
+
* each opening's centre as its ring's average), in the head frame (cm):
|
|
50
|
+
* `point` — where each is now (the person's face with its expression,
|
|
51
|
+
* `FaceRigState.local`); `expression` — its expression offset
|
|
52
|
+
* (`FaceRigState.residual`).
|
|
53
|
+
*/
|
|
54
|
+
export declare const writeFaceMorphLive: (local: ArrayLike<number>, residual: ArrayLike<number>, point: Float32Array, expression: Float32Array) => void;
|
|
55
|
+
/** Allocates the live arrays `writeFaceMorphLive` fills. */
|
|
56
|
+
export declare const createFaceMorphLive: () => {
|
|
57
|
+
point: Float32Array<ArrayBuffer>;
|
|
58
|
+
expression: Float32Array<ArrayBuffer>;
|
|
59
|
+
};
|
|
60
|
+
export type FaceMorphStepOptions = {
|
|
61
|
+
/** 0 = the live face, 1 = the shape. */
|
|
62
|
+
weight: number;
|
|
63
|
+
/** Expression strength on the shape (0 = none, 1 = the face's, > 1 exaggerates). */
|
|
64
|
+
expression: number;
|
|
65
|
+
/** Scale of the shape around the head frame's origin. */
|
|
66
|
+
scale: number;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* One frame of a morphing mesh, in the canonical head frame: for each vertex,
|
|
70
|
+
* its shape position (`shape`, cm, flat) blended toward its bound point on
|
|
71
|
+
* the live face by `(1 − weight) · coverage`. The shape itself takes the
|
|
72
|
+
* expression (`expression × coverage`). `out` gets canonical cm, flat.
|
|
73
|
+
*/
|
|
74
|
+
export declare const stepFaceMorph: (binding: Pick<FaceReprojectionBinding, "triangle" | "weights" | "coverage">, shape: ArrayLike<number>, live: {
|
|
75
|
+
point: Float32Array;
|
|
76
|
+
expression: Float32Array;
|
|
77
|
+
}, { weight, expression, scale }: FaceMorphStepOptions, out: Float32Array) => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { FaceBlendshapeName } from '../face-info/blendshapes';
|
|
2
|
+
/**
|
|
3
|
+
* The expression channels a face rig publishes: MediaPipe's 51 face
|
|
4
|
+
* blendshapes (ARKit's names — `browDownLeft` … `noseSneerRight`; MediaPipe
|
|
5
|
+
* has no `tongueOut`), without `_neutral`. "Left" is
|
|
6
|
+
* the side of landmark 263, the person's own left in the image MediaPipe sees,
|
|
7
|
+
* the same side ARKit names `Left` (and a Face Cap model `_L`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const FACE_MORPH_NAMES: Exclude<FaceBlendshapeName, "_neutral">[];
|
|
10
|
+
export type FaceMorphName = (typeof FACE_MORPH_NAMES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* The expression channel a morph target drives, by its name, or -1. Accepts
|
|
13
|
+
* the ARKit names (`eyeBlinkLeft`), Face Cap / Blender style sides
|
|
14
|
+
* (`eyeBlink_L`, `eyeBlink.R`, `eyeBlink_left`), any case, and exporter
|
|
15
|
+
* prefixes (`blendShape1.eyeBlink_L`, `Head_mesh.jawOpen`).
|
|
16
|
+
*/
|
|
17
|
+
export declare const faceMorphChannel: (morphName: string) => number;
|
|
18
|
+
/**
|
|
19
|
+
* Which part of the face an expression channel moves. In `"hybrid"` driving,
|
|
20
|
+
* `eyes` and `brows` come from the model's own morph targets (the authored
|
|
21
|
+
* lids and brows), the rest from the tracked landmarks. (`tongue` is reserved
|
|
22
|
+
* for trackers that report it; MediaPipe does not.)
|
|
23
|
+
*/
|
|
24
|
+
export type FaceMorphRegion = "eyes" | "brows" | "mouth" | "tongue";
|
|
25
|
+
export declare const faceMorphRegion: (channel: number) => FaceMorphRegion;
|
|
26
|
+
/** The channels of the gaze (eyeball turn), per side. */
|
|
27
|
+
export declare const FACE_GAZE_CHANNELS: {
|
|
28
|
+
readonly left: {
|
|
29
|
+
readonly in: number;
|
|
30
|
+
readonly out: number;
|
|
31
|
+
readonly up: number;
|
|
32
|
+
readonly down: number;
|
|
33
|
+
};
|
|
34
|
+
readonly right: {
|
|
35
|
+
readonly in: number;
|
|
36
|
+
readonly out: number;
|
|
37
|
+
readonly up: number;
|
|
38
|
+
readonly down: number;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Per landmark, how much it belongs to a region (1 inside, fading to 0
|
|
43
|
+
* around it, canonical distances): `eyes` = the eyelids and the eye
|
|
44
|
+
* surroundings up to the brow, `brows` = the eyebrows.
|
|
45
|
+
*/
|
|
46
|
+
export declare const FACE_REGION_MASKS: Record<"eyes" | "brows", Float32Array>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { FaceImageLandmark } from './faceReprojection';
|
|
2
|
+
/** Longest side a photo is analysed and baked at, in pixels. */
|
|
3
|
+
export declare const FACE_PHOTO_MAX_SIZE = 1280;
|
|
4
|
+
/**
|
|
5
|
+
* The canvas size a `width` × `height` photo is drawn at: its longest side at
|
|
6
|
+
* most `maxSize`, the aspect kept, never upscaled. `scale` is canvas pixels per
|
|
7
|
+
* photo pixel (1 when the photo already fits).
|
|
8
|
+
*/
|
|
9
|
+
export declare const fitPhotoCanvasSize: (width: number, height: number, maxSize?: number) => {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
scale: number;
|
|
13
|
+
};
|
|
14
|
+
/** A face's landmark bounds in a still image, normalized (0..1, y down). */
|
|
15
|
+
export type FaceImageBox = {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
/** One face found in a still image by `detectFaceImage`. */
|
|
22
|
+
export type FaceImageDetection = {
|
|
23
|
+
/**
|
|
24
|
+
* The 478 points (468 mesh + 10 iris), as the live tracker reports them:
|
|
25
|
+
* normalized image x / y (0..1, y down), z in x units. MediaPipe's sides:
|
|
26
|
+
* landmark 263 is on the image's right for a face looking at the camera.
|
|
27
|
+
*/
|
|
28
|
+
landmarks: FaceImageLandmark[];
|
|
29
|
+
/** Blendshape scores (0..1) by MediaPipe name (`jawOpen`, `eyeBlinkLeft`, …). */
|
|
30
|
+
blendshapes: Record<string, number>;
|
|
31
|
+
/** The facial transformation matrix (canonical face → camera, column-major 4×4), or null. */
|
|
32
|
+
matrix: number[] | null;
|
|
33
|
+
/** The landmarks' bounds. */
|
|
34
|
+
box: FaceImageBox;
|
|
35
|
+
};
|
|
36
|
+
/** Bounds of a landmark set (normalized). Empty input gives a zero box at the centre. */
|
|
37
|
+
export declare const faceImageBox: (landmarks: ReadonlyArray<FaceImageLandmark>) => FaceImageBox;
|
|
38
|
+
/**
|
|
39
|
+
* Which face of a photo to use: `"largest"` (the widest), or a number that
|
|
40
|
+
* counts faces left to right in the image (0 = leftmost). Not the live target
|
|
41
|
+
* face: that is `FaceSwap`'s `faceIndex`.
|
|
42
|
+
*/
|
|
43
|
+
export type FacePhotoPick = "largest" | number;
|
|
44
|
+
/**
|
|
45
|
+
* Indices into `detections`, ordered left to right by box centre x as the
|
|
46
|
+
* image is stored (canvas x, upright; a mirrored selfie is not flipped). Ties
|
|
47
|
+
* keep their order.
|
|
48
|
+
*/
|
|
49
|
+
export declare const faceImageOrderLeftToRight: (detections: ReadonlyArray<FaceImageDetection>) => number[];
|
|
50
|
+
/**
|
|
51
|
+
* The face to use. `"largest"` (default) is the widest face, the same rule as
|
|
52
|
+
* the live multi-subject policy (`selectSubject`). A number counts faces left
|
|
53
|
+
* to right (`faceImageOrderLeftToRight`, 0 = leftmost), whatever order the
|
|
54
|
+
* detector reported them in, so a UI can label them. `index` is the picked
|
|
55
|
+
* face's index in `detections`. Null when there is no such face.
|
|
56
|
+
*/
|
|
57
|
+
export declare const pickFaceImageDetection: (detections: ReadonlyArray<FaceImageDetection>, pick?: FacePhotoPick) => {
|
|
58
|
+
detection: FaceImageDetection;
|
|
59
|
+
index: number;
|
|
60
|
+
} | null;
|
|
61
|
+
/**
|
|
62
|
+
* What can be wrong with a usable photo. Each one still bakes, but looks worse:
|
|
63
|
+
* - `turned`: the head is turned away (the far cheek is filled from the near one);
|
|
64
|
+
* - `eyesClosed`: an eye is closed (shows when the photo's eyes are used, `ownEyes` off);
|
|
65
|
+
* - `mouthOpen`: the mouth is open (the lips stretch over the user's mouth);
|
|
66
|
+
* - `small`: the face is small in the photo (the swapped face looks soft);
|
|
67
|
+
* - `severalFaces`: more than one face was found (the largest is used unless another is picked).
|
|
68
|
+
*/
|
|
69
|
+
export declare const FACE_PHOTO_WARNINGS: readonly ["turned", "eyesClosed", "mouthOpen", "small", "severalFaces"];
|
|
70
|
+
export type FacePhotoWarning = (typeof FACE_PHOTO_WARNINGS)[number];
|
|
71
|
+
/** Where each warning starts. */
|
|
72
|
+
export declare const FACE_PHOTO_WARNING_LIMITS: Readonly<{
|
|
73
|
+
/** `turned`: head yaw beyond this, in degrees. */
|
|
74
|
+
turnedDegrees: 25;
|
|
75
|
+
/** `eyesClosed`: `eyeBlinkLeft` or `eyeBlinkRight` above this. */
|
|
76
|
+
eyeBlink: 0.5;
|
|
77
|
+
/** `mouthOpen`: `jawOpen` above this. */
|
|
78
|
+
jawOpen: 0.3;
|
|
79
|
+
/** `small`: distance between the eye centres below this, in pixels of the analysed photo canvas. */
|
|
80
|
+
interocularPixels: 60;
|
|
81
|
+
}>;
|
|
82
|
+
/**
|
|
83
|
+
* How far the head is turned left or right, in degrees (0 = facing the
|
|
84
|
+
* camera, unsigned), from the facial transformation matrix (column-major,
|
|
85
|
+
* camera at the origin looking down −Z): the angle around the vertical between
|
|
86
|
+
* the face's forward axis (canonical +Z, the third column) and the ray from
|
|
87
|
+
* the face back to the camera (minus the translation). MediaPipe fits the pose
|
|
88
|
+
* through a perspective camera, so a face near the edge of a photo that looks
|
|
89
|
+
* into the lens is rotated by about its ray angle; against the ray it reads 0,
|
|
90
|
+
* and a face turned toward the centre reads its real turn. A matrix without
|
|
91
|
+
* depth (translation z = 0) is measured against the optical axis. Null
|
|
92
|
+
* without a matrix.
|
|
93
|
+
*/
|
|
94
|
+
export declare const faceImageYawDegrees: (matrix: ArrayLike<number> | null) => number | null;
|
|
95
|
+
/**
|
|
96
|
+
* Distance between the two eye centres in pixels of a `width` × `height`
|
|
97
|
+
* image: the iris centres (468, 473) when the 478-point model reported them,
|
|
98
|
+
* else the midpoints of each eye's corners; 0 when there are too few points.
|
|
99
|
+
*/
|
|
100
|
+
export declare const faceImageInterocularPixels: (landmarks: ReadonlyArray<FaceImageLandmark>, width: number, height: number) => number;
|
|
101
|
+
/**
|
|
102
|
+
* The warnings for `detection` (the face in use) among `detections` (every
|
|
103
|
+
* face found) in a `size.width` × `size.height` photo canvas, in
|
|
104
|
+
* `FACE_PHOTO_WARNINGS` order.
|
|
105
|
+
*/
|
|
106
|
+
export declare const resolveFacePhotoWarnings: (detection: FaceImageDetection, detections: ReadonlyArray<FaceImageDetection>, size: {
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
}) => FacePhotoWarning[];
|
|
110
|
+
/**
|
|
111
|
+
* Why a photo or painted face could not be made:
|
|
112
|
+
* - `noFace`: no face was found in the photo;
|
|
113
|
+
* - `decode`: the image could not be decoded;
|
|
114
|
+
* - `cors`: the URL could not be fetched (CORS, network or HTTP error);
|
|
115
|
+
* - `model`: the face model could not be loaded;
|
|
116
|
+
* - `aborted`: the load was cancelled (a newer source replaced it, or unmount).
|
|
117
|
+
*/
|
|
118
|
+
export declare const FACE_TEXTURE_ERROR_CODES: readonly ["noFace", "decode", "cors", "model", "aborted"];
|
|
119
|
+
export type FaceTextureErrorCode = (typeof FACE_TEXTURE_ERROR_CODES)[number];
|
|
120
|
+
export type FaceTextureError = {
|
|
121
|
+
code: FaceTextureErrorCode;
|
|
122
|
+
message: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* A thrown `FaceTextureError`: an `Error` with a `code`. Internal (SDK code
|
|
126
|
+
* only, not exported from a door): apps receive the plain `FaceTextureError`.
|
|
127
|
+
*/
|
|
128
|
+
export declare class FaceTextureLoadError extends Error implements FaceTextureError {
|
|
129
|
+
readonly code: FaceTextureErrorCode;
|
|
130
|
+
/** The underlying error, when there was one. */
|
|
131
|
+
readonly cause: unknown;
|
|
132
|
+
constructor(code: FaceTextureErrorCode, message: string, cause?: unknown);
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Any thrown value as a `FaceTextureError` (an `AbortError` → `aborted`;
|
|
136
|
+
* anything else unknown → `decode`). Internal, like `FaceTextureLoadError`.
|
|
137
|
+
*/
|
|
138
|
+
export declare const toFaceTextureError: (error: unknown) => FaceTextureError;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { FacePinOrient } from './facePin';
|
|
2
|
+
/**
|
|
3
|
+
* Named piercing spots on the live face (FACE-10). Left and right are the
|
|
4
|
+
* person's REAL left and right on every source: on a mirrored feed (the front
|
|
5
|
+
* webcam) the face mesh's own sides are swapped, so `resolveFacePiercing`
|
|
6
|
+
* takes the other side's placement there.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FACE_PIERCING_NAMES: readonly ["nose.left", "nose.right", "septum", "lip.centre", "lip.left", "lip.right", "brow.left", "brow.right"];
|
|
9
|
+
export type FacePiercingName = (typeof FACE_PIERCING_NAMES)[number];
|
|
10
|
+
/**
|
|
11
|
+
* The jewellery a spot is placed for:
|
|
12
|
+
* - `"stud"` — a stud sits on the skin at the hole, its face out of the skin;
|
|
13
|
+
* - `"ring"` — a hoop passes through the skin at the hole and hangs (a
|
|
14
|
+
* septum ring below the septum, a lip ring over the lip, a brow ring through
|
|
15
|
+
* the brow).
|
|
16
|
+
*/
|
|
17
|
+
export type FacePiercingKind = "stud" | "ring";
|
|
18
|
+
export declare const FACE_PIERCING_KINDS: readonly FacePiercingKind[];
|
|
19
|
+
/** Position (cm) and rotation (degrees, XYZ order) of the jewellery frame in the pin frame. */
|
|
20
|
+
export type FacePiercingOffset = {
|
|
21
|
+
position: readonly [number, number, number];
|
|
22
|
+
rotation: readonly [number, number, number];
|
|
23
|
+
};
|
|
24
|
+
/** Where one kind of jewellery sits on a spot. */
|
|
25
|
+
export type FacePiercingPlacement = {
|
|
26
|
+
/**
|
|
27
|
+
* The hole, in the canonical head frame (cm) as on an unmirrored source
|
|
28
|
+
* (+X = the person's left). It is bound to the face surface under it.
|
|
29
|
+
*/
|
|
30
|
+
at: readonly [number, number, number];
|
|
31
|
+
/** `"surface"`: the jewellery turns with the skin; `"head"`: with the head. */
|
|
32
|
+
orient: FacePinOrient;
|
|
33
|
+
/** The jewellery frame in the pin frame (see `FacePiercingPreset`). */
|
|
34
|
+
offset: FacePiercingOffset;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A named piercing spot. Jewellery for it is authored in the **piercing
|
|
38
|
+
* frame**, centimetres:
|
|
39
|
+
* - the origin is the hole, on the skin;
|
|
40
|
+
* - +Z is the piercing axis, out of the skin: a stud's face looks along +Z;
|
|
41
|
+
* - +Y is up;
|
|
42
|
+
* - a ring lies in the YZ plane, its wire passing through the origin, and
|
|
43
|
+
* hangs toward −Y (its centre at `(0, −r, 0)` for a centre-line radius `r`).
|
|
44
|
+
*
|
|
45
|
+
* The placement turns that frame so the stud faces out of the skin and the
|
|
46
|
+
* ring hangs the way the real piercing does.
|
|
47
|
+
*/
|
|
48
|
+
export type FacePiercingPreset = {
|
|
49
|
+
name: FacePiercingName;
|
|
50
|
+
/** Human label, e.g. `"nostril (left)"`. */
|
|
51
|
+
label: string;
|
|
52
|
+
region: "nose" | "lip" | "brow";
|
|
53
|
+
/** The person's real side, or `"centre"`. */
|
|
54
|
+
side: "left" | "right" | "centre";
|
|
55
|
+
/** The classic jewellery for the spot (`FacePiercing`'s default `kind`). */
|
|
56
|
+
kind: FacePiercingKind;
|
|
57
|
+
/** Typical sizes (cm): a stud's face diameter, a ring's inner diameter. */
|
|
58
|
+
size: {
|
|
59
|
+
stud: number;
|
|
60
|
+
ring: number;
|
|
61
|
+
};
|
|
62
|
+
stud: FacePiercingPlacement;
|
|
63
|
+
ring: FacePiercingPlacement;
|
|
64
|
+
};
|
|
65
|
+
/** The same placement on the other side of the face (canonical X mirrored). */
|
|
66
|
+
export declare const mirrorFacePiercingPlacement: (p: FacePiercingPlacement) => FacePiercingPlacement;
|
|
67
|
+
/**
|
|
68
|
+
* The piercing presets: where each spot sits on the canonical face and how
|
|
69
|
+
* its jewellery is turned. Sided entries are given as on an unmirrored source
|
|
70
|
+
* (`*.left` at +X); `resolveFacePiercing` swaps them on a mirrored feed.
|
|
71
|
+
*/
|
|
72
|
+
export declare const FACE_PIERCINGS: Readonly<Record<FacePiercingName, FacePiercingPreset>>;
|
|
73
|
+
/** A preset resolved for one feed: what a `PinToFaceMesh` needs. */
|
|
74
|
+
export type ResolvedFacePiercing = {
|
|
75
|
+
/** The requested spot. */
|
|
76
|
+
name: FacePiercingName;
|
|
77
|
+
kind: FacePiercingKind;
|
|
78
|
+
/** The exact point on the canonical face surface (the hole). */
|
|
79
|
+
anchor: {
|
|
80
|
+
triangle: number;
|
|
81
|
+
weights: readonly [number, number, number];
|
|
82
|
+
};
|
|
83
|
+
orient: FacePinOrient;
|
|
84
|
+
/** The jewellery frame in the pin frame: position (cm), rotation (degrees). */
|
|
85
|
+
offset: FacePiercingOffset;
|
|
86
|
+
/** The typical size for the kind (cm): a stud's face diameter or a ring's inner diameter. */
|
|
87
|
+
size: number;
|
|
88
|
+
/**
|
|
89
|
+
* `true` when the placement is the mirror image of the left-side authoring
|
|
90
|
+
* (it sits at canonical −X): mirror your own jewellery offsets with it
|
|
91
|
+
* (`mirrorFacePiercingOffset`) so one offset fits both sides.
|
|
92
|
+
*/
|
|
93
|
+
flip: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Resolves a piercing preset for a feed. `mirrored` is whether the feed is
|
|
97
|
+
* mirrored (the front webcam; `useXRMirrored()`): the face mesh's left is
|
|
98
|
+
* then the person's right, so a sided spot takes the other side's placement
|
|
99
|
+
* and stays on the person's real side. The anchor is the exact surface point
|
|
100
|
+
* under the preset's hole (cached). Throws on an unknown name.
|
|
101
|
+
*/
|
|
102
|
+
export declare const resolveFacePiercing: (name: FacePiercingName, { kind, mirrored }?: {
|
|
103
|
+
kind?: FacePiercingKind;
|
|
104
|
+
mirrored?: boolean;
|
|
105
|
+
}) => ResolvedFacePiercing;
|
|
106
|
+
/** A nudge in the piercing frame: `position` (cm), `rotation` (degrees, XYZ), `scale`. */
|
|
107
|
+
export type FacePiercingNudge = {
|
|
108
|
+
position?: readonly [number, number, number];
|
|
109
|
+
rotation?: readonly [number, number, number];
|
|
110
|
+
scale?: number;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Mirrors a piercing-frame offset across the face (X negated, the Y and Z
|
|
114
|
+
* rotations negated, scale kept): the same nudge on the other side.
|
|
115
|
+
*/
|
|
116
|
+
export declare const mirrorFacePiercingOffset: (offset: FacePiercingNudge) => FacePiercingNudge;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { FaceRigState } from './faceRig';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* The named anchors a pin accepts (the SDK's face targets). Left / right are
|
|
5
|
+
* the person's own side on every feed when resolved for the feed
|
|
6
|
+
* (`facePinAnchorForFeed`, which `PinToFaceMesh` applies).
|
|
7
|
+
*/
|
|
8
|
+
export declare const FACE_PIN_TARGETS: readonly string[];
|
|
9
|
+
/**
|
|
10
|
+
* The anchor to bind on this feed. A named target is the person's own side
|
|
11
|
+
* (`"face.leftCheek"` = their real left cheek); the canonical face's sides
|
|
12
|
+
* are MediaPipe's (its left at +X), which is the person's other side on a
|
|
13
|
+
* mirrored feed (the front webcam), so a sided name is swapped there.
|
|
14
|
+
* `{ landmark }`, `{ point }` and `{ triangle }` anchors are canonical-face
|
|
15
|
+
* positions and pass through.
|
|
16
|
+
*/
|
|
17
|
+
export declare const facePinAnchorForFeed: (anchor: FacePinAnchor, mirrored: boolean) => FacePinAnchor;
|
|
18
|
+
/**
|
|
19
|
+
* Where on the face a pin sits:
|
|
20
|
+
* - a face target name (`"face.noseTip"`, `"face.leftCheek"`, `"face.forehead"`
|
|
21
|
+
* … `FACE_PIN_TARGETS`; composites like `"face.leftEye"` project onto the skin;
|
|
22
|
+
* left / right = the person's own side once `facePinAnchorForFeed` resolves it,
|
|
23
|
+
* as `PinToFaceMesh` does);
|
|
24
|
+
* - `{ landmark }` — a MediaPipe face landmark index (0–467);
|
|
25
|
+
* - `{ point }` — a point in the canonical head frame (cm), bound to the face
|
|
26
|
+
* surface under it (any spot, e.g. picked in the `.blend`);
|
|
27
|
+
* - `{ triangle, weights }` — an exact surface point: a canonical face triangle
|
|
28
|
+
* (index into `CANONICAL_FACE_TRIANGLES / 3`) and barycentric weights.
|
|
29
|
+
*/
|
|
30
|
+
export type FacePinAnchor = string | {
|
|
31
|
+
landmark: number;
|
|
32
|
+
} | {
|
|
33
|
+
point: readonly [number, number, number];
|
|
34
|
+
} | {
|
|
35
|
+
triangle: number;
|
|
36
|
+
weights: readonly [number, number, number];
|
|
37
|
+
};
|
|
38
|
+
/** A pin bound to the canonical face surface (see `bindFacePin`). */
|
|
39
|
+
export type FacePinBinding = {
|
|
40
|
+
triangle: number;
|
|
41
|
+
weights: [number, number, number];
|
|
42
|
+
/**
|
|
43
|
+
* Where the anchor point sits relative to its surface point at rest, in the
|
|
44
|
+
* pin's own frame (cm; [0, 0, 0] for an anchor on the skin) — so a `point`
|
|
45
|
+
* anchor above the skin stays there as the skin turns.
|
|
46
|
+
*/
|
|
47
|
+
offset: [number, number, number];
|
|
48
|
+
/** Triangles around the anchor whose live normals are averaged for the orientation. */
|
|
49
|
+
patch: Int32Array;
|
|
50
|
+
};
|
|
51
|
+
/** How far around the anchor (cm) the orientation's surface normal is averaged. Default for `bindFacePin`. */
|
|
52
|
+
export declare const FACE_PIN_PATCH_RADIUS = 1.2;
|
|
53
|
+
/**
|
|
54
|
+
* Binds an anchor to the canonical face surface, once. Throws on an unknown
|
|
55
|
+
* target name or an out-of-range landmark / triangle.
|
|
56
|
+
*/
|
|
57
|
+
export declare const bindFacePin: (anchor: FacePinAnchor, { patchRadius }?: {
|
|
58
|
+
patchRadius?: number;
|
|
59
|
+
}) => FacePinBinding;
|
|
60
|
+
/** A piece of the canonical face surface: its landmarks and its triangles over them. */
|
|
61
|
+
export type FaceSurfacePatch = {
|
|
62
|
+
/** The landmark indices the patch uses, ascending. */
|
|
63
|
+
landmarks: Uint16Array;
|
|
64
|
+
/** Its triangles as indices into `landmarks` (flat, 3 per triangle). */
|
|
65
|
+
index: Uint16Array;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* The face triangles whose centres lie within `radius` cm (at rest) of a bound
|
|
69
|
+
* pin's point, or the whole face for `null`: the skin a `FaceSurfaceOccluder`
|
|
70
|
+
* draws. Pure.
|
|
71
|
+
*/
|
|
72
|
+
export declare const faceSurfacePatch: (around: {
|
|
73
|
+
triangle: number;
|
|
74
|
+
weights: readonly [number, number, number];
|
|
75
|
+
} | null, radius?: number) => FaceSurfacePatch;
|
|
76
|
+
/**
|
|
77
|
+
* Which face shape a pin follows:
|
|
78
|
+
* - `"face"` — the person's real face (their face shape + expression): for
|
|
79
|
+
* accessories on the camera face;
|
|
80
|
+
* - `"model"` — the canonical face + expression (the person's own shape
|
|
81
|
+
* removed), the surface an `ExternalFaceMesh` character wears.
|
|
82
|
+
*/
|
|
83
|
+
export type FacePinSurface = "face" | "model";
|
|
84
|
+
/**
|
|
85
|
+
* How a pin turns: `"surface"` follows the live skin under it (a sticker on a
|
|
86
|
+
* smiling cheek tilts with it), `"head"` keeps the head's orientation (only the
|
|
87
|
+
* position follows the surface).
|
|
88
|
+
*/
|
|
89
|
+
export type FacePinOrient = "surface" | "head";
|
|
90
|
+
/** A rig as a pin reads it; `view` / `local` (when given) correct a trailing pose. */
|
|
91
|
+
export type FacePinRig = Pick<FaceRigState, "residual" | "neutral"> & Partial<Pick<FaceRigState, "view" | "local">>;
|
|
92
|
+
type PinRig = FacePinRig;
|
|
93
|
+
/**
|
|
94
|
+
* The live position of landmark `i` in the head frame (canonical cm), on the
|
|
95
|
+
* chosen surface — the surface a pin rides (`extra`: a `FaceWarp3D` /
|
|
96
|
+
* `FaceMorph` surface's landmark offsets, or `null`). Allocation-free.
|
|
97
|
+
*/
|
|
98
|
+
export declare const liveFaceLandmark: (rig: PinRig, surface: FacePinSurface, extra: ArrayLike<number> | null, i: number, out: THREE.Vector3) => THREE.Vector3;
|
|
99
|
+
/**
|
|
100
|
+
* Where a pin is this frame, in the head frame (canonical cm — the `FaceRig`
|
|
101
|
+
* group's space): `position` on the live surface (plus the anchor's rest lift
|
|
102
|
+
* along the normal) and `quaternion` = the surface frame (X along the face
|
|
103
|
+
* toward +X, Y up, Z out of the skin), or the head's (identity) with
|
|
104
|
+
* `orient: "head"`. Allocation-free.
|
|
105
|
+
*/
|
|
106
|
+
export declare const stepFacePin: (binding: FacePinBinding, rig: PinRig, { surface, orient, offsets, }: {
|
|
107
|
+
surface?: FacePinSurface;
|
|
108
|
+
orient?: FacePinOrient;
|
|
109
|
+
/**
|
|
110
|
+
* Per-landmark displacements of the surface (canonical cm, flat, 468 × 3)
|
|
111
|
+
* — a `FaceWarp3D` / `FaceMorph` surface (`FaceSurfaceState.offsets`).
|
|
112
|
+
*/
|
|
113
|
+
offsets?: ArrayLike<number> | null;
|
|
114
|
+
} | undefined, out: {
|
|
115
|
+
position: THREE.Vector3;
|
|
116
|
+
quaternion: THREE.Quaternion;
|
|
117
|
+
}) => {
|
|
118
|
+
position: THREE.Vector3;
|
|
119
|
+
quaternion: THREE.Quaternion;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* How far along its rest surface normal (cm, + = out of the face) a pin must
|
|
123
|
+
* move to sit on `model` — a face model in the head frame (an
|
|
124
|
+
* `ExternalFaceMesh`'s scene) whose skin is not exactly the canonical surface.
|
|
125
|
+
* Casts from `reach` cm outside the face inward (then from inside outward;
|
|
126
|
+
* 8 cm by default, so a stylised head's bulging cheeks and brow are found);
|
|
127
|
+
* `headFrame` is the `FaceRig` group (the head frame in world space). `null`
|
|
128
|
+
* when the ray misses. Add the result to the binding's `offset[2]`.
|
|
129
|
+
*/
|
|
130
|
+
export declare const projectFacePinOnto: (binding: FacePinBinding, model: THREE.Object3D, headFrame: THREE.Object3D, reach?: number) => number | null;
|
|
131
|
+
export {};
|