@pmndrs/vdb 0.1.0 → 0.2.0
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/CHANGELOG.md +592 -2
- package/README.md +85 -37
- package/THIRD_PARTY_NOTICES.md +197 -29
- package/dist/core/compute/atlas.d.ts +10 -2
- package/dist/core/compute/atlas.js +6 -1
- package/dist/core/compute/atlas.js.map +1 -1
- package/dist/core/compute/index.d.ts +3 -3
- package/dist/core/compute/index.js +2 -2
- package/dist/core/compute/index.js.map +1 -1
- package/dist/core/compute/majorant-build.d.ts +45 -0
- package/dist/core/compute/majorant-build.js +193 -0
- package/dist/core/compute/majorant-build.js.map +1 -0
- package/dist/core/compute/multi-scale.d.ts +155 -0
- package/dist/core/compute/multi-scale.js +684 -0
- package/dist/core/compute/multi-scale.js.map +1 -0
- package/dist/core/compute/pyramid.d.ts +22 -7
- package/dist/core/compute/pyramid.js +22 -9
- package/dist/core/compute/pyramid.js.map +1 -1
- package/dist/core/compute/shared.d.ts +1 -0
- package/dist/core/compute/shared.js.map +1 -1
- package/dist/core/compute/stats.d.ts +10 -3
- package/dist/core/compute/stats.js +6 -1
- package/dist/core/compute/stats.js.map +1 -1
- package/dist/core/compute/value-transform.d.ts +8 -1
- package/dist/core/compute/value-transform.js +9 -3
- package/dist/core/compute/value-transform.js.map +1 -1
- package/dist/core/errors.d.ts +10 -0
- package/dist/core/errors.js +8 -0
- package/dist/core/errors.js.map +1 -1
- package/dist/core/frame/emission.d.ts +85 -0
- package/dist/core/frame/emission.js +422 -0
- package/dist/core/frame/emission.js.map +1 -0
- package/dist/core/frame/environment.d.ts +47 -0
- package/dist/core/frame/environment.js +178 -0
- package/dist/core/frame/environment.js.map +1 -0
- package/dist/core/frame/index.d.ts +39 -0
- package/dist/core/frame/index.js +27 -0
- package/dist/core/frame/index.js.map +1 -0
- package/dist/core/frame/kernels.d.ts +115 -0
- package/dist/core/frame/kernels.js +496 -0
- package/dist/core/frame/kernels.js.map +1 -0
- package/dist/core/frame/limits.d.ts +67 -0
- package/dist/core/frame/limits.js +109 -0
- package/dist/core/frame/limits.js.map +1 -0
- package/dist/core/frame/phase.d.ts +17 -0
- package/dist/core/frame/phase.js +53 -0
- package/dist/core/frame/phase.js.map +1 -0
- package/dist/core/frame/pipelines.d.ts +49 -0
- package/dist/core/frame/pipelines.js +147 -0
- package/dist/core/frame/pipelines.js.map +1 -0
- package/dist/core/frame/renderer.d.ts +122 -0
- package/dist/core/frame/renderer.js +1712 -0
- package/dist/core/frame/renderer.js.map +1 -0
- package/dist/core/frame/resources.d.ts +71 -0
- package/dist/core/frame/resources.js +100 -0
- package/dist/core/frame/resources.js.map +1 -0
- package/dist/core/frame/scattering.d.ts +97 -0
- package/dist/core/frame/scattering.js +332 -0
- package/dist/core/frame/scattering.js.map +1 -0
- package/dist/core/frame/settings.d.ts +243 -0
- package/dist/core/frame/settings.js +67 -0
- package/dist/core/frame/settings.js.map +1 -0
- package/dist/core/frame/shadows.d.ts +55 -0
- package/dist/core/frame/shadows.js +460 -0
- package/dist/core/frame/shadows.js.map +1 -0
- package/dist/core/frame/types.d.ts +415 -0
- package/dist/core/frame/types.js +49 -0
- package/dist/core/frame/types.js.map +1 -0
- package/dist/core/frame/uniforms.d.ts +105 -0
- package/dist/core/frame/uniforms.js +276 -0
- package/dist/core/frame/uniforms.js.map +1 -0
- package/dist/core/frame/wgsl/chunks.d.ts +4 -0
- package/dist/core/frame/wgsl/chunks.js +728 -0
- package/dist/core/frame/wgsl/chunks.js.map +1 -0
- package/dist/core/frame/wgsl/emission.d.ts +82 -0
- package/dist/core/frame/wgsl/emission.js +353 -0
- package/dist/core/frame/wgsl/emission.js.map +1 -0
- package/dist/core/frame/wgsl/environment.d.ts +42 -0
- package/dist/core/frame/wgsl/environment.js +711 -0
- package/dist/core/frame/wgsl/environment.js.map +1 -0
- package/dist/core/frame/wgsl/gather.d.ts +55 -0
- package/dist/core/frame/wgsl/gather.js +850 -0
- package/dist/core/frame/wgsl/gather.js.map +1 -0
- package/dist/core/frame/wgsl/integrate.d.ts +78 -0
- package/dist/core/frame/wgsl/integrate.js +213 -0
- package/dist/core/frame/wgsl/integrate.js.map +1 -0
- package/dist/core/frame/wgsl/lighting.d.ts +103 -0
- package/dist/core/frame/wgsl/lighting.js +1636 -0
- package/dist/core/frame/wgsl/lighting.js.map +1 -0
- package/dist/core/frame/wgsl/occluders.d.ts +20 -0
- package/dist/core/frame/wgsl/occluders.js +95 -0
- package/dist/core/frame/wgsl/occluders.js.map +1 -0
- package/dist/core/frame/wgsl/resolve.d.ts +19 -0
- package/dist/core/frame/wgsl/resolve.js +205 -0
- package/dist/core/frame/wgsl/resolve.js.map +1 -0
- package/dist/core/frame/wgsl/shadows.d.ts +35 -0
- package/dist/core/frame/wgsl/shadows.js +328 -0
- package/dist/core/frame/wgsl/shadows.js.map +1 -0
- package/dist/core/half.d.ts +11 -0
- package/dist/core/half.js +22 -0
- package/dist/core/half.js.map +1 -0
- package/dist/core/index.d.ts +25 -3
- package/dist/core/index.js +23 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/internal.d.ts +17 -1
- package/dist/core/internal.js +18 -1
- package/dist/core/internal.js.map +1 -1
- package/dist/core/pool/image-header.d.ts +13 -2
- package/dist/core/pool/image-header.js +24 -5
- package/dist/core/pool/image-header.js.map +1 -1
- package/dist/core/pool/layout.d.ts +35 -1
- package/dist/core/pool/layout.js +51 -2
- package/dist/core/pool/layout.js.map +1 -1
- package/dist/core/pool/limits.d.ts +1 -0
- package/dist/core/pool/limits.js +1 -0
- package/dist/core/pool/limits.js.map +1 -1
- package/dist/core/pool/pool.d.ts +120 -15
- package/dist/core/pool/pool.js +255 -24
- package/dist/core/pool/pool.js.map +1 -1
- package/dist/core/reference/index.d.ts +6 -0
- package/dist/core/reference/index.js +7 -0
- package/dist/core/reference/index.js.map +1 -0
- package/dist/core/reference/renderer.d.ts +105 -0
- package/dist/core/reference/renderer.js +474 -0
- package/dist/core/reference/renderer.js.map +1 -0
- package/dist/core/reference/wgsl.d.ts +65 -0
- package/dist/core/reference/wgsl.js +803 -0
- package/dist/core/reference/wgsl.js.map +1 -0
- package/dist/{three → core}/sequence.d.ts +32 -2
- package/dist/{three → core}/sequence.js +24 -2
- package/dist/core/sequence.js.map +1 -0
- package/dist/core/source/brick-cache.d.ts +165 -0
- package/dist/core/source/brick-cache.js +627 -0
- package/dist/core/source/brick-cache.js.map +1 -0
- package/dist/core/source/dense-fill.d.ts +53 -0
- package/dist/core/source/dense-fill.js +377 -0
- package/dist/core/source/dense-fill.js.map +1 -0
- package/dist/core/source/dense.d.ts +33 -2
- package/dist/core/source/dense.js +121 -24
- package/dist/core/source/dense.js.map +1 -1
- package/dist/core/source/sparse-wgsl.d.ts +92 -0
- package/dist/core/source/sparse-wgsl.js +481 -0
- package/dist/core/source/sparse-wgsl.js.map +1 -0
- package/dist/core/source/sparse.d.ts +192 -0
- package/dist/core/source/sparse.js +762 -0
- package/dist/core/source/sparse.js.map +1 -0
- package/dist/core/source/types.d.ts +59 -2
- package/dist/core/source/types.js.map +1 -1
- package/dist/core/surface/index.d.ts +10 -0
- package/dist/core/surface/index.js +9 -0
- package/dist/core/surface/index.js.map +1 -0
- package/dist/core/surface/level-set-pass.d.ts +140 -0
- package/dist/core/surface/level-set-pass.js +291 -0
- package/dist/core/surface/level-set-pass.js.map +1 -0
- package/dist/core/surface/level-set-wgsl.d.ts +46 -0
- package/dist/core/surface/level-set-wgsl.js +99 -0
- package/dist/core/surface/level-set-wgsl.js.map +1 -0
- package/dist/core/surface/points.d.ts +109 -0
- package/dist/core/surface/points.js +226 -0
- package/dist/core/surface/points.js.map +1 -0
- package/dist/core/types.d.ts +12 -3
- package/dist/core/types.js +6 -2
- package/dist/core/types.js.map +1 -1
- package/dist/core/wgsl/api.d.ts +29 -5
- package/dist/core/wgsl/api.js +110 -27
- package/dist/core/wgsl/api.js.map +1 -1
- package/dist/core/wgsl/generate.d.ts +8 -0
- package/dist/core/wgsl/generate.js +195 -22
- package/dist/core/wgsl/generate.js.map +1 -1
- package/dist/core/wgsl/lean.d.ts +50 -0
- package/dist/core/wgsl/lean.js +327 -0
- package/dist/core/wgsl/lean.js.map +1 -0
- package/dist/core/wgsl/level-set.d.ts +5 -1
- package/dist/core/wgsl/level-set.js +11 -5
- package/dist/core/wgsl/level-set.js.map +1 -1
- package/dist/core/wgsl/majorant.d.ts +62 -0
- package/dist/core/wgsl/majorant.js +381 -0
- package/dist/core/wgsl/majorant.js.map +1 -0
- package/dist/core/wgsl/pnanovdb.chunks.generated.d.ts +2 -2
- package/dist/core/wgsl/pnanovdb.chunks.generated.js +15 -12
- package/dist/core/wgsl/pnanovdb.chunks.generated.js.map +1 -1
- package/dist/core/wgsl/types.d.ts +97 -3
- package/dist/core/wgsl/types.js.map +1 -1
- package/dist/three/coarse-first.d.ts +53 -8
- package/dist/three/coarse-first.js +24 -6
- package/dist/three/coarse-first.js.map +1 -1
- package/dist/three/compute.d.ts +12 -2
- package/dist/three/compute.js +16 -6
- package/dist/three/compute.js.map +1 -1
- package/dist/three/device.d.ts +7 -0
- package/dist/three/device.js +3 -0
- package/dist/three/device.js.map +1 -1
- package/dist/three/frame/core-environment.d.ts +38 -0
- package/dist/three/frame/core-environment.js +154 -0
- package/dist/three/frame/core-environment.js.map +1 -0
- package/dist/three/frame/core-integrate-material.d.ts +34 -0
- package/dist/three/frame/core-integrate-material.js +162 -0
- package/dist/three/frame/core-integrate-material.js.map +1 -0
- package/dist/three/frame/core-occluders.d.ts +53 -0
- package/dist/three/frame/core-occluders.js +193 -0
- package/dist/three/frame/core-occluders.js.map +1 -0
- package/dist/three/frame/core-structs.d.ts +34 -0
- package/dist/three/frame/core-structs.js +61 -0
- package/dist/three/frame/core-structs.js.map +1 -0
- package/dist/three/frame/core-textures.d.ts +41 -0
- package/dist/three/frame/core-textures.js +114 -0
- package/dist/three/frame/core-textures.js.map +1 -0
- package/dist/three/frame/emission-light.d.ts +64 -114
- package/dist/three/frame/emission-light.js +188 -567
- package/dist/three/frame/emission-light.js.map +1 -1
- package/dist/three/frame/index.d.ts +11 -31
- package/dist/three/frame/index.js +9 -29
- package/dist/three/frame/index.js.map +1 -1
- package/dist/three/frame/medium.d.ts +12 -0
- package/dist/three/frame/medium.js.map +1 -1
- package/dist/three/frame/renderer.d.ts +58 -454
- package/dist/three/frame/renderer.js +409 -1427
- package/dist/three/frame/renderer.js.map +1 -1
- package/dist/three/frame/spectrum.d.ts +0 -14
- package/dist/three/frame/spectrum.js +2 -23
- package/dist/three/frame/spectrum.js.map +1 -1
- package/dist/three/frame/three-internals.d.ts +3 -8
- package/dist/three/frame/three-internals.js +13 -11
- package/dist/three/frame/three-internals.js.map +1 -1
- package/dist/three/frame/volume-shadows.d.ts +93 -107
- package/dist/three/frame/volume-shadows.js +278 -631
- package/dist/three/frame/volume-shadows.js.map +1 -1
- package/dist/three/frame/volume.d.ts +91 -33
- package/dist/three/frame/volume.js +63 -51
- package/dist/three/frame/volume.js.map +1 -1
- package/dist/three/grid-node.d.ts +34 -1
- package/dist/three/grid-node.js +36 -1
- package/dist/three/grid-node.js.map +1 -1
- package/dist/three/index.d.ts +20 -11
- package/dist/three/index.js +21 -12
- package/dist/three/index.js.map +1 -1
- package/dist/three/internal.d.ts +14 -8
- package/dist/three/internal.js +11 -7
- package/dist/three/internal.js.map +1 -1
- package/dist/three/level-set-material.d.ts +81 -8
- package/dist/three/level-set-material.js +162 -125
- package/dist/three/level-set-material.js.map +1 -1
- package/dist/three/level-set-physical-material.d.ts +154 -0
- package/dist/three/level-set-physical-material.js +253 -0
- package/dist/three/level-set-physical-material.js.map +1 -0
- package/dist/three/level-set-velocity.d.ts +94 -0
- package/dist/three/level-set-velocity.js +208 -0
- package/dist/three/level-set-velocity.js.map +1 -0
- package/dist/three/material.d.ts +141 -11
- package/dist/three/material.js +161 -18
- package/dist/three/material.js.map +1 -1
- package/dist/three/points.d.ts +60 -4
- package/dist/three/points.js +140 -9
- package/dist/three/points.js.map +1 -1
- package/dist/three/sparse-source.d.ts +49 -117
- package/dist/three/sparse-source.js +109 -580
- package/dist/three/sparse-source.js.map +1 -1
- package/dist/three/volume-source.d.ts +11 -156
- package/dist/three/volume-source.js +29 -272
- package/dist/three/volume-source.js.map +1 -1
- package/dist/tools/cpu/brick-atlas.d.ts +36 -0
- package/dist/tools/cpu/brick-atlas.js +129 -0
- package/dist/tools/cpu/brick-atlas.js.map +1 -0
- package/dist/tools/cpu/compute.d.ts +23 -4
- package/dist/tools/cpu/compute.js +35 -14
- package/dist/tools/cpu/compute.js.map +1 -1
- package/dist/tools/cpu/lean-reads.d.ts +81 -0
- package/dist/tools/cpu/lean-reads.js +262 -0
- package/dist/tools/cpu/lean-reads.js.map +1 -0
- package/dist/tools/cpu/level-set.d.ts +42 -3
- package/dist/tools/cpu/level-set.js +59 -7
- package/dist/tools/cpu/level-set.js.map +1 -1
- package/dist/tools/cpu/majorant.d.ts +265 -0
- package/dist/tools/cpu/majorant.js +541 -0
- package/dist/tools/cpu/majorant.js.map +1 -0
- package/dist/tools/cpu/march.d.ts +93 -2
- package/dist/tools/cpu/march.js +165 -14
- package/dist/tools/cpu/march.js.map +1 -1
- package/dist/tools/cpu/mesh-decimate.d.ts +124 -0
- package/dist/tools/cpu/mesh-decimate.js +1225 -0
- package/dist/tools/cpu/mesh-decimate.js.map +1 -0
- package/dist/tools/cpu/points.d.ts +29 -0
- package/dist/tools/cpu/points.js +38 -0
- package/dist/tools/cpu/points.js.map +1 -0
- package/dist/tools/cpu/read-value.d.ts +19 -6
- package/dist/tools/cpu/read-value.js +32 -17
- package/dist/tools/cpu/read-value.js.map +1 -1
- package/dist/tools/cpu/sample-trilinear.d.ts +17 -4
- package/dist/tools/cpu/sample-trilinear.js +19 -7
- package/dist/tools/cpu/sample-trilinear.js.map +1 -1
- package/dist/tools/cpu/stride-tables.d.ts +2 -2
- package/dist/tools/cpu/stride-tables.generated.d.ts +6 -5
- package/dist/tools/cpu/stride-tables.generated.js +7 -6
- package/dist/tools/cpu/stride-tables.generated.js.map +1 -1
- package/dist/tools/cpu/stride-tables.js +1 -1
- package/dist/tools/cpu/stride-tables.js.map +1 -1
- package/dist/tools/cpu/surface-nets.d.ts +90 -0
- package/dist/tools/cpu/surface-nets.js +597 -0
- package/dist/tools/cpu/surface-nets.js.map +1 -0
- package/dist/tools/errors.d.ts +9 -0
- package/dist/tools/errors.js +9 -0
- package/dist/tools/errors.js.map +1 -1
- package/dist/tools/frame/ambient.d.ts +98 -0
- package/dist/tools/frame/ambient.js +274 -0
- package/dist/tools/frame/ambient.js.map +1 -0
- package/dist/tools/frame/blackbody.d.ts +15 -0
- package/dist/tools/frame/blackbody.js +35 -0
- package/dist/tools/frame/blackbody.js.map +1 -1
- package/dist/tools/frame/brick-cache.d.ts +165 -0
- package/dist/tools/frame/brick-cache.js +326 -0
- package/dist/tools/frame/brick-cache.js.map +1 -0
- package/dist/tools/frame/emission.d.ts +9 -0
- package/dist/tools/frame/emission.js +9 -1
- package/dist/tools/frame/emission.js.map +1 -1
- package/dist/tools/frame/environment-gpu.d.ts +111 -0
- package/dist/tools/frame/environment-gpu.js +280 -0
- package/dist/tools/frame/environment-gpu.js.map +1 -0
- package/dist/tools/frame/environment.d.ts +3 -2
- package/dist/tools/frame/environment.js +8 -4
- package/dist/tools/frame/environment.js.map +1 -1
- package/dist/tools/frame/froxel.d.ts +58 -0
- package/dist/tools/frame/froxel.js +115 -0
- package/dist/tools/frame/froxel.js.map +1 -0
- package/dist/tools/frame/grid.d.ts +90 -0
- package/dist/tools/frame/grid.js +112 -13
- package/dist/tools/frame/grid.js.map +1 -1
- package/dist/tools/frame/index.d.ts +14 -0
- package/dist/tools/frame/index.js +45 -4
- package/dist/tools/frame/index.js.map +1 -1
- package/dist/tools/frame/medium.d.ts +16 -0
- package/dist/tools/frame/medium.js +3 -1
- package/dist/tools/frame/medium.js.map +1 -1
- package/dist/tools/frame/mie.d.ts +9 -0
- package/dist/tools/frame/mie.js +18 -0
- package/dist/tools/frame/mie.js.map +1 -1
- package/dist/tools/frame/mlp-nn.d.ts +36 -0
- package/dist/tools/frame/mlp-nn.js +159 -0
- package/dist/tools/frame/mlp-nn.js.map +1 -0
- package/dist/tools/frame/mlp-tza.d.ts +29 -0
- package/dist/tools/frame/mlp-tza.js +186 -0
- package/dist/tools/frame/mlp-tza.js.map +1 -0
- package/dist/tools/frame/mlp.d.ts +183 -0
- package/dist/tools/frame/mlp.js +434 -0
- package/dist/tools/frame/mlp.js.map +1 -0
- package/dist/tools/frame/ms-exit.d.ts +42 -0
- package/dist/tools/frame/ms-exit.js +90 -0
- package/dist/tools/frame/ms-exit.js.map +1 -0
- package/dist/tools/frame/multi-scale.d.ts +152 -0
- package/dist/tools/frame/multi-scale.js +302 -0
- package/dist/tools/frame/multi-scale.js.map +1 -0
- package/dist/tools/frame/neural-weights.d.ts +6 -5
- package/dist/tools/frame/neural-weights.js +234 -235
- package/dist/tools/frame/neural-weights.js.map +1 -1
- package/dist/tools/frame/neural.js +1 -1
- package/dist/tools/frame/neural.js.map +1 -1
- package/dist/tools/frame/occluders.d.ts +51 -0
- package/dist/tools/frame/occluders.js +72 -0
- package/dist/tools/frame/occluders.js.map +1 -0
- package/dist/tools/frame/pyramid-layout.d.ts +17 -0
- package/dist/tools/frame/pyramid-layout.js +47 -0
- package/dist/tools/frame/pyramid-layout.js.map +1 -1
- package/dist/tools/frame/shadows.d.ts +110 -0
- package/dist/tools/frame/shadows.js +286 -0
- package/dist/tools/frame/shadows.js.map +1 -1
- package/dist/tools/frame/sparse.d.ts +82 -0
- package/dist/tools/frame/sparse.js +242 -1
- package/dist/tools/frame/sparse.js.map +1 -1
- package/dist/tools/frame/spectral-stack.d.ts +159 -0
- package/dist/tools/frame/spectral-stack.js +391 -0
- package/dist/tools/frame/spectral-stack.js.map +1 -0
- package/dist/tools/frame/spectral.d.ts +21 -2
- package/dist/tools/frame/spectral.js +30 -8
- package/dist/tools/frame/spectral.js.map +1 -1
- package/dist/tools/frame/stack.d.ts +115 -0
- package/dist/tools/frame/stack.js +290 -0
- package/dist/tools/frame/stack.js.map +1 -0
- package/dist/tools/frame/view.d.ts +131 -0
- package/dist/tools/frame/view.js +337 -0
- package/dist/tools/frame/view.js.map +1 -0
- package/dist/tools/index.d.ts +66 -15
- package/dist/tools/index.js +55 -11
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/internal.d.ts +58 -17
- package/dist/tools/internal.js +65 -11
- package/dist/tools/internal.js.map +1 -1
- package/dist/tools/nanovdb/build-from-vdb.d.ts +11 -2
- package/dist/tools/nanovdb/build-from-vdb.js +10 -2
- package/dist/tools/nanovdb/build-from-vdb.js.map +1 -1
- package/dist/tools/nanovdb/bytes.d.ts +17 -4
- package/dist/tools/nanovdb/bytes.js +46 -3
- package/dist/tools/nanovdb/bytes.js.map +1 -1
- package/dist/tools/nanovdb/coarse-first.d.ts +19 -3
- package/dist/tools/nanovdb/coarse-first.js +7 -1
- package/dist/tools/nanovdb/coarse-first.js.map +1 -1
- package/dist/tools/nanovdb/half.d.ts +22 -0
- package/dist/tools/nanovdb/half.js +73 -0
- package/dist/tools/nanovdb/half.js.map +1 -0
- package/dist/tools/nanovdb/index.d.ts +3 -1
- package/dist/tools/nanovdb/index.js +2 -1
- package/dist/tools/nanovdb/index.js.map +1 -1
- package/dist/tools/nanovdb/inspect.d.ts +10 -1
- package/dist/tools/nanovdb/inspect.js +8 -1
- package/dist/tools/nanovdb/inspect.js.map +1 -1
- package/dist/tools/nanovdb/leaf-codec.d.ts +35 -1
- package/dist/tools/nanovdb/leaf-codec.js +40 -4
- package/dist/tools/nanovdb/leaf-codec.js.map +1 -1
- package/dist/tools/nanovdb/quantize.d.ts +39 -10
- package/dist/tools/nanovdb/quantize.js +96 -44
- package/dist/tools/nanovdb/quantize.js.map +1 -1
- package/dist/tools/nanovdb/resample.d.ts +20 -3
- package/dist/tools/nanovdb/resample.js +20 -7
- package/dist/tools/nanovdb/resample.js.map +1 -1
- package/dist/tools/nanovdb/serialize.d.ts +34 -3
- package/dist/tools/nanovdb/serialize.js +51 -7
- package/dist/tools/nanovdb/serialize.js.map +1 -1
- package/dist/tools/nanovdb/stats.d.ts +34 -5
- package/dist/tools/nanovdb/stats.js +87 -11
- package/dist/tools/nanovdb/stats.js.map +1 -1
- package/dist/tools/nanovdb/transform.d.ts +4 -0
- package/dist/tools/nanovdb/transform.js +3 -0
- package/dist/tools/nanovdb/transform.js.map +1 -1
- package/dist/tools/nanovdb/tree.d.ts +14 -3
- package/dist/tools/nanovdb/tree.js +25 -13
- package/dist/tools/nanovdb/tree.js.map +1 -1
- package/dist/tools/nanovdb/write-nvdb.d.ts +47 -12
- package/dist/tools/nanovdb/write-nvdb.js +108 -28
- package/dist/tools/nanovdb/write-nvdb.js.map +1 -1
- package/dist/tools/nvdb-file.d.ts +77 -7
- package/dist/tools/nvdb-file.js +177 -20
- package/dist/tools/nvdb-file.js.map +1 -1
- package/dist/tools/nvdb-stream.d.ts +23 -7
- package/dist/tools/nvdb-stream.js +78 -34
- package/dist/tools/nvdb-stream.js.map +1 -1
- package/dist/tools/reference/analytic.d.ts +41 -0
- package/dist/tools/reference/analytic.js +95 -0
- package/dist/tools/reference/analytic.js.map +1 -0
- package/dist/tools/reference/environment.d.ts +62 -0
- package/dist/tools/reference/environment.js +154 -0
- package/dist/tools/reference/environment.js.map +1 -0
- package/dist/tools/reference/index.d.ts +12 -0
- package/dist/tools/reference/index.js +13 -0
- package/dist/tools/reference/index.js.map +1 -0
- package/dist/tools/reference/media.d.ts +14 -0
- package/dist/tools/reference/media.js +30 -0
- package/dist/tools/reference/media.js.map +1 -0
- package/dist/tools/reference/rng.d.ts +20 -0
- package/dist/tools/reference/rng.js +30 -0
- package/dist/tools/reference/rng.js.map +1 -0
- package/dist/tools/reference/scene.d.ts +312 -0
- package/dist/tools/reference/scene.js +169 -0
- package/dist/tools/reference/scene.js.map +1 -0
- package/dist/tools/reference/tables.d.ts +98 -0
- package/dist/tools/reference/tables.js +264 -0
- package/dist/tools/reference/tables.js.map +1 -0
- package/dist/tools/reference/trace.d.ts +160 -0
- package/dist/tools/reference/trace.js +497 -0
- package/dist/tools/reference/trace.js.map +1 -0
- package/dist/tools/vdb/blosc-write.d.ts +43 -0
- package/dist/tools/vdb/blosc-write.js +197 -0
- package/dist/tools/vdb/blosc-write.js.map +1 -0
- package/dist/tools/vdb/blosc.d.ts +35 -5
- package/dist/tools/vdb/blosc.js +82 -26
- package/dist/tools/vdb/blosc.js.map +1 -1
- package/dist/tools/vdb/blosclz.d.ts +33 -0
- package/dist/tools/vdb/blosclz.js +112 -0
- package/dist/tools/vdb/blosclz.js.map +1 -0
- package/dist/tools/vdb/byte-reader.d.ts +13 -3
- package/dist/tools/vdb/byte-reader.js +26 -4
- package/dist/tools/vdb/byte-reader.js.map +1 -1
- package/dist/tools/vdb/compression.d.ts +13 -5
- package/dist/tools/vdb/compression.js +13 -2
- package/dist/tools/vdb/compression.js.map +1 -1
- package/dist/tools/vdb/grid.js +8 -2
- package/dist/tools/vdb/grid.js.map +1 -1
- package/dist/tools/vdb/index.d.ts +2 -1
- package/dist/tools/vdb/index.js.map +1 -1
- package/dist/tools/vdb/lz4.d.ts +30 -0
- package/dist/tools/vdb/lz4.js +228 -0
- package/dist/tools/vdb/lz4.js.map +1 -0
- package/dist/tools/vdb/metadata.js +1 -1
- package/dist/tools/vdb/metadata.js.map +1 -1
- package/dist/tools/vdb/parse.d.ts +24 -2
- package/dist/tools/vdb/parse.js +102 -32
- package/dist/tools/vdb/parse.js.map +1 -1
- package/dist/tools/vdb/point-render-data.d.ts +49 -1
- package/dist/tools/vdb/point-render-data.js +91 -11
- package/dist/tools/vdb/point-render-data.js.map +1 -1
- package/dist/tools/vdb/points.d.ts +26 -0
- package/dist/tools/vdb/points.js +46 -5
- package/dist/tools/vdb/points.js.map +1 -1
- package/dist/tools/vdb/types.d.ts +59 -2
- package/dist/tools/vdb/types.js.map +1 -1
- package/dist/tools/wvdb/bake.d.ts +38 -9
- package/dist/tools/wvdb/bake.js +63 -13
- package/dist/tools/wvdb/bake.js.map +1 -1
- package/dist/tools/wvdb/dense.d.ts +80 -1
- package/dist/tools/wvdb/dense.js +67 -8
- package/dist/tools/wvdb/dense.js.map +1 -1
- package/dist/tools/wvdb/format.d.ts +59 -0
- package/dist/tools/wvdb/format.js +3 -0
- package/dist/tools/wvdb/format.js.map +1 -1
- package/dist/tools/wvdb/index.d.ts +1 -0
- package/dist/tools/wvdb/index.js +1 -0
- package/dist/tools/wvdb/index.js.map +1 -1
- package/dist/tools/wvdb/level-set.d.ts +10 -2
- package/dist/tools/wvdb/level-set.js.map +1 -1
- package/dist/tools/wvdb/nanovdb.d.ts +6 -1
- package/dist/tools/wvdb/nanovdb.js +5 -1
- package/dist/tools/wvdb/nanovdb.js.map +1 -1
- package/dist/tools/wvdb/partial.d.ts +74 -0
- package/dist/tools/wvdb/partial.js +233 -0
- package/dist/tools/wvdb/partial.js.map +1 -0
- package/dist/tools/wvdb/read.d.ts +77 -1
- package/dist/tools/wvdb/read.js +30 -7
- package/dist/tools/wvdb/read.js.map +1 -1
- package/dist/tools/wvdb/write.d.ts +23 -1
- package/dist/tools/wvdb/write.js +8 -1
- package/dist/tools/wvdb/write.js.map +1 -1
- package/package.json +2 -1
- package/vendor/VENDOR.md +21 -6
- package/vendor/pnanovdb.wgsl +52 -14
- package/dist/three/frame/blackbody.d.ts +0 -42
- package/dist/three/frame/blackbody.js +0 -74
- package/dist/three/frame/blackbody.js.map +0 -1
- package/dist/three/frame/chunks.d.ts +0 -157
- package/dist/three/frame/chunks.js +0 -559
- package/dist/three/frame/chunks.js.map +0 -1
- package/dist/three/frame/density-material.d.ts +0 -53
- package/dist/three/frame/density-material.js +0 -353
- package/dist/three/frame/density-material.js.map +0 -1
- package/dist/three/frame/environment-grid-material.d.ts +0 -21
- package/dist/three/frame/environment-grid-material.js +0 -184
- package/dist/three/frame/environment-grid-material.js.map +0 -1
- package/dist/three/frame/environment-material.d.ts +0 -22
- package/dist/three/frame/environment-material.js +0 -87
- package/dist/three/frame/environment-material.js.map +0 -1
- package/dist/three/frame/grid-mip-material.d.ts +0 -12
- package/dist/three/frame/grid-mip-material.js +0 -61
- package/dist/three/frame/grid-mip-material.js.map +0 -1
- package/dist/three/frame/inject-material.d.ts +0 -56
- package/dist/three/frame/inject-material.js +0 -424
- package/dist/three/frame/inject-material.js.map +0 -1
- package/dist/three/frame/integrate-material.d.ts +0 -26
- package/dist/three/frame/integrate-material.js +0 -198
- package/dist/three/frame/integrate-material.js.map +0 -1
- package/dist/three/frame/layout.d.ts +0 -34
- package/dist/three/frame/layout.js +0 -48
- package/dist/three/frame/layout.js.map +0 -1
- package/dist/three/frame/lighting-material.d.ts +0 -41
- package/dist/three/frame/lighting-material.js +0 -257
- package/dist/three/frame/lighting-material.js.map +0 -1
- package/dist/three/frame/lights.d.ts +0 -11
- package/dist/three/frame/lights.js +0 -16
- package/dist/three/frame/lights.js.map +0 -1
- package/dist/three/frame/neural.d.ts +0 -14
- package/dist/three/frame/neural.js +0 -105
- package/dist/three/frame/neural.js.map +0 -1
- package/dist/three/frame/phase.d.ts +0 -44
- package/dist/three/frame/phase.js +0 -80
- package/dist/three/frame/phase.js.map +0 -1
- package/dist/three/frame/shadow-density-material.d.ts +0 -30
- package/dist/three/frame/shadow-density-material.js +0 -123
- package/dist/three/frame/shadow-density-material.js.map +0 -1
- package/dist/three/frame/temporal-material.d.ts +0 -29
- package/dist/three/frame/temporal-material.js +0 -152
- package/dist/three/frame/temporal-material.js.map +0 -1
- package/dist/three/frame/transmittance-material.d.ts +0 -31
- package/dist/three/frame/transmittance-material.js +0 -315
- package/dist/three/frame/transmittance-material.js.map +0 -1
- package/dist/three/frame/view.d.ts +0 -103
- package/dist/three/frame/view.js +0 -296
- package/dist/three/frame/view.js.map +0 -1
- package/dist/three/frame/volume-shadow-material.d.ts +0 -36
- package/dist/three/frame/volume-shadow-material.js +0 -128
- package/dist/three/frame/volume-shadow-material.js.map +0 -1
- package/dist/three/sequence.js.map +0 -1
|
@@ -18,13 +18,16 @@
|
|
|
18
18
|
* his `decodeWVDBPage` computes them.
|
|
19
19
|
*/
|
|
20
20
|
import { type WvdbBake, type WvdbBox, type WvdbGridClass, type WvdbGridHeader, type WvdbHeader, type WvdbLayout, type WvdbPointsGridHeader, type WvdbSource, type WvdbVec3, type WvdbVolumeGridHeader } from "./format.js";
|
|
21
|
+
/** A parsed preamble and header, with where the data section starts. */
|
|
21
22
|
export interface WvdbHeaderInfo {
|
|
23
|
+
/** The parsed JSON header. */
|
|
22
24
|
header: WvdbHeader;
|
|
23
25
|
/** File version from the preamble (equals `header.version`). */
|
|
24
26
|
version: number;
|
|
25
27
|
/** Absolute file offset of the data section; chunk offsets are relative to it. */
|
|
26
28
|
dataStart: number;
|
|
27
29
|
}
|
|
30
|
+
/** Options of {@link readWvdbHeader}: the §14 limits and checks. */
|
|
28
31
|
export interface ReadWvdbHeaderOptions {
|
|
29
32
|
/**
|
|
30
33
|
* Total file length, when known. Enables the §14 checks that need it:
|
|
@@ -42,14 +45,21 @@ export declare function normalizeWvdbClass(value: string): WvdbGridClass;
|
|
|
42
45
|
* Reads the preamble and header. Returns `null` while `bytes` (a prefix of
|
|
43
46
|
* the file) does not yet hold the whole header; throws `WvdbFormatError` on a
|
|
44
47
|
* bad magic, an unsupported version, or a header that breaks §5/§14.
|
|
48
|
+
* @param bytes A prefix of the file (at least the preamble to get anything back).
|
|
49
|
+
* @param opts Limits and optional checks.
|
|
45
50
|
*/
|
|
46
51
|
export declare function readWvdbHeader(bytes: Uint8Array, opts?: ReadWvdbHeaderOptions): WvdbHeaderInfo | null;
|
|
52
|
+
/** One chunk of the data section, as {@link wvdbChunks} lists them. */
|
|
47
53
|
export interface WvdbChunkInfo {
|
|
54
|
+
/** Index into `header.grids`. */
|
|
48
55
|
gridIndex: number;
|
|
56
|
+
/** The LOD the chunk belongs to. */
|
|
49
57
|
lod: number;
|
|
58
|
+
/** What the chunk holds: a sparse LOD's mask, a page of bricks, or a page of points. */
|
|
50
59
|
kind: "mask" | "page" | "points";
|
|
51
60
|
/** Relative to dataStart. */
|
|
52
61
|
offset: number;
|
|
62
|
+
/** Compressed byte length. */
|
|
53
63
|
length: number;
|
|
54
64
|
/** page: bricks in the page; points: points in the chunk; mask: 0. */
|
|
55
65
|
count: number;
|
|
@@ -62,20 +72,34 @@ export declare function wvdbChunks(header: WvdbHeader): WvdbChunkInfo[];
|
|
|
62
72
|
* Absolute file byte range `[start, end)` that holds the chunks of `lod` for
|
|
63
73
|
* all grids (one contiguous range in a conforming file, §9). `start === end`
|
|
64
74
|
* when the LOD has no chunks.
|
|
75
|
+
* @param info The parsed header.
|
|
76
|
+
* @param lod LOD index (0 is the coarsest).
|
|
65
77
|
*/
|
|
66
78
|
export declare function wvdbLodByteRange(info: WvdbHeaderInfo, lod: number): {
|
|
67
79
|
start: number;
|
|
68
80
|
end: number;
|
|
69
81
|
};
|
|
70
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Bytes from the start of the file needed to decode LODs 0..lod (header included).
|
|
84
|
+
* @param info The parsed header.
|
|
85
|
+
* @param lod The last LOD to decode.
|
|
86
|
+
*/
|
|
71
87
|
export declare function wvdbPrefixLength(info: WvdbHeaderInfo, lod: number): number;
|
|
88
|
+
/** One decoded LOD of a volume grid. */
|
|
72
89
|
export interface WvdbVolumeLevel {
|
|
90
|
+
/** Discriminant: a volume level. */
|
|
73
91
|
kind: "volume";
|
|
92
|
+
/** LOD index (0 is the coarsest). */
|
|
74
93
|
lod: number;
|
|
94
|
+
/** Voxels per axis. */
|
|
75
95
|
dimensions: WvdbVec3;
|
|
96
|
+
/** Brick layout the LOD was stored in. */
|
|
76
97
|
layout: WvdbLayout;
|
|
98
|
+
/** Channels per voxel. */
|
|
77
99
|
channels: 1 | 3;
|
|
100
|
+
/** Bricks per axis (`ceil(dimensions / 8)`). */
|
|
78
101
|
brickCounts: WvdbVec3;
|
|
102
|
+
/** Bricks in the whole LOD, stored or not. */
|
|
79
103
|
brickTotal: number;
|
|
80
104
|
/** Mask words of a sparse LOD (bit `index` set = stored); null for dense. */
|
|
81
105
|
mask: Uint32Array | null;
|
|
@@ -83,17 +107,27 @@ export interface WvdbVolumeLevel {
|
|
|
83
107
|
brickIndices: Uint32Array;
|
|
84
108
|
/** Brick channel ranges in file order, `b * channels + c`. */
|
|
85
109
|
mins: Float32Array;
|
|
110
|
+
/** The matching maxima, same indexing as `mins`. */
|
|
86
111
|
maxs: Float32Array;
|
|
87
112
|
/** Dense decoded values: channel planes, x fastest; background where no brick is stored. */
|
|
88
113
|
values: Float32Array;
|
|
89
114
|
/** Bricks decoded so far (equals the LOD's brick count once complete; less in a partial stream event). */
|
|
90
115
|
bricksDecoded: number;
|
|
116
|
+
/**
|
|
117
|
+
* K4.22: one bit per brick (word `index >> 5`, bit `index & 31`), set once its page is decoded. Equals the
|
|
118
|
+
* stored bricks once complete; a partial stream event's undecoded stored bricks are the ones to fill.
|
|
119
|
+
*/
|
|
120
|
+
decoded: Uint32Array;
|
|
91
121
|
}
|
|
122
|
+
/** One decoded LOD of a points grid. */
|
|
92
123
|
export interface WvdbPointsLevel {
|
|
124
|
+
/** Discriminant: a points level. */
|
|
93
125
|
kind: "points";
|
|
126
|
+
/** LOD index (0 is the coarsest). */
|
|
94
127
|
lod: number;
|
|
95
128
|
/** Stored index of the first point of this LOD within the LOD-ordered point list. */
|
|
96
129
|
firstPoint: number;
|
|
130
|
+
/** Points this LOD adds. */
|
|
97
131
|
count: number;
|
|
98
132
|
/** xyz per point. */
|
|
99
133
|
positions: Float32Array;
|
|
@@ -102,6 +136,7 @@ export interface WvdbPointsLevel {
|
|
|
102
136
|
/** Points decoded so far (equals `count` once complete; less in a partial stream event). */
|
|
103
137
|
pointsDecoded: number;
|
|
104
138
|
}
|
|
139
|
+
/** A decoded LOD of either grid kind. */
|
|
105
140
|
export type WvdbLevel = WvdbVolumeLevel | WvdbPointsLevel;
|
|
106
141
|
interface WvdbGridBase {
|
|
107
142
|
name: string;
|
|
@@ -110,34 +145,55 @@ interface WvdbGridBase {
|
|
|
110
145
|
bbox: WvdbBox | null;
|
|
111
146
|
header: WvdbGridHeader;
|
|
112
147
|
}
|
|
148
|
+
/** A decoded volume grid. */
|
|
113
149
|
export interface WvdbVolumeGrid extends WvdbGridBase {
|
|
150
|
+
/** Discriminant: a volume grid. */
|
|
114
151
|
kind: "volume";
|
|
152
|
+
/** Channels per voxel. */
|
|
115
153
|
channels: 1 | 3;
|
|
116
154
|
/** One value per channel. */
|
|
117
155
|
background: number[];
|
|
156
|
+
/** Baked mean density, when the header has it. */
|
|
118
157
|
meanDensity?: number;
|
|
158
|
+
/** Baked count of non-zero voxels, when the header has it. */
|
|
119
159
|
nonZeroVoxels?: number;
|
|
160
|
+
/** The grid's header record. */
|
|
120
161
|
header: WvdbVolumeGridHeader;
|
|
121
162
|
/** Decoded LODs, coarse first (`levels[k].lod === k`). */
|
|
122
163
|
levels: WvdbVolumeLevel[];
|
|
123
164
|
}
|
|
165
|
+
/** A decoded points grid. */
|
|
124
166
|
export interface WvdbPointsGrid extends WvdbGridBase {
|
|
167
|
+
/** Discriminant: a points grid. */
|
|
125
168
|
kind: "points";
|
|
169
|
+
/** Points in the grid, all LODs together. */
|
|
126
170
|
count: number;
|
|
171
|
+
/** Points in the source before thinning, when recorded. */
|
|
127
172
|
sourceCount?: number;
|
|
173
|
+
/** Mean point spacing in world units, when recorded. */
|
|
128
174
|
spacing?: number;
|
|
175
|
+
/** True when the points carry colours. */
|
|
129
176
|
colors: boolean;
|
|
177
|
+
/** The grid's header record. */
|
|
130
178
|
header: WvdbPointsGridHeader;
|
|
131
179
|
/** Decoded LODs, coarse first. LOD k adds its points to LODs 0..k-1 (§3.5). */
|
|
132
180
|
levels: WvdbPointsLevel[];
|
|
133
181
|
}
|
|
182
|
+
/** A decoded grid of either kind. */
|
|
134
183
|
export type WvdbGrid = WvdbVolumeGrid | WvdbPointsGrid;
|
|
184
|
+
/** A decoded `.wvdb` file: its header and the LODs read so far. */
|
|
135
185
|
export interface WvdbFile {
|
|
186
|
+
/** File version. */
|
|
136
187
|
version: number;
|
|
188
|
+
/** The parsed header. */
|
|
137
189
|
header: WvdbHeader;
|
|
190
|
+
/** Absolute file offset of the data section. */
|
|
138
191
|
dataStart: number;
|
|
192
|
+
/** `header.source`. */
|
|
139
193
|
source: WvdbSource;
|
|
194
|
+
/** `header.bake`. */
|
|
140
195
|
bake: WvdbBake;
|
|
196
|
+
/** The decoded grids, in header order. */
|
|
141
197
|
grids: WvdbGrid[];
|
|
142
198
|
/** Number of LODs decoded (LODs 0..lodsDecoded-1). */
|
|
143
199
|
lodsDecoded: number;
|
|
@@ -151,8 +207,13 @@ export declare function inflateWvdbChunk(bytes: Uint8Array, maxSize: number): Ui
|
|
|
151
207
|
* offset `byteOffset` (0 for the whole file or a prefix; `range.start` for a
|
|
152
208
|
* range read from `wvdbLodByteRange`). Returns one level per grid, in header
|
|
153
209
|
* order.
|
|
210
|
+
* @param info The parsed header.
|
|
211
|
+
* @param lod The LOD to decode.
|
|
212
|
+
* @param bytes File bytes holding every chunk of that LOD.
|
|
213
|
+
* @param byteOffset File offset of `bytes[0]`.
|
|
154
214
|
*/
|
|
155
215
|
export declare function decodeWvdbLod(info: WvdbHeaderInfo, lod: number, bytes: Uint8Array, byteOffset?: number): WvdbLevel[];
|
|
216
|
+
/** Options of {@link readWvdb}: the header limits, a LOD cap and prefix reads. */
|
|
156
217
|
export interface ReadWvdbOptions extends Omit<ReadWvdbHeaderOptions, "fileLength"> {
|
|
157
218
|
/** Decode LODs 0..maxLod only. Default: all. */
|
|
158
219
|
maxLod?: number;
|
|
@@ -166,9 +227,13 @@ export interface ReadWvdbOptions extends Omit<ReadWvdbHeaderOptions, "fileLength
|
|
|
166
227
|
/**
|
|
167
228
|
* Reads a `.wvdb` file (or, with `partial`, a prefix of one) and decodes its
|
|
168
229
|
* LODs coarse to fine.
|
|
230
|
+
* @param input The file's bytes (or a prefix with `partial`).
|
|
231
|
+
* @param opts LOD cap, prefix mode and header limits.
|
|
169
232
|
*/
|
|
170
233
|
export declare function readWvdb(input: Uint8Array | ArrayBuffer, opts?: ReadWvdbOptions): WvdbFile;
|
|
234
|
+
/** What {@link WvdbStreamReader.push} reports: a LOD that finished, or gained a chunk. */
|
|
171
235
|
export interface WvdbLodEvent {
|
|
236
|
+
/** The LOD index. */
|
|
172
237
|
lod: number;
|
|
173
238
|
/**
|
|
174
239
|
* One level per grid, in header order. For a partial event these are the
|
|
@@ -181,6 +246,7 @@ export interface WvdbLodEvent {
|
|
|
181
246
|
/** Partial events: the chunk just decoded (a page's bricks are `brickIndices[first .. first + count)`). */
|
|
182
247
|
chunk?: WvdbChunkInfo;
|
|
183
248
|
}
|
|
249
|
+
/** Options of {@link WvdbStreamReader}. */
|
|
184
250
|
export interface WvdbStreamReaderOptions extends Omit<ReadWvdbOptions, "partial"> {
|
|
185
251
|
/**
|
|
186
252
|
* Also emit an event (`complete: false`) after every chunk of a LOD decodes,
|
|
@@ -214,6 +280,7 @@ export declare function wvdbChunkByteLimit(inflatedBytes: number): number;
|
|
|
214
280
|
* bounded by the largest chunk plus one pushed buffer. Each chunk's length is
|
|
215
281
|
* checked against {@link wvdbChunkByteLimit} when the header arrives. After an
|
|
216
282
|
* error, every later call throws the same error.
|
|
283
|
+
|
|
217
284
|
*/
|
|
218
285
|
export declare class WvdbStreamReader {
|
|
219
286
|
private readonly opts;
|
|
@@ -230,10 +297,13 @@ export declare class WvdbStreamReader {
|
|
|
230
297
|
private decoders;
|
|
231
298
|
private failure;
|
|
232
299
|
private peak;
|
|
300
|
+
/** The parsed header, or null before it has arrived. */
|
|
233
301
|
info: WvdbHeaderInfo | null;
|
|
234
302
|
/** The decoded file so far (grids gain levels as LODs complete); null before the header. */
|
|
235
303
|
file: WvdbFile | null;
|
|
304
|
+
/** @param opts LOD cap, partial-LOD events and header limits. */
|
|
236
305
|
constructor(opts?: WvdbStreamReaderOptions);
|
|
306
|
+
/** The parsed JSON header, or null before it has arrived. */
|
|
237
307
|
get header(): WvdbHeader | null;
|
|
238
308
|
/** True when every LOD up to `maxLod` is decoded. */
|
|
239
309
|
get done(): boolean;
|
|
@@ -243,7 +313,13 @@ export declare class WvdbStreamReader {
|
|
|
243
313
|
get bytesReceived(): number;
|
|
244
314
|
/** Compressed bytes held now, and the most ever held. */
|
|
245
315
|
get bufferedBytes(): number;
|
|
316
|
+
/** The most compressed bytes the reader has held at once. */
|
|
246
317
|
get peakBufferedBytes(): number;
|
|
318
|
+
/**
|
|
319
|
+
* Feeds the next bytes of the download and decodes what they complete.
|
|
320
|
+
* @param chunk The next bytes, in file order.
|
|
321
|
+
* @returns The LOD events this push produced (possibly none).
|
|
322
|
+
*/
|
|
247
323
|
push(chunk: Uint8Array): WvdbLodEvent[];
|
|
248
324
|
/** Call when the stream ends: throws `WvdbFormatError` if a LOD up to `maxLod` is still missing. */
|
|
249
325
|
end(): void;
|
package/dist/tools/wvdb/read.js
CHANGED
|
@@ -30,6 +30,8 @@ export function normalizeWvdbClass(value) {
|
|
|
30
30
|
* Reads the preamble and header. Returns `null` while `bytes` (a prefix of
|
|
31
31
|
* the file) does not yet hold the whole header; throws `WvdbFormatError` on a
|
|
32
32
|
* bad magic, an unsupported version, or a header that breaks §5/§14.
|
|
33
|
+
* @param bytes A prefix of the file (at least the preamble to get anything back).
|
|
34
|
+
* @param opts Limits and optional checks.
|
|
33
35
|
*/
|
|
34
36
|
export function readWvdbHeader(bytes, opts = {}) {
|
|
35
37
|
if (bytes.byteLength >= 4) {
|
|
@@ -240,6 +242,8 @@ function checkChunkOrder(header, dataLength) {
|
|
|
240
242
|
* Absolute file byte range `[start, end)` that holds the chunks of `lod` for
|
|
241
243
|
* all grids (one contiguous range in a conforming file, §9). `start === end`
|
|
242
244
|
* when the LOD has no chunks.
|
|
245
|
+
* @param info The parsed header.
|
|
246
|
+
* @param lod LOD index (0 is the coarsest).
|
|
243
247
|
*/
|
|
244
248
|
export function wvdbLodByteRange(info, lod) {
|
|
245
249
|
checkLodIndex(info.header, lod);
|
|
@@ -257,7 +261,11 @@ export function wvdbLodByteRange(info, lod) {
|
|
|
257
261
|
}
|
|
258
262
|
return { start: info.dataStart + start, end: info.dataStart + end };
|
|
259
263
|
}
|
|
260
|
-
/**
|
|
264
|
+
/**
|
|
265
|
+
* Bytes from the start of the file needed to decode LODs 0..lod (header included).
|
|
266
|
+
* @param info The parsed header.
|
|
267
|
+
* @param lod The last LOD to decode.
|
|
268
|
+
*/
|
|
261
269
|
export function wvdbPrefixLength(info, lod) {
|
|
262
270
|
checkLodIndex(info.header, lod);
|
|
263
271
|
let end = 0;
|
|
@@ -300,6 +308,10 @@ function sliceChunk(bytes, byteOffset, info, c) {
|
|
|
300
308
|
* offset `byteOffset` (0 for the whole file or a prefix; `range.start` for a
|
|
301
309
|
* range read from `wvdbLodByteRange`). Returns one level per grid, in header
|
|
302
310
|
* order.
|
|
311
|
+
* @param info The parsed header.
|
|
312
|
+
* @param lod The LOD to decode.
|
|
313
|
+
* @param bytes File bytes holding every chunk of that LOD.
|
|
314
|
+
* @param byteOffset File offset of `bytes[0]`.
|
|
303
315
|
*/
|
|
304
316
|
export function decodeWvdbLod(info, lod, bytes, byteOffset = 0) {
|
|
305
317
|
checkLodIndex(info.header, lod);
|
|
@@ -340,8 +352,9 @@ function volumeLodDecoder(grid, lod, bits) {
|
|
|
340
352
|
maxs: new Float32Array(entry.bricks * channels),
|
|
341
353
|
values,
|
|
342
354
|
bricksDecoded: 0,
|
|
355
|
+
decoded: new Uint32Array(Math.ceil(total / 32)),
|
|
343
356
|
};
|
|
344
|
-
const seen =
|
|
357
|
+
const seen = level.decoded;
|
|
345
358
|
let masks = 0;
|
|
346
359
|
return {
|
|
347
360
|
level,
|
|
@@ -368,11 +381,9 @@ function volumeLodDecoder(grid, lod, bits) {
|
|
|
368
381
|
level.bricksDecoded += c.count;
|
|
369
382
|
for (let b = 0; b < page.indices.length; b++) {
|
|
370
383
|
const index = page.indices[b];
|
|
371
|
-
if (seen)
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
seen[index >>> 5] |= 1 << (index & 31);
|
|
375
|
-
}
|
|
384
|
+
if (isMaskBitSet(seen, index))
|
|
385
|
+
throw new WvdbFormatError(`LOD ${lod} of "${grid.name}": brick ${index} is stored twice`);
|
|
386
|
+
seen[index >>> 5] |= 1 << (index & 31);
|
|
376
387
|
const [ox, oy, oz] = brickOrigin(dimensions, index);
|
|
377
388
|
const nx = Math.min(WVDB_BRICK_DIM, X - ox);
|
|
378
389
|
const ny = Math.min(WVDB_BRICK_DIM, Y - oy);
|
|
@@ -471,6 +482,8 @@ function addLevels(grids, levels) {
|
|
|
471
482
|
/**
|
|
472
483
|
* Reads a `.wvdb` file (or, with `partial`, a prefix of one) and decodes its
|
|
473
484
|
* LODs coarse to fine.
|
|
485
|
+
* @param input The file's bytes (or a prefix with `partial`).
|
|
486
|
+
* @param opts LOD cap, prefix mode and header limits.
|
|
474
487
|
*/
|
|
475
488
|
export function readWvdb(input, opts = {}) {
|
|
476
489
|
const bytes = input instanceof Uint8Array ? input : new Uint8Array(input);
|
|
@@ -536,6 +549,7 @@ function inflatedLimit(header, c) {
|
|
|
536
549
|
* bounded by the largest chunk plus one pushed buffer. Each chunk's length is
|
|
537
550
|
* checked against {@link wvdbChunkByteLimit} when the header arrives. After an
|
|
538
551
|
* error, every later call throws the same error.
|
|
552
|
+
|
|
539
553
|
*/
|
|
540
554
|
export class WvdbStreamReader {
|
|
541
555
|
opts;
|
|
@@ -552,12 +566,15 @@ export class WvdbStreamReader {
|
|
|
552
566
|
decoders = new Map();
|
|
553
567
|
failure = null;
|
|
554
568
|
peak = 0;
|
|
569
|
+
/** The parsed header, or null before it has arrived. */
|
|
555
570
|
info = null;
|
|
556
571
|
/** The decoded file so far (grids gain levels as LODs complete); null before the header. */
|
|
557
572
|
file = null;
|
|
573
|
+
/** @param opts LOD cap, partial-LOD events and header limits. */
|
|
558
574
|
constructor(opts = {}) {
|
|
559
575
|
this.opts = opts;
|
|
560
576
|
}
|
|
577
|
+
/** The parsed JSON header, or null before it has arrived. */
|
|
561
578
|
get header() {
|
|
562
579
|
return this.info?.header ?? null;
|
|
563
580
|
}
|
|
@@ -577,9 +594,15 @@ export class WvdbStreamReader {
|
|
|
577
594
|
get bufferedBytes() {
|
|
578
595
|
return this.bufEnd - this.bufStart;
|
|
579
596
|
}
|
|
597
|
+
/** The most compressed bytes the reader has held at once. */
|
|
580
598
|
get peakBufferedBytes() {
|
|
581
599
|
return this.peak;
|
|
582
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* Feeds the next bytes of the download and decodes what they complete.
|
|
603
|
+
* @param chunk The next bytes, in file order.
|
|
604
|
+
* @returns The LOD events this push produced (possibly none).
|
|
605
|
+
*/
|
|
583
606
|
push(chunk) {
|
|
584
607
|
if (this.failure !== null)
|
|
585
608
|
throw this.failure;
|