@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,667 @@
|
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var we = (e, t, n) => t in e ? ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var z = (e, t, n) => we(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { jsx as D, jsxs as oe } from "react/jsx-runtime";
|
|
5
|
+
import { Canvas as ye, useThree as Se, useFrame as _e } from "@react-three/fiber";
|
|
6
|
+
import { useRef as K, useState as Re, useEffect as J, useMemo as ne, useContext as fe, createContext as ve } from "react";
|
|
7
|
+
import * as U from "three";
|
|
8
|
+
import { R as pe } from "./uv-DJU_XfmN.js";
|
|
9
|
+
import { d as Ee, f as Te, u as Me, a as Ae } from "./selectors-DmNaKIwE.js";
|
|
10
|
+
import { u as ue } from "./index-CIe7eCMH.js";
|
|
11
|
+
import { u as ke, S as Ce } from "./context-DTxSQvp4.js";
|
|
12
|
+
const xe = {
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
height: "100%",
|
|
17
|
+
background: "#363636",
|
|
18
|
+
color: "white",
|
|
19
|
+
fontFamily: "monospace"
|
|
20
|
+
}, Fe = () => /* @__PURE__ */ D("div", { style: xe, children: "Loading..." }), Ie = (e) => /* @__PURE__ */ D("div", { style: xe, children: e.error }), Le = (e, t, { sceneDepth: n = !1 } = {}) => {
|
|
21
|
+
const a = new U.WebGLRenderTarget(e, t, {
|
|
22
|
+
colorSpace: U.SRGBColorSpace,
|
|
23
|
+
depthBuffer: !0,
|
|
24
|
+
stencilBuffer: !0
|
|
25
|
+
});
|
|
26
|
+
return n && (a.depthTexture = new U.DepthTexture(e, t), a.depthTexture.format = U.DepthStencilFormat, a.depthTexture.type = U.UnsignedInt248Type), a;
|
|
27
|
+
}, Be = (e) => typeof e == "number" ? e : Array.isArray(e) ? e[1] : 3, ie = {
|
|
28
|
+
position: "absolute",
|
|
29
|
+
top: 0,
|
|
30
|
+
left: 0,
|
|
31
|
+
width: "100%",
|
|
32
|
+
height: "100%",
|
|
33
|
+
zIndex: 10
|
|
34
|
+
}, se = {
|
|
35
|
+
sceneColorTexture: null,
|
|
36
|
+
sceneDepthTexture: null
|
|
37
|
+
}, Ge = (e) => {
|
|
38
|
+
const t = Me(), a = Ae() ? (t == null ? void 0 : t.decision.tier.renderScale) ?? 1 : 1, r = typeof window < "u" && window.devicePixelRatio || 1;
|
|
39
|
+
return Math.max(0.5, Math.min(r, e) * a);
|
|
40
|
+
}, Xe = ({
|
|
41
|
+
onRenderOutputs: e,
|
|
42
|
+
renderOutputs: t,
|
|
43
|
+
size: n
|
|
44
|
+
}) => {
|
|
45
|
+
const { gl: a, scene: r, size: i } = Se(), { session: c } = ue(), o = Math.max(1, Math.round((n == null ? void 0 : n.width) ?? i.width)), d = Math.max(1, Math.round((n == null ? void 0 : n.height) ?? i.height)), f = !!(t.sceneColor || t.sceneDepth), s = ne(() => f ? Le(o, d, {
|
|
46
|
+
sceneDepth: !!t.sceneDepth
|
|
47
|
+
}) : null, [f, d, t.sceneDepth, o]);
|
|
48
|
+
return J(() => {
|
|
49
|
+
if (!s) {
|
|
50
|
+
e == null || e(se);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
return e == null || e({
|
|
54
|
+
sceneColorTexture: t.sceneColor ? s.texture : null,
|
|
55
|
+
sceneDepthTexture: t.sceneDepth && s.depthTexture ? s.depthTexture : null
|
|
56
|
+
}), () => {
|
|
57
|
+
var l;
|
|
58
|
+
s.dispose(), (l = s.depthTexture) == null || l.dispose(), e == null || e(se);
|
|
59
|
+
};
|
|
60
|
+
}, [e, t.sceneColor, t.sceneDepth, s]), _e(() => {
|
|
61
|
+
if (!s) return;
|
|
62
|
+
const l = [];
|
|
63
|
+
t.excludeScreenUI !== !1 && r.traverse((v) => {
|
|
64
|
+
v.visible && v.renderOrder >= pe.SCREEN_UI && (l.push(v), v.visible = !1);
|
|
65
|
+
});
|
|
66
|
+
const x = a.getRenderTarget(), g = a.xr.enabled;
|
|
67
|
+
a.xr.enabled = !1, a.setRenderTarget(s), a.clear(), c._renderFrame(), a.setRenderTarget(x), a.xr.enabled = g, l.forEach((v) => {
|
|
68
|
+
v.visible = !0;
|
|
69
|
+
});
|
|
70
|
+
}, -100), null;
|
|
71
|
+
}, ct = ({
|
|
72
|
+
style: e,
|
|
73
|
+
canvasProps: t,
|
|
74
|
+
children: n,
|
|
75
|
+
loadingComponent: a,
|
|
76
|
+
loadingTransitionDuration: r,
|
|
77
|
+
errorComponent: i,
|
|
78
|
+
renderTargetSize: c,
|
|
79
|
+
renderOutputs: o = {},
|
|
80
|
+
onRenderOutputs: d
|
|
81
|
+
}) => {
|
|
82
|
+
const f = K(null), s = K(null), l = K(null), x = K(!1), g = Ge(Be(t == null ? void 0 : t.dpr)), { session: v } = ue(), p = Ee(), h = Te(), [m, R] = Re(!0);
|
|
83
|
+
return J(() => {
|
|
84
|
+
if (c) {
|
|
85
|
+
v._setRenderSize(
|
|
86
|
+
Math.round(c.width),
|
|
87
|
+
Math.round(c.height)
|
|
88
|
+
);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const u = (E, k) => {
|
|
92
|
+
E <= 0 || k <= 0 || v._setRenderSize(Math.round(E), Math.round(k));
|
|
93
|
+
}, M = () => {
|
|
94
|
+
!s.current || x.current || (x.current = !0, v._setRenderTarget(s.current));
|
|
95
|
+
}, y = (E, k) => {
|
|
96
|
+
l.current !== null && cancelAnimationFrame(l.current), l.current = requestAnimationFrame(() => {
|
|
97
|
+
l.current = null, u(E, k);
|
|
98
|
+
});
|
|
99
|
+
}, S = new ResizeObserver((E) => {
|
|
100
|
+
const k = E[0];
|
|
101
|
+
if (!k) return;
|
|
102
|
+
const { width: I, height: B } = k.contentRect;
|
|
103
|
+
M(), y(I, B);
|
|
104
|
+
});
|
|
105
|
+
return f.current && S.observe(f.current), M(), () => {
|
|
106
|
+
S.disconnect(), l.current !== null && (cancelAnimationFrame(l.current), l.current = null), x.current = !1;
|
|
107
|
+
};
|
|
108
|
+
}, [c, v]), J(() => {
|
|
109
|
+
p && (r ? setTimeout(() => {
|
|
110
|
+
R(!1);
|
|
111
|
+
}, r) : R(!1));
|
|
112
|
+
}, [p, r]), /* @__PURE__ */ oe(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
id: "vincentt-xr-container",
|
|
116
|
+
ref: f,
|
|
117
|
+
style: {
|
|
118
|
+
width: "100%",
|
|
119
|
+
height: "100%",
|
|
120
|
+
...e,
|
|
121
|
+
position: "relative"
|
|
122
|
+
},
|
|
123
|
+
children: [
|
|
124
|
+
m && /* @__PURE__ */ D("div", { style: ie, children: a || /* @__PURE__ */ D(Fe, {}) }),
|
|
125
|
+
h && /* @__PURE__ */ D("div", { style: ie, children: i || /* @__PURE__ */ D(Ie, { error: h.message }) }),
|
|
126
|
+
/* @__PURE__ */ oe(
|
|
127
|
+
ye,
|
|
128
|
+
{
|
|
129
|
+
id: "vincentt-xr-canvas",
|
|
130
|
+
ref: s,
|
|
131
|
+
gl: {
|
|
132
|
+
alpha: !0,
|
|
133
|
+
// Keep the framebuffer transient by default so resize/layout changes
|
|
134
|
+
// do not leave an old frame hanging around. Apps that need capture
|
|
135
|
+
// can opt back in via `canvasProps.gl`.
|
|
136
|
+
preserveDrawingBuffer: !1,
|
|
137
|
+
antialias: !0,
|
|
138
|
+
// Face effects may use the shared stencil buffer to subtract
|
|
139
|
+
// canonical regions (for example, mouth interior from lips).
|
|
140
|
+
stencil: !0,
|
|
141
|
+
premultipliedAlpha: !1,
|
|
142
|
+
// Disable alpha premultiplication
|
|
143
|
+
toneMapping: U.NoToneMapping
|
|
144
|
+
// Disable tone mapping for accurate video colors
|
|
145
|
+
},
|
|
146
|
+
...t,
|
|
147
|
+
dpr: g,
|
|
148
|
+
onCreated: (u) => {
|
|
149
|
+
c ? v._setRenderSize(
|
|
150
|
+
Math.round(c.width),
|
|
151
|
+
Math.round(c.height)
|
|
152
|
+
) : v._setRenderTarget(s.current), v._setR3FState({
|
|
153
|
+
renderer: u.gl,
|
|
154
|
+
scene: u.scene,
|
|
155
|
+
camera: u.camera
|
|
156
|
+
}), u.gl.outputColorSpace = U.SRGBColorSpace, t != null && t.onCreated && t.onCreated(u);
|
|
157
|
+
},
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ D(
|
|
160
|
+
Xe,
|
|
161
|
+
{
|
|
162
|
+
onRenderOutputs: d,
|
|
163
|
+
renderOutputs: o,
|
|
164
|
+
size: c
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
n
|
|
168
|
+
]
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}, De = (e, t, n, a, r) => {
|
|
175
|
+
const i = e / 2, c = t / 2, o = n.left * i + a.left, d = n.right * i - a.right, f = n.bottom * c + a.bottom, s = n.top * c - a.top, l = d - o, x = s - f, g = (o + d) / 2, v = (f + s) / 2, p = r[0] * l / 2, h = r[1] * x / 2;
|
|
176
|
+
return { centerX: g, centerY: v, width: l, height: x, pivotX: p, pivotY: h };
|
|
177
|
+
}, Ue = { left: 0, right: 0, top: 0, bottom: 0 }, $e = { left: 0, right: 0, top: 0, bottom: 0 }, We = [0, 0], ht = ({
|
|
178
|
+
anchors: e,
|
|
179
|
+
offsets: t,
|
|
180
|
+
pivot: n = We,
|
|
181
|
+
children: a
|
|
182
|
+
}) => {
|
|
183
|
+
const { width: r, height: i } = ke(), c = ne(
|
|
184
|
+
() => ({
|
|
185
|
+
anchors: { ...Ue, ...e ?? {} },
|
|
186
|
+
offsets: { ...$e, ...t ?? {} }
|
|
187
|
+
}),
|
|
188
|
+
[e, t]
|
|
189
|
+
), o = ne(
|
|
190
|
+
() => De(r, i, c.anchors, c.offsets, n),
|
|
191
|
+
[r, i, c, n]
|
|
192
|
+
);
|
|
193
|
+
J(() => {
|
|
194
|
+
const l = c.anchors;
|
|
195
|
+
l.left > l.right && console.warn(
|
|
196
|
+
`[ScreenTransform] inverted X axis: anchors.left (${l.left}) > anchors.right (${l.right})`
|
|
197
|
+
), l.bottom > l.top && console.warn(
|
|
198
|
+
`[ScreenTransform] inverted Y axis: anchors.bottom (${l.bottom}) > anchors.top (${l.top})`
|
|
199
|
+
), o.width <= 0 && console.warn(
|
|
200
|
+
`[ScreenTransform] zero or negative width (${o.width.toFixed(3)}) — anchors + offsets collapse the X extent`
|
|
201
|
+
), o.height <= 0 && console.warn(
|
|
202
|
+
`[ScreenTransform] zero or negative height (${o.height.toFixed(3)}) — anchors + offsets collapse the Y extent`
|
|
203
|
+
);
|
|
204
|
+
}, [c, o.width, o.height]);
|
|
205
|
+
const d = n[0] !== 0 || n[1] !== 0, f = d ? [1, 1, 1] : [o.width, o.height, 1], s = !d && o.width > 0 && o.height > 0 ? o.width / o.height : null;
|
|
206
|
+
return /* @__PURE__ */ D(
|
|
207
|
+
"group",
|
|
208
|
+
{
|
|
209
|
+
position: [o.centerX - o.pivotX, o.centerY - o.pivotY, 0],
|
|
210
|
+
scale: f,
|
|
211
|
+
renderOrder: pe.SCREEN_UI,
|
|
212
|
+
children: /* @__PURE__ */ D(Ce.Provider, { value: s, children: a })
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
class Ne {
|
|
217
|
+
constructor(t, n) {
|
|
218
|
+
z(this, "capabilities");
|
|
219
|
+
z(this, "snapshot");
|
|
220
|
+
z(this, "listeners", /* @__PURE__ */ new Set());
|
|
221
|
+
z(this, "eventListeners", /* @__PURE__ */ new Map());
|
|
222
|
+
this.capabilities = t, this.snapshot = {
|
|
223
|
+
state: "idle",
|
|
224
|
+
frame: 0,
|
|
225
|
+
time: 0,
|
|
226
|
+
playMode: "forward",
|
|
227
|
+
loop: !0,
|
|
228
|
+
loopCount: 0,
|
|
229
|
+
...n
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
play() {
|
|
233
|
+
const t = this.snapshot.state === "paused";
|
|
234
|
+
this.update({ state: "playing" }), this.emit(t ? "Resume" : "PlayBegin");
|
|
235
|
+
}
|
|
236
|
+
pause() {
|
|
237
|
+
this.update({ state: "paused" }), this.emit("Pause");
|
|
238
|
+
}
|
|
239
|
+
restart() {
|
|
240
|
+
this.update({ state: "playing", frame: 0, time: 0 }), this.emit("PlayBegin");
|
|
241
|
+
}
|
|
242
|
+
setPlayMode(t) {
|
|
243
|
+
!this.capabilities.canReverse && (t === "reverse" || t === "ping-pong" || t === "random") || this.update({ playMode: t });
|
|
244
|
+
}
|
|
245
|
+
setLoop(t, n = 0) {
|
|
246
|
+
this.update({ loop: t, loopCount: n });
|
|
247
|
+
}
|
|
248
|
+
seek(t) {
|
|
249
|
+
this.capabilities.canSeek && this.update({ frame: Math.max(0, Math.floor(t)), time: Math.max(0, t) });
|
|
250
|
+
}
|
|
251
|
+
subscribe(t) {
|
|
252
|
+
return this.listeners.add(t), () => this.listeners.delete(t);
|
|
253
|
+
}
|
|
254
|
+
on(t, n) {
|
|
255
|
+
const a = this.eventListeners.get(t) ?? /* @__PURE__ */ new Set();
|
|
256
|
+
return a.add(n), this.eventListeners.set(t, a), () => this.off(t, n);
|
|
257
|
+
}
|
|
258
|
+
off(t, n) {
|
|
259
|
+
var a;
|
|
260
|
+
(a = this.eventListeners.get(t)) == null || a.delete(n);
|
|
261
|
+
}
|
|
262
|
+
getSnapshot() {
|
|
263
|
+
return this.snapshot;
|
|
264
|
+
}
|
|
265
|
+
dispose() {
|
|
266
|
+
this.listeners.clear(), this.eventListeners.clear(), this.snapshot = { ...this.snapshot, state: "idle" };
|
|
267
|
+
}
|
|
268
|
+
updateSnapshot(t) {
|
|
269
|
+
this.update(t);
|
|
270
|
+
}
|
|
271
|
+
emit(t) {
|
|
272
|
+
var n;
|
|
273
|
+
(n = this.eventListeners.get(t)) == null || n.forEach((a) => a({ type: t, snapshot: this.snapshot }));
|
|
274
|
+
}
|
|
275
|
+
update(t) {
|
|
276
|
+
this.snapshot = { ...this.snapshot, ...t }, this.listeners.forEach((n) => n(this.snapshot));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const Ye = (e, t, n, a, r) => {
|
|
280
|
+
const i = Math.max(1, Math.floor(t)), c = Math.max(0, Math.floor(e)), o = n === "ping-pong" && i > 1 ? i * 2 - 2 : i, d = Math.floor(c / o), f = r > 0 ? d >= r : !a && c >= o, s = f ? o - 1 : c % o;
|
|
281
|
+
return { frame: n === "reverse" ? i - 1 - s % i : n === "random" ? s * 7919 % i : n === "ping-pong" && s >= i ? o - s : s, ended: f, loop: d };
|
|
282
|
+
}, dt = (e, t, n) => {
|
|
283
|
+
const a = Math.max(1, Math.floor(n));
|
|
284
|
+
return Math.floor(Math.max(0, e) * Math.max(0, t)) % a;
|
|
285
|
+
};
|
|
286
|
+
var le = {}, me, He;
|
|
287
|
+
function Pe(e, t, n, i) {
|
|
288
|
+
var r = 0, i = i === void 0 ? {} : i, c = i.loop === void 0 ? null : i.loop, o = i.palette === void 0 ? null : i.palette;
|
|
289
|
+
if (t <= 0 || n <= 0 || t > 65535 || n > 65535)
|
|
290
|
+
throw new Error("Width/Height invalid.");
|
|
291
|
+
function d(h) {
|
|
292
|
+
var m = h.length;
|
|
293
|
+
if (m < 2 || m > 256 || m & m - 1)
|
|
294
|
+
throw new Error(
|
|
295
|
+
"Invalid code/color length, must be power of 2 and 2 .. 256."
|
|
296
|
+
);
|
|
297
|
+
return m;
|
|
298
|
+
}
|
|
299
|
+
e[r++] = 71, e[r++] = 73, e[r++] = 70, e[r++] = 56, e[r++] = 57, e[r++] = 97;
|
|
300
|
+
var f = 0, s = 0;
|
|
301
|
+
if (o !== null) {
|
|
302
|
+
for (var l = d(o); l >>= 1; ) ++f;
|
|
303
|
+
if (l = 1 << f, --f, i.background !== void 0) {
|
|
304
|
+
if (s = i.background, s >= l)
|
|
305
|
+
throw new Error("Background index out of range.");
|
|
306
|
+
if (s === 0)
|
|
307
|
+
throw new Error("Background index explicitly passed as 0.");
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (e[r++] = t & 255, e[r++] = t >> 8 & 255, e[r++] = n & 255, e[r++] = n >> 8 & 255, e[r++] = (o !== null ? 128 : 0) | // Global Color Table Flag.
|
|
311
|
+
f, e[r++] = s, e[r++] = 0, o !== null)
|
|
312
|
+
for (var x = 0, g = o.length; x < g; ++x) {
|
|
313
|
+
var v = o[x];
|
|
314
|
+
e[r++] = v >> 16 & 255, e[r++] = v >> 8 & 255, e[r++] = v & 255;
|
|
315
|
+
}
|
|
316
|
+
if (c !== null) {
|
|
317
|
+
if (c < 0 || c > 65535)
|
|
318
|
+
throw new Error("Loop count invalid.");
|
|
319
|
+
e[r++] = 33, e[r++] = 255, e[r++] = 11, e[r++] = 78, e[r++] = 69, e[r++] = 84, e[r++] = 83, e[r++] = 67, e[r++] = 65, e[r++] = 80, e[r++] = 69, e[r++] = 50, e[r++] = 46, e[r++] = 48, e[r++] = 3, e[r++] = 1, e[r++] = c & 255, e[r++] = c >> 8 & 255, e[r++] = 0;
|
|
320
|
+
}
|
|
321
|
+
var p = !1;
|
|
322
|
+
this.addFrame = function(h, m, R, u, M, y) {
|
|
323
|
+
if (p === !0 && (--r, p = !1), y = y === void 0 ? {} : y, h < 0 || m < 0 || h > 65535 || m > 65535)
|
|
324
|
+
throw new Error("x/y invalid.");
|
|
325
|
+
if (R <= 0 || u <= 0 || R > 65535 || u > 65535)
|
|
326
|
+
throw new Error("Width/Height invalid.");
|
|
327
|
+
if (M.length < R * u)
|
|
328
|
+
throw new Error("Not enough pixels for the frame size.");
|
|
329
|
+
var S = !0, E = y.palette;
|
|
330
|
+
if (E == null && (S = !1, E = o), E == null)
|
|
331
|
+
throw new Error("Must supply either a local or global palette.");
|
|
332
|
+
for (var k = d(E), I = 0; k >>= 1; ) ++I;
|
|
333
|
+
k = 1 << I;
|
|
334
|
+
var B = y.delay === void 0 ? 0 : y.delay, _ = y.disposal === void 0 ? 0 : y.disposal;
|
|
335
|
+
if (_ < 0 || _ > 3)
|
|
336
|
+
throw new Error("Disposal out of range.");
|
|
337
|
+
var T = !1, F = 0;
|
|
338
|
+
if (y.transparent !== void 0 && y.transparent !== null && (T = !0, F = y.transparent, F < 0 || F >= k))
|
|
339
|
+
throw new Error("Transparent color index.");
|
|
340
|
+
if ((_ !== 0 || T || B !== 0) && (e[r++] = 33, e[r++] = 249, e[r++] = 4, e[r++] = _ << 2 | (T === !0 ? 1 : 0), e[r++] = B & 255, e[r++] = B >> 8 & 255, e[r++] = F, e[r++] = 0), e[r++] = 44, e[r++] = h & 255, e[r++] = h >> 8 & 255, e[r++] = m & 255, e[r++] = m >> 8 & 255, e[r++] = R & 255, e[r++] = R >> 8 & 255, e[r++] = u & 255, e[r++] = u >> 8 & 255, e[r++] = S === !0 ? 128 | I - 1 : 0, S === !0)
|
|
341
|
+
for (var $ = 0, L = E.length; $ < L; ++$) {
|
|
342
|
+
var C = E[$];
|
|
343
|
+
e[r++] = C >> 16 & 255, e[r++] = C >> 8 & 255, e[r++] = C & 255;
|
|
344
|
+
}
|
|
345
|
+
return r = je(
|
|
346
|
+
e,
|
|
347
|
+
r,
|
|
348
|
+
I < 2 ? 2 : I,
|
|
349
|
+
M
|
|
350
|
+
), r;
|
|
351
|
+
}, this.end = function() {
|
|
352
|
+
return p === !1 && (e[r++] = 59, p = !0), r;
|
|
353
|
+
}, this.getOutputBuffer = function() {
|
|
354
|
+
return e;
|
|
355
|
+
}, this.setOutputBuffer = function(h) {
|
|
356
|
+
e = h;
|
|
357
|
+
}, this.getOutputBufferPosition = function() {
|
|
358
|
+
return r;
|
|
359
|
+
}, this.setOutputBufferPosition = function(h) {
|
|
360
|
+
r = h;
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function je(e, t, n, a) {
|
|
364
|
+
e[t++] = n;
|
|
365
|
+
var r = t++, i = 1 << n, c = i - 1, o = i + 1, d = o + 1, f = n + 1, s = 0, l = 0;
|
|
366
|
+
function x(y) {
|
|
367
|
+
for (; s >= y; )
|
|
368
|
+
e[t++] = l & 255, l >>= 8, s -= 8, t === r + 256 && (e[r] = 255, r = t++);
|
|
369
|
+
}
|
|
370
|
+
function g(y) {
|
|
371
|
+
l |= y << s, s += f, x(8);
|
|
372
|
+
}
|
|
373
|
+
var v = a[0] & c, p = {};
|
|
374
|
+
g(i);
|
|
375
|
+
for (var h = 1, m = a.length; h < m; ++h) {
|
|
376
|
+
var R = a[h] & c, u = v << 8 | R, M = p[u];
|
|
377
|
+
if (M === void 0) {
|
|
378
|
+
for (l |= v << s, s += f; s >= 8; )
|
|
379
|
+
e[t++] = l & 255, l >>= 8, s -= 8, t === r + 256 && (e[r] = 255, r = t++);
|
|
380
|
+
d === 4096 ? (g(i), d = o + 1, f = n + 1, p = {}) : (d >= 1 << f && ++f, p[u] = d++), v = R;
|
|
381
|
+
} else
|
|
382
|
+
v = M;
|
|
383
|
+
}
|
|
384
|
+
return g(v), g(o), x(1), r + 1 === t ? e[r] = 0 : (e[r] = t - r - 1, e[t++] = 0), t;
|
|
385
|
+
}
|
|
386
|
+
function Ve(e) {
|
|
387
|
+
var t = 0;
|
|
388
|
+
if (e[t++] !== 71 || e[t++] !== 73 || e[t++] !== 70 || e[t++] !== 56 || (e[t++] + 1 & 253) !== 56 || e[t++] !== 97)
|
|
389
|
+
throw new Error("Invalid GIF 87a/89a header.");
|
|
390
|
+
var n = e[t++] | e[t++] << 8, a = e[t++] | e[t++] << 8, r = e[t++], i = r >> 7, c = r & 7, o = 1 << c + 1;
|
|
391
|
+
e[t++], e[t++];
|
|
392
|
+
var d = null, f = null;
|
|
393
|
+
i && (d = t, f = o, t += o * 3);
|
|
394
|
+
var s = !0, l = [], x = 0, g = null, v = 0, p = null;
|
|
395
|
+
for (this.width = n, this.height = a; s && t < e.length; )
|
|
396
|
+
switch (e[t++]) {
|
|
397
|
+
case 33:
|
|
398
|
+
switch (e[t++]) {
|
|
399
|
+
case 255:
|
|
400
|
+
if (e[t] !== 11 || // 21 FF already read, check block size.
|
|
401
|
+
// NETSCAPE2.0
|
|
402
|
+
e[t + 1] == 78 && e[t + 2] == 69 && e[t + 3] == 84 && e[t + 4] == 83 && e[t + 5] == 67 && e[t + 6] == 65 && e[t + 7] == 80 && e[t + 8] == 69 && e[t + 9] == 50 && e[t + 10] == 46 && e[t + 11] == 48 && // Sub-block
|
|
403
|
+
e[t + 12] == 3 && e[t + 13] == 1 && e[t + 16] == 0)
|
|
404
|
+
t += 14, p = e[t++] | e[t++] << 8, t++;
|
|
405
|
+
else
|
|
406
|
+
for (t += 12; ; ) {
|
|
407
|
+
var h = e[t++];
|
|
408
|
+
if (!(h >= 0)) throw Error("Invalid block size");
|
|
409
|
+
if (h === 0) break;
|
|
410
|
+
t += h;
|
|
411
|
+
}
|
|
412
|
+
break;
|
|
413
|
+
case 249:
|
|
414
|
+
if (e[t++] !== 4 || e[t + 4] !== 0)
|
|
415
|
+
throw new Error("Invalid graphics extension block.");
|
|
416
|
+
var m = e[t++];
|
|
417
|
+
x = e[t++] | e[t++] << 8, g = e[t++], m & 1 || (g = null), v = m >> 2 & 7, t++;
|
|
418
|
+
break;
|
|
419
|
+
case 254:
|
|
420
|
+
for (; ; ) {
|
|
421
|
+
var h = e[t++];
|
|
422
|
+
if (!(h >= 0)) throw Error("Invalid block size");
|
|
423
|
+
if (h === 0) break;
|
|
424
|
+
t += h;
|
|
425
|
+
}
|
|
426
|
+
break;
|
|
427
|
+
default:
|
|
428
|
+
throw new Error(
|
|
429
|
+
"Unknown graphic control label: 0x" + e[t - 1].toString(16)
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
break;
|
|
433
|
+
case 44:
|
|
434
|
+
var R = e[t++] | e[t++] << 8, u = e[t++] | e[t++] << 8, M = e[t++] | e[t++] << 8, y = e[t++] | e[t++] << 8, S = e[t++], E = S >> 7, k = S >> 6 & 1, I = S & 7, B = 1 << I + 1, _ = d, T = f, F = !1;
|
|
435
|
+
if (E) {
|
|
436
|
+
var F = !0;
|
|
437
|
+
_ = t, T = B, t += B * 3;
|
|
438
|
+
}
|
|
439
|
+
var $ = t;
|
|
440
|
+
for (t++; ; ) {
|
|
441
|
+
var h = e[t++];
|
|
442
|
+
if (!(h >= 0)) throw Error("Invalid block size");
|
|
443
|
+
if (h === 0) break;
|
|
444
|
+
t += h;
|
|
445
|
+
}
|
|
446
|
+
l.push({
|
|
447
|
+
x: R,
|
|
448
|
+
y: u,
|
|
449
|
+
width: M,
|
|
450
|
+
height: y,
|
|
451
|
+
has_local_palette: F,
|
|
452
|
+
palette_offset: _,
|
|
453
|
+
palette_size: T,
|
|
454
|
+
data_offset: $,
|
|
455
|
+
data_length: t - $,
|
|
456
|
+
transparent_index: g,
|
|
457
|
+
interlaced: !!k,
|
|
458
|
+
delay: x,
|
|
459
|
+
disposal: v
|
|
460
|
+
});
|
|
461
|
+
break;
|
|
462
|
+
case 59:
|
|
463
|
+
s = !1;
|
|
464
|
+
break;
|
|
465
|
+
default:
|
|
466
|
+
throw new Error("Unknown gif block: 0x" + e[t - 1].toString(16));
|
|
467
|
+
}
|
|
468
|
+
this.numFrames = function() {
|
|
469
|
+
return l.length;
|
|
470
|
+
}, this.loopCount = function() {
|
|
471
|
+
return p;
|
|
472
|
+
}, this.frameInfo = function(L) {
|
|
473
|
+
if (L < 0 || L >= l.length)
|
|
474
|
+
throw new Error("Frame index out of range.");
|
|
475
|
+
return l[L];
|
|
476
|
+
}, this.decodeAndBlitFrameBGRA = function(L, C) {
|
|
477
|
+
var w = this.frameInfo(L), Q = w.width * w.height, W = new Uint8Array(Q);
|
|
478
|
+
ce(
|
|
479
|
+
e,
|
|
480
|
+
w.data_offset,
|
|
481
|
+
W,
|
|
482
|
+
Q
|
|
483
|
+
);
|
|
484
|
+
var N = w.palette_offset, Y = w.transparent_index;
|
|
485
|
+
Y === null && (Y = 256);
|
|
486
|
+
var G = w.width, H = n - G, P = G, Z = (w.y * n + w.x) * 4, O = ((w.y + w.height) * n + w.x) * 4, A = Z, j = H * 4;
|
|
487
|
+
w.interlaced === !0 && (j += n * 4 * 7);
|
|
488
|
+
for (var V = 8, q = 0, b = W.length; q < b; ++q) {
|
|
489
|
+
var X = W[q];
|
|
490
|
+
if (P === 0 && (A += j, P = G, A >= O && (j = H * 4 + n * 4 * (V - 1), A = Z + (G + H) * (V << 1), V >>= 1)), X === Y)
|
|
491
|
+
A += 4;
|
|
492
|
+
else {
|
|
493
|
+
var ee = e[N + X * 3], te = e[N + X * 3 + 1], re = e[N + X * 3 + 2];
|
|
494
|
+
C[A++] = re, C[A++] = te, C[A++] = ee, C[A++] = 255;
|
|
495
|
+
}
|
|
496
|
+
--P;
|
|
497
|
+
}
|
|
498
|
+
}, this.decodeAndBlitFrameRGBA = function(L, C) {
|
|
499
|
+
var w = this.frameInfo(L), Q = w.width * w.height, W = new Uint8Array(Q);
|
|
500
|
+
ce(
|
|
501
|
+
e,
|
|
502
|
+
w.data_offset,
|
|
503
|
+
W,
|
|
504
|
+
Q
|
|
505
|
+
);
|
|
506
|
+
var N = w.palette_offset, Y = w.transparent_index;
|
|
507
|
+
Y === null && (Y = 256);
|
|
508
|
+
var G = w.width, H = n - G, P = G, Z = (w.y * n + w.x) * 4, O = ((w.y + w.height) * n + w.x) * 4, A = Z, j = H * 4;
|
|
509
|
+
w.interlaced === !0 && (j += n * 4 * 7);
|
|
510
|
+
for (var V = 8, q = 0, b = W.length; q < b; ++q) {
|
|
511
|
+
var X = W[q];
|
|
512
|
+
if (P === 0 && (A += j, P = G, A >= O && (j = H * 4 + n * 4 * (V - 1), A = Z + (G + H) * (V << 1), V >>= 1)), X === Y)
|
|
513
|
+
A += 4;
|
|
514
|
+
else {
|
|
515
|
+
var ee = e[N + X * 3], te = e[N + X * 3 + 1], re = e[N + X * 3 + 2];
|
|
516
|
+
C[A++] = ee, C[A++] = te, C[A++] = re, C[A++] = 255;
|
|
517
|
+
}
|
|
518
|
+
--P;
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
function ce(e, t, n, a) {
|
|
523
|
+
for (var r = e[t++], i = 1 << r, c = i + 1, o = c + 1, d = r + 1, f = (1 << d) - 1, s = 0, l = 0, x = 0, g = e[t++], v = new Int32Array(4096), p = null; ; ) {
|
|
524
|
+
for (; s < 16 && g !== 0; )
|
|
525
|
+
l |= e[t++] << s, s += 8, g === 1 ? g = e[t++] : --g;
|
|
526
|
+
if (s < d)
|
|
527
|
+
break;
|
|
528
|
+
var h = l & f;
|
|
529
|
+
if (l >>= d, s -= d, h === i) {
|
|
530
|
+
o = c + 1, d = r + 1, f = (1 << d) - 1, p = null;
|
|
531
|
+
continue;
|
|
532
|
+
} else if (h === c)
|
|
533
|
+
break;
|
|
534
|
+
for (var m = h < o ? h : p, R = 0, u = m; u > i; )
|
|
535
|
+
u = v[u] >> 8, ++R;
|
|
536
|
+
var M = u, y = x + R + (m !== h ? 1 : 0);
|
|
537
|
+
if (y > a) {
|
|
538
|
+
console.log("Warning, gif stream longer than expected.");
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
n[x++] = M, x += R;
|
|
542
|
+
var S = x;
|
|
543
|
+
for (m !== h && (n[x++] = M), u = m; R--; )
|
|
544
|
+
u = v[u], n[--S] = u & 255, u >>= 8;
|
|
545
|
+
p !== null && o < 4096 && (v[o++] = p << 8 | M, o >= f + 1 && d < 12 && (++d, f = f << 1 | 1)), p = h;
|
|
546
|
+
}
|
|
547
|
+
return x !== a && console.log("Warning, gif stream shorter than expected."), n;
|
|
548
|
+
}
|
|
549
|
+
try {
|
|
550
|
+
He = le.GifWriter = Pe, me = le.GifReader = Ve;
|
|
551
|
+
} catch {
|
|
552
|
+
}
|
|
553
|
+
const qe = me;
|
|
554
|
+
function ft(e) {
|
|
555
|
+
return async (t, n) => {
|
|
556
|
+
const a = e.find((r) => r.canResolve(t));
|
|
557
|
+
if (!a) throw new ze("No texture provider matched source", t);
|
|
558
|
+
return Qe(a.resolve.bind(a), t, n);
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
class ze extends Error {
|
|
562
|
+
constructor(n, a) {
|
|
563
|
+
super(n);
|
|
564
|
+
z(this, "source");
|
|
565
|
+
this.name = "TextureSourceLoadError", this.source = a;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
function ae(e) {
|
|
569
|
+
if (e.aborted)
|
|
570
|
+
throw new DOMException("Texture source load aborted", "AbortError");
|
|
571
|
+
}
|
|
572
|
+
async function Qe(e, t, n) {
|
|
573
|
+
ae(n);
|
|
574
|
+
const a = await e(t, n);
|
|
575
|
+
return n.aborted && (a.dispose(), ae(n)), a;
|
|
576
|
+
}
|
|
577
|
+
function vt(e) {
|
|
578
|
+
e == null || e.dispose();
|
|
579
|
+
}
|
|
580
|
+
const Ze = 5 * 1024 * 1024, he = 1e6, de = 180, Ke = (e, t, n) => {
|
|
581
|
+
for (let a = n.y; a < n.y + n.height; a += 1)
|
|
582
|
+
e.fill(0, (a * t + n.x) * 4, (a * t + n.x + n.width) * 4);
|
|
583
|
+
}, Je = (e, t, n, a, r) => t.byteLength > Ze ? `file is ${(t.byteLength / 1024 / 1024).toFixed(1)} MB; max is 5 MB` : n * a > he ? `canvas is ${n}x${a}; max area is ${he}` : r > de ? `frame count is ${r}; max is ${de}` : r === 0 ? "frame count is 0" : e ? null : "source URL is empty", Oe = (e) => typeof e == "string" ? e : e.src, pt = {
|
|
584
|
+
canResolve: (e) => typeof e == "string" ? /\.gif(?:[?#].*)?$/i.test(e) : e.kind === "gif",
|
|
585
|
+
async resolve(e, t) {
|
|
586
|
+
const n = Oe(e), a = await fetch(n, { signal: t });
|
|
587
|
+
if (!a.ok) throw new Error(`GIF request failed with ${a.status}`);
|
|
588
|
+
const r = new Uint8Array(await a.arrayBuffer());
|
|
589
|
+
ae(t);
|
|
590
|
+
const i = new qe(r), c = i.numFrames(), o = Je(n, r, i.width, i.height, c);
|
|
591
|
+
if (o)
|
|
592
|
+
throw console.warn(`[xr-sdk] GIF ScreenImage source rejected: ${o}`, n), new Error(`GIF source rejected: ${o}`);
|
|
593
|
+
const d = document.createElement("canvas");
|
|
594
|
+
d.width = i.width, d.height = i.height;
|
|
595
|
+
const f = d.getContext("2d");
|
|
596
|
+
if (!f) throw new Error("Could not create GIF canvas context");
|
|
597
|
+
const s = new U.CanvasTexture(d);
|
|
598
|
+
s.colorSpace = U.SRGBColorSpace;
|
|
599
|
+
const l = new Uint8Array(i.width * i.height * 4), x = new ImageData(
|
|
600
|
+
new Uint8ClampedArray(l.buffer),
|
|
601
|
+
i.width,
|
|
602
|
+
i.height
|
|
603
|
+
), g = Array.from({ length: c }, (_, T) => i.frameInfo(T)), v = g.reduce((_, T) => _ + Math.max(20, T.delay * 10), 0) / 1e3, p = new Ne(
|
|
604
|
+
{ canSeek: !1, canReverse: !1, supportsLoopCount: !0 },
|
|
605
|
+
{ state: "ready", duration: v, frameCount: c }
|
|
606
|
+
);
|
|
607
|
+
let h = 0, m = 0, R = !1, u = !1, M = 0, y = 0, S = null;
|
|
608
|
+
const E = (_, T = !1) => {
|
|
609
|
+
T && (l.fill(0), S = null), (S == null ? void 0 : S.info.disposal) === 2 ? Ke(l, i.width, S.info) : S != null && S.restorePixels && l.set(S.restorePixels);
|
|
610
|
+
const F = g[_], $ = F.disposal === 3 ? new Uint8Array(l) : null;
|
|
611
|
+
return i.decodeAndBlitFrameRGBA(_, l), f.putImageData(x, 0, 0), s.needsUpdate = !0, S = { info: F, restorePixels: $ }, u = !0, p.updateSnapshot({
|
|
612
|
+
frame: _,
|
|
613
|
+
time: g.slice(0, _).reduce((L, C) => L + Math.max(20, C.delay * 10), 0) / 1e3
|
|
614
|
+
}), u = !1, p.emit("KeyFrameInSecond"), Math.max(20, F.delay * 10);
|
|
615
|
+
}, k = (_) => {
|
|
616
|
+
m = window.setTimeout(() => {
|
|
617
|
+
h = requestAnimationFrame(I);
|
|
618
|
+
}, _);
|
|
619
|
+
}, I = () => {
|
|
620
|
+
if (R || p.getSnapshot().state !== "playing") return;
|
|
621
|
+
const _ = p.getSnapshot(), T = Ye(
|
|
622
|
+
M,
|
|
623
|
+
c,
|
|
624
|
+
_.playMode,
|
|
625
|
+
_.loop,
|
|
626
|
+
_.loopCount
|
|
627
|
+
);
|
|
628
|
+
if (T.ended) {
|
|
629
|
+
p.updateSnapshot({ state: "ended", frame: T.frame, time: v }), p.emit("PlayEnd");
|
|
630
|
+
return;
|
|
631
|
+
}
|
|
632
|
+
const F = T.loop !== y;
|
|
633
|
+
y = T.loop, M += 1, k(E(T.frame, F));
|
|
634
|
+
}, B = p.subscribe((_) => {
|
|
635
|
+
u || (clearTimeout(m), cancelAnimationFrame(h), _.state === "playing" && (h = requestAnimationFrame(I)));
|
|
636
|
+
});
|
|
637
|
+
return E(0), p.play(), {
|
|
638
|
+
texture: s,
|
|
639
|
+
controller: p,
|
|
640
|
+
metadata: { width: i.width, height: i.height, duration: v, frameCount: c },
|
|
641
|
+
dispose() {
|
|
642
|
+
R = !0, B(), clearTimeout(m), cancelAnimationFrame(h), p.dispose(), s.dispose();
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
}, be = ve(null), et = ve(null), ut = () => fe(be), xt = () => fe(et);
|
|
647
|
+
export {
|
|
648
|
+
Ne as B,
|
|
649
|
+
Ze as M,
|
|
650
|
+
ht as S,
|
|
651
|
+
ze as T,
|
|
652
|
+
ct as X,
|
|
653
|
+
be as a,
|
|
654
|
+
et as b,
|
|
655
|
+
De as c,
|
|
656
|
+
xt as d,
|
|
657
|
+
dt as e,
|
|
658
|
+
pt as f,
|
|
659
|
+
Ye as g,
|
|
660
|
+
de as h,
|
|
661
|
+
he as i,
|
|
662
|
+
ft as j,
|
|
663
|
+
vt as k,
|
|
664
|
+
Qe as r,
|
|
665
|
+
ae as t,
|
|
666
|
+
ut as u
|
|
667
|
+
};
|