@luma.gl/engine 10.0.0-alpha.4 → 10.0.0-alpha.5
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/README.md +9 -0
- package/dist/animation/animation-clip.cjs +36 -0
- package/dist/animation/animation-interpolation.cjs +115 -0
- package/dist/animation/animation-mixer.cjs +302 -0
- package/dist/animation/animation-track.cjs +55 -0
- package/dist/animation/animator.cjs +75 -0
- package/dist/animation/deform-positions.cjs +69 -0
- package/dist/animation/deform-positions.d.ts +13 -0
- package/dist/animation/deform-positions.d.ts.map +1 -0
- package/dist/animation/deform-positions.js +49 -0
- package/dist/animation/deform-positions.js.map +1 -0
- package/dist/animation/key-frames.cjs +81 -0
- package/dist/animation/morph-targets.cjs +162 -0
- package/dist/animation/node-animation-binding.cjs +67 -0
- package/dist/animation/node-animation-binding.d.ts +9 -0
- package/dist/animation/node-animation-binding.d.ts.map +1 -0
- package/dist/animation/node-animation-binding.js +45 -0
- package/dist/animation/node-animation-binding.js.map +1 -0
- package/dist/animation/property-animation-binding.cjs +159 -0
- package/dist/animation/property-animation-binding.d.ts +29 -0
- package/dist/animation/property-animation-binding.d.ts.map +1 -0
- package/dist/animation/property-animation-binding.js +138 -0
- package/dist/animation/property-animation-binding.js.map +1 -0
- package/dist/animation/scenegraph-animator.cjs +122 -0
- package/dist/animation/scenegraph-animator.d.ts +37 -0
- package/dist/animation/scenegraph-animator.d.ts.map +1 -0
- package/dist/animation/scenegraph-animator.js +99 -0
- package/dist/animation/scenegraph-animator.js.map +1 -0
- package/dist/animation/skin.cjs +49 -0
- package/dist/animation/texture-transform.cjs +41 -0
- package/dist/animation/texture-transform.d.ts +8 -0
- package/dist/animation/texture-transform.d.ts.map +1 -0
- package/dist/animation/texture-transform.js +17 -0
- package/dist/animation/texture-transform.js.map +1 -0
- package/dist/animation/timeline.cjs +129 -0
- package/dist/animation-loop/animation-loop-template.cjs +33 -0
- package/dist/animation-loop/animation-loop.cjs +498 -0
- package/dist/animation-loop/animation-loop.d.ts +2 -1
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +9 -3
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/animation-props.cjs +15 -0
- package/dist/animation-loop/make-animation-loop.cjs +104 -0
- package/dist/animation-loop/request-animation-frame.cjs +43 -0
- package/dist/application-utils/load-file.cjs +77 -0
- package/dist/application-utils/random.cjs +38 -0
- package/dist/audio/audio-controller.cjs +429 -0
- package/dist/audio/audio-controller.d.ts +146 -0
- package/dist/audio/audio-controller.d.ts.map +1 -0
- package/dist/audio/audio-controller.js +445 -0
- package/dist/audio/audio-controller.js.map +1 -0
- package/dist/audio/audio-environment.cjs +157 -0
- package/dist/audio/audio-environment.d.ts +49 -0
- package/dist/audio/audio-environment.d.ts.map +1 -0
- package/dist/audio/audio-environment.js +148 -0
- package/dist/audio/audio-environment.js.map +1 -0
- package/dist/audio/audio-graph.cjs +182 -0
- package/dist/audio/audio-graph.d.ts +58 -0
- package/dist/audio/audio-graph.d.ts.map +1 -0
- package/dist/audio/audio-graph.js +181 -0
- package/dist/audio/audio-graph.js.map +1 -0
- package/dist/compute/buffer-transform.cjs +146 -0
- package/dist/compute/buffer-transform.d.ts +15 -5
- package/dist/compute/buffer-transform.d.ts.map +1 -1
- package/dist/compute/buffer-transform.js +56 -12
- package/dist/compute/buffer-transform.js.map +1 -1
- package/dist/compute/computation.cjs +331 -0
- package/dist/compute/computation.d.ts +2 -4
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +3 -14
- package/dist/compute/computation.js.map +1 -1
- package/dist/compute/swap.cjs +132 -0
- package/dist/compute/texture-transform.cjs +142 -0
- package/dist/compute/texture-transform.d.ts +11 -7
- package/dist/compute/texture-transform.d.ts.map +1 -1
- package/dist/compute/texture-transform.js +16 -6
- package/dist/compute/texture-transform.js.map +1 -1
- package/dist/controls/orbit-controls.cjs +283 -0
- package/dist/controls/orbit-controls.d.ts +2 -0
- package/dist/controls/orbit-controls.d.ts.map +1 -1
- package/dist/controls/orbit-controls.js +2 -1
- package/dist/controls/orbit-controls.js.map +1 -1
- package/dist/debug/copy-texture-to-image.cjs +84 -0
- package/dist/debug/debug-framebuffer.cjs +113 -0
- package/dist/debug/debug-shader-layout.cjs +45 -0
- package/dist/debug/pixel-data-utils.cjs +54 -0
- package/dist/dist.dev.js +11756 -5632
- package/dist/dist.min.js +39 -35
- package/dist/dynamic-buffer/dynamic-buffer.cjs +39 -0
- package/dist/dynamic-buffer/dynamic-buffer.d.ts +1 -170
- package/dist/dynamic-buffer/dynamic-buffer.d.ts.map +1 -1
- package/dist/dynamic-buffer/dynamic-buffer.js +2 -312
- package/dist/dynamic-buffer/dynamic-buffer.js.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.cjs +27 -0
- package/dist/dynamic-texture/dynamic-texture.d.ts +1 -114
- package/dist/dynamic-texture/dynamic-texture.d.ts.map +1 -1
- package/dist/dynamic-texture/dynamic-texture.js +2 -584
- package/dist/dynamic-texture/dynamic-texture.js.map +1 -1
- package/dist/dynamic-texture/texture-binding-source.cjs +31 -0
- package/dist/dynamic-texture/texture-binding-source.d.ts +1 -54
- package/dist/dynamic-texture/texture-binding-source.d.ts.map +1 -1
- package/dist/dynamic-texture/texture-binding-source.js +2 -51
- package/dist/dynamic-texture/texture-binding-source.js.map +1 -1
- package/dist/dynamic-texture/texture-data.cjs +53 -0
- package/dist/dynamic-texture/texture-data.d.ts +1 -145
- package/dist/dynamic-texture/texture-data.d.ts.map +1 -1
- package/dist/dynamic-texture/texture-data.js +2 -209
- package/dist/dynamic-texture/texture-data.js.map +1 -1
- package/dist/dynamic-texture/video-texture.cjs +269 -0
- package/dist/dynamic-texture/video-texture.d.ts +1 -1
- package/dist/dynamic-texture/video-texture.d.ts.map +1 -1
- package/dist/experimental/controls/comparison-splitter.cjs +231 -0
- package/dist/experimental/controls/comparison-splitter.d.ts +54 -0
- package/dist/experimental/controls/comparison-splitter.d.ts.map +1 -0
- package/dist/experimental/controls/comparison-splitter.js +215 -0
- package/dist/experimental/controls/comparison-splitter.js.map +1 -0
- package/dist/experimental/controls/flat-controller.cjs +301 -0
- package/dist/experimental/controls/flat-controller.d.ts +80 -0
- package/dist/experimental/controls/flat-controller.d.ts.map +1 -0
- package/dist/experimental/controls/flat-controller.js +295 -0
- package/dist/experimental/controls/flat-controller.js.map +1 -0
- package/dist/experimental/controls/index.cjs +35 -0
- package/dist/experimental/controls/index.cjs.map +6 -0
- package/dist/experimental/controls/index.d.ts +7 -0
- package/dist/experimental/controls/index.d.ts.map +1 -0
- package/dist/experimental/controls/index.js +7 -0
- package/dist/experimental/controls/index.js.map +1 -0
- package/dist/experimental/controls/orbit-controls.cjs +27 -0
- package/dist/experimental/controls/orbit-controls.d.ts +3 -0
- package/dist/experimental/controls/orbit-controls.d.ts.map +1 -0
- package/dist/experimental/controls/orbit-controls.js +5 -0
- package/dist/experimental/controls/orbit-controls.js.map +1 -0
- package/dist/experimental/materials/emissive-material.cjs +126 -0
- package/dist/experimental/materials/emissive-material.d.ts +38 -0
- package/dist/experimental/materials/emissive-material.d.ts.map +1 -0
- package/dist/experimental/materials/emissive-material.js +100 -0
- package/dist/experimental/materials/emissive-material.js.map +1 -0
- package/dist/experimental/materials/glass-material.cjs +570 -0
- package/dist/experimental/materials/glass-material.d.ts +107 -0
- package/dist/experimental/materials/glass-material.d.ts.map +1 -0
- package/dist/experimental/materials/glass-material.js +544 -0
- package/dist/experimental/materials/glass-material.js.map +1 -0
- package/dist/experimental/materials/glass-transmission.cjs +954 -0
- package/dist/experimental/materials/glass-transmission.d.ts +193 -0
- package/dist/experimental/materials/glass-transmission.d.ts.map +1 -0
- package/dist/experimental/materials/glass-transmission.js +928 -0
- package/dist/experimental/materials/glass-transmission.js.map +1 -0
- package/dist/experimental/materials/index.cjs +61 -0
- package/dist/experimental/materials/index.cjs.map +6 -0
- package/dist/experimental/materials/index.d.ts +14 -0
- package/dist/experimental/materials/index.d.ts.map +1 -0
- package/dist/experimental/materials/index.js +11 -0
- package/dist/experimental/materials/index.js.map +1 -0
- package/dist/experimental/materials/optical-caustics.cjs +201 -0
- package/dist/experimental/materials/optical-caustics.d.ts +69 -0
- package/dist/experimental/materials/optical-caustics.d.ts.map +1 -0
- package/dist/experimental/materials/optical-caustics.js +180 -0
- package/dist/experimental/materials/optical-caustics.js.map +1 -0
- package/dist/experimental/materials/optical-lighting.cjs +169 -0
- package/dist/experimental/materials/optical-lighting.d.ts +7 -0
- package/dist/experimental/materials/optical-lighting.d.ts.map +1 -0
- package/dist/experimental/materials/optical-lighting.js +144 -0
- package/dist/experimental/materials/optical-lighting.js.map +1 -0
- package/dist/experimental/materials/optical-point-lights.cjs +258 -0
- package/dist/experimental/materials/optical-point-lights.d.ts +68 -0
- package/dist/experimental/materials/optical-point-lights.d.ts.map +1 -0
- package/dist/experimental/materials/optical-point-lights.js +237 -0
- package/dist/experimental/materials/optical-point-lights.js.map +1 -0
- package/dist/experimental/materials/reflective-material.cjs +216 -0
- package/dist/experimental/materials/reflective-material.d.ts +46 -0
- package/dist/experimental/materials/reflective-material.d.ts.map +1 -0
- package/dist/experimental/materials/reflective-material.js +190 -0
- package/dist/experimental/materials/reflective-material.js.map +1 -0
- package/dist/experimental/textures/html-texture.cjs +221 -0
- package/dist/experimental/textures/html-texture.d.ts +85 -0
- package/dist/experimental/textures/html-texture.d.ts.map +1 -0
- package/dist/experimental/textures/html-texture.js +206 -0
- package/dist/experimental/textures/html-texture.js.map +1 -0
- package/dist/experimental/textures/index.cjs +33 -0
- package/dist/experimental/textures/index.cjs.map +6 -0
- package/dist/experimental/textures/index.d.ts +5 -0
- package/dist/experimental/textures/index.d.ts.map +1 -0
- package/dist/experimental/textures/index.js +7 -0
- package/dist/experimental/textures/index.js.map +1 -0
- package/dist/experimental/textures/packed-pixels.cjs +248 -0
- package/dist/experimental/textures/packed-pixels.d.ts +17 -0
- package/dist/experimental/textures/packed-pixels.d.ts.map +1 -0
- package/dist/experimental/textures/packed-pixels.js +237 -0
- package/dist/experimental/textures/packed-pixels.js.map +1 -0
- package/dist/experimental/textures/rgba-decoder.cjs +60 -0
- package/dist/experimental/textures/rgba-decoder.d.ts +29 -0
- package/dist/experimental/textures/rgba-decoder.d.ts.map +1 -0
- package/dist/experimental/textures/rgba-decoder.js +43 -0
- package/dist/experimental/textures/rgba-decoder.js.map +1 -0
- package/dist/experimental/webxr/index.cjs +38 -0
- package/dist/experimental/webxr/index.cjs.map +6 -0
- package/dist/experimental/webxr/index.d.ts +9 -0
- package/dist/experimental/webxr/index.d.ts.map +1 -0
- package/dist/experimental/webxr/index.js +8 -0
- package/dist/experimental/webxr/index.js.map +1 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.cjs +38 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts +9 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.js +17 -0
- package/dist/experimental/webxr/webxr-animation-frame-provider.js.map +1 -0
- package/dist/experimental/webxr/webxr-camera-texture.cjs +157 -0
- package/dist/experimental/webxr/webxr-camera-texture.d.ts +48 -0
- package/dist/experimental/webxr/webxr-camera-texture.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-camera-texture.js +144 -0
- package/dist/experimental/webxr/webxr-camera-texture.js.map +1 -0
- package/dist/experimental/webxr/webxr-input.cjs +93 -0
- package/dist/experimental/webxr/webxr-input.d.ts +24 -0
- package/dist/experimental/webxr/webxr-input.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-input.js +70 -0
- package/dist/experimental/webxr/webxr-input.js.map +1 -0
- package/dist/experimental/webxr/webxr-manager.cjs +356 -0
- package/dist/experimental/webxr/webxr-manager.d.ts +91 -0
- package/dist/experimental/webxr/webxr-manager.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-manager.js +354 -0
- package/dist/experimental/webxr/webxr-manager.js.map +1 -0
- package/dist/experimental/webxr/webxr-types.cjs +15 -0
- package/dist/experimental/webxr/webxr-types.d.ts +152 -0
- package/dist/experimental/webxr/webxr-types.d.ts.map +1 -0
- package/dist/experimental/webxr/webxr-types.js +5 -0
- package/dist/experimental/webxr/webxr-types.js.map +1 -0
- package/dist/geometry/edge-geometry.cjs +171 -0
- package/dist/geometry/geometry-primitives.cjs +189 -0
- package/dist/geometry/geometry-primitives.d.ts +6 -0
- package/dist/geometry/geometry-primitives.d.ts.map +1 -1
- package/dist/geometry/geometry-primitives.js +8 -0
- package/dist/geometry/geometry-primitives.js.map +1 -1
- package/dist/geometry/geometry-table.cjs +15 -0
- package/dist/geometry/geometry-utils.cjs +147 -0
- package/dist/geometry/geometry.cjs +90 -0
- package/dist/geometry/gpu-geometry.cjs +130 -0
- package/dist/geometry/gpu-vector-geometry-adapter.cjs +88 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts +5 -0
- package/dist/geometry/gpu-vector-geometry-adapter.d.ts.map +1 -0
- package/dist/geometry/gpu-vector-geometry-adapter.js +73 -0
- package/dist/geometry/gpu-vector-geometry-adapter.js.map +1 -0
- package/dist/geometry/gpu-vector-geometry.cjs +40 -0
- package/dist/geometry/gpu-vector-geometry.d.ts +21 -0
- package/dist/geometry/gpu-vector-geometry.d.ts.map +1 -0
- package/dist/geometry/gpu-vector-geometry.js +19 -0
- package/dist/geometry/gpu-vector-geometry.js.map +1 -0
- package/dist/geometry/mesh-simplification.cjs +385 -0
- package/dist/geometry/ring-geometry.cjs +104 -0
- package/dist/geometry/ring-geometry.d.ts +17 -0
- package/dist/geometry/ring-geometry.d.ts.map +1 -0
- package/dist/geometry/ring-geometry.js +94 -0
- package/dist/geometry/ring-geometry.js.map +1 -0
- package/dist/geometry/stroke-geometry.cjs +171 -0
- package/dist/graph/models/index.cjs +66 -0
- package/dist/graph/models/index.cjs.map +6 -0
- package/dist/graph/models/index.d.ts +7 -0
- package/dist/graph/models/index.d.ts.map +1 -0
- package/dist/graph/models/index.js +10 -0
- package/dist/graph/models/index.js.map +1 -0
- package/dist/graph/models/path/path-attribute-model.cjs +421 -0
- package/dist/graph/models/path/path-attribute-model.d.ts +142 -0
- package/dist/graph/models/path/path-attribute-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-attribute-model.js +409 -0
- package/dist/graph/models/path/path-attribute-model.js.map +1 -0
- package/dist/graph/models/path/path-storage-model.cjs +711 -0
- package/dist/graph/models/path/path-storage-model.d.ts +174 -0
- package/dist/graph/models/path/path-storage-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-storage-model.js +720 -0
- package/dist/graph/models/path/path-storage-model.js.map +1 -0
- package/dist/graph/models/path/path-trips-storage-model.cjs +271 -0
- package/dist/graph/models/path/path-trips-storage-model.d.ts +58 -0
- package/dist/graph/models/path/path-trips-storage-model.d.ts.map +1 -0
- package/dist/graph/models/path/path-trips-storage-model.js +248 -0
- package/dist/graph/models/path/path-trips-storage-model.js.map +1 -0
- package/dist/graph/models/polygon/polygon-attribute-model.cjs +117 -0
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts +53 -0
- package/dist/graph/models/polygon/polygon-attribute-model.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-attribute-model.js +101 -0
- package/dist/graph/models/polygon/polygon-attribute-model.js.map +1 -0
- package/dist/graph/models/polygon/polygon-shaders.cjs +283 -0
- package/dist/graph/models/polygon/polygon-shaders.d.ts +77 -0
- package/dist/graph/models/polygon/polygon-shaders.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-shaders.js +242 -0
- package/dist/graph/models/polygon/polygon-shaders.js.map +1 -0
- package/dist/graph/models/polygon/polygon-storage-model.cjs +111 -0
- package/dist/graph/models/polygon/polygon-storage-model.d.ts +53 -0
- package/dist/graph/models/polygon/polygon-storage-model.d.ts.map +1 -0
- package/dist/graph/models/polygon/polygon-storage-model.js +92 -0
- package/dist/graph/models/polygon/polygon-storage-model.js.map +1 -0
- package/dist/graph/physics/index.cjs +50 -0
- package/dist/graph/physics/index.cjs.map +6 -0
- package/dist/graph/physics/index.d.ts +12 -0
- package/dist/graph/physics/index.d.ts.map +1 -0
- package/dist/graph/physics/index.js +12 -0
- package/dist/graph/physics/index.js.map +1 -0
- package/dist/graph/physics/physics-scenegraph.cjs +92 -0
- package/dist/graph/physics/physics-scenegraph.d.ts +35 -0
- package/dist/graph/physics/physics-scenegraph.d.ts.map +1 -0
- package/dist/graph/physics/physics-scenegraph.js +80 -0
- package/dist/graph/physics/physics-scenegraph.js.map +1 -0
- package/dist/graph/physics/scenegraph-behaviors.cjs +164 -0
- package/dist/graph/physics/scenegraph-behaviors.d.ts +37 -0
- package/dist/graph/physics/scenegraph-behaviors.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-behaviors.js +145 -0
- package/dist/graph/physics/scenegraph-behaviors.js.map +1 -0
- package/dist/graph/physics/scenegraph-instance.cjs +246 -0
- package/dist/graph/physics/scenegraph-instance.d.ts +59 -0
- package/dist/graph/physics/scenegraph-instance.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-instance.js +241 -0
- package/dist/graph/physics/scenegraph-instance.js.map +1 -0
- package/dist/graph/physics/scenegraph-joints.cjs +51 -0
- package/dist/graph/physics/scenegraph-joints.d.ts +5 -0
- package/dist/graph/physics/scenegraph-joints.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-joints.js +31 -0
- package/dist/graph/physics/scenegraph-joints.js.map +1 -0
- package/dist/graph/physics/scenegraph-motion.cjs +177 -0
- package/dist/graph/physics/scenegraph-motion.d.ts +37 -0
- package/dist/graph/physics/scenegraph-motion.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-motion.js +168 -0
- package/dist/graph/physics/scenegraph-motion.js.map +1 -0
- package/dist/graph/physics/scenegraph-properties.cjs +170 -0
- package/dist/graph/physics/scenegraph-properties.d.ts +37 -0
- package/dist/graph/physics/scenegraph-properties.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-properties.js +186 -0
- package/dist/graph/physics/scenegraph-properties.js.map +1 -0
- package/dist/graph/physics/scenegraph-publication.cjs +112 -0
- package/dist/graph/physics/scenegraph-publication.d.ts +23 -0
- package/dist/graph/physics/scenegraph-publication.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-publication.js +99 -0
- package/dist/graph/physics/scenegraph-publication.js.map +1 -0
- package/dist/graph/physics/scenegraph-session.cjs +256 -0
- package/dist/graph/physics/scenegraph-session.d.ts +68 -0
- package/dist/graph/physics/scenegraph-session.d.ts.map +1 -0
- package/dist/graph/physics/scenegraph-session.js +249 -0
- package/dist/graph/physics/scenegraph-session.js.map +1 -0
- package/dist/graph/tables/gpu-table-geometry.cjs +84 -0
- package/dist/graph/tables/gpu-table-geometry.d.ts +32 -0
- package/dist/graph/tables/gpu-table-geometry.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-geometry.js +67 -0
- package/dist/graph/tables/gpu-table-geometry.js.map +1 -0
- package/dist/graph/tables/gpu-table-model.cjs +459 -0
- package/dist/graph/tables/gpu-table-model.d.ts +67 -0
- package/dist/graph/tables/gpu-table-model.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-model.js +457 -0
- package/dist/graph/tables/gpu-table-model.js.map +1 -0
- package/dist/graph/tables/gpu-table-transform.cjs +341 -0
- package/dist/graph/tables/gpu-table-transform.d.ts +61 -0
- package/dist/graph/tables/gpu-table-transform.d.ts.map +1 -0
- package/dist/graph/tables/gpu-table-transform.js +333 -0
- package/dist/graph/tables/gpu-table-transform.js.map +1 -0
- package/dist/graph/tables/index.cjs +33 -0
- package/dist/graph/tables/index.cjs.map +6 -0
- package/dist/graph/tables/index.d.ts +4 -0
- package/dist/graph/tables/index.d.ts.map +1 -0
- package/dist/graph/tables/index.js +7 -0
- package/dist/graph/tables/index.js.map +1 -0
- package/dist/index.cjs +303 -9569
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +32 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -3
- package/dist/index.js.map +1 -1
- package/dist/interactivity/interactivity.cjs +570 -0
- package/dist/interactivity/interactivity.d.ts +107 -0
- package/dist/interactivity/interactivity.d.ts.map +1 -0
- package/dist/interactivity/interactivity.js +575 -0
- package/dist/interactivity/interactivity.js.map +1 -0
- package/dist/interactivity/physics.cjs +15 -0
- package/dist/interactivity/physics.d.ts +12 -0
- package/dist/interactivity/physics.d.ts.map +1 -0
- package/dist/interactivity/physics.js +5 -0
- package/dist/interactivity/physics.js.map +1 -0
- package/dist/material/material-factory.cjs +99 -0
- package/dist/material/material-factory.d.ts +1 -1
- package/dist/material/material-factory.d.ts.map +1 -1
- package/dist/material/material.cjs +239 -0
- package/dist/material/material.d.ts +2 -2
- package/dist/material/material.d.ts.map +1 -1
- package/dist/material/material.js +2 -2
- package/dist/material/material.js.map +1 -1
- package/dist/model/gpu-vector-bindings.cjs +226 -0
- package/dist/model/gpu-vector-bindings.d.ts +36 -0
- package/dist/model/gpu-vector-bindings.d.ts.map +1 -0
- package/dist/model/gpu-vector-bindings.js +217 -0
- package/dist/model/gpu-vector-bindings.js.map +1 -0
- package/dist/model/gpu-vector-draw-batches.cjs +82 -0
- package/dist/model/gpu-vector-draw-batches.d.ts +5 -0
- package/dist/model/gpu-vector-draw-batches.d.ts.map +1 -0
- package/dist/model/gpu-vector-draw-batches.js +73 -0
- package/dist/model/gpu-vector-draw-batches.js.map +1 -0
- package/dist/model/gpu-vector-model-batches.cjs +94 -0
- package/dist/model/gpu-vector-model-batches.d.ts +41 -0
- package/dist/model/gpu-vector-model-batches.d.ts.map +1 -0
- package/dist/model/gpu-vector-model-batches.js +77 -0
- package/dist/model/gpu-vector-model-batches.js.map +1 -0
- package/dist/model/gpu-vector-model.cjs +1264 -0
- package/dist/model/gpu-vector-model.d.ts +352 -0
- package/dist/model/gpu-vector-model.d.ts.map +1 -0
- package/dist/model/gpu-vector-model.js +1375 -0
- package/dist/model/gpu-vector-model.js.map +1 -0
- package/dist/model/model.cjs +134 -0
- package/dist/model/model.d.ts +21 -305
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +68 -1092
- package/dist/model/model.js.map +1 -1
- package/dist/model/split-uniforms-and-bindings.cjs +44 -0
- package/dist/model/split-uniforms-and-bindings.d.ts +1 -1
- package/dist/model/split-uniforms-and-bindings.d.ts.map +1 -1
- package/dist/model/split-uniforms-and-bindings.js +5 -2
- package/dist/model/split-uniforms-and-bindings.js.map +1 -1
- package/dist/models/billboard-texture-model.cjs +167 -0
- package/dist/models/billboard-texture-model.d.ts +1 -1
- package/dist/models/billboard-texture-model.d.ts.map +1 -1
- package/dist/models/billboard-texture-model.js +1 -1
- package/dist/models/billboard-texture-model.js.map +1 -1
- package/dist/models/billboard-texture-module.cjs +61 -0
- package/dist/models/clip-space.cjs +103 -0
- package/dist/models/directional-light-model.cjs +45 -0
- package/dist/models/light-model-utils.cjs +426 -0
- package/dist/models/point-light-model.cjs +44 -0
- package/dist/models/spot-light-model.cjs +45 -0
- package/dist/modules/picking/color-picking.cjs +209 -0
- package/dist/modules/picking/color-picking.d.ts +1 -1
- package/dist/modules/picking/index-color-picking.cjs +230 -0
- package/dist/modules/picking/index-color-picking.d.ts +1 -1
- package/dist/modules/picking/index-picking.cjs +201 -0
- package/dist/modules/picking/index-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-color-picking.cjs +28 -0
- package/dist/modules/picking/legacy-color-picking.d.ts +1 -1
- package/dist/modules/picking/legacy-picking-manager.cjs +92 -0
- package/dist/modules/picking/picking-manager.cjs +360 -0
- package/dist/modules/picking/picking-uniforms.cjs +140 -0
- package/dist/modules/picking/picking-uniforms.d.ts +1 -1
- package/dist/modules/picking/picking-uniforms.d.ts.map +1 -1
- package/dist/modules/picking/picking.cjs +43 -0
- package/dist/modules/picking/picking.d.ts +1 -1
- package/dist/passes/get-fragment-shader.cjs +119 -0
- package/dist/passes/shader-pass-renderer.cjs +722 -0
- package/dist/passes/shader-pass-renderer.d.ts +2 -2
- package/dist/passes/shader-pass-renderer.d.ts.map +1 -1
- package/dist/passes/shader-pass-renderer.js +1 -1
- package/dist/passes/shader-pass-renderer.js.map +1 -1
- package/dist/passes/texture-transform-module.cjs +78 -0
- package/dist/scenegraph/controllers/area-light-controller.cjs +143 -0
- package/dist/scenegraph/controllers/area-light-controller.d.ts +31 -0
- package/dist/scenegraph/controllers/area-light-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/area-light-controller.js +130 -0
- package/dist/scenegraph/controllers/area-light-controller.js.map +1 -0
- package/dist/scenegraph/controllers/billboard-controller.cjs +156 -0
- package/dist/scenegraph/controllers/billboard-controller.d.ts +45 -0
- package/dist/scenegraph/controllers/billboard-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/billboard-controller.js +156 -0
- package/dist/scenegraph/controllers/billboard-controller.js.map +1 -0
- package/dist/scenegraph/controllers/joint-controller.cjs +71 -0
- package/dist/scenegraph/controllers/joint-controller.d.ts +30 -0
- package/dist/scenegraph/controllers/joint-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/joint-controller.js +53 -0
- package/dist/scenegraph/controllers/joint-controller.js.map +1 -0
- package/dist/scenegraph/controllers/material-variants.cjs +61 -0
- package/dist/scenegraph/controllers/material-variants.d.ts +42 -0
- package/dist/scenegraph/controllers/material-variants.d.ts.map +1 -0
- package/dist/scenegraph/controllers/material-variants.js +40 -0
- package/dist/scenegraph/controllers/material-variants.js.map +1 -0
- package/dist/scenegraph/controllers/morph-controller.cjs +61 -0
- package/dist/scenegraph/controllers/morph-controller.d.ts +19 -0
- package/dist/scenegraph/controllers/morph-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/morph-controller.js +41 -0
- package/dist/scenegraph/controllers/morph-controller.js.map +1 -0
- package/dist/scenegraph/controllers/skin-controller.cjs +111 -0
- package/dist/scenegraph/controllers/skin-controller.d.ts +36 -0
- package/dist/scenegraph/controllers/skin-controller.d.ts.map +1 -0
- package/dist/scenegraph/controllers/skin-controller.js +90 -0
- package/dist/scenegraph/controllers/skin-controller.js.map +1 -0
- package/dist/scenegraph/group-node.cjs +129 -0
- package/dist/scenegraph/model-node.cjs +68 -0
- package/dist/scenegraph/physics-transforms.cjs +95 -0
- package/dist/scenegraph/physics-transforms.d.ts +13 -0
- package/dist/scenegraph/physics-transforms.d.ts.map +1 -0
- package/dist/scenegraph/physics-transforms.js +72 -0
- package/dist/scenegraph/physics-transforms.js.map +1 -0
- package/dist/scenegraph/published-transforms.cjs +37 -0
- package/dist/scenegraph/published-transforms.d.ts +17 -0
- package/dist/scenegraph/published-transforms.d.ts.map +1 -0
- package/dist/scenegraph/published-transforms.js +16 -0
- package/dist/scenegraph/published-transforms.js.map +1 -0
- package/dist/scenegraph/scenegraph-bounds.cjs +51 -0
- package/dist/scenegraph/scenegraph-node.cjs +182 -0
- package/dist/shader-inputs.cjs +231 -0
- package/dist/shader-inputs.d.ts +1 -1
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/utils/buffer-layout-helper.cjs +52 -0
- package/dist/utils/buffer-layout-order.cjs +37 -0
- package/dist/utils/deep-equal.cjs +65 -0
- package/dist/utils/get-platform-info.cjs +21 -0
- package/dist/utils/get-platform-info.d.ts +2 -0
- package/dist/utils/get-platform-info.d.ts.map +1 -0
- package/dist/utils/get-platform-info.js +5 -0
- package/dist/utils/get-platform-info.js.map +1 -0
- package/dist/utils/gpu-vector-batch-structure.cjs +45 -0
- package/dist/utils/gpu-vector-batch-structure.d.ts +12 -0
- package/dist/utils/gpu-vector-batch-structure.d.ts.map +1 -0
- package/dist/utils/gpu-vector-batch-structure.js +27 -0
- package/dist/utils/gpu-vector-batch-structure.js.map +1 -0
- package/dist/utils/shader-module-utils.cjs +148 -0
- package/dist/utils/uid.cjs +32 -0
- package/package.json +45 -7
- package/src/animation/deform-positions.ts +62 -0
- package/src/animation/node-animation-binding.ts +54 -0
- package/src/animation/property-animation-binding.ts +212 -0
- package/src/animation/scenegraph-animator.ts +117 -0
- package/src/animation/texture-transform.ts +59 -0
- package/src/animation-loop/animation-loop.ts +10 -3
- package/src/audio/audio-controller.ts +583 -0
- package/src/audio/audio-environment.ts +202 -0
- package/src/audio/audio-graph.ts +253 -0
- package/src/compute/buffer-transform.ts +71 -16
- package/src/compute/computation.ts +4 -19
- package/src/compute/texture-transform.ts +25 -12
- package/src/controls/orbit-controls.ts +4 -1
- package/src/dynamic-buffer/dynamic-buffer.ts +15 -449
- package/src/dynamic-texture/dynamic-texture.ts +5 -760
- package/src/dynamic-texture/texture-binding-source.ts +8 -90
- package/src/dynamic-texture/texture-data.ts +31 -340
- package/src/dynamic-texture/video-texture.ts +1 -1
- package/src/experimental/controls/comparison-splitter.ts +269 -0
- package/src/experimental/controls/flat-controller.ts +403 -0
- package/src/experimental/controls/index.ts +16 -0
- package/src/experimental/controls/orbit-controls.ts +6 -0
- package/src/experimental/materials/emissive-material.ts +120 -0
- package/src/experimental/materials/glass-material.ts +607 -0
- package/src/experimental/materials/glass-transmission.ts +1023 -0
- package/src/experimental/materials/index.ts +49 -0
- package/src/experimental/materials/optical-caustics.ts +234 -0
- package/src/experimental/materials/optical-lighting.ts +148 -0
- package/src/experimental/materials/optical-point-lights.ts +288 -0
- package/src/experimental/materials/reflective-material.ts +214 -0
- package/src/experimental/textures/html-texture.ts +285 -0
- package/src/experimental/textures/index.ts +8 -0
- package/src/experimental/textures/packed-pixels.ts +351 -0
- package/src/experimental/textures/rgba-decoder.ts +79 -0
- package/src/experimental/webxr/index.ts +21 -0
- package/src/experimental/webxr/webxr-animation-frame-provider.ts +22 -0
- package/src/experimental/webxr/webxr-camera-texture.ts +195 -0
- package/src/experimental/webxr/webxr-input.ts +117 -0
- package/src/experimental/webxr/webxr-manager.ts +524 -0
- package/src/experimental/webxr/webxr-types.ts +192 -0
- package/src/geometry/geometry-primitives.ts +11 -0
- package/src/geometry/gpu-vector-geometry-adapter.ts +78 -0
- package/src/geometry/gpu-vector-geometry.ts +33 -0
- package/src/geometry/ring-geometry.ts +117 -0
- package/src/graph/models/index.ts +45 -0
- package/src/graph/models/path/path-attribute-model.ts +563 -0
- package/src/graph/models/path/path-storage-model.ts +996 -0
- package/src/graph/models/path/path-trips-storage-model.ts +286 -0
- package/src/graph/models/polygon/polygon-attribute-model.ts +165 -0
- package/src/graph/models/polygon/polygon-shaders.ts +279 -0
- package/src/graph/models/polygon/polygon-storage-model.ts +146 -0
- package/src/graph/physics/index.ts +24 -0
- package/src/graph/physics/physics-scenegraph.ts +112 -0
- package/src/graph/physics/scenegraph-behaviors.ts +169 -0
- package/src/graph/physics/scenegraph-instance.ts +296 -0
- package/src/graph/physics/scenegraph-joints.ts +37 -0
- package/src/graph/physics/scenegraph-motion.ts +175 -0
- package/src/graph/physics/scenegraph-properties.ts +241 -0
- package/src/graph/physics/scenegraph-publication.ts +116 -0
- package/src/graph/physics/scenegraph-session.ts +317 -0
- package/src/graph/tables/gpu-table-geometry.ts +88 -0
- package/src/graph/tables/gpu-table-model.ts +661 -0
- package/src/graph/tables/gpu-table-transform.ts +497 -0
- package/src/graph/tables/index.ts +18 -0
- package/src/index.ts +130 -13
- package/src/interactivity/interactivity.ts +670 -0
- package/src/interactivity/physics.ts +19 -0
- package/src/material/material-factory.ts +1 -1
- package/src/material/material.ts +2 -2
- package/src/model/gpu-vector-bindings.ts +276 -0
- package/src/model/gpu-vector-draw-batches.ts +116 -0
- package/src/model/gpu-vector-model-batches.ts +142 -0
- package/src/model/gpu-vector-model.ts +1819 -0
- package/src/model/model.ts +91 -1444
- package/src/model/split-uniforms-and-bindings.ts +6 -3
- package/src/models/billboard-texture-model.ts +1 -1
- package/src/modules/picking/legacy-picking-manager.ts +1 -1
- package/src/modules/picking/picking-uniforms.ts +1 -1
- package/src/passes/shader-pass-renderer.ts +2 -2
- package/src/scenegraph/controllers/area-light-controller.ts +152 -0
- package/src/scenegraph/controllers/billboard-controller.ts +204 -0
- package/src/scenegraph/controllers/joint-controller.ts +81 -0
- package/src/scenegraph/controllers/material-variants.ts +70 -0
- package/src/scenegraph/controllers/morph-controller.ts +61 -0
- package/src/scenegraph/controllers/skin-controller.ts +125 -0
- package/src/scenegraph/physics-transforms.ts +82 -0
- package/src/scenegraph/published-transforms.ts +18 -0
- package/src/shader-inputs.ts +1 -1
- package/src/utils/get-platform-info.ts +5 -0
- package/src/utils/gpu-vector-batch-structure.ts +36 -0
- package/dist/compute/kernel.d.ts +0 -54
- package/dist/compute/kernel.d.ts.map +0 -1
- package/dist/compute/kernel.js +0 -103
- package/dist/compute/kernel.js.map +0 -1
- package/dist/compute/render-kernel.d.ts +0 -65
- package/dist/compute/render-kernel.d.ts.map +0 -1
- package/dist/compute/render-kernel.js +0 -129
- package/dist/compute/render-kernel.js.map +0 -1
- package/src/compute/kernel.ts +0 -146
- package/src/compute/render-kernel.ts +0 -192
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var video_texture_exports = {};
|
|
19
|
+
__export(video_texture_exports, {
|
|
20
|
+
VideoTexture: () => VideoTexture
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(video_texture_exports);
|
|
23
|
+
var import_core = require("@luma.gl/core");
|
|
24
|
+
var import_uid = require("../utils/uid.cjs");
|
|
25
|
+
class VideoTexture {
|
|
26
|
+
/** Device used to create copied and native external texture bindings. */
|
|
27
|
+
device;
|
|
28
|
+
/** Stable resource identifier used in loading and debug messages. */
|
|
29
|
+
id;
|
|
30
|
+
/** Whether this video binding source has been destroyed. */
|
|
31
|
+
destroyed = false;
|
|
32
|
+
/** Monotonic binding generation advanced when concrete draw bindings may need recreation. */
|
|
33
|
+
generation = 0;
|
|
34
|
+
_source;
|
|
35
|
+
_colorSpace;
|
|
36
|
+
_sampler;
|
|
37
|
+
_isReady = false;
|
|
38
|
+
_updateTimestamp;
|
|
39
|
+
_sourceVersion = 0;
|
|
40
|
+
_sourceFrameToken = null;
|
|
41
|
+
_texture = null;
|
|
42
|
+
_textureFrameToken = void 0;
|
|
43
|
+
_externalTexture = null;
|
|
44
|
+
/** Current caller-owned live video source. */
|
|
45
|
+
get source() {
|
|
46
|
+
return this._source;
|
|
47
|
+
}
|
|
48
|
+
/** Whether the current source exposes dimensions and a current frame. */
|
|
49
|
+
get isReady() {
|
|
50
|
+
this._observeSource();
|
|
51
|
+
return this._isReady;
|
|
52
|
+
}
|
|
53
|
+
/** Device timestamp of the most recent source content or binding identity update. */
|
|
54
|
+
get updateTimestamp() {
|
|
55
|
+
this._observeSource();
|
|
56
|
+
return this._updateTimestamp;
|
|
57
|
+
}
|
|
58
|
+
/** Resource label used by debug output. */
|
|
59
|
+
get [Symbol.toStringTag]() {
|
|
60
|
+
return "VideoTexture";
|
|
61
|
+
}
|
|
62
|
+
/** Formats the current source dimensions and readiness for debug output. */
|
|
63
|
+
toString() {
|
|
64
|
+
const size = getVideoTextureSourceSize(this._source);
|
|
65
|
+
return `VideoTexture:"${this.id}":${size.width}x${size.height}px:(${this._isReady ? "ready" : "loading..."})`;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates a live video binding source.
|
|
69
|
+
* @param device Device that resolves copied or native external bindings.
|
|
70
|
+
* @param props Live video source and copied texture options.
|
|
71
|
+
*/
|
|
72
|
+
constructor(device, props) {
|
|
73
|
+
(0, import_core.assert)(isHTMLVideoElementSource(props == null ? void 0 : props.source) || isVideoFrameSource(props == null ? void 0 : props.source));
|
|
74
|
+
this.device = device;
|
|
75
|
+
this.id = props.id || (0, import_uid.uid)("video-texture");
|
|
76
|
+
this._source = props.source;
|
|
77
|
+
this._colorSpace = props.colorSpace ?? "srgb";
|
|
78
|
+
this._sampler = props.sampler ?? {};
|
|
79
|
+
this._updateTimestamp = this.device.incrementTimestamp();
|
|
80
|
+
this.setSource(props.source);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Replaces the caller-owned video source and invalidates resolved bindings.
|
|
84
|
+
* @param source Next caller-owned video source to follow.
|
|
85
|
+
*/
|
|
86
|
+
setSource(source) {
|
|
87
|
+
(0, import_core.assert)(isHTMLVideoElementSource(source) || isVideoFrameSource(source));
|
|
88
|
+
this._destroyExternalTexture();
|
|
89
|
+
this._source = source;
|
|
90
|
+
this._sourceVersion++;
|
|
91
|
+
this._sourceFrameToken = null;
|
|
92
|
+
this._textureFrameToken = void 0;
|
|
93
|
+
this._observeSource();
|
|
94
|
+
this._touchGeneration();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resolves one reflected shader texture slot for the current video frame.
|
|
98
|
+
* @param bindingLayout Reflected `texture` or `external-texture` shader slot.
|
|
99
|
+
* @returns A copied texture, native external texture, or `null` while unavailable.
|
|
100
|
+
*/
|
|
101
|
+
resolveTextureBinding(bindingLayout) {
|
|
102
|
+
this._observeSource();
|
|
103
|
+
if (!this._isReady || this.destroyed) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
if (bindingLayout.type === "external-texture" && this.device.type === "webgpu") {
|
|
107
|
+
return this._createNativeExternalTexture();
|
|
108
|
+
}
|
|
109
|
+
return this._resolveCopiedTexture();
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Replaces the default sampler used by copied and native external bindings.
|
|
113
|
+
* @param sampler Sampler instance or sampler properties to use for future resolutions.
|
|
114
|
+
*/
|
|
115
|
+
setSampler(sampler) {
|
|
116
|
+
var _a, _b, _c;
|
|
117
|
+
this._sampler = sampler;
|
|
118
|
+
(_a = this._texture) == null ? void 0 : _a.setSampler(sampler);
|
|
119
|
+
(_c = (_b = this._externalTexture) == null ? void 0 : _b.setSampler) == null ? void 0 : _c.call(_b, sampler);
|
|
120
|
+
this._touchGeneration();
|
|
121
|
+
}
|
|
122
|
+
/** Releases owned copied/external bindings without closing the caller-owned source. */
|
|
123
|
+
destroy() {
|
|
124
|
+
var _a;
|
|
125
|
+
if (this.destroyed) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this._destroyExternalTexture();
|
|
129
|
+
(_a = this._texture) == null ? void 0 : _a.destroy();
|
|
130
|
+
this._texture = null;
|
|
131
|
+
this._textureFrameToken = void 0;
|
|
132
|
+
this._isReady = false;
|
|
133
|
+
this.destroyed = true;
|
|
134
|
+
this._touchGeneration();
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Resolves and uploads the copied texture variant for the current source frame.
|
|
138
|
+
* @returns Copied texture containing the current observed frame.
|
|
139
|
+
*/
|
|
140
|
+
_resolveCopiedTexture() {
|
|
141
|
+
const texture = this._getOrCreateCopiedTexture();
|
|
142
|
+
if (!Object.is(this._textureFrameToken, this._sourceFrameToken)) {
|
|
143
|
+
texture.copyExternalImage({
|
|
144
|
+
image: this._source,
|
|
145
|
+
colorSpace: this._colorSpace
|
|
146
|
+
});
|
|
147
|
+
this._textureFrameToken = this._sourceFrameToken;
|
|
148
|
+
}
|
|
149
|
+
return texture;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Returns an existing size-compatible copied texture or creates one lazily.
|
|
153
|
+
* @returns Copied texture allocated for the current source dimensions.
|
|
154
|
+
*/
|
|
155
|
+
_getOrCreateCopiedTexture() {
|
|
156
|
+
const size = this._getResolvedSize();
|
|
157
|
+
const currentTexture = this._texture;
|
|
158
|
+
if (currentTexture && currentTexture.width === size.width && currentTexture.height === size.height) {
|
|
159
|
+
return currentTexture;
|
|
160
|
+
}
|
|
161
|
+
currentTexture == null ? void 0 : currentTexture.destroy();
|
|
162
|
+
const texture = this.device.createTexture({
|
|
163
|
+
id: `${this.id}-texture`,
|
|
164
|
+
width: size.width,
|
|
165
|
+
height: size.height,
|
|
166
|
+
format: "rgba8unorm",
|
|
167
|
+
usage: import_core.Texture.SAMPLE | import_core.Texture.COPY_DST,
|
|
168
|
+
mipLevels: 1,
|
|
169
|
+
sampler: this._sampler
|
|
170
|
+
});
|
|
171
|
+
this._texture = texture;
|
|
172
|
+
this._textureFrameToken = void 0;
|
|
173
|
+
this._touchGeneration();
|
|
174
|
+
return texture;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Acquires one native WebGPU external texture binding.
|
|
178
|
+
* @returns Fresh acquired external texture.
|
|
179
|
+
*/
|
|
180
|
+
_createNativeExternalTexture() {
|
|
181
|
+
this._destroyExternalTexture();
|
|
182
|
+
this._externalTexture = this.device.createExternalTexture({
|
|
183
|
+
id: `${this.id}-external`,
|
|
184
|
+
source: this._source,
|
|
185
|
+
colorSpace: this._colorSpace,
|
|
186
|
+
sampler: this._sampler
|
|
187
|
+
});
|
|
188
|
+
this.generation++;
|
|
189
|
+
return this._externalTexture;
|
|
190
|
+
}
|
|
191
|
+
/** Releases the current acquired external texture wrapper. */
|
|
192
|
+
_destroyExternalTexture() {
|
|
193
|
+
var _a;
|
|
194
|
+
(_a = this._externalTexture) == null ? void 0 : _a.destroy();
|
|
195
|
+
this._externalTexture = null;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Resolves current copied texture dimensions.
|
|
199
|
+
* @returns Positive dimensions for the current source frame.
|
|
200
|
+
*/
|
|
201
|
+
_getResolvedSize() {
|
|
202
|
+
const size = getVideoTextureSourceSize(this._source);
|
|
203
|
+
(0, import_core.assert)(size.width > 0 && size.height > 0);
|
|
204
|
+
return size;
|
|
205
|
+
}
|
|
206
|
+
/** Observes current source readiness and frame identity before binding resolution. */
|
|
207
|
+
_observeSource() {
|
|
208
|
+
if (this.destroyed) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
const isReady = isVideoTextureSourceReady(this._source);
|
|
212
|
+
if (isReady !== this._isReady) {
|
|
213
|
+
this._isReady = isReady;
|
|
214
|
+
this._touch();
|
|
215
|
+
}
|
|
216
|
+
if (!isReady) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
const frameToken = getVideoTextureSourceFrameToken(this._source, this._sourceVersion);
|
|
220
|
+
if (!Object.is(frameToken, this._sourceFrameToken)) {
|
|
221
|
+
this._sourceFrameToken = frameToken;
|
|
222
|
+
this._touch();
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
/** Advances the device timestamp after source content or readiness changes. */
|
|
226
|
+
_touch() {
|
|
227
|
+
this._updateTimestamp = this.device.incrementTimestamp();
|
|
228
|
+
}
|
|
229
|
+
/** Advances binding generation and timestamp after binding identity can change. */
|
|
230
|
+
_touchGeneration() {
|
|
231
|
+
this.generation++;
|
|
232
|
+
this._touch();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function isHTMLVideoElementSource(source) {
|
|
236
|
+
if (!source || typeof source !== "object") {
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
return typeof HTMLVideoElement !== "undefined" && source instanceof HTMLVideoElement || "videoWidth" in source && "videoHeight" in source && "readyState" in source && "currentTime" in source;
|
|
240
|
+
}
|
|
241
|
+
function isVideoFrameSource(source) {
|
|
242
|
+
if (!source || typeof source !== "object") {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
return typeof VideoFrame !== "undefined" && source instanceof VideoFrame || "displayWidth" in source && "displayHeight" in source && "timestamp" in source && !("videoWidth" in source);
|
|
246
|
+
}
|
|
247
|
+
function isVideoTextureSourceReady(source) {
|
|
248
|
+
const size = getVideoTextureSourceSize(source);
|
|
249
|
+
if (size.width <= 0 || size.height <= 0) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
return isHTMLVideoElementSource(source) ? source.readyState >= 2 : true;
|
|
253
|
+
}
|
|
254
|
+
function getVideoTextureSourceSize(source) {
|
|
255
|
+
if (isHTMLVideoElementSource(source)) {
|
|
256
|
+
return { width: source.videoWidth, height: source.videoHeight };
|
|
257
|
+
}
|
|
258
|
+
return { width: source.displayWidth, height: source.displayHeight };
|
|
259
|
+
}
|
|
260
|
+
function getVideoTextureSourceFrameToken(source, sourceVersion) {
|
|
261
|
+
if (isHTMLVideoElementSource(source)) {
|
|
262
|
+
return `${sourceVersion}:${source.currentTime}:${source.videoWidth}x${source.videoHeight}`;
|
|
263
|
+
}
|
|
264
|
+
return `${sourceVersion}:${source.timestamp}:${source.displayWidth}x${source.displayHeight}`;
|
|
265
|
+
}
|
|
266
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
267
|
+
0 && (module.exports = {
|
|
268
|
+
VideoTexture
|
|
269
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Device, ExternalTexture, ResourceProps, Sampler, SamplerProps } from '@luma.gl/core';
|
|
2
2
|
import { Texture } from '@luma.gl/core';
|
|
3
|
-
import type { TextureBindingLayout, TextureBindingSource } from
|
|
3
|
+
import type { TextureBindingLayout, TextureBindingSource } from '@luma.gl/core/dynamic';
|
|
4
4
|
/** Properties for a live video binding source. */
|
|
5
5
|
export type VideoTextureProps = Pick<ResourceProps, 'id'> & {
|
|
6
6
|
/** Caller-owned live video source followed by this binding source. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-texture.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/video-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,OAAO,EAAS,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,
|
|
1
|
+
{"version":3,"file":"video-texture.d.ts","sourceRoot":"","sources":["../../src/dynamic-texture/video-texture.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACjG,OAAO,EAAC,OAAO,EAAS,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAC,oBAAoB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AAEtF,kDAAkD;AAClD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG;IAC1D,sEAAsE;IACtE,MAAM,EAAE,gBAAgB,GAAG,UAAU,CAAC;IACtC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;CAClC,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,YAAa,YAAW,oBAAoB;IACvD,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,4DAA4D;IAC5D,SAAS,UAAS;IAClB,6FAA6F;IAC7F,UAAU,SAAK;IAEf,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,gBAAgB,CAAgC;IAExD,8CAA8C;IAC9C,IAAI,MAAM,IAAI,gBAAgB,GAAG,UAAU,CAE1C;IAED,yEAAyE;IACzE,IAAI,OAAO,IAAI,OAAO,CAGrB;IAED,qFAAqF;IACrF,IAAI,eAAe,IAAI,MAAM,CAG5B;IAED,2CAA2C;IAC3C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,WAEvB;IAED,4EAA4E;IAC5E,QAAQ,IAAI,MAAM;IAKlB;;;;OAIG;gBACS,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB;IAcpD;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU,GAAG,IAAI;IAatD;;;;OAIG;IACH,qBAAqB,CAAC,aAAa,EAAE,oBAAoB,GAAG,OAAO,GAAG,eAAe,GAAG,IAAI;IAa5F;;;OAGG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI;IAOjD,uFAAuF;IACvF,OAAO,IAAI,IAAI;IAaf;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAc7B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA4BjC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAcpC,8DAA8D;IAC9D,OAAO,CAAC,uBAAuB;IAK/B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAOxB,sFAAsF;IACtF,OAAO,CAAC,cAAc;IAsBtB,+EAA+E;IAC/E,OAAO,CAAC,MAAM;IAId,mFAAmF;IACnF,OAAO,CAAC,gBAAgB;CAIzB"}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var comparison_splitter_exports = {};
|
|
19
|
+
__export(comparison_splitter_exports, {
|
|
20
|
+
ComparisonSplitter: () => ComparisonSplitter
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(comparison_splitter_exports);
|
|
23
|
+
const DEFAULT_ACCENT_COLOR = "#33ebff";
|
|
24
|
+
const DEFAULT_HANDLE_COLOR = "rgb(8 47 73 / 92%)";
|
|
25
|
+
class ComparisonSplitter {
|
|
26
|
+
/** Focusable DOM separator. Its children and inline styles are owned by this instance. */
|
|
27
|
+
element;
|
|
28
|
+
canvas;
|
|
29
|
+
container;
|
|
30
|
+
onChange;
|
|
31
|
+
onCommit;
|
|
32
|
+
dividerLine;
|
|
33
|
+
accentColor;
|
|
34
|
+
value;
|
|
35
|
+
visible = true;
|
|
36
|
+
activePointerId = null;
|
|
37
|
+
destroyed = false;
|
|
38
|
+
constructor({ canvas, id, value, onChange, onCommit, label = "Before and after comparison", accentColor = DEFAULT_ACCENT_COLOR, handleColor = DEFAULT_HANDLE_COLOR, container }) {
|
|
39
|
+
this.canvas = canvas;
|
|
40
|
+
this.container = container;
|
|
41
|
+
this.value = clampSplit(value);
|
|
42
|
+
this.onChange = onChange;
|
|
43
|
+
this.onCommit = onCommit;
|
|
44
|
+
this.accentColor = accentColor;
|
|
45
|
+
const ownerDocument = canvas.ownerDocument || document;
|
|
46
|
+
this.element = ownerDocument.createElement("div");
|
|
47
|
+
if (id) {
|
|
48
|
+
this.element.id = id;
|
|
49
|
+
}
|
|
50
|
+
this.element.tabIndex = 0;
|
|
51
|
+
this.element.dataset["lumaComparisonSplitter"] = "true";
|
|
52
|
+
this.element.setAttribute("role", "separator");
|
|
53
|
+
this.element.setAttribute("aria-label", label);
|
|
54
|
+
this.element.setAttribute("aria-orientation", "vertical");
|
|
55
|
+
this.element.setAttribute("aria-valuemin", "0");
|
|
56
|
+
this.element.setAttribute("aria-valuemax", "1");
|
|
57
|
+
Object.assign(this.element.style, {
|
|
58
|
+
position: container ? "absolute" : "fixed",
|
|
59
|
+
width: "32px",
|
|
60
|
+
transform: "translateX(-50%)",
|
|
61
|
+
cursor: "col-resize",
|
|
62
|
+
touchAction: "none",
|
|
63
|
+
userSelect: "none",
|
|
64
|
+
outlineOffset: "4px",
|
|
65
|
+
zIndex: "10"
|
|
66
|
+
});
|
|
67
|
+
this.dividerLine = ownerDocument.createElement("span");
|
|
68
|
+
this.dividerLine.setAttribute("aria-hidden", "true");
|
|
69
|
+
Object.assign(this.dividerLine.style, {
|
|
70
|
+
position: "absolute",
|
|
71
|
+
top: "0",
|
|
72
|
+
bottom: "0",
|
|
73
|
+
left: "50%",
|
|
74
|
+
width: "2px",
|
|
75
|
+
transform: "translateX(-50%)",
|
|
76
|
+
backgroundColor: accentColor,
|
|
77
|
+
boxShadow: `0 0 8px ${accentColor}`,
|
|
78
|
+
pointerEvents: "none"
|
|
79
|
+
});
|
|
80
|
+
const handle = ownerDocument.createElement("span");
|
|
81
|
+
handle.setAttribute("aria-hidden", "true");
|
|
82
|
+
handle.textContent = "\u2194";
|
|
83
|
+
Object.assign(handle.style, {
|
|
84
|
+
position: "absolute",
|
|
85
|
+
top: "50%",
|
|
86
|
+
left: "50%",
|
|
87
|
+
width: "20px",
|
|
88
|
+
height: "44px",
|
|
89
|
+
transform: "translate(-50%, -50%)",
|
|
90
|
+
border: `1px solid ${accentColor}`,
|
|
91
|
+
borderRadius: "8px",
|
|
92
|
+
backgroundColor: handleColor,
|
|
93
|
+
color: accentColor,
|
|
94
|
+
boxShadow: "0 2px 12px rgb(0 0 0 / 45%)",
|
|
95
|
+
font: "16px / 42px system-ui, sans-serif",
|
|
96
|
+
textAlign: "center",
|
|
97
|
+
pointerEvents: "none"
|
|
98
|
+
});
|
|
99
|
+
this.element.append(this.dividerLine, handle);
|
|
100
|
+
this.element.addEventListener("pointerdown", this.handlePointerDown);
|
|
101
|
+
this.element.addEventListener("pointermove", this.handlePointerMove);
|
|
102
|
+
this.element.addEventListener("pointerup", this.handlePointerUp);
|
|
103
|
+
this.element.addEventListener("pointercancel", this.handlePointerCancel);
|
|
104
|
+
this.element.addEventListener("keydown", this.handleKeyDown);
|
|
105
|
+
(container || ownerDocument.body).append(this.element);
|
|
106
|
+
this.updateValue(this.value, false);
|
|
107
|
+
}
|
|
108
|
+
/** Releases pointer capture, removes interaction handlers, and detaches this divider. */
|
|
109
|
+
destroy() {
|
|
110
|
+
if (this.destroyed) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.destroyed = true;
|
|
114
|
+
if (this.activePointerId !== null && this.element.hasPointerCapture(this.activePointerId)) {
|
|
115
|
+
this.element.releasePointerCapture(this.activePointerId);
|
|
116
|
+
}
|
|
117
|
+
this.activePointerId = null;
|
|
118
|
+
this.element.removeEventListener("pointerdown", this.handlePointerDown);
|
|
119
|
+
this.element.removeEventListener("pointermove", this.handlePointerMove);
|
|
120
|
+
this.element.removeEventListener("pointerup", this.handlePointerUp);
|
|
121
|
+
this.element.removeEventListener("pointercancel", this.handlePointerCancel);
|
|
122
|
+
this.element.removeEventListener("keydown", this.handleKeyDown);
|
|
123
|
+
this.element.remove();
|
|
124
|
+
}
|
|
125
|
+
/** Updates the normalized divider position without firing interaction callbacks. */
|
|
126
|
+
setValue(value) {
|
|
127
|
+
this.updateValue(value, false);
|
|
128
|
+
}
|
|
129
|
+
/** Hides or shows the divider while preserving its normalized position. */
|
|
130
|
+
setVisible(visible) {
|
|
131
|
+
this.visible = visible;
|
|
132
|
+
this.updateLayout();
|
|
133
|
+
}
|
|
134
|
+
/** Repositions the divider after the canvas or optional host moves, scrolls, or resizes. */
|
|
135
|
+
updateLayout() {
|
|
136
|
+
var _a;
|
|
137
|
+
const canvasBounds = this.canvas.getBoundingClientRect();
|
|
138
|
+
const rendered = this.visible && canvasBounds.width > 0 && canvasBounds.height > 0;
|
|
139
|
+
this.element.hidden = !rendered;
|
|
140
|
+
if (!rendered) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const containerBounds = (_a = this.container) == null ? void 0 : _a.getBoundingClientRect();
|
|
144
|
+
const horizontalOffset = containerBounds ? containerBounds.left + this.container.clientLeft - this.container.scrollLeft : 0;
|
|
145
|
+
const verticalOffset = containerBounds ? containerBounds.top + this.container.clientTop - this.container.scrollTop : 0;
|
|
146
|
+
this.element.style.left = `${canvasBounds.left - horizontalOffset + canvasBounds.width * this.value}px`;
|
|
147
|
+
this.element.style.top = `${canvasBounds.top - verticalOffset}px`;
|
|
148
|
+
this.element.style.height = `${canvasBounds.height}px`;
|
|
149
|
+
}
|
|
150
|
+
updateValue(value, notify) {
|
|
151
|
+
this.value = clampSplit(value);
|
|
152
|
+
this.element.setAttribute("aria-valuenow", this.value.toFixed(2));
|
|
153
|
+
this.element.setAttribute("aria-valuetext", `${Math.round(this.value * 100)}% before`);
|
|
154
|
+
this.updateLayout();
|
|
155
|
+
if (notify) {
|
|
156
|
+
this.onChange(this.value);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
updateFromPointer(clientX) {
|
|
160
|
+
const canvasBounds = this.canvas.getBoundingClientRect();
|
|
161
|
+
if (canvasBounds.width > 0) {
|
|
162
|
+
this.updateValue((clientX - canvasBounds.left) / canvasBounds.width, true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
finishPointerInteraction(event, updatePosition) {
|
|
166
|
+
var _a;
|
|
167
|
+
if (event.pointerId !== this.activePointerId) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (updatePosition) {
|
|
171
|
+
this.updateFromPointer(event.clientX);
|
|
172
|
+
}
|
|
173
|
+
this.activePointerId = null;
|
|
174
|
+
delete this.element.dataset["dragging"];
|
|
175
|
+
this.dividerLine.style.width = "2px";
|
|
176
|
+
this.dividerLine.style.backgroundColor = this.accentColor;
|
|
177
|
+
if (this.element.hasPointerCapture(event.pointerId)) {
|
|
178
|
+
this.element.releasePointerCapture(event.pointerId);
|
|
179
|
+
}
|
|
180
|
+
(_a = this.onCommit) == null ? void 0 : _a.call(this, this.value);
|
|
181
|
+
}
|
|
182
|
+
handlePointerDown = (event) => {
|
|
183
|
+
if (event.button !== 0 || this.activePointerId !== null) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
this.activePointerId = event.pointerId;
|
|
188
|
+
this.element.dataset["dragging"] = "true";
|
|
189
|
+
this.dividerLine.style.width = "3px";
|
|
190
|
+
this.dividerLine.style.backgroundColor = "#fff";
|
|
191
|
+
this.element.setPointerCapture(event.pointerId);
|
|
192
|
+
this.updateFromPointer(event.clientX);
|
|
193
|
+
};
|
|
194
|
+
handlePointerMove = (event) => {
|
|
195
|
+
if (event.pointerId === this.activePointerId) {
|
|
196
|
+
this.updateFromPointer(event.clientX);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
handlePointerUp = (event) => {
|
|
200
|
+
this.finishPointerInteraction(event, true);
|
|
201
|
+
};
|
|
202
|
+
handlePointerCancel = (event) => {
|
|
203
|
+
this.finishPointerInteraction(event, false);
|
|
204
|
+
};
|
|
205
|
+
handleKeyDown = (event) => {
|
|
206
|
+
var _a;
|
|
207
|
+
const step = event.shiftKey ? 0.05 : 0.01;
|
|
208
|
+
let nextValue = this.value;
|
|
209
|
+
if (event.key === "ArrowLeft" || event.key === "ArrowDown") {
|
|
210
|
+
nextValue -= step;
|
|
211
|
+
} else if (event.key === "ArrowRight" || event.key === "ArrowUp") {
|
|
212
|
+
nextValue += step;
|
|
213
|
+
} else if (event.key === "Home") {
|
|
214
|
+
nextValue = 0;
|
|
215
|
+
} else if (event.key === "End") {
|
|
216
|
+
nextValue = 1;
|
|
217
|
+
} else {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
event.preventDefault();
|
|
221
|
+
this.updateValue(nextValue, true);
|
|
222
|
+
(_a = this.onCommit) == null ? void 0 : _a.call(this, this.value);
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function clampSplit(value) {
|
|
226
|
+
return Math.min(1, Math.max(0, value));
|
|
227
|
+
}
|
|
228
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
229
|
+
0 && (module.exports = {
|
|
230
|
+
ComparisonSplitter
|
|
231
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Configuration for an accessible, independently styled canvas comparison divider. */
|
|
2
|
+
export type ComparisonSplitterProps = {
|
|
3
|
+
/** Canvas whose client rectangle determines the divider's visible bounds. */
|
|
4
|
+
canvas: HTMLCanvasElement;
|
|
5
|
+
/** Optional stable identifier for application styling, automation, or accessibility. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** Initial horizontal divider position, expressed between zero and one. */
|
|
8
|
+
value: number;
|
|
9
|
+
/** Called immediately while a pointer or keyboard interaction moves the divider. */
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
/** Called once when a pointer interaction ends or a keyboard move is applied. */
|
|
12
|
+
onCommit?: (value: number) => void;
|
|
13
|
+
/** Accessible description announced for the focusable separator. */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** CSS color applied independently to this divider's line, handle, and glow. */
|
|
16
|
+
accentColor?: string;
|
|
17
|
+
/** CSS background color applied independently to this divider's handle. */
|
|
18
|
+
handleColor?: string;
|
|
19
|
+
/** Optional positioned host; defaults to a fixed overlay in the canvas document body. */
|
|
20
|
+
container?: HTMLElement;
|
|
21
|
+
};
|
|
22
|
+
/** Accessible, self-contained DOM divider for comparing two views of one canvas. */
|
|
23
|
+
export declare class ComparisonSplitter {
|
|
24
|
+
/** Focusable DOM separator. Its children and inline styles are owned by this instance. */
|
|
25
|
+
readonly element: HTMLDivElement;
|
|
26
|
+
private readonly canvas;
|
|
27
|
+
private readonly container;
|
|
28
|
+
private readonly onChange;
|
|
29
|
+
private readonly onCommit;
|
|
30
|
+
private readonly dividerLine;
|
|
31
|
+
private readonly accentColor;
|
|
32
|
+
private value;
|
|
33
|
+
private visible;
|
|
34
|
+
private activePointerId;
|
|
35
|
+
private destroyed;
|
|
36
|
+
constructor({ canvas, id, value, onChange, onCommit, label, accentColor, handleColor, container }: ComparisonSplitterProps);
|
|
37
|
+
/** Releases pointer capture, removes interaction handlers, and detaches this divider. */
|
|
38
|
+
destroy(): void;
|
|
39
|
+
/** Updates the normalized divider position without firing interaction callbacks. */
|
|
40
|
+
setValue(value: number): void;
|
|
41
|
+
/** Hides or shows the divider while preserving its normalized position. */
|
|
42
|
+
setVisible(visible: boolean): void;
|
|
43
|
+
/** Repositions the divider after the canvas or optional host moves, scrolls, or resizes. */
|
|
44
|
+
updateLayout(): void;
|
|
45
|
+
private updateValue;
|
|
46
|
+
private updateFromPointer;
|
|
47
|
+
private finishPointerInteraction;
|
|
48
|
+
private readonly handlePointerDown;
|
|
49
|
+
private readonly handlePointerMove;
|
|
50
|
+
private readonly handlePointerUp;
|
|
51
|
+
private readonly handlePointerCancel;
|
|
52
|
+
private readonly handleKeyDown;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=comparison-splitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comparison-splitter.d.ts","sourceRoot":"","sources":["../../../src/experimental/controls/comparison-splitter.ts"],"names":[],"mappings":"AAIA,uFAAuF;AACvF,MAAM,MAAM,uBAAuB,GAAG;IACpC,6EAA6E;IAC7E,MAAM,EAAE,iBAAiB,CAAC;IAC1B,wFAAwF;IACxF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB,CAAC;AAKF,oFAAoF;AACpF,qBAAa,kBAAkB;IAC7B,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwC;IACjE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkB;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,SAAS,CAAS;gBAEd,EACV,MAAM,EACN,EAAE,EACF,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAqC,EACrC,WAAkC,EAClC,WAAkC,EAClC,SAAS,EACV,EAAE,uBAAuB;IA2E1B,yFAAyF;IACzF,OAAO,IAAI,IAAI;IAkBf,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAI7B,2EAA2E;IAC3E,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAKlC,4FAA4F;IAC5F,YAAY,IAAI,IAAI;IAqBpB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,wBAAwB;IAkBhC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAYhC;IAEF,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAIhC;IAEF,OAAO,CAAC,QAAQ,CAAC,eAAe,CAE9B;IAEF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAElC;IAEF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAkB5B;CACH"}
|