@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,1071 @@
|
|
|
1
|
+
import { F as v, a as q, b as B, c as N, d as J, e as d, f as R } from "./renderPasses-B6l8IpJv.js";
|
|
2
|
+
import * as S from "three";
|
|
3
|
+
import { jsx as _, jsxs as ge } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as M, useEffect as Q } from "react";
|
|
5
|
+
import { X as fe } from "./index-CIe7eCMH.js";
|
|
6
|
+
import { u as be } from "./landmarks-bftdwq6Z.js";
|
|
7
|
+
import { F as ve, r as Se, a as ye } from "./renderState-CJNmj5jz.js";
|
|
8
|
+
import { useThree as ke, useFrame as xe } from "@react-three/fiber";
|
|
9
|
+
import { c as Ee } from "./selectors-DmNaKIwE.js";
|
|
10
|
+
import { f as Me } from "./FaceSurface-DmP9AEeC.js";
|
|
11
|
+
import { c as Re, d as we } from "./landmarkMask-BFDyBnKM.js";
|
|
12
|
+
const ht = [
|
|
13
|
+
{ label: "Wireframe", value: v.wireframe },
|
|
14
|
+
{ label: "Basic", value: v.basic },
|
|
15
|
+
{ label: "Standard", value: v.standard },
|
|
16
|
+
{ label: "Physical", value: v.physical },
|
|
17
|
+
{ label: "Toon", value: v.toon },
|
|
18
|
+
{ label: "Normal", value: v.normal },
|
|
19
|
+
{ label: "Matcap", value: v.matcap },
|
|
20
|
+
{ label: "Shader", value: v.shader }
|
|
21
|
+
], gt = [
|
|
22
|
+
{ label: "Original Face", value: q.originalFace },
|
|
23
|
+
{ label: "Composite", value: q.composite }
|
|
24
|
+
], ft = [
|
|
25
|
+
{ label: "Front", value: B.front },
|
|
26
|
+
{ label: "Back", value: B.back },
|
|
27
|
+
{ label: "Double", value: B.double }
|
|
28
|
+
], bt = [
|
|
29
|
+
{ label: "None", value: N.none },
|
|
30
|
+
{ label: "UV Map 1", value: N.canonical },
|
|
31
|
+
{ label: "UV Map 2", value: N.style2 }
|
|
32
|
+
], vt = [
|
|
33
|
+
{ label: "None", value: J.none },
|
|
34
|
+
{ label: "Default Mask", value: J.canonical }
|
|
35
|
+
], St = [
|
|
36
|
+
{ label: "Solid", value: R.solid },
|
|
37
|
+
{ label: "Gradient", value: R.gradient },
|
|
38
|
+
{ label: "Image URL", value: R.imageUrl },
|
|
39
|
+
{ label: "Media URL", value: R.mediaUrl }
|
|
40
|
+
], yt = [
|
|
41
|
+
{ label: "Normal", value: d.normal },
|
|
42
|
+
{ label: "Add", value: d.add },
|
|
43
|
+
{ label: "Subtract", value: d.subtract },
|
|
44
|
+
{ label: "Multiply", value: d.multiply },
|
|
45
|
+
{ label: "Screen", value: d.screen },
|
|
46
|
+
{ label: "Overlay", value: d.overlay },
|
|
47
|
+
{ label: "Soft Light", value: d.softLight },
|
|
48
|
+
{ label: "Hard Light", value: d.hardLight },
|
|
49
|
+
{ label: "Lighten", value: d.lighten },
|
|
50
|
+
{ label: "Darken", value: d.darken },
|
|
51
|
+
{ label: "Difference", value: d.difference },
|
|
52
|
+
{ label: "Exclusion", value: d.exclusion }
|
|
53
|
+
], Ae = ["both", "left", "right"], Fe = ["shader", "image"], Ce = {
|
|
54
|
+
eye: "both",
|
|
55
|
+
mode: "shader",
|
|
56
|
+
color: "#4fa3ff",
|
|
57
|
+
textureUrl: "",
|
|
58
|
+
tintImage: !1,
|
|
59
|
+
scale: 1,
|
|
60
|
+
opacity: 0.85,
|
|
61
|
+
targetFps: 0,
|
|
62
|
+
smoothing: 0,
|
|
63
|
+
leadMs: 80,
|
|
64
|
+
mirrored: !1,
|
|
65
|
+
faceIndex: 0,
|
|
66
|
+
holdMs: 250
|
|
67
|
+
}, kt = [
|
|
68
|
+
{
|
|
69
|
+
key: "eye",
|
|
70
|
+
label: "Eye",
|
|
71
|
+
type: "select",
|
|
72
|
+
options: Ae.map((e) => ({ label: e, value: e }))
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: "mode",
|
|
76
|
+
label: "Material",
|
|
77
|
+
type: "select",
|
|
78
|
+
options: Fe.map((e) => ({ label: e, value: e }))
|
|
79
|
+
},
|
|
80
|
+
{ key: "color", label: "Color / tint", type: "color" },
|
|
81
|
+
{ key: "textureUrl", label: "Image URL (image mode)", type: "text" },
|
|
82
|
+
{ key: "tintImage", label: "Tint image with color", type: "boolean" },
|
|
83
|
+
{ key: "scale", label: "Scale (× iris radius)", type: "number", min: 0.2, max: 4, step: 0.05 },
|
|
84
|
+
{ key: "opacity", label: "Opacity", type: "number", min: 0, max: 1, step: 0.05 },
|
|
85
|
+
{ key: "targetFps", label: "Face FPS (0 = session)", type: "number", min: 0, max: 60, step: 1 },
|
|
86
|
+
{ key: "smoothing", label: "Smoothing (0 = raw)", type: "number", min: 0, max: 60, step: 1 },
|
|
87
|
+
{ key: "leadMs", label: "Lead between samples (ms)", type: "number", min: 0, max: 200, step: 10 },
|
|
88
|
+
{ key: "mirrored", label: "Mirror material", type: "boolean" },
|
|
89
|
+
{ key: "faceIndex", label: "Face index", type: "number", min: 0, max: 3, step: 1 },
|
|
90
|
+
{ key: "holdMs", label: "Hold (ms)", type: "number", min: 0, max: 1e3, step: 10 }
|
|
91
|
+
], xt = (e) => ({
|
|
92
|
+
...Ce,
|
|
93
|
+
...e
|
|
94
|
+
}), Et = (e, t) => ({ ...e, ...t }), Mt = [
|
|
95
|
+
"lips",
|
|
96
|
+
"contour",
|
|
97
|
+
"blush",
|
|
98
|
+
"highlighter",
|
|
99
|
+
"eyeshadow",
|
|
100
|
+
"eyeliner",
|
|
101
|
+
"brows"
|
|
102
|
+
], z = [
|
|
103
|
+
"matte",
|
|
104
|
+
"satin",
|
|
105
|
+
"gloss",
|
|
106
|
+
"shimmer",
|
|
107
|
+
"metallic",
|
|
108
|
+
"glitter"
|
|
109
|
+
], Rt = ["both", "left", "right"], _e = [
|
|
110
|
+
"lips",
|
|
111
|
+
"blush",
|
|
112
|
+
"contour",
|
|
113
|
+
"highlighter",
|
|
114
|
+
"brows"
|
|
115
|
+
], G = {
|
|
116
|
+
matte: { shine: 0, sparkleDensity: 0, sparkleSize: 0.25 },
|
|
117
|
+
satin: { shine: 0.3, sparkleDensity: 0, sparkleSize: 0.25 },
|
|
118
|
+
gloss: { shine: 0.8, sparkleDensity: 0, sparkleSize: 0.25 },
|
|
119
|
+
shimmer: { shine: 0.5, sparkleDensity: 0.6, sparkleSize: 0.25 },
|
|
120
|
+
metallic: { shine: 0.7, sparkleDensity: 0, sparkleSize: 0.25 },
|
|
121
|
+
glitter: { shine: 0.7, sparkleDensity: 0.35, sparkleSize: 0.8 }
|
|
122
|
+
}, Te = ["shine", "sparkleDensity", "sparkleSize"], Y = [0.1, 1.5], I = {
|
|
123
|
+
lips: {
|
|
124
|
+
nude: "#b9826f",
|
|
125
|
+
rosewood: "#9e5a5a",
|
|
126
|
+
mauve: "#a0606e",
|
|
127
|
+
softPink: "#d88a95",
|
|
128
|
+
coral: "#e0645a",
|
|
129
|
+
peach: "#e8907a",
|
|
130
|
+
classicRed: "#a3202d",
|
|
131
|
+
brick: "#8e3b2c",
|
|
132
|
+
berry: "#7b2846",
|
|
133
|
+
plum: "#5e2a45",
|
|
134
|
+
wine: "#5a1a28",
|
|
135
|
+
chocolate: "#5b3a2e"
|
|
136
|
+
},
|
|
137
|
+
contour: {
|
|
138
|
+
fair: "#c9a08a",
|
|
139
|
+
light: "#b48a72",
|
|
140
|
+
medium: "#98705a",
|
|
141
|
+
tan: "#7f5a45",
|
|
142
|
+
deep: "#5e4032",
|
|
143
|
+
rich: "#432c22",
|
|
144
|
+
bronzeLight: "#b9805a",
|
|
145
|
+
bronzeDeep: "#8a5532"
|
|
146
|
+
},
|
|
147
|
+
blush: {
|
|
148
|
+
softPink: "#e8a0a8",
|
|
149
|
+
rose: "#d97a85",
|
|
150
|
+
peach: "#f0a07c",
|
|
151
|
+
coral: "#ec7b67",
|
|
152
|
+
apricot: "#f2a86b",
|
|
153
|
+
mauve: "#c0828f",
|
|
154
|
+
berry: "#b04a68",
|
|
155
|
+
brick: "#b4574a",
|
|
156
|
+
terracotta: "#c4694c",
|
|
157
|
+
plum: "#8f4a68"
|
|
158
|
+
},
|
|
159
|
+
highlighter: {
|
|
160
|
+
pearl: "#f6eee6",
|
|
161
|
+
champagne: "#f2dcc0",
|
|
162
|
+
gold: "#e9c27a",
|
|
163
|
+
roseGold: "#eab3a0",
|
|
164
|
+
bronzeGlow: "#d29a66",
|
|
165
|
+
lilacPearl: "#e6d6ef"
|
|
166
|
+
},
|
|
167
|
+
eyeshadow: {
|
|
168
|
+
ivory: "#f3e6d3",
|
|
169
|
+
champagne: "#e9d2b0",
|
|
170
|
+
sand: "#d2b48c",
|
|
171
|
+
taupe: "#8f7a6e",
|
|
172
|
+
warmBrown: "#8b5a3c",
|
|
173
|
+
coolBrown: "#6e5a50",
|
|
174
|
+
espresso: "#3e2a22",
|
|
175
|
+
charcoal: "#3a3a3c",
|
|
176
|
+
black: "#141414",
|
|
177
|
+
bronze: "#a8743f",
|
|
178
|
+
copper: "#b5653a",
|
|
179
|
+
gold: "#d4ae5a",
|
|
180
|
+
roseGold: "#d49a8a",
|
|
181
|
+
plum: "#6b3a5a",
|
|
182
|
+
burgundy: "#6e2433",
|
|
183
|
+
olive: "#6f6a3a",
|
|
184
|
+
navy: "#23314f",
|
|
185
|
+
emerald: "#1f6b52",
|
|
186
|
+
teal: "#1f6f73",
|
|
187
|
+
lilac: "#b8a0cf",
|
|
188
|
+
silver: "#c5c7cb"
|
|
189
|
+
},
|
|
190
|
+
eyeliner: {
|
|
191
|
+
black: "#0d0d0d",
|
|
192
|
+
brownBlack: "#231a16",
|
|
193
|
+
brown: "#4a3226",
|
|
194
|
+
charcoal: "#33343a",
|
|
195
|
+
navy: "#1c2848",
|
|
196
|
+
plum: "#4f2442",
|
|
197
|
+
emerald: "#145a44",
|
|
198
|
+
bronze: "#8a5a2e",
|
|
199
|
+
gold: "#c9a14e",
|
|
200
|
+
white: "#f5f3ef"
|
|
201
|
+
},
|
|
202
|
+
brows: {
|
|
203
|
+
blonde: "#a88a62",
|
|
204
|
+
taupe: "#7c6a5c",
|
|
205
|
+
softBrown: "#6b4f3c",
|
|
206
|
+
mediumBrown: "#57402f",
|
|
207
|
+
darkBrown: "#3d2c22",
|
|
208
|
+
softBlack: "#252020",
|
|
209
|
+
auburn: "#7a4030",
|
|
210
|
+
grey: "#8a8580"
|
|
211
|
+
}
|
|
212
|
+
}, k = (e) => Object.keys(I[e]), Le = {
|
|
213
|
+
lips: k("lips"),
|
|
214
|
+
contour: k("contour"),
|
|
215
|
+
blush: k("blush"),
|
|
216
|
+
highlighter: k("highlighter"),
|
|
217
|
+
eyeshadow: k("eyeshadow"),
|
|
218
|
+
eyeliner: k("eyeliner"),
|
|
219
|
+
brows: k("brows")
|
|
220
|
+
}, K = (e) => _e.includes(e), oe = (e, t) => typeof t == "string" && Object.prototype.hasOwnProperty.call(I[e], t), ee = (e, t) => t === "custom" || t === "auto" && K(e) || oe(e, t);
|
|
221
|
+
function Oe(e, t) {
|
|
222
|
+
return t === "auto" ? K(e) ? "auto" : void 0 : oe(e, t) ? I[e][t] : void 0;
|
|
223
|
+
}
|
|
224
|
+
const T = (e) => {
|
|
225
|
+
const t = e.trim().toLowerCase(), o = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/.exec(t);
|
|
226
|
+
return o ? `#${o[1]}${o[1]}${o[2]}${o[2]}${o[3]}${o[3]}` : t;
|
|
227
|
+
}, Pe = (e, t) => Object.values(I[e]).some(
|
|
228
|
+
(o) => T(o) === t
|
|
229
|
+
), Ie = (e, t, o, s, l) => {
|
|
230
|
+
const a = ee(e, t), r = a ? t : ee(e, s) ? s : "custom", i = typeof o == "string" && o.trim() ? o.trim() : void 0;
|
|
231
|
+
if (r === "custom") return { shade: r, color: i ?? l };
|
|
232
|
+
const c = r === "auto" ? l : Oe(e, r) ?? l;
|
|
233
|
+
if (i !== void 0) {
|
|
234
|
+
const n = T(i), f = a && (Pe(e, n) || n === T(l));
|
|
235
|
+
if (n !== T(c) && !f) return { shade: "custom", color: i };
|
|
236
|
+
}
|
|
237
|
+
return { shade: r, color: c };
|
|
238
|
+
}, se = (e) => {
|
|
239
|
+
const t = e.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase();
|
|
240
|
+
return t[0].toUpperCase() + t.slice(1);
|
|
241
|
+
}, Ue = (e) => [
|
|
242
|
+
{ label: "Custom color", value: "custom" },
|
|
243
|
+
...K(e) ? [{ label: "Auto (own color)", value: "auto" }] : [],
|
|
244
|
+
...Le[e].map((t) => ({ label: se(t), value: t }))
|
|
245
|
+
], re = [
|
|
246
|
+
"lipstick",
|
|
247
|
+
"gloss",
|
|
248
|
+
"matte",
|
|
249
|
+
"tint",
|
|
250
|
+
"metallic",
|
|
251
|
+
"gradient",
|
|
252
|
+
"shimmer",
|
|
253
|
+
"glitter"
|
|
254
|
+
], De = ["texture", "solid"], Be = ["outward", "vertical", "horizontal"], Ne = {
|
|
255
|
+
enabled: !0,
|
|
256
|
+
preset: "custom",
|
|
257
|
+
shade: "custom",
|
|
258
|
+
maskMode: "outer-and-inner-lips",
|
|
259
|
+
colorMode: "texture",
|
|
260
|
+
color: "#e85d75",
|
|
261
|
+
opacity: 0.8,
|
|
262
|
+
coverage: 0.8,
|
|
263
|
+
finish: "satin",
|
|
264
|
+
...G.satin,
|
|
265
|
+
sparkleColor: "",
|
|
266
|
+
intensity: 1,
|
|
267
|
+
shading: 1,
|
|
268
|
+
gloss: 0.35,
|
|
269
|
+
roughness: 0.5,
|
|
270
|
+
highlightColor: "#ffffff",
|
|
271
|
+
gradientColor: "#ffd6de",
|
|
272
|
+
gradientAmount: 0,
|
|
273
|
+
gradientDirection: "outward",
|
|
274
|
+
edgeSoftness: 0.12,
|
|
275
|
+
innerLipColor: "#7a1f36",
|
|
276
|
+
innerLipAmount: 0,
|
|
277
|
+
innerLipWidth: 0.35,
|
|
278
|
+
splitLips: !1,
|
|
279
|
+
lowerLipColor: "#e85d75",
|
|
280
|
+
lowerLipOpacity: 0.8,
|
|
281
|
+
textureScaleX: 1,
|
|
282
|
+
textureScaleY: 1,
|
|
283
|
+
textureOffsetX: 0,
|
|
284
|
+
textureOffsetY: 0,
|
|
285
|
+
textureRotation: 0,
|
|
286
|
+
textureFlipX: !1,
|
|
287
|
+
textureFlipY: !1
|
|
288
|
+
}, le = {
|
|
289
|
+
lipstick: {
|
|
290
|
+
finish: "satin",
|
|
291
|
+
coverage: 0.85,
|
|
292
|
+
color: "#c0304f",
|
|
293
|
+
opacity: 0.85,
|
|
294
|
+
intensity: 1,
|
|
295
|
+
shading: 1,
|
|
296
|
+
gloss: 0.35,
|
|
297
|
+
roughness: 0.5,
|
|
298
|
+
highlightColor: "#ffffff",
|
|
299
|
+
gradientAmount: 0
|
|
300
|
+
},
|
|
301
|
+
gloss: {
|
|
302
|
+
finish: "gloss",
|
|
303
|
+
coverage: 0.45,
|
|
304
|
+
color: "#e05a7a",
|
|
305
|
+
opacity: 0.7,
|
|
306
|
+
intensity: 1,
|
|
307
|
+
shading: 1,
|
|
308
|
+
gloss: 0.95,
|
|
309
|
+
roughness: 0.12,
|
|
310
|
+
highlightColor: "#ffffff",
|
|
311
|
+
gradientAmount: 0
|
|
312
|
+
},
|
|
313
|
+
matte: {
|
|
314
|
+
finish: "matte",
|
|
315
|
+
coverage: 0.95,
|
|
316
|
+
color: "#a8323e",
|
|
317
|
+
opacity: 0.92,
|
|
318
|
+
intensity: 1,
|
|
319
|
+
shading: 1,
|
|
320
|
+
gloss: 0,
|
|
321
|
+
roughness: 1,
|
|
322
|
+
highlightColor: "#ffffff",
|
|
323
|
+
gradientAmount: 0
|
|
324
|
+
},
|
|
325
|
+
tint: {
|
|
326
|
+
finish: "matte",
|
|
327
|
+
coverage: 0.3,
|
|
328
|
+
color: "#ff6b81",
|
|
329
|
+
opacity: 0.4,
|
|
330
|
+
intensity: 1,
|
|
331
|
+
shading: 1,
|
|
332
|
+
gloss: 0.1,
|
|
333
|
+
roughness: 0.7,
|
|
334
|
+
highlightColor: "#ffffff",
|
|
335
|
+
gradientAmount: 0
|
|
336
|
+
},
|
|
337
|
+
metallic: {
|
|
338
|
+
finish: "metallic",
|
|
339
|
+
coverage: 0.9,
|
|
340
|
+
color: "#b5485a",
|
|
341
|
+
opacity: 0.9,
|
|
342
|
+
intensity: 1,
|
|
343
|
+
shading: 1,
|
|
344
|
+
gloss: 1,
|
|
345
|
+
roughness: 0.3,
|
|
346
|
+
highlightColor: "#f3c46b",
|
|
347
|
+
gradientAmount: 0
|
|
348
|
+
},
|
|
349
|
+
gradient: {
|
|
350
|
+
finish: "satin",
|
|
351
|
+
coverage: 0.8,
|
|
352
|
+
color: "#d6336c",
|
|
353
|
+
opacity: 0.8,
|
|
354
|
+
intensity: 1,
|
|
355
|
+
shading: 1,
|
|
356
|
+
gloss: 0.3,
|
|
357
|
+
roughness: 0.5,
|
|
358
|
+
highlightColor: "#ffffff",
|
|
359
|
+
gradientColor: "#f9c2cf",
|
|
360
|
+
gradientAmount: 0.85,
|
|
361
|
+
gradientDirection: "outward"
|
|
362
|
+
},
|
|
363
|
+
shimmer: {
|
|
364
|
+
finish: "shimmer",
|
|
365
|
+
coverage: 0.7,
|
|
366
|
+
color: "#c8577a",
|
|
367
|
+
opacity: 0.8,
|
|
368
|
+
intensity: 1,
|
|
369
|
+
shading: 1,
|
|
370
|
+
gloss: 0.4,
|
|
371
|
+
roughness: 0.45,
|
|
372
|
+
highlightColor: "#ffffff",
|
|
373
|
+
gradientAmount: 0
|
|
374
|
+
},
|
|
375
|
+
glitter: {
|
|
376
|
+
finish: "glitter",
|
|
377
|
+
coverage: 0.5,
|
|
378
|
+
color: "#b8406a",
|
|
379
|
+
opacity: 0.8,
|
|
380
|
+
intensity: 1,
|
|
381
|
+
shading: 1,
|
|
382
|
+
gloss: 0.5,
|
|
383
|
+
roughness: 0.35,
|
|
384
|
+
highlightColor: "#ffffff",
|
|
385
|
+
gradientAmount: 0
|
|
386
|
+
}
|
|
387
|
+
}, ie = (e) => typeof e == "string" && re.includes(e), m = (e, t, o, s) => typeof e == "number" && Number.isFinite(e) ? Math.min(o, Math.max(t, e)) : s, Xe = (e, t) => typeof e == "number" && Number.isFinite(e) ? e : t, w = (e, t) => typeof e == "string" && e.trim() ? e : t, He = (e, t) => typeof e == "string" ? e.trim() : t, A = (e, t) => typeof e == "boolean" ? e : t, X = (e, t, o) => typeof t == "string" && e.includes(t) ? t : o, Ye = (e) => Object.fromEntries(
|
|
388
|
+
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
389
|
+
), ze = (e = {}) => {
|
|
390
|
+
const t = ie(e.preset) ? e.preset : "custom", o = Ye(e), s = {
|
|
391
|
+
...Ne,
|
|
392
|
+
...t === "custom" ? {} : le[t]
|
|
393
|
+
}, l = X(z, o.finish, s.finish), a = { ...s, ...G[l] }, r = { ...a, ...o }, { shade: i, color: c } = Ie(
|
|
394
|
+
"lips",
|
|
395
|
+
o.shade,
|
|
396
|
+
o.color,
|
|
397
|
+
a.shade,
|
|
398
|
+
a.color
|
|
399
|
+
);
|
|
400
|
+
return {
|
|
401
|
+
enabled: A(r.enabled, a.enabled),
|
|
402
|
+
preset: t,
|
|
403
|
+
shade: i,
|
|
404
|
+
maskMode: r.maskMode === "outer-lips" ? "outer-lips" : "outer-and-inner-lips",
|
|
405
|
+
colorMode: X(De, r.colorMode, a.colorMode),
|
|
406
|
+
color: c,
|
|
407
|
+
opacity: m(r.opacity, 0, 1, a.opacity),
|
|
408
|
+
coverage: m(r.coverage, 0, 1, a.coverage),
|
|
409
|
+
finish: l,
|
|
410
|
+
shine: m(r.shine, 0, 1, a.shine),
|
|
411
|
+
sparkleDensity: m(r.sparkleDensity, 0, 1, a.sparkleDensity),
|
|
412
|
+
sparkleSize: m(r.sparkleSize, ...Y, a.sparkleSize),
|
|
413
|
+
sparkleColor: He(r.sparkleColor, a.sparkleColor),
|
|
414
|
+
intensity: m(r.intensity, 0, 1, a.intensity),
|
|
415
|
+
shading: m(r.shading, 0, 1, a.shading),
|
|
416
|
+
gloss: m(r.gloss, 0, 1, a.gloss),
|
|
417
|
+
roughness: m(r.roughness, 0, 1, a.roughness),
|
|
418
|
+
highlightColor: w(r.highlightColor, a.highlightColor),
|
|
419
|
+
gradientColor: w(r.gradientColor, a.gradientColor),
|
|
420
|
+
gradientAmount: m(r.gradientAmount, 0, 1, a.gradientAmount),
|
|
421
|
+
gradientDirection: X(
|
|
422
|
+
Be,
|
|
423
|
+
r.gradientDirection,
|
|
424
|
+
a.gradientDirection
|
|
425
|
+
),
|
|
426
|
+
edgeSoftness: m(r.edgeSoftness, 0, 1, a.edgeSoftness),
|
|
427
|
+
innerLipColor: w(r.innerLipColor, a.innerLipColor),
|
|
428
|
+
innerLipAmount: m(r.innerLipAmount, 0, 1, a.innerLipAmount),
|
|
429
|
+
innerLipWidth: m(r.innerLipWidth, 0, 1, a.innerLipWidth),
|
|
430
|
+
splitLips: A(r.splitLips, a.splitLips),
|
|
431
|
+
lowerLipColor: w(r.lowerLipColor, a.lowerLipColor),
|
|
432
|
+
lowerLipOpacity: m(r.lowerLipOpacity, 0, 1, a.lowerLipOpacity),
|
|
433
|
+
textureScaleX: m(r.textureScaleX, 0.05, 20, a.textureScaleX),
|
|
434
|
+
textureScaleY: m(r.textureScaleY, 0.05, 20, a.textureScaleY),
|
|
435
|
+
textureOffsetX: m(r.textureOffsetX, -2, 2, a.textureOffsetX),
|
|
436
|
+
textureOffsetY: m(r.textureOffsetY, -2, 2, a.textureOffsetY),
|
|
437
|
+
textureRotation: Xe(r.textureRotation, a.textureRotation),
|
|
438
|
+
textureFlipX: A(r.textureFlipX, a.textureFlipX),
|
|
439
|
+
textureFlipY: A(r.textureFlipY, a.textureFlipY)
|
|
440
|
+
};
|
|
441
|
+
}, wt = (e, t) => {
|
|
442
|
+
const o = Object.keys(e).some(
|
|
443
|
+
(a) => t[a] === void 0
|
|
444
|
+
), s = Object.fromEntries(
|
|
445
|
+
Object.entries(t).filter(
|
|
446
|
+
([a, r]) => r !== void 0 && (o || r !== e[a])
|
|
447
|
+
)
|
|
448
|
+
), l = { ...e };
|
|
449
|
+
if (s.preset !== e.preset && ie(s.preset) && Object.assign(l, le[s.preset]), Object.assign(l, s), l.finish !== e.finish && z.includes(l.finish)) {
|
|
450
|
+
Object.assign(l, G[l.finish]);
|
|
451
|
+
for (const a of Te)
|
|
452
|
+
s[a] !== void 0 && (l[a] = s[a]);
|
|
453
|
+
}
|
|
454
|
+
return s.color === void 0 ? l.shade !== "custom" && delete l.color : s.shade === void 0 && s.color !== e.color && (l.shade = "custom"), ze(l);
|
|
455
|
+
}, p = { min: 0, max: 1, step: 0.01 }, At = [
|
|
456
|
+
{ key: "enabled", label: "On", type: "boolean" },
|
|
457
|
+
{
|
|
458
|
+
key: "preset",
|
|
459
|
+
label: "Preset",
|
|
460
|
+
type: "select",
|
|
461
|
+
options: [
|
|
462
|
+
{ label: "Custom", value: "custom" },
|
|
463
|
+
...re.map((e) => ({
|
|
464
|
+
label: e[0].toUpperCase() + e.slice(1),
|
|
465
|
+
value: e
|
|
466
|
+
}))
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
{ key: "shade", label: "Shade", type: "select", options: Ue("lips") },
|
|
470
|
+
{
|
|
471
|
+
key: "maskMode",
|
|
472
|
+
label: "Mask mode",
|
|
473
|
+
type: "select",
|
|
474
|
+
options: [
|
|
475
|
+
{ label: "Outer + inner lips (mouth cut out)", value: "outer-and-inner-lips" },
|
|
476
|
+
{ label: "Outer lips (mouth included)", value: "outer-lips" }
|
|
477
|
+
]
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
key: "colorMode",
|
|
481
|
+
label: "Color mode",
|
|
482
|
+
type: "select",
|
|
483
|
+
options: [
|
|
484
|
+
{ label: "Design texture", value: "texture" },
|
|
485
|
+
{ label: "Procedural (solid / gradient)", value: "solid" }
|
|
486
|
+
]
|
|
487
|
+
},
|
|
488
|
+
{ key: "color", label: "Tint color", type: "color" },
|
|
489
|
+
{ key: "opacity", label: "Opacity", type: "number", ...p },
|
|
490
|
+
{ key: "coverage", label: "Coverage (sheer → opaque)", type: "number", ...p },
|
|
491
|
+
{
|
|
492
|
+
key: "finish",
|
|
493
|
+
label: "Finish",
|
|
494
|
+
type: "select",
|
|
495
|
+
options: z.map((e) => ({ label: se(e), value: e }))
|
|
496
|
+
},
|
|
497
|
+
{ key: "shine", label: "Shine", type: "number", ...p },
|
|
498
|
+
{ key: "sparkleColor", label: "Sparkle color (blank = from shade)", type: "text" },
|
|
499
|
+
{ key: "sparkleDensity", label: "Sparkle density", type: "number", ...p },
|
|
500
|
+
{
|
|
501
|
+
key: "sparkleSize",
|
|
502
|
+
label: "Sparkle size (mm)",
|
|
503
|
+
type: "number",
|
|
504
|
+
min: Y[0],
|
|
505
|
+
max: Y[1],
|
|
506
|
+
step: 0.05
|
|
507
|
+
},
|
|
508
|
+
{ key: "intensity", label: "Tint intensity", type: "number", ...p },
|
|
509
|
+
{ key: "shading", label: "Follow light (0 = flat)", type: "number", ...p },
|
|
510
|
+
{ key: "gloss", label: "Gloss", type: "number", ...p },
|
|
511
|
+
{ key: "roughness", label: "Roughness", type: "number", ...p },
|
|
512
|
+
{ key: "highlightColor", label: "Highlight color", type: "color" },
|
|
513
|
+
{ key: "gradientColor", label: "Gradient color", type: "color" },
|
|
514
|
+
{ key: "gradientAmount", label: "Gradient amount", type: "number", ...p },
|
|
515
|
+
{
|
|
516
|
+
key: "gradientDirection",
|
|
517
|
+
label: "Gradient direction",
|
|
518
|
+
type: "select",
|
|
519
|
+
options: [
|
|
520
|
+
{ label: "Mouth line → outer edge", value: "outward" },
|
|
521
|
+
{ label: "Bottom → top", value: "vertical" },
|
|
522
|
+
{ label: "Person's right → left corner", value: "horizontal" }
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
{ key: "edgeSoftness", label: "Edge softness", type: "number", ...p },
|
|
526
|
+
{ key: "innerLipColor", label: "Inner lip color", type: "color" },
|
|
527
|
+
{ key: "innerLipAmount", label: "Inner lip amount", type: "number", ...p },
|
|
528
|
+
{ key: "innerLipWidth", label: "Inner lip width", type: "number", ...p },
|
|
529
|
+
{ key: "splitLips", label: "Separate lower lip", type: "boolean" },
|
|
530
|
+
{ key: "lowerLipColor", label: "Lower lip color", type: "color" },
|
|
531
|
+
{ key: "lowerLipOpacity", label: "Lower lip opacity", type: "number", ...p },
|
|
532
|
+
{ key: "textureScaleX", label: "Texture scale X", type: "number", min: 0.1, max: 10, step: 0.05 },
|
|
533
|
+
{ key: "textureScaleY", label: "Texture scale Y", type: "number", min: 0.1, max: 10, step: 0.05 },
|
|
534
|
+
{ key: "textureOffsetX", label: "Texture offset X", type: "number", min: -1, max: 1, step: 0.01 },
|
|
535
|
+
{ key: "textureOffsetY", label: "Texture offset Y", type: "number", min: -1, max: 1, step: 0.01 },
|
|
536
|
+
{
|
|
537
|
+
key: "textureRotation",
|
|
538
|
+
label: "Texture rotation°",
|
|
539
|
+
type: "number",
|
|
540
|
+
min: -180,
|
|
541
|
+
max: 180,
|
|
542
|
+
step: 1
|
|
543
|
+
},
|
|
544
|
+
{ key: "textureFlipX", label: "Flip horizontal", type: "boolean" },
|
|
545
|
+
{ key: "textureFlipY", label: "Flip vertical", type: "boolean" }
|
|
546
|
+
], Ft = (e, t, o = new S.Matrix3()) => {
|
|
547
|
+
const s = (t.minU + t.maxU) / 2, l = (t.minV + t.maxV) / 2, a = t.maxU - t.minU, r = t.maxV - t.minV, i = -S.MathUtils.degToRad(e.textureRotation), c = Math.cos(i), n = Math.sin(i), f = (e.textureFlipX ? -1 : 1) / Math.max(e.textureScaleX, 1e-3), h = (e.textureFlipY ? -1 : 1) / Math.max(e.textureScaleY, 1e-3), g = f * c, y = -f * n, u = h * n, x = h * c, E = s + e.textureOffsetX * a, U = l + e.textureOffsetY * r, $ = s - (g * E + y * U), D = l - (u * E + x * U);
|
|
548
|
+
return o.set(g, y, $, u, x, D, 0, 0, 1);
|
|
549
|
+
}, Ct = [
|
|
550
|
+
"eachOther",
|
|
551
|
+
"photo",
|
|
552
|
+
"canonicalTexture",
|
|
553
|
+
"faceTexture"
|
|
554
|
+
], ne = ["natural", "keepColors", "raw"], L = {
|
|
555
|
+
preset: "natural",
|
|
556
|
+
matchSkinTone: 1,
|
|
557
|
+
matchLighting: 1,
|
|
558
|
+
edgeMatch: 1,
|
|
559
|
+
edgeSoftness: 1.2,
|
|
560
|
+
edgeInset: 0.3,
|
|
561
|
+
ownEyes: !0,
|
|
562
|
+
ownMouth: !0,
|
|
563
|
+
featureSoftness: 0.25,
|
|
564
|
+
detail: 1,
|
|
565
|
+
smoothing: 0.35,
|
|
566
|
+
amount: 1
|
|
567
|
+
}, j = {
|
|
568
|
+
natural: {
|
|
569
|
+
matchSkinTone: 1,
|
|
570
|
+
matchLighting: 1,
|
|
571
|
+
edgeMatch: 1,
|
|
572
|
+
edgeSoftness: 1.2,
|
|
573
|
+
ownEyes: !0,
|
|
574
|
+
ownMouth: !0,
|
|
575
|
+
detail: 1
|
|
576
|
+
},
|
|
577
|
+
keepColors: { matchSkinTone: 0, matchLighting: 0.7, edgeMatch: 1, edgeSoftness: 1 },
|
|
578
|
+
raw: { matchSkinTone: 0, matchLighting: 0, edgeMatch: 0, edgeSoftness: 0.4 }
|
|
579
|
+
}, ce = (e) => typeof e == "string" && ne.includes(e), Ge = (e) => ue(e) ? "keepColors" : "natural", ue = (e) => {
|
|
580
|
+
var t;
|
|
581
|
+
return (e == null ? void 0 : e.kind) === "canonicalTexture" || (e == null ? void 0 : e.kind) === "faceTexture" && ((t = e.face) == null ? void 0 : t.kind) === "canonical";
|
|
582
|
+
}, Ke = 0.1, me = (e, t, o, s) => typeof e == "number" && Number.isFinite(e) ? Math.min(o, Math.max(t, e)) : s, te = (e, t) => typeof e == "boolean" ? e : t, je = (e, t, o) => typeof t == "string" && e.includes(t) ? t : o, W = (e) => Object.fromEntries(
|
|
583
|
+
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
584
|
+
), P = {
|
|
585
|
+
matchSkinTone: [0, 1],
|
|
586
|
+
matchLighting: [0, 1],
|
|
587
|
+
edgeMatch: [0, 1],
|
|
588
|
+
edgeSoftness: [0.3, 3],
|
|
589
|
+
edgeInset: [0, 1.5],
|
|
590
|
+
featureSoftness: [0.1, 0.6],
|
|
591
|
+
detail: [0, 1],
|
|
592
|
+
smoothing: [0, 1],
|
|
593
|
+
amount: [0, 1]
|
|
594
|
+
}, pe = (e, t) => Object.entries(j[t]).every(
|
|
595
|
+
([o, s]) => e[o] === s
|
|
596
|
+
), ae = (e = {}, t = {}) => {
|
|
597
|
+
const o = e.preset ?? Ge(t.source), s = ce(o) ? o : "custom", l = {
|
|
598
|
+
...L,
|
|
599
|
+
...ue(t.source) ? { featureSoftness: Ke } : {},
|
|
600
|
+
...s === "custom" ? {} : j[s]
|
|
601
|
+
}, a = { ...l, ...W(e) }, r = P, i = (n) => me(a[n], r[n][0], r[n][1], l[n]), c = {
|
|
602
|
+
preset: s,
|
|
603
|
+
matchSkinTone: i("matchSkinTone"),
|
|
604
|
+
matchLighting: i("matchLighting"),
|
|
605
|
+
edgeMatch: i("edgeMatch"),
|
|
606
|
+
edgeSoftness: i("edgeSoftness"),
|
|
607
|
+
edgeInset: i("edgeInset"),
|
|
608
|
+
ownEyes: te(a.ownEyes, l.ownEyes),
|
|
609
|
+
ownMouth: te(a.ownMouth, l.ownMouth),
|
|
610
|
+
featureSoftness: i("featureSoftness"),
|
|
611
|
+
detail: i("detail"),
|
|
612
|
+
smoothing: i("smoothing"),
|
|
613
|
+
amount: i("amount")
|
|
614
|
+
};
|
|
615
|
+
return s !== "custom" && !pe(c, s) && (c.preset = "custom"), c;
|
|
616
|
+
}, _t = (e, t) => {
|
|
617
|
+
const o = Object.fromEntries(
|
|
618
|
+
Object.entries(t).filter(
|
|
619
|
+
([l, a]) => l !== "preset" && a !== void 0 && a !== e[l]
|
|
620
|
+
)
|
|
621
|
+
), s = t.preset;
|
|
622
|
+
return ce(s) && (s !== e.preset || !pe(e, s)) ? ae({
|
|
623
|
+
...e,
|
|
624
|
+
...j[s],
|
|
625
|
+
...o,
|
|
626
|
+
preset: s
|
|
627
|
+
}) : ae({
|
|
628
|
+
...e,
|
|
629
|
+
...o,
|
|
630
|
+
preset: s === "custom" ? "custom" : e.preset
|
|
631
|
+
});
|
|
632
|
+
}, b = { min: 0, max: 1, step: 0.01 }, O = (e, t) => ({
|
|
633
|
+
min: P[e][0],
|
|
634
|
+
max: P[e][1],
|
|
635
|
+
step: t
|
|
636
|
+
}), We = {
|
|
637
|
+
natural: "Natural",
|
|
638
|
+
keepColors: "Keep colors",
|
|
639
|
+
raw: "Raw"
|
|
640
|
+
}, Tt = [
|
|
641
|
+
{
|
|
642
|
+
key: "preset",
|
|
643
|
+
label: "Preset",
|
|
644
|
+
type: "select",
|
|
645
|
+
options: [
|
|
646
|
+
{ label: "Custom", value: "custom" },
|
|
647
|
+
...ne.map((e) => ({ label: We[e], value: e }))
|
|
648
|
+
]
|
|
649
|
+
},
|
|
650
|
+
{ key: "matchSkinTone", label: "Match skin tone", type: "number", ...b },
|
|
651
|
+
{ key: "matchLighting", label: "Match lighting", type: "number", ...b },
|
|
652
|
+
{ key: "edgeMatch", label: "Match at the edge", type: "number", ...b },
|
|
653
|
+
{
|
|
654
|
+
key: "edgeSoftness",
|
|
655
|
+
label: "Edge softness (cm)",
|
|
656
|
+
type: "number",
|
|
657
|
+
...O("edgeSoftness", 0.05)
|
|
658
|
+
},
|
|
659
|
+
{ key: "edgeInset", label: "Edge inset (cm)", type: "number", ...O("edgeInset", 0.05) },
|
|
660
|
+
{ key: "ownEyes", label: "Keep own eyes", type: "boolean" },
|
|
661
|
+
{ key: "ownMouth", label: "Keep own mouth", type: "boolean" },
|
|
662
|
+
{
|
|
663
|
+
key: "featureSoftness",
|
|
664
|
+
label: "Eye and mouth rim (cm)",
|
|
665
|
+
type: "number",
|
|
666
|
+
...O("featureSoftness", 0.01)
|
|
667
|
+
},
|
|
668
|
+
{ key: "detail", label: "Detail", type: "number", ...b },
|
|
669
|
+
{ key: "smoothing", label: "Smoothing", type: "number", ...b },
|
|
670
|
+
{ key: "amount", label: "Amount", type: "number", ...b }
|
|
671
|
+
], V = [
|
|
672
|
+
"leftLeft",
|
|
673
|
+
"rightRight",
|
|
674
|
+
"flip",
|
|
675
|
+
"upsideDown"
|
|
676
|
+
], Ve = {
|
|
677
|
+
leftLeft: "your left half twice",
|
|
678
|
+
rightRight: "your right half twice",
|
|
679
|
+
flip: "left and right swapped",
|
|
680
|
+
upsideDown: "eyes and mouth upside down"
|
|
681
|
+
}, Lt = (e) => typeof e == "string" && V.includes(e), $e = {
|
|
682
|
+
variant: "leftLeft",
|
|
683
|
+
matchLighting: 1,
|
|
684
|
+
edgeSoftness: 1.2,
|
|
685
|
+
smoothing: 0.35,
|
|
686
|
+
amount: 1
|
|
687
|
+
}, Ze = (e = {}) => {
|
|
688
|
+
const t = $e, o = { ...t, ...W(e) }, s = P, l = (a) => me(o[a], s[a][0], s[a][1], t[a]);
|
|
689
|
+
return {
|
|
690
|
+
variant: je(V, o.variant, t.variant),
|
|
691
|
+
matchLighting: l("matchLighting"),
|
|
692
|
+
edgeSoftness: l("edgeSoftness"),
|
|
693
|
+
smoothing: l("smoothing"),
|
|
694
|
+
amount: l("amount")
|
|
695
|
+
};
|
|
696
|
+
}, Ot = (e, t) => Ze({ ...e, ...W(t) }), Pt = [
|
|
697
|
+
{
|
|
698
|
+
key: "variant",
|
|
699
|
+
label: "Variant",
|
|
700
|
+
type: "select",
|
|
701
|
+
options: V.map((e) => ({
|
|
702
|
+
label: Ve[e],
|
|
703
|
+
value: e
|
|
704
|
+
}))
|
|
705
|
+
},
|
|
706
|
+
{ key: "matchLighting", label: "Match lighting", type: "number", ...b },
|
|
707
|
+
{
|
|
708
|
+
key: "edgeSoftness",
|
|
709
|
+
label: "Edge softness (cm)",
|
|
710
|
+
type: "number",
|
|
711
|
+
...O("edgeSoftness", 0.05)
|
|
712
|
+
},
|
|
713
|
+
{ key: "smoothing", label: "Smoothing", type: "number", ...b },
|
|
714
|
+
{ key: "amount", label: "Amount", type: "number", ...b }
|
|
715
|
+
], It = (e) => ({
|
|
716
|
+
matchSkinTone: 0,
|
|
717
|
+
matchLighting: e.matchLighting,
|
|
718
|
+
edgeMatch: e.matchLighting,
|
|
719
|
+
edgeSoftness: e.edgeSoftness,
|
|
720
|
+
edgeInset: L.edgeInset,
|
|
721
|
+
ownEyes: !1,
|
|
722
|
+
ownMouth: !1,
|
|
723
|
+
featureSoftness: L.featureSoftness,
|
|
724
|
+
detail: L.detail,
|
|
725
|
+
smoothing: e.smoothing,
|
|
726
|
+
amount: e.amount
|
|
727
|
+
}), qe = Object.freeze({
|
|
728
|
+
...Me,
|
|
729
|
+
transparent: !1,
|
|
730
|
+
depthTest: !0,
|
|
731
|
+
depthWrite: !1,
|
|
732
|
+
toneMapped: !1
|
|
733
|
+
}), Je = `
|
|
734
|
+
varying vec2 vUv;
|
|
735
|
+
|
|
736
|
+
void main() {
|
|
737
|
+
vUv = uv;
|
|
738
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
739
|
+
}
|
|
740
|
+
`, Qe = `
|
|
741
|
+
uniform sampler2D cameraTexture;
|
|
742
|
+
uniform sampler2D retouchMaskTexture;
|
|
743
|
+
uniform vec2 texelSize;
|
|
744
|
+
uniform float retouchAmount;
|
|
745
|
+
uniform float blurRadius;
|
|
746
|
+
uniform float detailPreservation;
|
|
747
|
+
uniform float blemishReduction;
|
|
748
|
+
uniform float blemishRadius;
|
|
749
|
+
uniform float previewMask;
|
|
750
|
+
uniform float protectLandmarks;
|
|
751
|
+
uniform float clipMinX;
|
|
752
|
+
uniform float clipMaxX;
|
|
753
|
+
varying vec2 vUv;
|
|
754
|
+
|
|
755
|
+
vec3 sampleCamera(vec2 uv) {
|
|
756
|
+
return texture2D(cameraTexture, clamp(uv, vec2(0.0), vec2(1.0))).rgb;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
vec3 readRetouchMask(vec2 uv) {
|
|
760
|
+
vec4 mask = texture2D(retouchMaskTexture, uv);
|
|
761
|
+
float faceRegion = clamp(mask.b, 0.0, 1.0);
|
|
762
|
+
float softFaceRegion = min(mask.r, faceRegion);
|
|
763
|
+
float protectedRegion = min(mask.g, faceRegion) * protectLandmarks;
|
|
764
|
+
float hardProtectedRegion = step(0.08, protectedRegion);
|
|
765
|
+
float softRetouchRegion = softFaceRegion * (1.0 - protectedRegion);
|
|
766
|
+
float hardRetouchRegion = step(0.5, faceRegion) * (1.0 - hardProtectedRegion);
|
|
767
|
+
|
|
768
|
+
return vec3(
|
|
769
|
+
clamp(softRetouchRegion, 0.0, 1.0),
|
|
770
|
+
clamp(protectedRegion, 0.0, 1.0),
|
|
771
|
+
clamp(hardRetouchRegion, 0.0, 1.0)
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
float retouchCoverage(vec2 uv) {
|
|
776
|
+
return step(0.001, readRetouchMask(uv).x);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
void addMaskedBlurSample(inout vec3 color, inout float weightSum, vec2 centerUv, vec2 sampleUv, float weight) {
|
|
780
|
+
float coverage = retouchCoverage(sampleUv);
|
|
781
|
+
vec3 sampleColor = mix(sampleCamera(centerUv), sampleCamera(sampleUv), coverage);
|
|
782
|
+
color += sampleColor * weight;
|
|
783
|
+
weightSum += weight;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
vec3 maskedBlurCamera(vec2 uv, float radius) {
|
|
787
|
+
vec2 r = texelSize * radius;
|
|
788
|
+
vec3 color = sampleCamera(uv) * 0.2;
|
|
789
|
+
float weightSum = 0.2;
|
|
790
|
+
|
|
791
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, 0.0), 0.1);
|
|
792
|
+
addMaskedBlurSample(color, weightSum, uv, uv - vec2(r.x, 0.0), 0.1);
|
|
793
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(0.0, r.y), 0.1);
|
|
794
|
+
addMaskedBlurSample(color, weightSum, uv, uv - vec2(0.0, r.y), 0.1);
|
|
795
|
+
addMaskedBlurSample(color, weightSum, uv, uv + r, 0.075);
|
|
796
|
+
addMaskedBlurSample(color, weightSum, uv, uv - r, 0.075);
|
|
797
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, -r.y), 0.075);
|
|
798
|
+
addMaskedBlurSample(color, weightSum, uv, uv + vec2(-r.x, r.y), 0.075);
|
|
799
|
+
addMaskedBlurSample(color, weightSum, uv, uv + r * 2.0, 0.05);
|
|
800
|
+
addMaskedBlurSample(color, weightSum, uv, uv - r * 2.0, 0.05);
|
|
801
|
+
|
|
802
|
+
return color / max(weightSum, 0.001);
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
float retouchLuminance(vec3 color) {
|
|
806
|
+
return dot(color, vec3(0.299, 0.587, 0.114));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
vec3 reduceBlemishes(vec3 current, vec3 source, vec3 localAverage, vec3 skinBase, float skinMask) {
|
|
810
|
+
float originalLum = retouchLuminance(source);
|
|
811
|
+
float localLum = retouchLuminance(localAverage);
|
|
812
|
+
float redness = max(source.r - max(source.g, source.b), 0.0);
|
|
813
|
+
float localRedness = max(localAverage.r - max(localAverage.g, localAverage.b), 0.0);
|
|
814
|
+
float excessRedness = max(redness - localRedness * 0.72, 0.0);
|
|
815
|
+
float darkSpot = max(localLum - originalLum, 0.0);
|
|
816
|
+
float contrast = length(source - localAverage);
|
|
817
|
+
float candidate =
|
|
818
|
+
smoothstep(0.012, 0.09, excessRedness) +
|
|
819
|
+
smoothstep(0.018, 0.13, darkSpot) +
|
|
820
|
+
smoothstep(0.03, 0.16, contrast);
|
|
821
|
+
float blemishMask = clamp(candidate * 0.72, 0.0, 1.0) * skinMask * blemishReduction;
|
|
822
|
+
|
|
823
|
+
vec3 chromaReduced = vec3(
|
|
824
|
+
mix(current.r, min(current.r, localAverage.r * 1.04), blemishMask),
|
|
825
|
+
mix(current.g, max(current.g, localAverage.g * 0.98), 0.35 * blemishMask),
|
|
826
|
+
mix(current.b, max(current.b, localAverage.b * 0.98), 0.35 * blemishMask)
|
|
827
|
+
);
|
|
828
|
+
vec3 texture = source - localAverage;
|
|
829
|
+
vec3 repaired = clamp(skinBase + texture * detailPreservation * 0.18, 0.0, 1.0);
|
|
830
|
+
|
|
831
|
+
return mix(chromaReduced, repaired, min(blemishMask * 1.15, 1.0));
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
void main() {
|
|
835
|
+
if (vUv.x < clipMinX || vUv.x > clipMaxX) discard;
|
|
836
|
+
|
|
837
|
+
vec3 original = sampleCamera(vUv);
|
|
838
|
+
vec3 masks = readRetouchMask(vUv);
|
|
839
|
+
float faceAlpha = max(max(masks.x, masks.y), masks.z);
|
|
840
|
+
|
|
841
|
+
if (previewMask > 0.5) {
|
|
842
|
+
float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
|
|
843
|
+
float retouchPreview = mix(masks.x, masks.z, sharpPreview);
|
|
844
|
+
float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
|
|
845
|
+
vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
|
|
846
|
+
vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
|
|
847
|
+
vec3 maskPreview = max(facePreview, featurePreview);
|
|
848
|
+
vec3 debugColor = mix(original * 0.18, maskPreview, max(retouchPreview, protectedPreview));
|
|
849
|
+
gl_FragColor = vec4(debugColor, faceAlpha);
|
|
850
|
+
#include <colorspace_fragment>
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
float effectiveBlurRadius = min(blurRadius, 12.0);
|
|
855
|
+
vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
|
|
856
|
+
vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
|
|
857
|
+
vec3 detail = original - smallBlur;
|
|
858
|
+
float detailAmount = mix(detailPreservation, 0.9, masks.y);
|
|
859
|
+
vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
|
|
860
|
+
vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
|
|
861
|
+
vec3 blemishAverage = maskedBlurCamera(vUv, max(1.0, blemishRadius));
|
|
862
|
+
color = reduceBlemishes(color, original, blemishAverage, smoothed, masks.x);
|
|
863
|
+
gl_FragColor = vec4(color, faceAlpha);
|
|
864
|
+
#include <colorspace_fragment>
|
|
865
|
+
}
|
|
866
|
+
`, et = ({
|
|
867
|
+
retouchMask: e,
|
|
868
|
+
retouchAmount: t,
|
|
869
|
+
blurRadius: o,
|
|
870
|
+
detailPreservation: s = 0.62,
|
|
871
|
+
blemishReduction: l = 0.35,
|
|
872
|
+
blemishRadius: a = 3,
|
|
873
|
+
previewMask: r,
|
|
874
|
+
protectLandmarks: i,
|
|
875
|
+
clipMinX: c = 0,
|
|
876
|
+
clipMaxX: n = 1,
|
|
877
|
+
renderOrder: f = ve
|
|
878
|
+
}) => {
|
|
879
|
+
const { camera: h, size: g } = ke(), y = Ee(), u = M(
|
|
880
|
+
() => ({
|
|
881
|
+
cameraTexture: { value: null },
|
|
882
|
+
retouchMaskTexture: { value: null },
|
|
883
|
+
texelSize: { value: new S.Vector2(1 / 1280, 1 / 720) },
|
|
884
|
+
retouchAmount: { value: 0 },
|
|
885
|
+
blurRadius: { value: 0 },
|
|
886
|
+
detailPreservation: { value: 0 },
|
|
887
|
+
blemishReduction: { value: 0 },
|
|
888
|
+
blemishRadius: { value: 0 },
|
|
889
|
+
previewMask: { value: 0 },
|
|
890
|
+
protectLandmarks: { value: 1 },
|
|
891
|
+
clipMinX: { value: 0 },
|
|
892
|
+
clipMaxX: { value: 1 }
|
|
893
|
+
}),
|
|
894
|
+
[]
|
|
895
|
+
), x = M(() => {
|
|
896
|
+
if (!h.isPerspectiveCamera)
|
|
897
|
+
return [10, 10];
|
|
898
|
+
const E = h, D = (E.position.z || 5) - -1, he = S.MathUtils.degToRad(E.fov), Z = 2 * Math.tan(he / 2) * D;
|
|
899
|
+
return [Z * (g.width / g.height), Z];
|
|
900
|
+
}, [h, g]);
|
|
901
|
+
return xe(() => {
|
|
902
|
+
u.cameraTexture.value = y ?? null, u.retouchMaskTexture.value = e, u.texelSize.value.set(1 / Math.max(g.width, 1), 1 / Math.max(g.height, 1)), u.retouchAmount.value = t, u.blurRadius.value = o, u.detailPreservation.value = s, u.blemishReduction.value = l, u.blemishRadius.value = a, u.previewMask.value = r ? 1 : 0, u.protectLandmarks.value = i ? 1 : 0, u.clipMinX.value = c, u.clipMaxX.value = n;
|
|
903
|
+
}), y ? /* @__PURE__ */ _("group", { position: [0, 0, -1], children: /* @__PURE__ */ ge("mesh", { renderOrder: f, children: [
|
|
904
|
+
/* @__PURE__ */ _("planeGeometry", { args: x }),
|
|
905
|
+
/* @__PURE__ */ _(
|
|
906
|
+
"shaderMaterial",
|
|
907
|
+
{
|
|
908
|
+
uniforms: u,
|
|
909
|
+
vertexShader: Je,
|
|
910
|
+
fragmentShader: Qe,
|
|
911
|
+
...qe
|
|
912
|
+
}
|
|
913
|
+
)
|
|
914
|
+
] }) }) : null;
|
|
915
|
+
}, tt = (e) => {
|
|
916
|
+
const t = document.createElement("canvas");
|
|
917
|
+
t.width = e, t.height = e;
|
|
918
|
+
const o = t.getContext("2d", { willReadFrequently: !1 });
|
|
919
|
+
if (!o) throw new Error("Unable to create face retouch mask context");
|
|
920
|
+
const s = new S.CanvasTexture(t);
|
|
921
|
+
return s.colorSpace = S.NoColorSpace, s.minFilter = S.LinearFilter, s.magFilter = S.LinearFilter, s.generateMipmaps = !1, s.needsUpdate = !0, { canvas: t, context: o, texture: s };
|
|
922
|
+
}, at = (e, t = Re, o = {}, s = 0) => {
|
|
923
|
+
const l = M(() => tt(t), [t]);
|
|
924
|
+
return Q(() => {
|
|
925
|
+
let a = 0;
|
|
926
|
+
const r = () => {
|
|
927
|
+
var c, n;
|
|
928
|
+
a = requestAnimationFrame(r);
|
|
929
|
+
const i = (n = (c = e == null ? void 0 : e.detectionResults) == null ? void 0 : c.faceLandmarks) == null ? void 0 : n[s];
|
|
930
|
+
we(l.context, i, t, o), l.texture.needsUpdate = !0;
|
|
931
|
+
};
|
|
932
|
+
return r(), () => {
|
|
933
|
+
cancelAnimationFrame(a);
|
|
934
|
+
};
|
|
935
|
+
}, [s, e, l.context, l.texture, o, t]), Q(() => () => {
|
|
936
|
+
l.texture.dispose();
|
|
937
|
+
}, [l.texture]), { canvas: l.canvas, texture: l.texture };
|
|
938
|
+
}, Ut = [
|
|
939
|
+
{ key: "skinSmoothing", label: "Skin smoothing", type: "number", min: 0, max: 1, step: 0.01 },
|
|
940
|
+
{ key: "skinRealism", label: "Skin realism", type: "number", min: 0, max: 1, step: 0.01 },
|
|
941
|
+
{
|
|
942
|
+
key: "blemishReduction",
|
|
943
|
+
label: "Blemish reduction",
|
|
944
|
+
type: "number",
|
|
945
|
+
min: 0,
|
|
946
|
+
max: 1,
|
|
947
|
+
step: 0.01
|
|
948
|
+
},
|
|
949
|
+
{ key: "previewMask", label: "Preview mask", type: "boolean" }
|
|
950
|
+
], F = {
|
|
951
|
+
skinSmoothing: 0.55,
|
|
952
|
+
skinRealism: 0.62,
|
|
953
|
+
blemishReduction: 0.35,
|
|
954
|
+
previewMask: !1
|
|
955
|
+
}, C = {
|
|
956
|
+
blurRadius: 8,
|
|
957
|
+
blemishRadius: 3,
|
|
958
|
+
protectLandmarks: !0,
|
|
959
|
+
foreheadCoverage: !0
|
|
960
|
+
}, H = (e, t) => {
|
|
961
|
+
const o = Number(e);
|
|
962
|
+
return Number.isFinite(o) ? Math.min(1, Math.max(0, o)) : t;
|
|
963
|
+
}, de = (e = {}) => ({
|
|
964
|
+
skinSmoothing: H(e.skinSmoothing, F.skinSmoothing),
|
|
965
|
+
skinRealism: H(e.skinRealism, F.skinRealism),
|
|
966
|
+
blemishReduction: H(e.blemishReduction, F.blemishReduction),
|
|
967
|
+
previewMask: typeof e.previewMask == "boolean" ? e.previewMask : F.previewMask
|
|
968
|
+
}), Dt = (e, t) => de({ ...e, ...t }), Bt = ({
|
|
969
|
+
faceIndex: e,
|
|
970
|
+
numFaces: t,
|
|
971
|
+
skinSmoothing: o,
|
|
972
|
+
skinRealism: s,
|
|
973
|
+
blemishReduction: l,
|
|
974
|
+
previewMask: a,
|
|
975
|
+
clipMinX: r = 0,
|
|
976
|
+
clipMaxX: i = 1,
|
|
977
|
+
renderOrder: c
|
|
978
|
+
}) => {
|
|
979
|
+
const n = ye(e), f = Se(n, t), h = de({
|
|
980
|
+
skinSmoothing: o,
|
|
981
|
+
skinRealism: s,
|
|
982
|
+
blemishReduction: l,
|
|
983
|
+
previewMask: a
|
|
984
|
+
}), g = M(() => ({ numFaces: f }), [f]), { node: y } = be(
|
|
985
|
+
fe.FACE_TRACKER,
|
|
986
|
+
g
|
|
987
|
+
), u = M(
|
|
988
|
+
() => ({ foreheadCoverage: C.foreheadCoverage }),
|
|
989
|
+
[]
|
|
990
|
+
), x = at(y, void 0, u, n);
|
|
991
|
+
return /* @__PURE__ */ _(
|
|
992
|
+
et,
|
|
993
|
+
{
|
|
994
|
+
retouchMask: x.texture,
|
|
995
|
+
retouchAmount: h.skinSmoothing,
|
|
996
|
+
blurRadius: C.blurRadius,
|
|
997
|
+
detailPreservation: h.skinRealism,
|
|
998
|
+
blemishReduction: h.blemishReduction,
|
|
999
|
+
blemishRadius: C.blemishRadius,
|
|
1000
|
+
previewMask: h.previewMask,
|
|
1001
|
+
protectLandmarks: C.protectLandmarks,
|
|
1002
|
+
clipMinX: r,
|
|
1003
|
+
clipMaxX: i,
|
|
1004
|
+
renderOrder: c
|
|
1005
|
+
}
|
|
1006
|
+
);
|
|
1007
|
+
};
|
|
1008
|
+
export {
|
|
1009
|
+
V as $,
|
|
1010
|
+
Ue as A,
|
|
1011
|
+
se as B,
|
|
1012
|
+
Mt as C,
|
|
1013
|
+
Ne as D,
|
|
1014
|
+
Le as E,
|
|
1015
|
+
Ut as F,
|
|
1016
|
+
L as G,
|
|
1017
|
+
P as H,
|
|
1018
|
+
kt as I,
|
|
1019
|
+
Ze as J,
|
|
1020
|
+
It as K,
|
|
1021
|
+
At as L,
|
|
1022
|
+
G as M,
|
|
1023
|
+
j as N,
|
|
1024
|
+
Ce as O,
|
|
1025
|
+
Ae as P,
|
|
1026
|
+
Fe as Q,
|
|
1027
|
+
De as R,
|
|
1028
|
+
ie as S,
|
|
1029
|
+
_e as T,
|
|
1030
|
+
oe as U,
|
|
1031
|
+
Oe as V,
|
|
1032
|
+
K as W,
|
|
1033
|
+
F as X,
|
|
1034
|
+
Bt as Y,
|
|
1035
|
+
$e as Z,
|
|
1036
|
+
Pt as _,
|
|
1037
|
+
ae as a,
|
|
1038
|
+
Ve as a0,
|
|
1039
|
+
Ke as a1,
|
|
1040
|
+
ne as a2,
|
|
1041
|
+
Ct as a3,
|
|
1042
|
+
Ge as a4,
|
|
1043
|
+
Lt as a5,
|
|
1044
|
+
ce as a6,
|
|
1045
|
+
Ot as a7,
|
|
1046
|
+
Tt as b,
|
|
1047
|
+
_t as c,
|
|
1048
|
+
xt as d,
|
|
1049
|
+
Et as e,
|
|
1050
|
+
ze as f,
|
|
1051
|
+
wt as g,
|
|
1052
|
+
ht as h,
|
|
1053
|
+
ft as i,
|
|
1054
|
+
vt as j,
|
|
1055
|
+
yt as k,
|
|
1056
|
+
Be as l,
|
|
1057
|
+
St as m,
|
|
1058
|
+
Ft as n,
|
|
1059
|
+
le as o,
|
|
1060
|
+
Dt as p,
|
|
1061
|
+
re as q,
|
|
1062
|
+
de as r,
|
|
1063
|
+
gt as s,
|
|
1064
|
+
bt as t,
|
|
1065
|
+
I as u,
|
|
1066
|
+
z as v,
|
|
1067
|
+
Te as w,
|
|
1068
|
+
Y as x,
|
|
1069
|
+
Rt as y,
|
|
1070
|
+
Ie as z
|
|
1071
|
+
};
|